07-09-2008 11:39 PM
07-11-2008 08:41 AM
Hi, Amx,
You should understand how the resolution info stored in the images.
In general, this info stored in metadata inside of the image file (mostly in header) and depends from the image format. Jpeg, tiff, png stores this info in different ways.
For example, inside of png format with 300dpi this info stored by following way:
First, four bytes (hexadecimal): 70 48 59 73
Then resolution in pixels per meter 00 00 2E 2D 00 00 2E 2D
Finally one byte 01 (unit specifier defined)
So, your resolution calculated by following 2E 2D (hex) = 11821 pixels in meter; it means 118.21 pixel per cm; it means 118.21 * 2.54 = 300 pixel per inch.
In jpeg or tiff this info will be stored by other way.
There are no way for recover this info with or without VDM. You should parse the hader of the file (yourself, or, may be with third party library). If you will try to open calibrated image with IMAQ Vision functions, and then check calibration info, then you will get an error -1074396113 ( The source/input image has not been calibrated.)
Otherwise IMAQ Image can be calibrated, but do not mix IMAQ Vision calibration with calibration described above. NI uses own calibration info, which can be stored in png (with vision info) or aipd files.
Resume. If you need to open "third party" calibrated files in your application (stored in Photoshop, for example), then you need to have appropriate parser for header for recovering this info. But if you have Vision Development Module and want to save calibration info in your own files, then you can use IMAQ Write Image And Vision Info / IMAQ Read Image And Vision Info functions for this task.
hopefully it helps,
Andrey.
07-13-2008 08:48 PM