def animpingpong(self):
print self
print self.Object
print self.Object.Name
obj=self.Object
img = cv2.imread(obj.imageFile)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
gray = np.float32(gray)
dst = cv2.cornerHarris(gray,3,3,0.00001)
dst = cv2.dilate(dst,None)
img[dst>0.01*dst.max()]=[0,0,255]
from matplotlib import pyplot as plt
plt.subplot(121),plt.imshow(img,cmap = 'gray')
plt.title('Edge Image'), plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(dst,cmap = 'gray')
plt.title('Corner Image'), plt.xticks([]), plt.yticks([])
plt.show()
评论列表
文章目录