MasteringOpenCV / code

Code for the book "Mastering OpenCV with Practical Computer Vision Projects" by Packt Publishing 2012.
Other
2.73k stars 1.65k forks source link

Automatic Number Plate Recognition project( igaspard/ANPR) in windows getting errors #13

Open aklenka opened 11 years ago

aklenka commented 11 years ago

Hi, I am new to OCR and I am trying to run sample code of Automatic Number Plate Recognition project( igaspard/ANPR) in windows . Taking the sample code I have created 4 individual program

  1. main application using main.cpp,
  2. trainOCR using trainOCR.cpp
  3. trainSVM using trainSVM.cpp and
  4. evalOCR using evalOCR.cpp. (NOTE: each above cpp having main function that’s why I created 4 project).

I do not have any idea which project I should run first and what input I should to assign for the each project.

When I try to run the individual application with input as 2715DTZ.jpg(test folder of sample data) I am getting different error.

  1. Like from main project error OpenCV Automatic Number Plate Recognition working with file: OpenCV Error: Bad argument (train data must be floating-point matrix) in cvCheckTrainData, file C:/slave/builds/WinInstallerMegaPack/src/opencv/m odules/ml/src/inner_functions.cpp, line 857 terminate called after throwing an instance of 'cv::Exception' what(): C:/slave/builds/WinInstallerMegaPack/src/opencv/modules/ml/src/inner_functions.cpp:857: error: (-5) train data must be floating-point matrix in function cvCheckTrainData

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

  1. from trainOCR project error Character 0 file: 0 OpenCV Error: Assertion failed (ssize.area() > 0) in resize, file C:/slave/builds/WinInstallerMegaPack/src/opencv/modules/imgproc/src/imgwarp.cpp , line 1725 terminate called after throwing an instance of 'cv::Exception' what(): C:/slave/builds/WinInstallerMegaPack/src/opencv/modules/imgproc/src/imgwarp.cpp:1725: error: (-215) ssize.area() > 0 in function resize

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

  1. from trainSVM project error OpenCV Training SVM Automatic Number Plate Recognition Usage: trainSVM.exe
  2. From evalOCR project error terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

I do not understand what sequence I should run the application and what should be input.

So please kindly suggest me how can I overcome all the above issue using the same sample code or is there any other way to create the project? I am not figuring out what is issue from my side.

Thanks & regards Anil

shervinemami commented 10 years ago

Hi Anil, sorry that we did not reply to you. Are you still having problems with this?

faresfakhfakh commented 10 years ago

Hi shervinmemi, I have the same problems!!

Thanks

xuewenyuan commented 9 years ago

I met the same error when I used SVM. Is there any solution? Thanks.

echotianyuan commented 8 years ago

Hello shervinmemi, I met the same problems. Could you or anyone else give some advice here? Thanks :)

fengzhu-stemcell commented 7 years ago

Hi! I tried to run the program but got errors beginning with these:

[ 11%] Building CXX object CMakeFiles/ANPR.dir/main.cpp.o In file included from /home/pyimagesearch/Downloads/code-Ed2_OpenCV31/Chapter5_NumberPlateRecognition/main.cpp:23:0: /home/pyimagesearch/Downloads/code-Ed2_OpenCV31/Chapter5_NumberPlateRecognition/OCR.h:66:9: error: ‘CvANN_MLP’ does not name a type CvANN_MLP ann; ...

I cloned branch ed2-opencv31 and my machine has OpenCV 3.4 installed. Still couldn't make it work.

damiles commented 7 years ago

@faresfakhfakh working on update code for OpenCV 3. I will ping you when it's updated.