LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add variables as strings in an image .JPG, I should do this before creating the file or after?

Hello everyone,

I have a VI that makes the acquisition of ultrasound images and save frames using "Write to JPEG FILE.vi". The problem is I need to add information (variables such as string and numeric) in these frames.
Here is my VI, it uses a DLL to process the image, output_bilinear is an array that is linearized through another dll (smallest) to enter (output_bilinear_vector 2) the "Write to JPEG FILE.vi"
 
save_jpeg.jpg
What should I do, enter this information before saving the JPEG file (by some how editing the matrix) or should I edit the JPEG after create(using some image editor)?
Please help.
Thanks
0 Kudos
Message 1 of 6
(3,640 Views)

Unfortunately you can't do this so easy...

 

What you can do is following:

 

- if you using Vision Toolkit, save data to PNG. There are some functions available for writing your custom data to PNG.

- learn how to store user data in jpeg. For example, EXIF data stored in jped as custom data. Search in internet how it organized.

- simply add your data directly at the end of JPEG file. As far, as I know, JPEG file have postfix, so, may be your info will be just ignored by common programs, but you will be read this info back (not checked how it works - just try it).

 

Andrey.

0 Kudos
Message 2 of 6
(3,633 Views)

unfortunately I do not have the vision toolkit, but with it, as would be done?

the other two options, the information would not be visible in the image?
I need this information to be recorded and visible in the images, like a date and hour at a photo.

 

thank-you

0 Kudos
Message 3 of 6
(3,626 Views)

LuizFelipe wrote:

unfortunately I do not have the vision toolkit, but with it, as would be done?


Yes, but not with JPEG. In PNG format - yes.


LuizFelipe wrote:

the other two options, the information would not be visible in the image?


The information will be invisible.


LuizFelipe wrote:

I need this information to be recorded and visible in the images, like a date and hour at a photo.


In case if information should be visible, then you should add this info as overlay. Also I will not recommend to use JPEG format in this case, because you will get poor quality of such overlay due to loss compression.

 

Andrey.

 

0 Kudos
Message 4 of 6
(3,610 Views)
Ok, has no problem using PNG instead of JPEG.

But how do I  add this info as overlay? I need the vision toolkit for that?

 

thanks

 

 

 

0 Kudos
Message 5 of 6
(3,604 Views)

With Vision Toolkit you will be able to create and store non-destructive overlay and custom data in single PNG file. Search forum for "IMAQ Overlay" - you will found some links. Also Vision toolkit delivered with good examples. But it will be pretty expencive solution.

 

Probably something linke this will meet your requirements:

 

screenshot.png 

 

Andrey.

0 Kudos
Message 6 of 6
(3,597 Views)