Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -20,7 +20,7 @@ def orb_sim(img1, img2):
|
|
20 |
# Brute-force matcher
|
21 |
bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
|
22 |
matches = bf.match(desc_a, desc_b)
|
23 |
-
similar_regions = [i for i in matches if i.distance <
|
24 |
if len(matches) == 0:
|
25 |
return 0
|
26 |
return len(similar_regions) / len(matches)
|
|
|
20 |
# Brute-force matcher
|
21 |
bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
|
22 |
matches = bf.match(desc_a, desc_b)
|
23 |
+
similar_regions = [i for i in matches if i.distance < 20]
|
24 |
if len(matches) == 0:
|
25 |
return 0
|
26 |
return len(similar_regions) / len(matches)
|