Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

OCR ROI how to ignore outer frame of license plate

Solved!
Go to solution

Hi. I'm trying to do an OCR programme to detect license plate numbers. However, I'm having this problem where I have to specify the ROI for the OCR to recognize my charactes. 

 

Otherwise the programme can't read the characters properly because of the presence of outer frame on the image (probably the OCR is reading that as a single character).

What operations I can do to solve this?

 

Picture 1: This is when the ROI is not specified

 

Picture 2: After the ROI is manually selected

 

Thanks.

0 Kudos
Message 1 of 9
(4,753 Views)
Solution
Accepted by topic author ohhlalaa

Hi,

 

Actually the answer to this question will vary significantly based on the other conditions of your system. But first of all, I think you should locate the position and angle of the plate.

If we proceed with the image which you have shared, you may search for the plate frame (rectangle shape) by using match pattern/geometric match pattern functions, while ignoring the characters inside it. After that, you can set a coordinate system using position and angle of it. Then you can select your ROI and run the system.

This is just a suggestion looking at the above image, you should find your way considering all of the conditions.

0 Kudos
Message 2 of 9
(4,714 Views)
use mask
0 Kudos
Message 3 of 9
(4,707 Views)

I tried to look for shape matching examples for these kind of projects. I managed to find this. This program converts the Shape Report from the IMAQ Shape Matching VI into ROI image. This works for my program but I don't understand why substracts and adds the numbers (100, -20, 40, 40). If I can understand this maybe I can improve my program further. Thanks.

Capture.PNG

 

0 Kudos
Message 4 of 9
(4,468 Views)

These four numbers of the shape report are x, y coordinates of top left point and bottom right point respectively. I do not know what is the original VI but those calculations are made based on the needs of original VI. In your case, you need to look at the inside of the rectangle so you can directly use those coordinates. Or you can also make some calculations to only search at the inner part of the rectangle, ignoring the frame.

0 Kudos
Message 5 of 9
(4,454 Views)

I answer this question before i was hope you could solve your problem but it seem to shouldn't 

here is example for vision assistant and using mask use this before your rest of code it will be solve your problem 

 

0 Kudos
Message 6 of 9
(4,440 Views)
before use adjust the mask to cover all of your plate
0 Kudos
Message 7 of 9
(4,439 Views)

I don't think mask would help since the location of license plates differ from car to car.

0 Kudos
Message 8 of 9
(4,427 Views)
if you do not know location of plate in your image ROI will not work too
how you want use ROI when you do not know location of your plate ?!
0 Kudos
Message 9 of 9
(4,425 Views)