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: 

Camera Tracking the brighest spot.

Solved!
Go to solution

Hi everybody,

I am a self-taught LabVIEW user. I am working on a project on free space optics communication with a moving target that I have to track and aim at. I was thinking about using an usb camera to image a bright LED on the target and just get the x y position of the brightest point in the image to keep the feedback loop as fast as possible. I don't know how to get from the usb camera to the xy coordinates using Vision. Could you point me in the right direction?

 

Notes: The led could saturate more than one pixel i am fine averaging the position of the array of max coordinates or just getting the center wichever is faster.

0 Kudos
Message 1 of 9
(3,844 Views)

You have posted no code, which makes it difficult for us to guess (a) your level of knowledge/sophistication or (b) the version of LabVIEW you are using.

 

Have you checked the examples that come with LabVIEW?  Have you looked at "Particle Analysis Report.vi"?

 

Bob Schor

0 Kudos
Message 2 of 9
(3,824 Views)

I have posted no code because I am starting to write it now. (a) I have gone through the core 2 course (maybe I am a bit rusty but I understood everything in that module). (b) I am using LabVIEW 2016 32 bit on windows 7.
I had a look at the "Particle Analysis Report.vi" and I can reverse engineer it but the threshold is not exactly what I was looking for: I do not know in advance what will be the RGB level at which to cut, It may work if I can first analyse the image get the maximum value and put a threshold at 0.95 the maximum.

Once I have the coordinates of the led I have a pretty clear idea in my mind on how to write the rest (I will post it as soon as I get it).

0 Kudos
Message 3 of 9
(3,806 Views)
Check Object Tracking example.
-Go to Help->Find Examples->Search for Tracking
Thanks
uday
0 Kudos
Message 4 of 9
(3,794 Views)
Solution
Accepted by topic author LeonardoDB

I would go with IMAQ/NI-VISION tools and try to implement something from the particle analysis. Maybe you will have to play a bit with the threshold etc but then you should be able to get e.g. the center of gravity of a single, big particle that would be the X, Y coordinates that you are searching for.

0 Kudos
Message 5 of 9
(3,792 Views)
Solution
Accepted by topic author LeonardoDB

When doing Particle Analysis, the most difficult image type is RGB.  One of the first steps is to convert the Color to GreyScale, with the second step often being converting GreyScale to Binary (Black and White), the latter usually done by thresholding.

 

Bob Schor

0 Kudos
Message 6 of 9
(3,783 Views)

Thanks everyone for the help!

I managed to solve it with the attached vi and it works nicely. I noticed that I need a camera that accepts the exposure to be controlled otherwise it automatically compensates such that also reflections from bright objects are 255 in hue and it needs further processing to distinguish them from the LED.

0 Kudos
Message 7 of 9
(3,722 Views)

Hi,

I need to program using labview with USB camera to detect when blinking eyes. How can I do? Help me.

thanks,
Larissa Aguiar.

0 Kudos
Message 8 of 9
(3,131 Views)

One reason we ask Posters to "attach a VI" is that it gives us some clues, such as "Which Version of LabVIEW are you using?" and "How experienced a LabVIEW Developer are you?" (the latter being based on the quality of the attached code, admittedly a crude estimate).  

 

Processing Images is one of the more interesting and challenging features of LabVIEW.  If you have several years of experience using LabVIEW, and have experience using LabVIEW Vision, then a challenging problem such as detecting an eye blink might be a fun thing to try.  If, on the other hand, you are a new LabVIEW User, your best bet would be to hire someone with experience with NI Vision to develop a routine for you.

 

 

Bob Schor

0 Kudos
Message 9 of 9
(3,123 Views)