correct conditional for opencv