LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combining two images

I am working on a way to identify overexposed and underexposed pixels then to combine the two images into one.  I can fairly easily obtain each image but am having trouble combining the two.  When I try to add them together, the over exposed image is completely ignored.  I have tried a number of different approaches, but nothing seems to be working.  Help would be appreciated.

Download All
0 Kudos
Message 1 of 7
(4,914 Views)

keller,

 

It looks like you are passing the same image into both inputs of the threshold_overlay_double VI. Is that what you meant to do?

 

2017-06-22 13_37_48-Grab and Basic Attributes double.vi Block Diagram on Test Ficheros.lvproj_Contro.png

-Jordan

0 Kudos
Message 2 of 7
(4,844 Views)

Yes.  We were trying a number of different approaches to see if we could get anything to change or work differently.  Passing the same image into both inputs was entirely intentional and had no effect of the outcome.

-Aiden

p.s. I am another person working on this project.

0 Kudos
Message 3 of 7
(4,838 Views)

What is your end goal in adding the two images together? It's possible that the IMAQ Add VI is adding the images together, but it just looks like it isn't. I can't run your code to see the behavior, but I don't see any reasons why it would ignore one of the inputs. Can you give us more information about what you are seeing? Do you have any sample images that we could use to run your code?

 

-Jordan

0 Kudos
Message 4 of 7
(4,813 Views)

We are trying to turn the pure black pixels blue and the pure red pixels red then put the two together into one image so that the whites are red, the blacks are blue, and everything in between stays in the grey scale.  You can see in the two images to the right that we successfully change the color of the over and under exposed pixels.  The image on the left is our attempt to put the two images together.  Only the blue pixels show up and the overall image is significantly brighter for some unknown reason.  I hope this helps.  Let me know if you need any more information.

 

-Aiden

Download All
0 Kudos
Message 5 of 7
(4,794 Views)

Hi guys,

 

I think I figured out what is going wrong. When you are doing your thresholding on the image, you are setting all white pixels (RGB value of (255,255,255) to red (255,0,0) and all black pixels (0,0,0) to blue (0,0,255). Any time you add RGB images together, you're literally adding the RGB values of each pixel together. When you add the two images in the top-level VI, you keep the blue pixels because a black pixel (0,0,0) + a blue pixel (0,0,255) = Blue (0,0,255). But the red pixels get overwritten by white because red (255,0,0) + white (255,255,255) = white (255,255,255). The image also appears lighter because you are essentially doubling all the other grayscale pixel values by adding them to themselves.

 

A better way to combine the red and blue thresholds would be to take the two images that are output by each of the IMAQ Threshold VIs and put them into the red and blue plane inputs of the IMAQ ReplaceColorPlane VI like this

ReplaceColorPlane.png

 

Now when you add the original image, the two color planes and the grayscale image are all combined into a single RGB image. 

 

-Jordan

 

 

0 Kudos
Message 6 of 7
(4,762 Views)

That worked perfectly.  Thank you so much for all the help!

-Aiden

0 Kudos
Message 7 of 7
(4,749 Views)