ArtemStorozhuk
ArtemStorozhuk

Reputation: 8725

Detect red color in different illumination or background

I can't find the best way to detect red color in different illumination or background.

I found that there's YCbCr color space which is good for red or blue color detection (actually I need to detect blue color too). The problem is that I can't figure out which threshold to use in different lightning. For example in sunny weather this threshold equals 210 (from 255), when in cloudly weather this threshold equals 130.

I use OpenCV library to implement this.

Thanks for any help or advice.

Upvotes: 0

Views: 3802

Answers (2)

Tõnu Samuel
Tõnu Samuel

Reputation: 2896

Yes, HSV is usually used for such purpose. In HSV you can tell that whatever is brightness etc, red is what is needed. I also recommend to look into two places. One is simple tutorial http://aishack.in/tutorials/tracking-colored-objects-in-opencv/ and another is to take a book Learning OpenCV and use examples of histograms from there. They do exactly what you need. Using HSV and Histograms makes your solution solid.

Upvotes: 2

Eric
Eric

Reputation: 2341

HSV color space should be more robust to change of illumination.

Upvotes: 1

Related Questions