08-09-2009 05:45 AM
Just want a OCR for handset LCD, but the handset is not fixed, so the location for OCR is not same every time. so I need move and rotate the image for OCR. I used the pattern matching to get the LCD location in first. The problem is ..
Can the coordinate system transform a ROI?
How to get the area of LCD?
If it need copy to other viewer then implement the OCR? the match results need be move and rotate the image.
Or I can use the mask?
Someboy can give me the flow, I use the vb, but I just need a idea. thanks!
08-09-2009 07:51 PM
Please check my procedures.
1. Open the image.
2. Implement the pattern match, get the angle.
3. Rotate the angle in the image.
4. Implement the pattern match again, get the coordinate.
5. Set the ROI, implement the OCR.
Another idea as below,
1. Open the image.
2. Implement the pattern match.
3. Copy the match area into other viewer.---but i don't know how to do.
4. Set the ROI, implement the OCR.
Waiting for your help. thx!
08-10-2009 12:56 AM
Hi jack_yu,
Can you post a few images? If the back ground in reallygood( in terms of contrast difference). You can use a edge detection too. Post a few images If you can
08-10-2009 03:51 AM
Pls check attached the image, it is not good. however, the edge detect will return a coordinate system also.
I rather to get the pattern match, then extract the sub-image to other viewer, since I need do other process also.
Now I have reviewed other discuss in the forums, OCR can be finished, but I really want to extract the match area for more process. the Vision support a method --extract2 for copy a Rectangle, but my match results is a RotatedRectangle. how to extract the ratated rectangle to new viewer and the angle set to zero. like 2nd image, The blue area will be ratated and deleted the yellow part.
thks, muks..
08-10-2009 04:39 AM
08-10-2009 04:40 AM
08-10-2009 05:04 AM
thx! muks,
but i can not open the vi due to I don't have lv, i only try run the ni vision and used it with vb. could you inform me which problem you solved.
1. OCR
2. Extract the rotated regions.
Best regards,
Jackyu
08-10-2009 05:15 AM
Hi jack_yu,
I just did pattern matching with rotated images of your original image. I chose "talk" as the template and used an "array to cluster" . Then i used an un-bundle to get the angle alone. Now i subtracted this from 360 and gave it to imaq rotate. Now everytime you will get the image rotated in the same way. You can extract it by using the value of top,left and bottom right from the bounding box. Which again you will get from the unbundle function and then use an imaq extract.
08-10-2009 05:40 AM
thx! let me repeat your steps...
1. Do the pattern("talk") match. get the angleX, TopXY.
2. Rotate angleX to whole image.
3. ??? As you know, the coordinate system will be changed now, the TopXY will be still available??
4. Used the Extract2 to get the sub-image.
I will try it by your idea, however, there is no mothed to extract a non-rectangle directly??? we need write a own sub-vi like yours to implement?.
thx a lot muks!
08-10-2009 05:50 AM