title: Normalizing lighting conditions for image recognition
body: <p>I am using OpenCV to process a video to identify frames containing objects using a rudimentary algorithm (background subtraction → brightness threshold → dilation → contour detection).</p>
  
  <p>The video is shot over the course of a day, so lighting conditions are gradually changing, so I expect it would improve my results if I did some sort of brightness and/or contrast normalization step first.</p>
  
  <p>Answers to <a href="https://stackoverflow.com/questions/57030125/automatically-adjusting-brightness-of-image-with-opencv">this question</a> suggest using <code>convertScaleAbs</code>, or contrast optimization with histogram clipping, or <a href="https://docs.opencv.org/3.1.0/d5/daf/tutorial_py_histogram_equalization.html" rel="nofollow noreferrer">histogram equalization</a>.</p>
  
  <p>Of these techniques or others, what would be the best preprocessing step to normalize the frames?</p>