I'm using OpenCV
to implement ANPR program.
I tried to extract the numbers in the plate. The sample code is below
adaptiveThreshold(src_gray, binary_image, THESHOLD_MAX, ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY_INV, BLOCK_SIZE, MEAN_OFFSET);
CvBlobs blobs;
IplImage binary = binary_image;
IplImage *labelImg = cvCreateImage(cvGetSize(&binary), IPL_DEPTH_LABEL, 1);
unsigned int result = cvLabel(&binary, labelImg, blobs);
cvReleaseImage(&labelImg);
cvFilterByArea(blobs, DETECT_BLOB_AREA_MIN, DETECT_BLOB_AREA_MAX);
Everything is almost OK with the adaptiveThreshold()
and `cvLabel(), however there are some images give the ouput of adaptiveThreshold() is not good, the following is an example.
There are 3 letters in the plate (that are bounded with the Red rectangles).
there 3 letter cannot detect with cvLabel() because they are stick with plate bound. In this case, my algorithm cannot extract these letter.
Someone tell me there are any way to extract those 3 letter in this case?
Thank you very much!