Value range for HSV image to highlight EMGUCV color

Further,

        Image<Hsv, Byte> hsvimg = img.Convert<Hsv, Byte>();           
        Image<Gray, Byte>[] channels = hsvimg.Split();  
        Image<Gray, Byte> imghue = channels[0];         
        Image<Gray, Byte> imgsat = channels[1];
        Image<Gray, Byte> imgval = channels[2];         

        Image<Gray, byte> huefilter = imghue.InRange(new Gray(?), new Gray(?));            
        Image<Gray, byte> satfilter = imghue.InRange(new Gray(?), new Gray(?));
        Image<Gray, byte> valfilter = imgval.InRange(new Gray(?), new Gray(?));

What is the range value for different channels (h, s, v) for different color rendition? This is 0-255 or 0-128. I want to define an Orange, Black, and Sky blue object for an image.

+3
source share
1 answer

Can you try something like that for an orange

 Image<Gray, byte> huefilter = 
                imghue.InRange(new Gray(Color.Orange.GetHue() - 10), 
                                     new Gray(Color.Orange.GetHue() + 10));   

-10 and +10 are just an assumption and can be wide. just play with it and see what works.

for satfilteryou can useColor.Orange.GetSaturation()

and for the third, I assume that you can use Color.Orange.GetBrightness()

+2
source

All Articles