# Which colour space is best for extracting real world objects?

I am currently extracting objects of interest setting a lower limit range and a upper limit range using these colour spaces

YUV LAB

I am having issues extracting a black colour cloth in varying lighting conditions.

Which colour space is most accurate to the human perception of colour, which we have in OpenCV?

Can't find online which colourspace is the most accurate representation of human perception.

Can anyone help??????

edit retag close merge delete

For what it's worth, humans have a genetic tendency to see green better than red or blue. I think it has something to do with the colour of plants back when we were tree huggers. It's also common to have a colour space where the bits are 5 for red, 6 for green, and 5 for blue -- this is instead of 8 8 8 in a 24-bit RGB image.

https://msdn.microsoft.com/en-us/libr...

( 2018-05-09 10:43:45 -0600 )edit
1

@sjhalayka I red up on the link you posted. Which one I use for my use case is still a mystery. I'm currently considering using LAB over YUV

( 2018-05-09 23:14:54 -0600 )edit
1

unfortunately, black (or white) is NOT a colour. it can be any hue (or uv or ab value), so you can only rely on Y or L here.

maybe you're better off, doing this in bgr space, and check for low values of all 3 channels.

( 2018-05-10 02:24:23 -0600 )edit

Sort by ยป oldest newest most voted

@berak Instead of scratching my head finding the range of values in any of the colour spaces. I just turned image to grayscale threshold the image its giving satisfactory result.

more

@Santhosh1 -- You could also try out YCrCb: http://answers.opencv.org/question/19...

Look at the code given in the answer:

Y =   16 +  65.738*R/256 + 129.057*G/256 +  25.064*B/256
Cb = 128 -  37.945*R/256 -  74.494*G/256 + 112.439*B/256
Cr = 128 + 112.439*R/256 -  94.154*G/256 -  18.285*B/256


Look at how much more green contributes to Y over red and blue. Green is special, I tell ya.

( 2018-05-10 21:40:35 -0600 )edit

Official site

GitHub

Wiki

Documentation