Ask Your Question

Revision history [back]

Error in TextDetectorCNN_create

Hi experts

I am running opencv 4.1.0 Windows 10 64 bit with python 3.7.

My code is:

img = cv2.imread('C:/projects/kort/Hjerter/IMG_2383.jpg')

det = cv2.text.TextDetectorCNN_create("c:/projects/Caffe/textbox.prototxt", "c:/projects/Caffe/TextBoxes_icdar13.caffemodel")

rects, probs = det.detect(img)

But I get the following error below. Any hints?

rects, probs = det.detect(img) Traceback (most recent call last): File "", line 1, in cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv_contrib\modules\text\src\text_detectorCNN.cpp:66: error: (-2:Unspecified error) in function 'void cdecl cv::text::TextDetectorCNNImpl::detect(const class cv::InputArray &,class std::vector<class cv::rect,class="" std::allocator<class="" cv::rect="" &gt;="" &gt;="" &amp;,class="" std::vector<float,class="" std::allocator="" &gt;="" &amp;)'="" (expected:="" 'inputimage.channels()="=" inputchannelcount_'),="" where="" 'inputimage_.channels()'="" is="" 1="" must="" be="" equal="" to="" 'inputchannelcount_'="" is="" 3<="" p="">

click to hide/show revision 2
None

updated 2019-05-20 10:26:06 -0600

berak gravatar image

Error in TextDetectorCNN_create

Hi experts

I am running opencv 4.1.0 Windows 10 64 bit with python 3.7.

My code is:

img = cv2.imread('C:/projects/kort/Hjerter/IMG_2383.jpg')

cv2.imread('C:/projects/kort/Hjerter/IMG_2383.jpg')

det = cv2.text.TextDetectorCNN_create("c:/projects/Caffe/textbox.prototxt", "c:/projects/Caffe/TextBoxes_icdar13.caffemodel")

"c:/projects/Caffe/TextBoxes_icdar13.caffemodel")

rects, probs = det.detect(img)

det.detect(img)

But I get the following error below. Any hints?

rects, probs = det.detect(img)
Traceback (most recent call last):
File "", line 1, in 
cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv_contrib\modules\text\src\text_detectorCNN.cpp:66: error: (-2:Unspecified error) in function 'void cdecl cv::text::TextDetectorCNNImpl::detect(const class cv::InputArray &,class std::vector<class cv::rect,class="" std::allocator<class="" cv::rect="" &gt;="" &gt;="" &amp;,class="" std::vector<float,class="" std::allocator="" &gt;="" &amp;)'="" (expected:="" 'inputimage.channels()="=" inputchannelcount_'),="" where="" 'inputimage_.channels()'="" is="" 1="" must="" be="" equal="" to="" 'inputchannelcount_'="" is="" 3<="" p="">

cv::Rect,class std::allocator<class cv::Rect > > &,class std::vector<float,class std::allocator > &)' (expected: 'inputImage.channels() == inputChannelCount_'), where 'inputImage_.channels()' is 1 must be equal to 'inputChannelCount_' is 3