Greetings, I may be doing something wrong, however, when doing a comparison of the different feature detection methods of ORB , AKAZE and sift I can’t find enough points to discriminate between images, I can only do it using GaussianBlur and canny.
the link img
################################
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
def procORB(img):
orb = cv.ORB_create()
kp = orb.detect(img,None)
return orb.compute(img, kp)
def procSift(img):
sift = cv.xfeatures2d.SIFT_create(nfeatures=500)
return sift.detectAndCompute(img,None)
def procView(img,kp, title):
img=cv.drawKeypoints(img, kp, None, color=(0,255,0), flags=0)
plt.imshow(img),plt.legend(),plt.title(title),plt.show()
def procAkaze(img):
akaze = cv.AKAZE_create()
return akaze.detectAndCompute(img, None)
def run():
path=/media/joolivar/Lento/DATASET/piscinas/“”
path_img=“/media/joolivar/Lento/DATASET/piscinas/images (16).jpeg”
img = cv.imread(path_img, cv.IMREAD_GRAYSCALE)
gauss=cv.GaussianBlur(img,(5,5),0)
canny = cv.Canny(gauss, 50, 150)
img=np.hstack((img, canny))
kp,des = procSift(img)
procView(img,kp, ‘Sift’)
kp,des = procORB(img)
procView(img,kp, ‘ORB’)
kp,des =procAkaze(img)
procView(img,kp, ‘Akaze’)
run()