summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2014-08-25 21:17:40 +0200
committerFlorian Jung <flo@windfisch.org>2014-08-25 21:17:40 +0200
commitf25f794ce71695782aac15b72fc491a33965351c (patch)
tree7969ed66c5cb9a2eb2fc3ef3a043091a46a05eee
parent7f55187f9e931e9c2ddff8bdc5ed58ee327a1173 (diff)
video writer, size optimierung
-rw-r--r--test.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test.py b/test.py
index b20d9e3..339334d 100644
--- a/test.py
+++ b/test.py
@@ -4,6 +4,7 @@ import numpy
from math import sin,cos
cap = cv2.VideoCapture("../vid.mp4")
+writer = cv2.VideoWriter("../outvid.avi",cv2.cv.CV_FOURCC(*'MP42'),25,(1600,900),1)
feature_params = dict( maxCorners = 100,
qualityLevel = 0.3,
@@ -12,7 +13,7 @@ feature_params = dict( maxCorners = 100,
scale_factor=0.5
scr_width=1600
-scr_height=900
+scr_height=600
# Parameters for lucas kanade optical flow
@@ -31,7 +32,7 @@ screencontent = numpy.zeros((scr_height, scr_width,3), numpy.uint8)
total_angle=0.
total_x=1500
-total_y=0
+total_y=-300
while(cap.isOpened()):
ret, frame = cap.read()
@@ -100,6 +101,8 @@ while(cap.isOpened()):
cv2.imshow('frame', frame)
cv2.imshow('screencontent', screencontent)
cv2.imshow('screencontent2', screencontent2)
+
+ writer.write(screencontent2)
oldframe=frame
oldgray=gray