How to detect (True/False) if the frame contains at least one for example rgb(213, 39, 27) pixel? I want to process frame only when the detection is true.
import cv2
VIDEO_URL = ''
cap = cv2.VideoCapture(VIDEO_URL)
fps = cap.get(cv2.CAP_PROP_FPS)
wait_ms = int(1000/fps)
while True:
ret, frame = cap.read()
img = cv2.cvtColor(frame, cv2.IMREAD_COLOR)[815:970, 360:1920]
#image processing here
if cv2.waitKey(wait_ms) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()