LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add meta tag data to a TIF image file

I'd like to add information such as camera type, shutter speed, and other measurement parameters to image files that I'm creating with my IMAQ application. I have not found a good source of information on how to accomplish this. Does anybody else have any suggestions, leads or pointers?

 

Thanks in Advance,

Derek

0 Kudos
Message 1 of 14
(9,317 Views)

If you use a PNG you can write with vision data and use the IMAQ write custom data vi to add key-value pairs to your image (ie 'shutter' = 200), there are complementary read functions.  I dont believe you can do this with TIFFs just PNG but I might be wrong about TIFFs.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 14
(9,306 Views)

I've looked at IMAQ Write Image and Vision Info File 2.vi. According to the documentation, "Writes an image, along with extra vision information associated with the image, to a PNG file. This extra vision information includes overlay information, pattern matching template information, and calibration information. Note that this vision information can only be saved with the PNG file format."

 

I have used the Write Custom Data.vi to write several keys to the image, before using the Write Image and Vision Info VI noted above. It does not seem that the keys can be read as metadata from the file by windows or other applications.

 

It is discussed on LAVA at

http://lavag.org/topic/5297-embedding-additional-txt-in-a-png-file-imaq-82/

 

It seems like the solution should be quite simple.... not there yet.

0 Kudos
Message 3 of 14
(9,291 Views)

Strange that only now I find the link:

http://forums.ni.com/t5/LabVIEW/Storing-image-metadata/m-p/986456

 

"LabVIEW does not provide a direct way to write TIFF metadata."

 

The suggestion is to use Windows API.

0 Kudos
Message 4 of 14
(9,286 Views)

I did not see a requirement for reading this info outside of labview, I use this all the time to save the image info such as scale and exposure to my pngs, but these are custom data that windows will just ignore.  There should be a method for adding properties to a file just as the app builder adds the version info or word adds a author to file, I have never tried this though.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 14
(9,277 Views)

I've been working on using .NET to accomplish this metadata task. It is not for the faint of heart. As an interim accomplishment, I've created a subVI to read 1 or more TIFF files, extract all the images, and write them to a single TIFF file. This may be useful to somebody, so I thought I would make it available.

Message 6 of 14
(9,196 Views)

You could also download a copy of libTIFF and call it using the call library node.  This option is probably not newcomer friendly.  TIFF is a very complex format.

0 Kudos
Message 7 of 14
(9,176 Views)

Yeah, Libtiff is really a good way to do this...you will gain a lot of possibilities by using this library:

- use your own filetags

- use already defined tags (like author, copyright and so on, which can be read by some professional imaging software)

- use compression (losless!!!)

- write 16 bit image data (which is not possible with png)

 

But I also think that this is a hard way to go, as Libtiff has a somehow strange way to handle memory...but its the better choise!!


THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 8 of 14
(9,160 Views)

I found that using .NET I am able to write to some of the metadata fields. Attached is a copy of my work so far. If anyone knows how to write to additional fields in the TIFF file, please let me know.

 

Derek

0 Kudos
Message 9 of 14
(9,161 Views)

these ushort's that are defined on your block diagram are the metatags that correspond to description, model, artist and so on...there are lots of others. you can find them in TIFF Revision 6.0

 

do it the same way you do it in your code by adding your needed tags..


THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 10 of 14
(9,156 Views)