Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How should I save contour image?

Solved!
Go to solution

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.

Nunzio1999_0-1713521475173.png

The problem is, when I use IMAQ Write bmp file I get black images like this.

Nunzio1999_1-1713521765556.bmp

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.

 

0 Kudos
Message 1 of 8
(616 Views)

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:

OverlaySnippet.png

How it looks in Windows Explorer:

Screenshot 2024-04-21 19.23.20.png

Demo in attachment, saved in LV2018, hope it helps.

 

Message 2 of 8
(579 Views)

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.

0 Kudos
Message 3 of 8
(559 Views)

@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:

Screenshot 2024-04-22 20.28.22.png

0 Kudos
Message 4 of 8
(554 Views)

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?

0 Kudos
Message 5 of 8
(540 Views)

@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.

0 Kudos
Message 6 of 8
(533 Views)

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

0 Kudos
Message 7 of 8
(527 Views)
Solution
Accepted by Nunzio1999

@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:

Screenshot 2024-04-23 18.10.27.png

Full source snippet in the attachment

Message 8 of 8
(502 Views)