web前备份
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -11,7 +11,7 @@ class CaptureThread(BaseThread):
|
||||
device_id,
|
||||
flip_method=0,
|
||||
drop_if_full=True,
|
||||
api_preference=cv2.CAP_ANY,
|
||||
api_preference=cv2.CAP_V4L2,
|
||||
resolution=None,
|
||||
parent=None):
|
||||
"""
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -8,6 +8,7 @@ def gstreamer_pipeline(cam_id=0,
|
||||
framerate=30,
|
||||
format="YUYV",
|
||||
):
|
||||
print("11111111233333333333545656646464646")
|
||||
"""
|
||||
Use libgstreamer to open csi-cameras.
|
||||
"""
|
||||
@@ -17,7 +18,6 @@ def gstreamer_pipeline(cam_id=0,
|
||||
"videoconvert ! "
|
||||
"video/x-raw,format=YUYV ! " # 转为 OpenCV 能直接用的 BGR 格式
|
||||
"appsink"
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user