LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I find the image type of an image file

Solved!
Go to solution

This was posted on the LabView forum in error yesterday,  Please excuse the dual post.

 

I am trying to open a JPEG image.  If I do not know the image type (8U, 16I, GrayscaleSingle, ... etc)... is there a way to find out that information?

 

If you open the file using IMAQ ReadFile...you have to supply a Create Image input to allocate space...the input specifies a type to read...but if the type of the stored data is not the type specified in the read file you either read the file as the type specified, or the file does not produce any values...(and no error is produced).

 

Examples:

 

Store a JPEG as a Single Percision Floating point image.

 

Use a Creat File to specify that the file is read with the following types...with the following results

 

Type Specified        Type Read         Resulting image

U8                               U8                     8 bit image appears

16I                               16I

0 Kudos
Message 1 of 4
(3,046 Views)

duplicate post

 

Please continue in other thread.

0 Kudos
Message 2 of 4
(3,044 Views)
Solution
Accepted by topic author Hummer1

Hummer1,

 

There are two methods to accomplish this:

 

1) IMAQ GetFileInfo, which has quite a few outputs involving the image details.

2) Read JPEG File, which you can unbundle the image data output to get the image depth, or other attributes.

 

I would reccomend the IMAQ function, due to it being more detailed.

Hope this helps

Chris Van Horn
Applications Engineer
Message 3 of 4
(3,018 Views)

that's perfect...

I didn't see that...thanks for the tip.

 

Sometimes the simple and straightforward hides in the fog of diversity and capable.

 

Humming once again.

0 Kudos
Message 4 of 4
(3,009 Views)