Ask Your Question

Revision history [back]

Python cv2 inRange : how to segment "reddish" colors in HSV space

Hi,

I am creating a skin detection computer vision script. I looked at the examples in pyimagesearch and youtube, they use the cv2.inrange() function on HSV color space. However , they used hard coded values for the ranges and that makes their example only able to detect "white" or "black" skin colors.

I tried to use it to detect an "Orange"(asian) skin color, i sampled a region of orange skin and found that it has a hue value of 170 degrees to 20 degrees(reddish). However, the inrange function cannot detect this range because it spills over the 180 to 0 degrees boundary. How do i detect the orange skin color?

Thanks a lot