08-19-2010 05:04 PM
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
08-19-2010 08:17 PM
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.
08-20-2010 10:41 AM
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.
08-20-2010 10:56 AM
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.
08-20-2010 01:34 PM
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.
09-02-2010 09:28 AM
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.
09-03-2010 08:22 AM
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.
09-03-2010 04:29 PM
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!!
09-03-2010 04:29 PM
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
09-03-2010 04:34 PM
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..