From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OCR in rotated image

Hello all

My problem is that I'm doing an OCR in a picture (see attachment) and the region sometime is in the correct position but no all the time. I have placed two different pictures for different scenarios. When I have the text in the picture horizontally I can do the OCR but when the text in the picture is in a different place I can't do the OCR. I know I have to rotate the picture but I don't know how it for any scenario. I'm using vision assistance. Any help!!!

0 Kudos
Message 1 of 4
(3,663 Views)

Hey gundam01

The best way to do this is redefining the ROI orientation by searching a good pattern so you can reference your ROI to that pattern and change your coordinate system orientation. Another workaround could be to rotate the image itself so that the text is readable. There is a Vision Assistant step that allows you to do this, the Geometry Step, but it does not have a terminal in which you can indicate the angle to rotate. In order to do this you can use the Run LabVIEW VI step, which you can pass a value to rotate the image a specified angle. You can find this angle using the pattern matching, in your case maybe you can search for specific holes positions, and then use the angle of that pattern to rotate the image. This could work so you can make your script more robust.

Carlos Pazos

Senior Product Marketing Manager

National Instruments
0 Kudos
Message 2 of 4
(3,624 Views)
Thank Carlos

The first thing I try  was to search for a pattern in the picture to reference the ROI but it doesn't work for my picture. I know it's possible to do the pattern matching but the light I'm using isn't the best one. The way I'm doing it is to rotate the image in the VI and the same time doing the OCR. That way I'm able to do the OCR but I thing the best way to do it is using matching pattern like you say.


0 Kudos
Message 3 of 4
(3,614 Views)

Dear gundun

I have the same problem. If your problem is solved, Please explain!

 

Thank you

sincerely

0 Kudos
Message 4 of 4
(2,927 Views)