From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to set my binary threshold's output into rgb color?

Solved!
Go to solution

Is it possible to set my binary threshold's output into rgb color?
I processed an rgb image into a binary image with thresholding , now I want to make the result of the thresholding (1's) into a specific color.


1. is it possible to do it in vision assistant ?
2. is it possible to do it in labview ?

 

PULSEWannabe_0-1665311153338.png

the blue is only for display purpose, that is 1 from thresholding, i want the detected area (blue colored area) become pixel with 255,0,0 value (red)

0 Kudos
Message 1 of 5
(984 Views)

If you just want to display your binary image with another color couple, you can simply edit the binary palette used to display the image:

 

Using Vision Assistant 2020:

 

1. Make sure your binarization step is selected:

raphschru_1-1665323544539.png

2. Make sure the Binary palette is selected, then edit:

raphschru_2-1665323823276.png

 

3. There you can select a different color for each value (0 and 1 in your case):

raphschru_3-1665323925389.png

 

 

Using LabVIEW:

 

1. Create an IMAQ Image control:

raphschru_5-1665324716559.png

 

2. Configure a user-defined palette programmatically using property nodes on this control:

raphschru_4-1665324322812.png

There you can specify an array of up to 256 elements, giving the display color for each individual binary group (starting from 0 to 255).

0 Kudos
Message 2 of 5
(953 Views)

sorry for not mentioning 
I want binary (2bit) --> RGB , by changing the 1's in binary to specific RGB color.

 

edit : i've thought of taking out every 1s pixel's coordinate, then changing its array element from 1 to rgb color, then convert it to RGB image, but i think the process is complicated. i just wonder if there's a simpler way. thanks

0 Kudos
Message 3 of 5
(929 Views)
Solution
Accepted by topic author PULSE.Wannabe

OK, this was the second option: turning the binary image (U8) into a real RGB image (U32).

 

I don't think there is a direct way of doing it with Vision Assistant, but with LabVIEW you can do:

Convert Binary U8 to U32 RGB Image.png

0 Kudos
Message 4 of 5
(908 Views)

Ah you can directly multiply it, i see , thanks so much

0 Kudos
Message 5 of 5
(846 Views)