CPP 静态合成

This commit is contained in:
2026-05-25 15:37:16 +08:00
parent 04561d2697
commit 01360b2dab
92 changed files with 1074421 additions and 28 deletions

View File

@@ -73,26 +73,13 @@ class FisheyeCameraModel(object):
return self
def undistort(self, image):
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
uimg = cv2.UMat(image)
uresult = cv2.remap(uimg, *self.undistort_maps,
interpolation=cv2.INTER_LINEAR,
borderMode=cv2.BORDER_CONSTANT)
return uresult.get()
def project(self, image):
# 转为 UMat触发 GPU 路径)
uimg = cv2.UMat(image)
uresult = cv2.warpPerspective(
uimg,
@@ -102,7 +89,7 @@ class FisheyeCameraModel(object):
borderMode=cv2.BORDER_CONSTANT,
borderValue=(0, 0, 0)
)
return uresult.get() # 转回 numpy array 供后续使用
return uresult.get()
def flip(self, image):
if self.camera_name == "front":