def __init__(self, img, min_match_count=10, flann_index=0, flann_trees=5,
flann_checks=50):
self.min_match_count = min_match_count
self.thing = img
self.rvr_comm,self.sdr_comm = multiprocessing.Pipe(duplex=False)
# Initiate SIFT detector
self.sift = cv2.xfeatures2d.SIFT_create()
# Find keypoints and descriptors of thing with SIFT
self.keypoints, self.descriptors = self.sift.detectAndCompute(img,
None)
print 'num keypoints =', len(self.keypoints)
# Initiate FLANN matcher
index_params = dict(algorithm = flann_index, trees = flann_trees)
search_params = dict(checks = flann_checks)
self.flann = cv2.FlannBasedMatcher(index_params, search_params)
评论列表
文章目录