04-19-2024 05:16 AM
Hi, I'm working on software that analyzes combustion images. I have reached the end of the software, also thanks to your help in some previous posts, I only have one problem left now.
I would like to save the contour image with the "distances" as shown in the screen.
The problem is, when I use IMAQ Write bmp file I get black images like this.
So now, I want to ask you how should I save this type of image?
I have not attached the complete .vi as I just need to know how to save this type of data in an image, I will upload it if you think it is necessary.
Solved! Go to Solution.
04-21-2024 12:24 PM
There are two possible methods.
Method 1 is to save original image together with Vision Info. Then your overlay will be saved as non-destructive overlay. This possible only on PNG format, because this custom information will be stored in private PNG chunk. Advantage - overlays is non-destructive, you can load image and delete it. Disadvantage - this image can be opened only with NI IMAQ Read Image and Vision Info VI. No other third-party software will read and display such overlay.
Method 2 (probably what you looking for) is Destructive overlay. You have to merge your overlay together with image into RGB image, then save in any format, BMP also good, then you will see it in Windows.
Snippet:
How it looks in Windows Explorer:
Demo in attachment, saved in LV2018, hope it helps.
04-22-2024 12:55 PM
It's exactly what I was looking for, a destructive overlay.
However, I have a problem, which is that the distances overlap but not the contours.
I attach the .vi because after several attempts I didn't understand the error, and I attach 2/3 images if you want to try.
I also attach the target image and the one I get.
04-22-2024 01:31 PM
@Nunzio1999 wrote:
It's exactly what I was looking for, a destructive overlay.
However, I have a problem, which is that the distances overlap but not the contours.
Its because your image displayed with Binary palette. It is Grayscale image, but you turn grays into colors by palette.
All what you need is to call IMAQ Get Palette with Binary and connect Palette input of IMAQ Merge Overlay as shown below, then it should work:
04-23-2024 04:05 AM
Perfect, that was exactly the problem!
I would have one last problem left and I don't know if I should create a further post.
In practice, I would like to overlay the original image at the beginning of the case structure onto the final image, and I cannot use the various imaq image overlays.
Could you help me?
04-23-2024 04:58 AM - edited 04-23-2024 04:59 AM
@Nunzio1999 wrote:
Perfect, that was exactly the problem!
I would have one last problem left and I don't know if I should create a further post.
In practice, I would like to overlay the original image at the beginning of the case structure onto the final image, and I cannot use the various imaq image overlays.
Could you help me?
Here I not fully understand your needs. May be the IMAQ Copy Overlay will help? With this VI you can copy overlay at the end, then "attach" it to the original image and then merge and save it. But remember that the red color contour is not native IMAQ overlay, this is indexed color in the palette, so if you need to move this across the images, then you have to convert image to array, iterate over all pixels, select this indexed color, create bitmap with same color used in the palette, and finally use IMAQ Overlay Bitmap. Not the fastest way, but should work.
04-23-2024 05:29 AM
I need exactly what you understand.
I need to overlay contour and distance on original image. Can I ask you to attach an example? I lost in the instruction
04-23-2024 11:12 AM
@Nunzio1999 wrote:
I need exactly what you understand.
I need to overlay contour and distance on original image. Can I ask you to attach an example? I lost in the instruction
This is how it should work for you:
Full source snippet in the attachment