title: Detect red color in different illumination or background
body: <p>I can't find the best way to detect red color in different illumination or background.</p>
  
  <p>I found that there's <a href="http://en.wikipedia.org/wiki/YCbCr" rel="nofollow">YCbCr color space</a> 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.</p>
  
  <p>I use OpenCV library to implement this.</p>
  
  <p>Thanks for any help or advice.</p>