How to use SIFT algorithm to compute how similar two images are?

First, aren’t you supposed to be using vl_sift instead of sift? Second, you can use SIFT feature matching to find correspondences in the two images. Here’s some sample code: I = imread(‘p1.jpg’); J = imread(‘p2.jpg’); I = single(rgb2gray(I)); % Conversion to single is recommended J = single(rgb2gray(J)); % in the documentation [F1 D1] = vl_sift(I); … Read more

Sift implementation with OpenCV 2.2

Below is a minimal example: #include <opencv/cv.h> #include <opencv/highgui.h> int main(int argc, const char* argv[]) { const cv::Mat input = cv::imread(“input.jpg”, 0); //Load as grayscale cv::SiftFeatureDetector detector; std::vector<cv::KeyPoint> keypoints; detector.detect(input, keypoints); // Add results to image and save. cv::Mat output; cv::drawKeypoints(input, keypoints, output); cv::imwrite(“sift_result.jpg”, output); return 0; } Tested on OpenCV 2.3

Can’t use SURF, SIFT in OpenCV

There is a pip source that makes this very easy. If you have another version of opencv-python installed use this command to remove it to avoid conflicts: pip uninstall opencv-python Then install the contrib version with this: pip install opencv-contrib-python SIFT usage: import cv2 sift = cv2.xfeatures2d.SIFT_create()