main.py 463 B

12345678910111213141516171819202122
  1. import cv2
  2. import numpy as np
  3. video = cv2.VideoCapture(r'pictures/pictures.avi')
  4. counter = 0
  5. if video.isOpened():
  6. while True:
  7. ret, frame = video.read()
  8. if not ret:
  9. print("Video doesn't open")
  10. break
  11. x, y = np.where(np.all(frame==np.array([0,0,0]), axis=2))
  12. if len(x) + len(y) == 114532:
  13. counter+=1
  14. print('mine')
  15. video.release()
  16. cv2.destroyAllWindows()
  17. # 86
  18. print(counter)