Skip to content

ArucoExample.py Draw paper template Depth error #7

@ghost

Description

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions