def animpingpong(self):
obj=self.Object
res=None
for t in obj.OutList:
print t.Label
img=t.ViewObject.Proxy.img.copy()
if res==None:
res=img.copy()
else:
#rr=cv2.subtract(res,img)
#rr=cv2.add(res,img)
aw=0.0+float(obj.aWeight)/100
bw=0.0+float(obj.bWeight)/100
print aw
print bw
if obj.aInverse:
# b umsetzen
ret, mask = cv2.threshold(img, 50, 255, cv2.THRESH_BINARY)
img=cv2.bitwise_not(mask)
rr=cv2.addWeighted(res,aw,img,bw,0)
res=rr
#b,g,r = cv2.split(res)
cv2.imshow(obj.Label,res)
#cv2.imshow(obj.Label +" b",b)
#cv2.imshow(obj.Label + " g",g)
#cv2.imshow(obj.Label + " r",r)
res=img
if not obj.matplotlib:
cv2.imshow(obj.Label,img)
else:
from matplotlib import pyplot as plt
# plt.subplot(121),
plt.imshow(img,cmap = 'gray')
plt.title(obj.Label), plt.xticks([]), plt.yticks([])
plt.show()
self.img=img
评论列表
文章目录