# Robust black cloth detection.

My task requires detection of the black cloth in the beginning. I was trying to find a way to extract the black cloth from a few test case images.

Method 1

I first tried to convert the colour image the grayscale, then threshold the image to a particular level. Problem with this mention is due to the variation in the lighting conditions of images. I had a broad range of values from 40 - 140. Which requires a lot of manual intervention to detect the extract

I red a post on SO Estimate Brightness of an image Opencv, which mentions HSV colour good indicator of the brightness. I tried playing around with V in the HSV but was unable to find a good result.

I tried playing around withS in HSV which gave surprisingly good result, for my situation where I wanted to find the region I wanted to find my black cloth in. Value of S at 100,55 and 18 are giving good result in this particular order.

Having a hard time figuring out what exactly is happening here.

Can anyone help me explain how a black cloth is being detected in a HSV colour space just by changing S Value?

edit retag close merge delete

compareBGR with grayscale. How will I compare can you explain?