text recognition using opencv contrib text module [closed]

asked 2016-09-20 05:26:22 -0600

BenNG gravatar image

Hi

I would like to be able to recognize character in a image. For that I try to use the sample code give here but I have this error. Any ideas ? thanks !

Ptr<OCRHMMDecoder::ClassifierCallback> ocr = loadOCRHMMClassifierCNN("OCRBeamSearch_CNN_model_data.xml.gz");

I have this error

OpenCV Error: Bad argument (Default classifier data file not found!) in OCRHMMClassifierCNN, file /home/benng/bin/opencv_working_dir/opencv_contrib/modules/text/src/ocr_hmm_decoder.cpp, line 973
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/benng/bin/opencv_working_dir/opencv_contrib/modules/text/src/ocr_hmm_decoder.cpp:973: error: (-5) Default classifier data file not found! in function OCRHMMClassifierCNN

[1]    12754 abort (core dumped)  ./DisplayImage
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2016-09-20 08:40:16.248330

Comments

this file has to be in the folder, where you run the program.

berak gravatar imageberak ( 2016-09-20 05:32:46 -0600 )edit

ahhhh my bad... I build in a build directory :( Thank you

BenNG gravatar imageBenNG ( 2016-09-20 08:11:14 -0600 )edit