Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid Image Type - AVI file + Singe Color Plane Extract + Threshold

Solved!
Go to solution

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:

AVI reading + SCPE + TH.jpg

 

and the error:

Error 1074396080.jpg

0 Kudos
Message 1 of 13
(6,175 Views)

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

 

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 13
(6,171 Views)

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?

0 Kudos
Message 3 of 13
(6,162 Views)
Solution
Accepted by topic author seasoo

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

 

 

Bruce Ammons
Ammons Engineering
Message 4 of 13
(6,160 Views)

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?

0 Kudos
Message 5 of 13
(6,153 Views)

Okay, now I get it! I was reading "IMAQ create" but thinking of "IMAQ read file"... excited if it's gonna work now 😉

0 Kudos
Message 6 of 13
(6,142 Views)

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...

0 Kudos
Message 7 of 13
(6,127 Views)

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?

 

0 Kudos
Message 8 of 13
(6,120 Views)

Right click on the image display, and select the Binary palette.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 9 of 13
(6,118 Views)

is there a reason why the binary image looks like this:

binary.jpg

0 Kudos
Message 10 of 13
(6,107 Views)