''' Created on 2015-9-16 @author: PC ''' import cv2 from matplotlib import pyplot as plt import time img1=cv2.imread("D:\\a1.jpg") img2=cv2.imread("D:\\a2.jpg") b=1.0 a=0.0 while 1: if a<=1.0: img=cv2.addWeighted(img1,a,img2,b,0) cv2.imshow("jianbian",img) time.sleep(5) print a,b a=a+0.1 b=b-0.1 else: print "ok,that finish "
cv2.waitKey(0) break cv2.destroyAllWindows()
cv2.waitkey(记得要有数字)不要是0就行了