diff options
-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 |