Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to recognise LEDs

I have a new image i want to analyze i have tried to use color threshold but i am unsure of the settings. The light is quiet bright so when the LED is on it very hard to see it as it looks white when in fact it is red i have attahced a picture below. In this instance three LEDs are on the top one is off but the button one is so bright it is hard to see. If yanyone could have a look and perhaps advise me on what settings to use for the color threshold in vision assistant. Any help welcome thank you

 

Regards,

 

Damien

0 Kudos
Message 1 of 14
(5,256 Views)

Heres the image.

0 Kudos
Message 2 of 14
(5,254 Views)

Dear Damien129,

 

I have been looking at your issue relating to your image.

 

It seems you have overexposed the device to too much light when taking the photo. If you wish to view the LED colours clearly, you will firstly need to adjust your environment so that you don't have light reflecting off the device when taking the image.

 

No functions in Vision Assistant will be able to fix the overexposure. I would recommend placing the device in the shade or have your image acquisition device placed at a different angle before taking the image.

 

I have tried using the 'Colour Threshold' function with various settings. I also tried to use the 'Brightness' function (found under the Image tab) to amend the contrast of the image.

 

Neither of these approaches could rectify the view of the LED colours. 

 

What exactly are you trying to do with your application? Once you have taken the image, what will you do with it? Read values? Further image processing?

 

If you could let me know how you get on when setting up the environment differently prior to image acqusition, I would greatly appreciate it.

 

Regards,

Dom C
0 Kudos
Message 3 of 14
(5,222 Views)

Hey Clad19,

 

I am trying to recognise which LEDs are on for a certain step and also perform character recognition and pattern matching. I have 2 different DUTs i am trying to perform processing on. I have attached 2 pictures, the first i just have to just recognise which LEDs are on, for instance at the first test step the first LED is on, second test step 2 LEDs are on etc. In the picture provided i have 4 LEDs on. Could you help in this instance i am not great at vision.

 

The image i provided last week i have tried minimising the exposure and have come up with the following.There are four LEDs on and a green LED (L) for phase direction. I want to recognise the characters 50Hz and 410 which i can do at a higher exposure but not in this instance, however i want to pick up these LEDs and not the other ones which are slightly on along with the characters without having to take 2 images if it is possible. Any help appreciated.

 

Damien

Download All
0 Kudos
Message 4 of 14
(5,189 Views)

Hi Damien129,

 

Thank you for sending me some clarification regarding your problem.

 

I have been working on the the modified image of last week.  

 

I have a couple of other questions for you:

 

- Which are the LED's you do not wish to pick out? The Resistance LED and the Power LED? Is that correct?

 

- The 50 Hz character can be recognised using the OCR function available in Vision Assistant. By first changing the brightness of the image (specifically the Gamma exposure), we can make the image brighter without losing the colour intensity of the LED's.

 

However, it will only work for a specific character set. Therefore, if this value will change, you will not be able to do OCR for the LCD screen. Will this 50 Hz value change, or is this the mains frequency that will stay stable?

 

With the new image sent (the other DUT) that has four red LEDs, what do you mean by wanting to recognise which LEDs are on for a certain step? From the image it seems they are all on at the same time. 

 

What exactly do you want to do with the image of the 4 red LED's? 

 

My suggestion would be to have some light on the DUT's before taking the image, not in complete darkness. 

 

By this I mean still have a light shining on the device, but off centre (not perpendicular to the DUT).

 

When I mentioned in the previous post to place it in the shade, I didn't envisage such a dark background. Apologies for this mis-communication on my part.

 

I will continue to work on the images you sent me but would be greatful if you could take a couple more images with different lighting. I could then give more definitive suggestions as to how to proceed.

 

For the moment, I suggest the following:

 

- Read through the documentation relating to NI Vision Assistant:

 

Ni Vision Assistant Tutorial

 

- Play around with the OCR/OCV functions once you have amended the 'Brightness' of the image, focusing on the character set file. 

 

If you could get back to me with the information above, I would greatly appreciate it.

 

Regards,

 

 

 

Dom C
0 Kudos
Message 5 of 14
(5,167 Views)

Hi Clad19,

 

I have worked on the problem i had and have come up with a solution i think. I have attached the vision assistant script and an image i have used. However i have a few questions if you could assist me in, firstly, I am looking to set up my script in that the image is calibrated so if for instance the DUT is not in the exact position as the previous DUT when i run my script again my ROI changes, the method i am using is to find a straight edge then a bottom edeg and get the coordinates but is there a function i can use to the calibration right each time even if the DUT is off by say 5 mm or at a slight angle?

 

My second question has got to do witht the vi i have attached. When i run this vi the image that appears is black/blank. However if i leave out the functions where i analyse the LEDs and just check for the pattern matching or OCR the image appears fine, is there a way of observing the image when i check for the LEDs.

 

To answer your questions i believe i have found a solution for picking out the LEDs i do not want to pick up, for instance at 400V four power LEDs are on so i use a color pattern matching then i use particle analysis to count how many objects it detects. At this voltage the green phase LED is on its just a matter of me ensuring the direction is correct.

 

With the image of the 4 LEDs i just want to count them and say yes at 400V i see 4 LEDs plus the green phase LED.

 

At 230V i will see just 3 LEDs and no phase LED. The image i sent you is just one step the of maybe 20steps, the frequency remains the same for the most part but it goes to 1000Hz in 2 steps. Thanks for your time with this matter.

 


Regards,

 

Damien

 

 

 

 

Download All
0 Kudos
Message 6 of 14
(5,148 Views)

Hey,I have answered my second question regarding the black image, it was just a matter of usng the image buffer function to restore the image. I have tried to use the image calibration function in my script but find it tricky to understand. Are the find the edge functions the best way to ensure my region of interest for OCR stays the same?

 

Damien

0 Kudos
Message 7 of 14
(5,145 Views)

Hi Damien129,

 

I hope you are well.

 

Apologies for the slight delay in getting back to you with more information.

 

I have been looking at your Vision Assistant Script and the image you have sent me.

 

The script seems alright at the moment. 

 

In regards to your main question:

 

- How can I ensure that the OCR works correctly even when the DUT has been moved slightly?

 

You will need to use a combination of edge detection and clamping. If you could set up edge detection on the left and right edges of the LCD, you could then use one or both as a reference for the ROI of your OCR for the frequency and voltage. 

 

Or you could start with the image and do the following:

 

- Perform a colour extraction on the image (to change it from a 32 bit image to an 8-bit image)

 

- Set up a Pattern Match for an area where a coordinate system will be set up. An area around the bottom left hand corner of the DUT for example. 

 

- Set up a coordinate system. This will reference the pattern match you have set up beforehand. This will be set up in the middle of the Pattern Match region. 

 

- Use the 'Clamp' function to fix a specific ROI that will be referenced to the coordinate system you have set up. This means that no matter where in the image your DUT has moved, the ROI for the OCR will always be referenced to it.

 

- You can then perform OCR on the region of interests, following the procedure you have already undertaken.  

 

I have attached a very basic example that demonstrates this. I have taken an image of three penguins. I have created a Pattern Match region as the head of one penguin. I have then set up a coordinate system at the middle of this.

 

I have then clamped the beak of another penguin within the image. This clamped region is referenced to the coordinate system.

 

I have amended this image so that there are two additional copies. There is the original position of the three penguins and then two images where the positions vary. 

 

Hope this should help clarify the concept for you and help you further with your application. If you could let me know how this goes for you, I would greatly appreciate it. 

 

Kind Regards,

Dom C
Download All
0 Kudos
Message 8 of 14
(5,128 Views)

Here is the final image required for the script.

 

Regards,

Dom C
0 Kudos
Message 9 of 14
(5,127 Views)

Hi Clad19,

 

Thank you again for your help. Yes that worked fine initially for a number of my images. At the moment i do not have access to the hardware so i have to use the images i have taken last week to try and come up with a basis to start my inspection. I have two cameras for 2 test stations but the light is slightly different at these test stations,so when i included the functions you suggested into my own script all of the images i took in the first test station worked fine but the second test station failed to pick up or match the pattern from the first test station the images were taken at different times hence the reason why one is slanting slightly to th right and the other slightly to the left.  I have attached an images below from test station1 and test station2 with a script if you could perhaps have a look and see it would be great.

 

Regards,

 

Damien

Download All
0 Kudos
Message 10 of 14
(5,119 Views)