LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Evaluate how red the pixels are in an image

I have an RGB image and want to evaluate the redness of each pixel. I know I can use IMAQ ExtractColorPlanes to get the red plane. However, it does not tell me the redness of the pixels. For example, the black and red pixels will show the same value in the red color plane. Is there any good idea for evaluating the redness of the pixels?

0 Kudos
Message 1 of 4
(189 Views)

Hi Xiang,

 


@Xiang00 wrote:

I have an RGB image and want to evaluate the redness of each pixel.


Convert the RGB values to HSV values and check the H (hue) for "redness"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(171 Views)

@GerdW wrote:

Hi Xiang,

 


@Xiang00 wrote:

I have an RGB image and want to evaluate the redness of each pixel.


Convert the RGB values to HSV values and check the H (hue) for "redness"…


You need a little extra.  For black, the hue ought to be undefined; but of course a number has to be put there, so it defaults to 0, which is red.

0 Kudos
Message 3 of 4
(164 Views)

@Xiang00 wrote:

I have an RGB image and want to evaluate the redness of each pixel.


Most easiest way probably is to switch to CIE Lab model and check the distance between "pure red" and color of each pixel, lower values will be closer to Red, larger - far away, something like that:

Snippet.png

And you can perform threshold to get a mask if needed:

Screenshot 2024-10-01 14.29.02.png

VI is attached (LV2018).

Message 4 of 4
(134 Views)