From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

-1074396080 "Invalid image type" Extract Color Planes

Solved!
Go to solution

I was getting the above error under LV 8.5, so I searched and found this example:

 

http://digital.ni.com/public.nsf/ad0f282819902a1986256f79005462b1/20ab177016de51c0c1256f03006a74cb/$FILE/ExtractColorPlane_Example.vi

 

which includes two vi's ExtractSingleColorPLane and  ExtractColorPlanes.  The first works fine ,  but ExtractColorPlanes throw the same error I was getting in my own code.

 

Any suggestions?

 

David

0 Kudos
Message 1 of 7
(6,801 Views)

Hello David,

 

The reason why this error occurs in this example is due to a timing issue. The 'Image' image buffer first storest the color image that is read from a file and then stores the output of IMAQ ExtractSingleColorPlane. The IMAQ ExtractColorPlanes VI expects an RGB image to be its input. However, if the IMAQExtractSingleColorPlane VI runs BEFORE the IMAQ ExtractColorPlanes VI, the 'Image' image buffer no longer holds an RGB image. This is what leads to the error you mentioned in this case.

 

A workaround is to create a copy of the RGB image so that the buffer is not over-written. I have attached an image to show how this can be done. I hope this helps!

Vivek Nath
National Instruments
Applications Engineer

Machine Vision
0 Kudos
Message 2 of 7
(6,783 Views)

Vivek,

 

Thanks - I made the copy as you showed, and it works - sometimes.  Something else is going on also, because  if I run it several times in a row, it will run sometimes, and fail with the original error message other times.  Other times I get no error message but the image from ExtractColorPlanes has obvious defects in it.

 

David

0 Kudos
Message 3 of 7
(6,768 Views)
Solution
Accepted by topic author davidc10
If you are taking extracting multiple pieces of information from the same image, you should always keep that image in its original form.  Create additional image refs to store the extracted info.
Randall Pursley
0 Kudos
Message 4 of 7
(6,753 Views)

Randall,

 

Thanks - that works just fine.  Which of the help files/ reference docs is most useful for such things?

 

David

0 Kudos
Message 5 of 7
(6,731 Views)
Just the general IMAQ documentation.  You just need to keep in mind that you are passing around references to the image data and not the data itself.  If you don't wire a destination for the processing step, you will overwrite your existing data.  Sometimes you may want that, but not always.
Randall Pursley
0 Kudos
Message 6 of 7
(6,696 Views)

Hi, I trie to run the VI, and it's not working, I don't know why, I've been the same problem.... any suggestigon?

"Everything that has a beginning has an end"
0 Kudos
Message 7 of 7
(5,843 Views)