LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

if i have labviel program for threshold,but i get the image in black and red,how can i change red to white color?

hi every one,i have here labview progran,it is the threshold example.vi.

i get the image with red and black,how can ichange this red color to white ine,

thnx

0 Kudos
Message 1 of 3
(2,030 Views)

What is Red And What is Black and What do you want to be Red and What do you wnat to be white?

 

You will generally need to use property nodes for this.

Tim
GHSP
0 Kudos
Message 2 of 3
(2,028 Views)

Colors are stored as a three part number in RedGreenBlue format where each color ranges from 0 to 255.

 

Pure red is 255, 0, 0

Pure black is 0,0,0

Pure white is 255,255,255

 

So if you want to change pure red to white, all you have to do is read the Red component and then copy it over to the green and blue components.

 

The attached vi shows how to do this.

 

This version is very simple and relies on the assumption that the input color is either pure red or black.  If you have intermediate colors, you can add a bit of logic to distinguish colors in the middle.

 

For example, you could say, "if the red component is more than the blue+green components, make red=0, blue=0, green=0, else 255,255,255.

 

That is shown in the second example.

Download All
0 Kudos
Message 3 of 3
(2,019 Views)