Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

cv2 opencv-python imshow while loop

import cv2
capture = cv2.VideoCapture(path)
while True:
   ret,frame = capture.read(0)
   region_of_interest = detect(frame)

    if region_of_interest != 0:
        # if you want to show somenthing better put a text
        cv2.putText(frame, data, (cord1, cord2), cv2.FONT_HERSHEY_SIMPLEX,0.5, (0, 255, 0), 2)


    cv2.imshow('Normal Video',frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

capture.release()
cv2.destroyAllWindows()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #imshow #loop
ADD COMMENT
Topic
Name
8+3 =