Skip to content

Commit

Permalink
Minor fix in classical detectors pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rpautrat committed Nov 5, 2019
1 parent eccbd5e commit 90488b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superpoint/models/classical_detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@


def classical_detector(im, **config):
im = np.uint8(im * 255)
if config['method'] == 'harris':
im = np.uint8(im * 255)
detections = cv2.cornerHarris(im, 4, 3, 0.04)

elif config['method'] == 'shi':
im = np.uint8(im * 255)
detections = np.zeros(im.shape[:2], np.float)
thresh = np.linspace(0.0001, 1, 600, endpoint=False)
for t in thresh:
Expand All @@ -25,6 +26,7 @@ def classical_detector(im, **config):
detections[(corners[:, 0, 1], corners[:, 0, 0])] = t

elif config['method'] == 'fast':
im = np.uint8(im * 255)
detector = cv2.FastFeatureDetector_create(10)
corners = detector.detect(im.astype(np.uint8))
detections = np.zeros(im.shape[:2], np.float)
Expand Down

0 comments on commit 90488b0

Please sign in to comment.