Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

ImageToArray gives Invalid Image type Error

I am trying to get the data from images acquired through IMAQdx.  I successfully grabbed images and displayed them using the Grab.vi so I started work on my own vi using this as a template.  All was going fine until I added the ImageToArray.vi to my vi which caused it to stop with an Invalid Image Type Error.   I went back to Grab.vi example and added ImageToArray.vi and it worked fine.  I could see no differences between this and the one I built yet mine was showing an error.  Next I opened a new vi, selected all on the Grab.vi Block diagram and dragged the selection to the new vi.  When run this one also failed with an Invalid Image Type Error.

 

Can anybody tell me what is wrong here?

 

I attach the modified Grab.vi and the one generated by coping everything from the modified Grab.vi

 

I am using LabVIEW 2012

Download All
0 Kudos
Message 1 of 3
(3,317 Views)

Hi Ken,

 

I think the problem you are having is caused because your image from the camera is RGB.

 

I would suggest you try inserting the 'IMAQ ExtractSingleColorPlane' VI between the 'grab' VI and the 'ImagetoArray' VI to convet the image to greyscale. I am unsure how you would display three colours for each pixel in a 2D numeric array.

 

Regards,

Dave.

Senior Software Engineer
www.Adansor.com
0 Kudos
Message 2 of 3
(3,308 Views)

Dave

 

Thanks for the advice, I had just about got there by using ColorImageToArray.vi which works because the image is generated by a Mono camera.  I only have the basic Vision Utilities so the one you mentioned is not available to me.

 

Image to array added to the shipped example Grab.vi does not output anything but does not give an error like the 'copied' version.  Still do not understand this but I suppose that as I have got my Application working I shall just have to forget about it.

 

Thanks Again

 

Ken

0 Kudos
Message 3 of 3
(3,303 Views)