def __init__(self, image,
maxImageSize=1000,
minInlierRatio=0.15, minInliers=25,
fast=False):
'''
maxImageSize -> limit image size to speed up process, set to False to deactivate
minInlierRatio --> [e.g:0.2] -> min 20% inlier need to be matched, else: raise Error
'''
self.signal_ranges = []
self.maxImageSize = maxImageSize
self.minInlierRatio = minInlierRatio
self.minInliers = minInliers
self._fH = None # homography factor, if image was resized
self.base8bit = self._prepareImage(image)
# Parameters for nearest-neighbour matching
# flann_params = dict(algorithm=1, trees=2)
# self.matcher = cv2.FlannBasedMatcher(flann_params, {})
# PATTERN DETECTOR:
# self.detector = cv2.BRISK_create()
if fast:
self.detector = cv2.ORB_create()
else:
self.detector = cv2.ORB_create(
nfeatures=70000,
# scoreType=cv2.ORB_FAST_SCORE
)
# removed because of license issues:
# cv2.xfeatures2d.SIFT_create()
f, d = self.detector.detectAndCompute(self.base8bit, None)
self.base_features, self.base_descs = f, d # .astype(np.float32)
评论列表
文章目录