Open Gigaszi opened 5 months ago
Brisk is just able to find a ridiculus number of keypoints for this set of images. This leads naturaly to a longer processing time.
def limit_keypoints(keypoints: list, descriptors: NDArray, max_keypoints: int = 50000) -> tuple:
"""Limit the number of keypoints and descriptors """
if len(keypoints) > max_keypoints:
#randomly select max_keypoints
indices = np.random.choice(len(keypoints), max_keypoints, replace=False)
keypoints = [keypoints[i] for i in indices]
descriptors = descriptors[indices]
return keypoints, descriptors
kpts1, desc1 = limit_keypoints(kpts1, desc1)
kpts2, desc2 = limit_keypoints(kpts2, desc2)
(@itisacloud)
Other solutions could be to reduce the resolution of the input image (#421)
@matthiasschaub and @itisacloud , you are both correct. Two suggested ways , the limitation of descriptors' number and reduction of image size, are ok with me. However, I would suggest to go to image resizing:
h, w, _ = temp_img.shape # the default template size is (1587, 1867)
img_clipped = clip(cv2.resize(img_raw, (w, h)), temp_img)
When digitizing multiple (here 4) sketch maps of an urban error, this error occurs:
Map Frame:
Sketch Map: