12-19-2011 09:51 AM
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
12-19-2011 10:01 AM
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.
12-19-2011 11:13 AM - edited 12-19-2011 11:18 AM
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.