Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening an AVI file and dot tracking

Hi,
I am trying to open up an AVI file in Labview and then use the IMAQ Detect Cirlces and the Caliper buttons to track two points so that I can determine the length that a biological material has stretched so I can calculate stress and strain.  I have successfully used an IMAQ 1394 camera to do this function, but I am having trouble opening an AVI and tracking the two points. When I try to run my program, I get an error that says "Invalid Image Type"
I have attached my AVI file and if anyone can help me I would greatly appreciate it.
Thank you very much,
Jessica
Melody
0 Kudos
Message 1 of 6
(3,813 Views)
I don't have 8.5 installed, so my version is broken. However, I looked over your program, and my guess is this: In the first loop iteration, the image being modified starts out as a U32 image, then is converted to U8 by extracting the Luminance plane. On the second loop iteration, that same image is referenced, and the 2nd frame is saved as a U8 image instead of U32. Since the extract planes VI needs U32, the VI gets an error saying it's the wrong image type.
 
My recommendation: Use a destination image (U8) for the plane extraction VI, so that you keep your U32 and U8 images separate.
 
Also, a question: Why do you have a Greyscale (U8) enumerated constant hooked up to the border size of your initial image?
 
Hope this helps.
0 Kudos
Message 2 of 6
(3,806 Views)
Hi, Thank you for your help! I'm still learning about Labview (I am a new user) and I thought that I had to use Greyscale constant because my camera is a black and white camera- do I not need it?
You said use a destination image- I am not exactly sure how to do that. Do I just just the IMAQ create button again in the while loop?
Thank you so much!
Jessica
Melody
0 Kudos
Message 3 of 6
(3,793 Views)

What I meant about the Greyscale constant is that it's not hooked up to the right place. In cases where you need to create an image, that constant would get hooked up to the image type. In your case, you get the image type from the AVI file. The greyscale is hooked up to the image border (a numeric value which changes the additional pixels around an image, necessary for operations with structuring elements such as the dilate function) , which is best left unconnected unless you have a need to increase it. In your case, I don't believe it matters, I'm simply saying that the constant doesn't have to be there.

To create a destination image, you make a spot in the memory for your image. Use an IMAQ create, give the image a new name, make the type Greyscale (U8), and then hook the image up to the Image DST terminal on the Extract Planes VI (right below the Image SRC, or source, which you've already hooked up). You can create the image outside of the loop, and then wire it inside.

But, there's also a different issue here. The Extract Single Color Plane VI is designed for color images. You said that you have a black and white camera, which would imply that the AVI you've recorded is also black and white. If that's the case, than each frame you're grabbing is already a greyscale image, and the Extract Single Color Plane not only wouldn't work, but it wouldn't make sense (it's designed to convert a color image to greyscale). If the AVI was saved as a U32/Color file, then the program should work properly if you use the destination image as described above. If your AVI was saved as greyscale (which I believe it was), then the extract planes VI should be unnecessary, and you can wire the AVI frame output directly to your detect circles and Caliper VI.   

 

0 Kudos
Message 4 of 6
(3,790 Views)

Hi,

Can you post one of the AVI files (hopefully it's not too big).

0 Kudos
Message 5 of 6
(3,783 Views)
Hi,
I actually got it to work thanks to you!
Thank you for all of your help!
Jessica
Melody
0 Kudos
Message 6 of 6
(3,761 Views)