ZED-opencv踩坑记录
程序员文章站
2022-05-16 11:24:01
...
从Zed获得的图片必须用,.copy再调用一次。
否则回出现错误:
cv2.error: OpenCV(4.5.2) :-1: error: (-5:Bad argument) in function 'putText'
> Overload resolution failed:
> - Layout of the output array img is incompatible with cv::Mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels)
> - Expected Ptr<cv::UMat> for argument 'img'
因此作此修改。至于原因,据说是OPENCV的bug。
frame = mat1.get_data()
frame = frame[:, :, :3]
frame = frame[0:720,0:640]
frame = frame.copy()
image = image.copy()