Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Matching ......

Hello,
 
I'm working on image processing as a part of my project I have some questions:
 
I'm using Lab view 8.2 + 8.5
also vision assistant
 
1) I have to decide if room label is exsist in the picture or not (the pic. is attached), the camera will be on a moving small car and will be turning using a motor will take some picture will stop if the label is in the picture
 
I have used many tools Like shap matching (Binary) , Pattern matching,...
 
the problem is that the car will not stop at same distance every time and the size of the label will not be fix some time will be taken at an angle
 
for Pattern matching is it a must to be the same size?? i have created a tamplet then when I apply it to diffrent size label or at angle it doesn't work
 
I have an idea to read columns int the array and find pattern but I'm confused of how to define the pattern
 
2) I have  to apply OCR on the regon thet contain the room number how can i define the ROI or cut the picture
 
 
every thing must be done automatically the user will not enter any thing
 
thank you
 
  
 
 
Download All
0 Kudos
Message 1 of 3
(3,351 Views)

Hello Mar-Q,

Thank you for contacting National Instruments! I am assuming that you have the Vision Development Module which includes the appropriate Vision VIs. I believe your best bet is to stick with pattern matching. One way to address the distortion caused by taking the image from an angle is calibration. This is intended for a fixed camera setup so it is not suited for your application. The other option is to use pattern matching. I suggest you first create a template of the label straight on. Set the Minimum Score input for the Match Pattern VI to allow for the inconsistencies in the image. As long as you can set the Minimum Score low enough to recognize the label most of the time in addition to not throw false positives this should work for you. Please realize this will take many trials to determine if your minimum score is working.

If this does not work, you may have to get a little more sophisticated with your programming. You could make several templates and loop through them to check for a match. Say you take three templates to start with: a template from the right hand, left hand and straight on perspectives. Then run your pattern match through all three and to check for the presence of the label. You will need to adjust the minimum score on this pattern match, too, and there will need to be several trials to get templates just right.

Take a look at the example called Pattern Matching Example.vi. This takes an 8-bit grayscale image input.

As for setting the ROI for OCR, you can do this several ways programmatically. This issue I see with your application is that the ROI is not always in the same place. Although, the ROI does not need to be a perfect outline of the label. If you could narrow the ROI down to an area, say the center of the image, even the top half of the image this would help the algorithm when looking for characters. As far as implementation goes, you can use any of the IMAQ Convert Shape to ROI. I would suggest using IMAQ Convert Rectangle to ROI. This will allow you to programmatically set the points of your region and convert it in to ROI data for the rest of the OCR process.

Does this help?

--Michelle

National Instruments
0 Kudos
Message 2 of 3
(3,312 Views)
Hi Michelle_B
 
Thank you very much for your answer  I appreciated,
 
I will try your idea and suggestion I hop it works
 
I will answer you back for the result
 
Best regards
Mar-Q
0 Kudos
Message 3 of 3
(3,295 Views)