diff options
author | Florian Jung <flo@windfisch.org> | 2014-08-25 21:17:40 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2014-08-25 21:17:40 +0200 |
commit | f25f794ce71695782aac15b72fc491a33965351c (patch) | |
tree | 7969ed66c5cb9a2eb2fc3ef3a043091a46a05eee | |
parent | 7f55187f9e931e9c2ddff8bdc5ed58ee327a1173 (diff) |
video writer, size optimierung
-rw-r--r-- | test.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |