Python cv2 报错 TypeError: Expected Ptr<cv::UMat> for argument ‘src‘ 深度相机 pyrealsense2

解决方法:

frames = pipeline.wait_for_frames()
color_frame = frames.get_color_frame()
depth_frame = frames.get_depth_frame()

color_image = np.asanyarray(color_frame.get_data())
depth_image = np.asanyarray(depth_frame.get_data())

一定要加.get_data()!!!! 要不然就会老是报一些奇奇怪怪的cv2的错误,因为数据类型不一致。

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐