import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('left08.jpg',0)
cv2.imshow("contours", img)
fast = cv2.FastFeatureDetector()
print(type(fast))
kp = fast.detect(img , None)
img2 = cv2.drawKeypoints(img, kp, color=(255, 0, 0))
print("Threshold: ", fast.getInt('threshold'))
print("nonmaxSuppression:: ", fast.getBool('nonmaxSuppression'))
print("neighborhood:: ", fast.getInt('type'))
print("Total Keypoints with nonmaxSuppression:: ", len(kp))
cv2.imwrite('fast_true.png',img2)
kp = fast.detect(img,None)
print ("Total Keypoints without nonmaxSuppression: ", len(kp))
img3 = cv2.drawKeypoints(img, kp, color=(255,0,0))
#fast(src)
#cv.namedWindow("input image", cv.WINDOW_AUTOSIZE)
cv2.waitKey(0)
cv2.destroyAllWindows()