workaround for ranges_flag with opencv-2.2