With optimized light (by trial and error) for OpenCV it recognize what it should, in this case playing cards but could be any object. As soon as the light changes in any way, the recognition fails. Is there any way to have OpenCV to automatically adjust for different light situations?