LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not an image error when displaying a .png file.

I have a system that is acquiring images every second.  I've added an alarm related to these images, but I also want to display a freeze-frame of the alarmed image and save it as a .jpg.

 

Haven't been able to save the images in .jpg format, only .png since the images are 16 bit.  Why do I want .jpg?  Because I don't need the high-res and large file size associated with .png format.

 

I'm also having problems with the "freeze-frame" feature.  At the moment, I'm trying to read the .png file and display it in the LabVIEW panel.  I know, i know, why read from the file?  Because I haven't figured out how to display a "freeze frame" of the images.

 

I'm using the IMAQ Read File.vi, but I get a "Not an image" error code (-1074396120).

 

Any suggestions would be greatly appreciated.

0 Kudos
Message 1 of 5
(3,349 Views)

Could you add one of your PNG's to the forum.

or the code that creates them?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 5
(3,321 Views)
Check the buffer names (IMG DST). If they are unique. Post a screen shot of your vi.
0 Kudos
Message 3 of 5
(3,300 Views)

"Save image.png" is a snapshot of the sub-vi used to save the image as a .png file.  It creates a file name based on the current time and then saves it to a predetermined location.  All of this code seems to work.  (The saved image appears normal when I open it.)

 

The .png created by the vi is too large to attach (8MB).

 

I get the "not an image" error when I try to open the saved file as an image.  "Open file.png" is a snapshot of the code used to open the image.  The code within the Save Image.vi is shown in the first attachment "Save image.png".  I'm a little confused about the image input to the IMAQ ReadFile.vi.  I just wired the same image that was saved (control, not a constant).  Maybe that's the problem?

Download All
0 Kudos
Message 4 of 5
(3,286 Views)

Hi Epster,

 

It would be more helpful if you could post the actual sections of code that are producing this error. 

With my experience with this error, I would suggest a few things.  First, ensure that when you are calling IMAQ Create, (if you are using multiple IMAQ Creates), then ensure that each buffer name is unique.  If not, they will all overwrite to that one "untitled" buffer.  Secondly, ensure that you are not calling the IMAQ Dispose with the "all images" input set to True until after your program has completed.

 

If you are not using IMAQ Create to create the image in the first place (I didn't see any in your posted code), then you would most certainly get the not an image error. 

 

Finally, I'd try opening the image in a shipping example.  To access the shipping examples, go to Help> Find Examples.  Browse to Toolkits and Modules Installed choose Vision, and select one of the many examples there. 

 

If these steps do not work, then go ahead and post your actual code so others can have a look. 

 

Cheers, 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 5 of 5
(3,266 Views)