diff options
-rw-r--r-- | test.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |