Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when using IMAQ VIs to read PNG and GIFF images

Hi Guys,
 
I've created a VI that reads . I'm having problems when I use the IMAQ VI GetFileInfo to read GIFF files and ColorImageToArray VI to read PNG files.
 
So far it can only read JPEG images without error. Can anyone help me with this issue?
 
The image dimensions are 1024*768.
 
Attached is part of the VI that I'm facing problems with.
 
Thanks In advance guys
 
Ridwan 
 
 
 


Message Edited by Wan81 on 05-19-2008 10:20 PM
0 Kudos
Message 1 of 8
(6,107 Views)
Hello Ridwan,

NI Vision Development Module does not support the GIF file type. This accounts for the error you were getting when you tried to use the IMAQ GetFileInfo VI with the .GIF image.

I ran the VI you attached to this e-mail and was able to successfully convert a .PNG image file with a resolution of 1024 by 768 to an array. Could you please mention what error you were getting with this VI for a .PNG file?

I hope this helps.

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 2 of 8
(6,088 Views)
Hi Vivek,
 
The error I received when I try to open a PNG image is:
 
IMAQ Vision (Hex 0xBFF60450)
Invalid Image Type. ColourImageToArray Error-1074396080
 
Thanks Vik


Message Edited by Wan81 on 05-25-2008 09:12 PM
0 Kudos
Message 3 of 8
(6,048 Views)
Hi Vik.
Obviously, IMAQ GetFileInfo doesn't say that the Image Type is HSL or RGB.
Did you check it?
Regards, Guenter
0 Kudos
Message 4 of 8
(6,030 Views)
Hi Guenter,
 
What am i supposed to check from GetFileInfo VI? Is my wiring wrong?
 
Thanks again for the help.
 
Ridwan
0 Kudos
Message 5 of 8
(5,977 Views)
Hi Ridwan.
It is not the wiring.
You must create an image of the type
HSL or RGB. I have changed your VI to indicate the image type that it creates.
As you need HSL or RGB, why not creating an image of the appropriate type?
Regards, Guenter
0 Kudos
Message 6 of 8
(5,963 Views)

Thanks Guenter for the reply. Will try out the new VI in my program.

 

Ridwan

0 Kudos
Message 7 of 8
(5,911 Views)
Hi Guenter,
 
I have realised my mistake now. It is as what you have mentioned regarding the appropriate image type. It seems that when I tried to load a BMP file which is around 700kb in size or lesser, an error message pops out. However, a BMP file with size 2.353MB poses no problems.
 
Further checks reveals that only when I save the files as type '24bit BMP', there will be no error.So, it seems that the labview VI only recognizes these type of files only. Hence, I am ensuring that files are saved with the correct format to prevent similar errors.
 
Thanks for the help so far.
 
Ridwan
0 Kudos
Message 8 of 8
(5,800 Views)