用法:OpenCV 4.5.3-dev
我举了这个例子:https://github.com/opencv/opencv/blob/master/samples/dnn/scene_text_spotting.cpp它的用途:
- 用于检测模型:DB_TD500_resnet50.onnx
- 对于识别模型:crnncs.onx
- 用于词汇表:alphabet_94.txt
- 解码类型被设置为:;CTC前缀波束搜索">
这些设置收到以下错误:
OpenCV(4.5.3-dev) C:DevToolsopencvmodulesdnnsrcmodel.cpp:745: error: (-2:Unspecified error) in function 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl cv::dnn::TextRecognitionModel_Impl::ctcPrefixBeamSearchDecode(const class cv::Mat &)'
> (expected: 'prediction.size[2] == (int)vocabulary.size() + 1'), where
> 'prediction.size[2]' is 96
> must be equal to
> '(int)vocabulary.size() + 1' is 95
在词汇表末尾添加一行空行,或在词汇表向量中再推一项。我不知道这只是一个变通办法还是一个真正的解决方案。。。