From f25f794ce71695782aac15b72fc491a33965351c Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 25 Aug 2014 21:17:40 +0200 Subject: video writer, size optimierung --- test.py | 7 +++++-- 1 file 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 -- cgit v1.2.3