LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OCR for low quality image

Hello Everyone,

 

I have attached a picture which is quiet low in quality, I am performing an OCR function on it to extract only the top left value of temperature ( encircled in red ) from it.

 

I tried to train the OCR through vision assistant but when I try to extract the numbers, unfortunately it shows no extracted value.

 

Can someone guide me on how to extract the number properly through OCR ?

 

 

0 Kudos
Message 1 of 18
(1,842 Views)

in my experience OCR is always easier in greyscale,

try turn the image into greyscale and increasing the contrast before setting the ROI and doing the OCR.
- although I'd be surprised if you couldn't read the value back over a serial port from the camera using commands (whihc you may find less intensive and doesn't require the Vision license to deploy)

Regards

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 2 of 18
(1,831 Views)

via Google's Pytesseract , I can turn this section from your example

IR_1_crop_grey.png

 

via

image_path = r"E:\7_python\lps\2021-08-23_224840_flir\IR_1_crop_grey.png"
img = cv2.imread(image_path)

text = pytesseract.image_to_string(img, config='--psm 12 --oem 3')
x= re.findall(r'\d+\.\d+', text)

print("text extracted\n", text, "\ndecimals regex\n", x)
 
into
 
text extracted
|spo°23.0)
♀
decimals regex
['23.0']

 

 

I haven't tried to run this via LabView's Python Node - this could work, but you could also get stuck

 

As James pointed out, the 23.0 °C value is likely to be accessed in another - more direct - way.

 

 

0 Kudos
Message 3 of 18
(1,789 Views)

yes, pytesseract can be used via python node

 


I tried to train the OCR through vision assistant but when I try to extract the numbers, unfortunately it shows no extracted value.

 


for the uncropped, colored image, there's also no output

but for the cropped grayscaled, the temperature value can be extracted

 

 

 

 

 

 

 

0 Kudos
Message 4 of 18
(1,758 Views)

Hello james,

 

Thank you for the tip regading OCR.

 

Actually, I tried alot to communicate with camera but I could not do so. I am using FLIR T335 camera and when I connect it neither I see it in device manager of the computer nor in NI-MAX. I have contacted FLIR customer service and they told me that ThermoVision Labview Toolkit is discontinued and they cannot support me in connecting the camera to the LabView.

 

As I want to grab pictures and take the temperature as displayed in the camera screen so I decdied to use OCR instead.

0 Kudos
Message 5 of 18
(1,734 Views)

@Pukhtun_Yum wrote:

Hello james,

 

Thank you for the tip regading OCR.

 

Actually, I tried alot to communicate with camera but I could not do so. I am using FLIR T335 camera and when I connect it neither I see it in device manager of the computer nor in NI-MAX. I have contacted FLIR customer service and they told me that ThermoVision Labview Toolkit is discontinued and they cannot support me in connecting the camera to the LabView.

 

As I want to grab pictures and take the temperature as displayed in the camera screen so I decdied to use OCR instead.


Stuff the LabVIEW toolkit, I'm sure there's a simple Serial interface defined in the user manual.
you've probably just not got it wired up correctly in H/W yet!

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 6 of 18
(1,731 Views)

There is nothing in manual related to LabView.

 

I have been stuck in the mud from long now and could not comeup with anything.

0 Kudos
Message 7 of 18
(1,719 Views)

@Pukhtun_Yum wrote:

 

Actually, I tried alot to communicate with camera but I could not do so. I am using FLIR T335 camera and when I connect it neither I see it in device manager of the computer nor in NI-MAX.

 How do you connect the camera to the computer ?

via USB?

Which OS are you using? Windows 10?

 

 

Do you have installed a proper device driver with the right bitness (32 or 64) for the FLIR T335?

e.g. do you have a CD or DVD which came with the manual?

 

 


@Pukhtun_Yum wrote:

I have contacted FLIR customer service and they told me that ThermoVision Labview Toolkit is discontinued and they cannot support me in connecting the camera to the LabView.

 


the toolkit can still be found online at

https://thermovision-labview-toolkit.software.informer.com/download/

 

I downloaded a .zip file from the link above within a virtual machine, within the zip file is a pdf and a .iso file

the .iso file does contain a lot o stuff which appear to be device driver

 

but wait - are you sure the FLIR T335 camera  was made to be used with the ThermoVision Labview Toolkit?

The Toolkit was discontinued in 2013, Windows 10 was released in 2015...

 

0 Kudos
Message 8 of 18
(1,714 Views)

Hello,

 

I am reading the temperature values from a picture through OCR. I converted the original image to greyscale and increased the contrast of the image to read the numbers properly but when I choose ROI as rectangle then it does not seperate 2 and 9 but consider them as one number.

 

Is it because the distance between 2 and 9 is very small ?

0 Kudos
Message 9 of 18
(1,683 Views)

- I am connecting the camera through USB-2

- I am using windows 10

- I contacted FLIR customer service and they gave me drivers

 

- The FLIR customer service told me that the toolikit is discontinued

- When I connect T335 camera with the computer the following appears (picture attached)

0 Kudos
Message 10 of 18
(1,695 Views)