From 361c8e5837accebd4fd61676fb19e5ecf2c2f998 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 25 Aug 2014 19:16:30 +0200 Subject: panorama gut --- test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test.py b/test.py index 3e33792..4a5b87e 100644 --- a/test.py +++ b/test.py @@ -30,7 +30,7 @@ mask = numpy.ones((height,width, 1), numpy.uint8) * 255 screencontent = numpy.zeros((scr_height, scr_width,3), numpy.uint8) total_angle=0. -total_x=0 +total_x=1500 total_y=0 while(cap.isOpened()): @@ -84,10 +84,11 @@ while(cap.isOpened()): # mat2=numpy.array([[cos(total_angle), sin(total_angle), total_x], [-sin(total_angle),cos(total_angle),total_y]]) frame2= cv2.warpAffine(frame, mat2, (scr_width,scr_height) ) mask2 = cv2.warpAffine(mask, mat2, (scr_width,scr_height) ) - + ret, mask2 = cv2.threshold(mask2, 254, 255, cv2.THRESH_BINARY) + #mask2 = cv2.dilate(mask2, numpy.ones((3,3),numpy.uint8)) #screencontent = frame2 screencontent = cv2.bitwise_and(screencontent,screencontent, mask=cv2.bitwise_not(mask2)) - screencontent = cv2.add(screencontent, frame2) + screencontent = cv2.add(screencontent, cv2.bitwise_and(frame2,frame2,mask=mask2)) #screencontent = frame2 #screencontent = mask2 -- cgit v1.2.3