<p>Take a look into <strong>SuperGlue</strong>, graph neural network based feature matching. Although, they do not provide training code, but two pretrained model for indoor, outdoor is available. Links,</p>
<p><a href="https://github.com/magicleap/SuperGluePretrainedNetwork" rel="nofollow noreferrer">https://github.com/magicleap/SuperGluePretrainedNetwork</a></p>
<p><a href="https://psarlin.com/superglue/" rel="nofollow noreferrer">https://psarlin.com/superglue/</a></p>
<p><a href="https://arxiv.org/pdf/1911.11763.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1911.11763.pdf</a></p>
<p><a href="https://i.stack.imgur.com/Z0JKB.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z0JKB.gif" alt="enter image description here" /></a></p>
How to more accurately compare the characteristics between two images?
<p>I have developed two methods using SIFT and ORB, but it seems to me that the points do not correspond correctly. Am I using these functions wrongly or do I need something different?</p>
<pre><code>orb = cv2.ORB_create()
keypoints_X, descriptor_X = orb.detectAndCompute(car1_gray, None)
keypoints_y, descriptor_y = orb.detectAndCompute(car2_gray, None)
bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck = True)
matches = bf.match(descriptor_X, descriptor_y)
matches = sorted(matches, key = lambda x: x.distance)
result = cv2.drawMatches(car1_gray, keypoints_X, car2_gray, keypoints_y, matches[:10], car2_gray, flags = 2)
</code></pre>
<hr />
<pre><code>sift = cv2.SIFT_create()

keypoints_X, descriptor_X = sift.detectAndCompute(car1_gray, None)
keypoints_y, descriptor_y = sift.detectAndCompute(car2_gray, None)
bf = cv2.BFMatcher()
matches = bf.knnMatch(descriptor_X, descriptor_y, k=2)

bom = []

for m,n in matches:
    if m.distance &lt; 0.75*n.distance:
        bom.append([m])

result = cv2.drawMatchesKnn(car1_gray, keypoints_X, car2_gray, keypoints_y, bom, None, flags=cv2.DrawMatchesFlags_NOT_DRAW_SINGLE_POINTS)
</code></pre>
<p>Below the result of SIFT and ORB:
<a href="https://i.stack.imgur.com/BPMYM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BPMYM.jpg" alt="SIFT and ORB result" /></a></p>