Vsevolod Levitan 11 hónapja
szülő
commit
3c26d6c782
3 módosított fájl, 19 hozzáadás és 1 törlés
  1. 3 1
      .gitignore
  2. 16 0
      pictures/main.py
  3. BIN
      pictures/pictures.avi

+ 3 - 1
.gitignore

@@ -1,8 +1,10 @@
 # Created by https://www.toptal.com/developers/gitignore/api/python,windows,visualstudiocode,vim
 # Edit at https://www.toptal.com/developers/gitignore?templates=python,windows,visualstudiocode,vim
 
-__/*
+__*/*
 __*
+.*
+.*/*
 
 ### Python ###
 # Byte-compiled / optimized / DLL files

+ 16 - 0
pictures/main.py

@@ -0,0 +1,16 @@
+import cv2
+import numpy as np
+
+vid = cv2.VideoCapture("./pictures.avi")
+
+target = np.array([160.31783565, 179.92989583, 204.62822049])
+c = 0
+
+ret, frame = vid.read()
+while ret:
+    col = frame.mean(axis=0).mean(axis=0)
+    if abs(np.sum(target - col)) < 1:
+        c += 1
+    ret, frame = vid.read()
+
+print(f"Total frames: {c}")  # 70

BIN
pictures/pictures.avi