04-22-2013 04:48 PM
Hi all,
I'm doing a final year project at uni and working with licence plate recognition software in LabVIEW.
So far, using vision assistant, I use the straight edge 4 times to detect all 4 edges of the licence plate and then use the itersection points of these 4 lines to build a ROI around the licence plate to send to the OCR tool.
At first the ROI is slightly too big for the OCR tool to recognise the licence plate characters because there are screws above and below the characters that get in the way and mess up the OCR's output string. To combat this I have the ROI incremented inwards (i.e. shrinking the rectange towards its centre point) until the ROI borders only the licence plate characters. However at this point the output string from the OCR read text 3 tool is blank which is really confusing because when the ROI rectangle is bigger or smaller than the characters it outputs strings that contain Is or Js or 1s (I guess because it is reading portions or characters rather than the whole thing).
Could someone please let me know why this is happening or what I'm doing wrong?
Thanks
Nick
04-22-2013 07:05 PM
How big are the screws compared to the lettering, and how many are there?
Some suggestions which may help.
1) Remove objects smaller than a certain size.
This assumes that the screws are noticibly smaller than the lettering. You could for instance get a list of the objects within the ROI, work out what size the letters are and remove the ones much smaller.
2) Similar to 1), Just remove the 2/4 smallest objects.
This assumes that only the screws and lettering are detected as objects rather than other crud too. 1 (above) essentially does this.
A few other questions:
What is the lighting like in the images?
Are you looking at the plates straight on or at a angle?
Could you put up one of your example images for us to see?
04-22-2013 07:26 PM
How would you go about removing small objects?
Heres a image of the type of licence plate being processed. The picture is normally taken straight on and lighting isn't much of a problem because of the filtering done before image processing
04-23-2013 01:39 AM
@mackyd123 wrote:
when the ROI rectangle is bigger or smaller than the characters it outputs strings that contain Is or Js or 1s (I guess because it is reading portions or characters rather than the whole thing).
This looks like an important clue. Why is it reading portions of characters rather than the whole thing when the rectangle is too big?
Could it be that you are somehow passing a different rectangle than you think -- that is, that the coordinates or units are different? Or do you clip the image and send just the small image to the OCR?
Another thing you might try -- take the same image, and manually (this is just temporarily for a test; it is not meant to be a solution) in an image editor, remove the screws and such. Then you can pass the slightly larger rectangle to the OCR tool without extraneous stuff messing up the OCR. That is, solve a simpler case first, and when that is working move on to handling the case with the screws. ( I am also wondering if the OCR has a problem where there is no white border around the letters; OCR usually deals with a page of text where the letters don't take up the whole page, and some of the OCR algorithms may depend on finding that edge between black and white.)
Batya
04-23-2013 07:25 AM
Yeah I thought that I might be passing the wrong coordinates to the OCR but I'm certain after checking that the ROI is in the right place because I checked the coordinates of the points in the ROI against where they would be on the image and they were correct.
I tried using vision assistant and drawing a box over just the letters of the licence plate and the OCR worked fine there but when I try to get an output in the actual LabVIEW environment thats when I get nothing