cv2 opencv python imshow while loop

Solutions on MaxInterview for cv2 opencv python imshow while loop by the best coders in the world

showing results for - "cv2 opencv python imshow while loop"
Melina
05 Sep 2020
1import cv2
2capture = cv2.VideoCapture(path)
3while True:
4   ret,frame = capture.read(0)
5   region_of_interest = detect(frame)
6
7    if region_of_interest != 0:
8        # if you want to show somenthing better put a text
9        cv2.putText(frame, data, (cord1, cord2), cv2.FONT_HERSHEY_SIMPLEX,0.5, (0, 255, 0), 2)
10
11
12    cv2.imshow('Normal Video',frame)
13    if cv2.waitKey(1) & 0xFF == ord('q'):
14        break
15
16capture.release()
17cv2.destroyAllWindows()
18