06-21-2013 05:16 PM
Hi there,
I don't have much experience on LabVIEW so far... This maybe the reason why I'm struggling with the following problem.
I'd like to Open an AVI file and transform it to get the information I need. Therefore I tried an "easy" first step by opening the file, displaying it, editing the file (Single Color Plane Extraction) and showing that one too, after that the avi image gets into the threshold function and is displayed as well.
I'm using LV10. And when I run the vi Error 1074396080 occurs (Invalid Image Type). I already tried to use different avi files but it still did not work. What am I missing?
Thanks for your help!
My vi:
and the error:
Solved! Go to Solution.
06-21-2013 09:52 PM
The problem is that you are converting the color AVI image to a grayscale image the first time through the loop. The second time through the loop, it is still a grayscale image when you extract the next AVI image. When you try to extract a color plane from the grayscale image, you get the image type error. If you put a bunch of probes after each step and run the code with tracing turned on, you will see the different images and their types. Pause at the end of each loop to examine the probe images.
When you are converting from one image format to another, it is a good idea to create a second image of the new format and use that as the destination image during the conversion. You should create a grayscale image for the destination of the Extract Color Plane. I would also create another grayscale image for the destination of the binary threshold operation, although it isn't strictly necessary.
Bruce
06-22-2013 09:28 AM
I guess I understand the problem, but I still don't know how to solve it... I tried different things now, but nothing worked so far.
Could you upload an image of the right way?
06-22-2013 10:51 AM
Use IMAQ Create to make another image buffer for storing an image. Give it the name Grayscale or something like that. Wire the output of IMAQ Create to the Image Dst input on IMAQ ExtractSingleColorPlane.
Use IMAQ Create to make a third image buffer for storing an image. Give it the name Binary or something like that. Wire the output of IMAQ Create to the Image Dst input on IMAQ Threshold.
You can put the IMAQ Create VIs on the diagram outside the loop, just below the existing IMAQ Create.
Bruce
06-22-2013 02:17 PM
Alright, I'm going to try that, but I'm not sure how IMAQ create gets the increasing frame numbers if not from a loop... or is it not really necessary?
06-22-2013 05:25 PM
Okay, now I get it! I was reading "IMAQ create" but thinking of "IMAQ read file"... excited if it's gonna work now 😉
06-23-2013 01:01 PM
okay, i did as you suggested... quick and dirty... but it did not work.
during the first loop the original image was in colour, the grayscale one was in grey, but the threshold one already had an error.
the second loop produced a grey original image and an error in both of the other ones...
06-23-2013 05:08 PM
I got it! Thanks for your help! I probably was thinking too complicated 😉
One thing I'd like to change now is my threshold image... it is displayed in grayscale, but I would prefer it to be in binary like non video images are handled. Is there a way to change that or is IMAQ create blocking me there since you cannot set binary as image type?
06-23-2013 05:48 PM
Right click on the image display, and select the Binary palette.
Bruce
06-24-2013 04:27 AM
is there a reason why the binary image looks like this: