We have already found our characters, which are license plate candidates. Now we need to determine which characters match, so that we can extract the text data and map the characters within the license plates.
First, we run each plate candidate through our gray_thresh_img function, which does our de-noising and binarization. In this case, we get a cleaner output because we are using a sub-image and not the complete image.
This is the extraction code we will use:
for plate_candidate in plate_candidates: plate_candidate.grayimg, plate_candidate.thesholded = \ gray_thresh_img(plate_candidate.plate_im) plate_candidate.thesholded = cv2.resize(plate_candidate.thesholded, (0, 0), fx = 1.6, fy = ...