opencv - TextDetectorCNN_create 的问题
问题描述
我正在使用 python 3.7 运行 opencv 4.1.0 Windows 10 64 位。
我的代码是:
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)
这是我得到的错误(下)。有什么提示吗?
rects, probs = det.detect(img)
Traceback(最近一次调用最后一次):文件“”,第 1 行,在 cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv_contrib\modules\text\src\text_detectorCNN.cpp:66: 错误: (-2:Unspecified error) in function 'void cdecl cv::text::TextDetectorCNNImpl::detect(const class cv::InputArray &,class std::vector > &,class std::vector &)' (预期: 'inputImage.channels() == inputChannelCount_'),其中 'inputImage_.channels()' 为 1 必须等于 'inputChannelCount_' 为 3
解决方案
推荐阅读
- powershell - Powershell,如何快速处理?
- javascript - React 编译错误 - 意外令牌 (34:58) a.data.[field] !== undefined && b.data.[field]
- spring-boot - Kafka 在 Consumer.Poll(Duration.ZERO) 之后没有分配分区;
- git - Intellij IDEA - git ssh - 权限被拒绝(公钥)
- javascript - Jquery中的数组排序问题(按价格排序)
- html - 图标不会显示在与 div 内的文本相同的高度
- ruby-on-rails - 将 rails 4.2.7 升级到 rails 6.0.4.1,postgres jsonb 列数据返回为空哈希 {},尽管列中有数据
- python - 通过子字符串搜索连接 pyspark 中的两个数据帧
- python - 带有周围步骤的时间序列分类
- jquery - 如果 window.close 功能不起作用怎么办?