📜  cv2 opencv-python imshow while 循环 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:07.006000             🧑  作者: Mango

代码示例1
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()