web前备份
This commit is contained in:
@@ -76,10 +76,33 @@ class FisheyeCameraModel(object):
|
||||
result = cv2.remap(image, *self.undistort_maps, interpolation=cv2.INTER_LINEAR,
|
||||
borderMode=cv2.BORDER_CONSTANT)
|
||||
return result
|
||||
# def undistort(self, image):
|
||||
# uimg = cv2.UMat(image)
|
||||
# uresult = cv2.remap(
|
||||
# uimg,
|
||||
# *self.undistort_maps,
|
||||
# interpolation=cv2.INTER_LINEAR,
|
||||
# borderMode=cv2.BORDER_CONSTANT,
|
||||
# borderValue=(0, 0, 0)
|
||||
# )
|
||||
# return uresult.get()
|
||||
|
||||
# def project(self, image):
|
||||
# result = cv2.warpPerspective(image, self.project_matrix, self.project_shape)
|
||||
# return result
|
||||
|
||||
def project(self, image):
|
||||
result = cv2.warpPerspective(image, self.project_matrix, self.project_shape)
|
||||
return result
|
||||
# 转为 UMat(触发 GPU 路径)
|
||||
uimg = cv2.UMat(image)
|
||||
uresult = cv2.warpPerspective(
|
||||
uimg,
|
||||
self.project_matrix,
|
||||
self.project_shape,
|
||||
flags=cv2.INTER_LINEAR,
|
||||
borderMode=cv2.BORDER_CONSTANT,
|
||||
borderValue=(0, 0, 0)
|
||||
)
|
||||
return uresult.get() # 转回 numpy array 供后续使用
|
||||
|
||||
def flip(self, image):
|
||||
if self.camera_name == "front":
|
||||
|
||||
Reference in New Issue
Block a user