Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Analyzing a video for when a LED comes on

Hi all, 

 

I've been tasked with analysing experimental data of surgical performance. Along with the raw data which measures various displacements and forces I have a video of the experiement. To start with I need to sinc the video with the raw data so that I can identify certain features in the data and then view the video at that point. An LED is positioned in the video and shines red when the other data stream start acquiring data. So i need to programmatically find the frame when this light comes on and then convert that to a time so I know what the ofset is between the video and the data streams.

 

How would I get started doing this? I've never done anything like this before so any guidance on where to get started would be great. 

 

Thanks in advance

 

Stephen 

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 1 of 12
(3,826 Views)

there is many method to do that i told you some of them 
1there is example in labview with name of color matching see this vi   it could detect when red led is on
2 you can use ROI for place that led exist in video and use  IMAQ Light Meter (Rectangle) VI with thersould
3 you can use histogram analyse in led position 
4 you can wire led to trigger of your daq and then you do not need image processing too 

0 Kudos
Message 2 of 12
(3,806 Views)

Thanks for the reply. I've looked into these suggestions and what I find is that they are used to process images, mostly jpeg format. My video is in wmv form, how will i go about bringing in the video file to labview. I've seen various tutiorals on how to do this using a camera but not for an existing video.

 

Sorry if this is blatently obvious but I am very new to this stuff. 

 

Thanks

 

Stephen

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 3 of 12
(3,794 Views)

Hey, I've implemented the histogram method and used the example that is given in labview. I modified this so that I read in the images frame by frame from the video. I do this in a producer loop and queue each image and then process it in the consumer loop which is basically the example code. It runs but the histogram doesn't change when the led light comes on. In fact for any ROI it will not change after the initial change when I move the ROI. 

 

Does anyone know of a reason for this?

 

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 4 of 12
(3,790 Views)
Please attach your work.
0 Kudos
Message 5 of 12
(3,776 Views)

Hey, here is the VI sorry if it's not very clear.

 

Thanks

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 6 of 12
(3,772 Views)

Your code is absolutly correct with some flaws.

 

But for now let me know what happens when you keep enable "Enque Data" boolean true and removing the case structure in consumer loop with just a section in true case.

 

Also remove the constant section 'default rectangle' since it is not letting you to draw the ROI. Disable it..!

 

Try it and let me know

0 Kudos
Message 7 of 12
(3,766 Views)

That solved the problem, thank you just one quick question if you don't mind.

 

One issue now is using the histogram method i have to use grey scale. This means that my ROI has to be smaller than ideal to detect the change. In the coloured version of my video there is a red light that comes on, nothing else in the video is red so if I could detect the intensity of red light that would be ideal as the ROI does change slightly between the videos I have. Do you know a way to do this using histograms or are they only compatible with greyscale. 

 

Thanks again

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 8 of 12
(3,758 Views)

You can use single color plane extraction and extracting a red plane

But make sure that you have selected the image type as color not greyscale (change the Imaq create type to RGB)

0 Kudos
Message 9 of 12
(3,755 Views)

use this vi but take care about the your imaq theu should be in rgb 32bit 

also try the other method that I indicate thay are better to work 

color.jpg

0 Kudos
Message 10 of 12
(3,749 Views)