Machine Vision

Showing results for 
Search instead for 
Did you mean: 

Detection of dark character after change in ROI


in our current project we are detecting the dark character of the specified ROI from our device screen we are unable to detect character

but after changing the ROI of the screen character it starts detection.

kindly suggest or respond regarding the issue.


Wagh Dnyaneshwar   

0 Kudos
Message 1 of 11

posting an image, might be helpful in understanding the problem.

0 Kudos
Message 2 of 11


thanks for your response,

that OCR read function is detecting some garbage characters for dark character but with same image if ROI is reduced LabVIEW OCR read function is able to detect dark text correctly.


you can go through the attached images 

in these images 

1] limit access_1_Garbage_1.png == showing the garbage characters after drawing ROI on the Image and showing garbage characters in the read string window

2] limit access_2_Corrected.png == showing the characters are readable and recognized in read string window

3] limit access_1.png  == original image for the reference.


warm regards


0 Kudos
Message 3 of 11

Seems like you background has a lot of high frequency pattern.

I would recommend to run a smoothing filter to reduce the background pattern before trying to detect the letters.



Amit Shachaf
0 Kudos
Message 4 of 11

It's a guess you are reading text from an LCD screen, which is creating noise, which AmitShachaf pointed out.  


To reduce background noise, I dropped the Red and Blue plane in the color image, keeping the green, which made the image monochrome, and fed that into the OCR tool.  The OCR tool has  wide range of options, and with a small bit of poking, it was possible to train on the text, in the full image. Setting Threshold to manual or  Auto:Linear helped, and telling the OCR tool to performed a couple of erosions (to remove small particles).  A picture of the result image with OCR tags is attached.  Also included is the LabVIEW Script File, and a copy of the trained OCR file.  [NOTE The OCR file format that NI uses has a .ABC suffex, but this forum DOES NOT SUPPORT .abc.. So attached RAR file can be uncompressed.].  Hopefully this will get you pointed in the right directions.. the OCR tool has many options, and you need to go through them carefully to  increase your success rate..  


There are probably a dozen ways to improve image quality through filtering and color adjustments.  I just wandered into one of them.


Hope it helps


Good luck!



Download All
0 Kudos
Message 5 of 11

OCR.vascr is giving "invalid script file selected error" in vision assistant version 2019 SP1

0 Kudos
Message 6 of 11

Is this in reference to the script I sent?  It was created in LabVIEW 2020.  I can generate LV Code from the script from my end in 2019sp1 if that is the case.


Let me know



0 Kudos
Message 7 of 11


thanks for your reply

kindly give me the code with LV 2019 sp1



Wagh Dnyaneshwar

0 Kudos
Message 8 of 11

please send me the code in LabVIEW 2019 SP1

0 Kudos
Message 9 of 11

Thanks for the reminder!  I get lost some days.


The VI and the ABC file are attached.   The characters are trained, so will only recognize the characters in that image, you may have to train the entire set.


Hope this gives you a good starting point.


This is just a conversion from the Script, so it's pretty messy, but it was able to read the provided image.


Best of luck!







0 Kudos
Message 10 of 11