leapuvc icon indicating copy to clipboard operation
leapuvc copied to clipboard

ArucoExample.py Draw paper template Depth error

Open ghost opened this issue 6 years ago • 0 comments

Hi, I recently experienced the following issue when trying to generate the python aruco paper examples to print out;

   cv2.imshow('Template', drawPaperTemplate())
cv2.error: OpenCV(4.0.0) c:\projects\opencv-python\opencv\modules\imgproc\src\color.hpp:261: error: (-2:Unspecified error) in function '__cdecl cv::CvtHelper<struct cv::Set<1,-1,-1>,struct cv::Set<3,4,-1>,struct cv::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)'
> Unsupported depth of input image:
>     'VDepth::contains(depth)'
> where
>     'depth' is 6 (CV_64F)

I have fixed this by changing the following:

cv2.imshow('Template', drawPaperTemplate())

to

t = drawPaperTemplate().astype(np.uint8)
cv2.imshow('Template', t)

ghost avatar Feb 14 '19 13:02 ghost