06-22-2016 09:30 AM
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
06-22-2016 05:35 PM
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
06-23-2016 05:12 AM
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
06-23-2016 08:42 AM
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?
06-23-2016 11:32 PM
06-24-2016 05:19 AM
Hey, here is the VI sorry if it's not very clear.
Thanks
06-24-2016 06:07 AM - edited 06-24-2016 06:12 AM
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
06-24-2016 06:20 AM
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
06-24-2016 06:46 AM - edited 06-24-2016 06:48 AM
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)
06-24-2016 07:34 AM
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