09-22-2010 09:46 AM
Hi,
First, I would like to knwo how overlay infos are stored when you write a png file with "IMAQ Write Image And Vision Info File 2".
Are these infos stored as bitmap or are the coordinates of each overlay element written individually?
Then, I've found a vi here that I've modified in order to get a bitmap of all the overlay in a png (see attached vi). It works good, but I would like to go further and have each overlay element extracted separately.
Thanks
09-22-2010 11:22 AM
Hi, toto,
At the first, you should clearly understand differences between destructive and non-destructive overlay. When you using NI Overlay functions, then overlay is non-destructive. In given example overlay is destructive (because merged with image), all pixels under overlay was lost.
You can "recover" destructive overlay in some cases - for example your image is grayscale, and overlay is red, then merged image stored in RGB format. So, you can extract all red pixels, and this is your overlay. Of course, overlay will be extracted as bitmap as was shown in example above.
Back to NI Overlay written in PNG image with image info. As you (probably) know you can store custom data in PNG, and this fact was used by NI for storing non-destructive overlay together with image. Unfortunately internal format of overlay is undocumented, so you can see this overlay, but you can't parse or delete elements from this overlay. Technically overlay stored in custom data with niEi tag and packed with zip.
I will show to you very small snippet (LV2010/VDM 10.0), how overlay stored inside of PNG (OpenG Tools are required) - just for your understanding:
So, theoretically you can recover each overlay primitive, but I will do not recommend to use such way, because its undocumented (may not work any longer with other version of VDM).
Andrey.