Plate recognition
The second step in license plate recognition aims to retrieve the characters of the license plate with OCR. For each detected plate, we proceed to segment the plate for each character and use an artificial neural network machine learning algorithm to recognize the character. Also, in this section, you will learn how to evaluate a classification algorithm.
OCR segmentation
First, we will obtain a plate image patch as an input to the OCR segmentation function with an equalized histogram. We then need to apply only a threshold filter and use this threshold image as the input of a Find contours
algorithm. We can observe this process in the following image:
This segmentation process is coded as follows:
Mat img_threshold; threshold(input, img_threshold, 60, 255, CV_THRESH_BINARY_INV); if(DEBUG) imshow("Threshold plate", img_threshold); Mat img_contours; img_threshold.copyTo(img_contours); //Find contours of possibles characters vector< vector< Point...