sift

Generate similarity score in percentage from SIFT using opencv

天大地大妈咪最大 提交于 2019-12-20 12:13:51
问题 I have been trying to find a way to generate similarity score ( in %) after comparing two images using SIFT in python (2.7.x) opencv (2.4.9). I was only able to find examples that draw lines between matches. How do I proceed with this. 回答1: There is an opencv equivalent of vl_ubcmatch function in Matlab. Here is the excerpt from opencv documentation. # create BFMatcher object bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True) # Match descriptors. matches = bf.match(des1,des2) matches = bf.

Generate similarity score in percentage from SIFT using opencv

南笙酒味 提交于 2019-12-20 12:11:30
问题 I have been trying to find a way to generate similarity score ( in %) after comparing two images using SIFT in python (2.7.x) opencv (2.4.9). I was only able to find examples that draw lines between matches. How do I proceed with this. 回答1: There is an opencv equivalent of vl_ubcmatch function in Matlab. Here is the excerpt from opencv documentation. # create BFMatcher object bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True) # Match descriptors. matches = bf.match(des1,des2) matches = bf.

xfeatures2d not found in OpenCV on Ubuntu

▼魔方 西西 提交于 2019-12-20 03:27:04
问题 I am using OpenCV version 3.2.0 and xfeatures2d is not found on this. Is there any way I can install this to the same version of OpenCV? >>> import cv2 >>> help(cv2.xfeatures2d) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'xfeatures2d' 回答1: I encountered the same problem. SURF and SIFT are not a part of the main repo module of OpenCV. Instead, they are available in opencv_contrib folder. The README file of opencv

Is LSH about transforming vectors to binary vectors for hamming distance?

ぐ巨炮叔叔 提交于 2019-12-20 03:16:41
问题 I read some paper about LSH and I know that is used for solving the approximated k-NN problem. We can divide the algorithm in two parts: Given a vector in D dimensions (where D is big) of any value, translate it with a set of N (where N<<D ) hash functions to a binary vector in N dimensions. Using hamming distance, apply some search technique on the set of given binary codes obtained from phase 1 to find the k-NN. The keypoint is that computing the hamming distance for vectors in N dimensions

OpenCV SIFT descriptor keypoint radius

元气小坏坏 提交于 2019-12-18 12:03:17
问题 I was digging into OpenCV's implementation of SIFT descriptor extraction. I came upon some puzzling code to get the radius of the interest point neighborhood. Below is the annotated code, with variable names changed to be more descriptive: // keep octave below 256 (255 is 1111 1111) int octave = kpt.octave & 255; // if octave is >= 128, ...???? octave = octave < 128 ? octave : (-128 | octave); // 1/2^absval(octave) float scale = octave >= 0 ? 1.0f/(1 << octave) : (float)(1 << -octave); //

How do I use SIFT in OpenCV 3.0 with c++?

夙愿已清 提交于 2019-12-18 11:02:39
问题 I have OpenCV 3.0, and I have compiled & installed it with the opencv_contrib module so that's not a problem. Unfortunately the examples from previous versions do not work with the current one, and so although this question has already been asked more than once I would like a more current example that I can actually work with. Even the official examples don't work in this version (feature detection works but not other feature examples) and they use SURF anyway. So, how do I use OpenCV SIFT on

OpenCV - Surf Algorithm - Giving lots of false positives

╄→гoц情女王★ 提交于 2019-12-17 23:15:49
问题 I am learning OpenCV and have started exploring the SURF Algorithm for image matching. I have created a sample image library by modifying the default images available with Microsoft Windows 7. Each image has a rotated, scaled, blurred and skewed version in the same folder. My code for finding out matching images is as shown below. As can be seen in the code, the distance is measured by the line dis/objectDescriptors->total and further similarity is calculated by 100 - (dis/objectDescriptors-

Implementing SIFT in Java

China☆狼群 提交于 2019-12-17 22:25:35
问题 So I'm working on a simple Java app that allows a user to input an image as a query and have the app compare it against a database of images (which is basically no more than a directory of different images). I'm basically investigating several image similarity measurement techniques to find out which ones are appropriate for comparing pictures of cars. I've been doing some reading and apart from FFT/SSIM, I've read that the SIFT algorithm can yield very good results. However, as someone with

opencv-python 获取 sift 特征值

送分小仙女□ 提交于 2019-12-17 01:43:11
# -*- coding: utf-8 -*- import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2 . imread ( "./img/person.jpg" ) img1 = img . copy ( ) img1 = cv2 . cvtColor ( img1 , cv2 . COLOR_BGR2RGB ) gray = cv2 . cvtColor ( img , cv2 . COLOR_BGR2GRAY ) sift = cv2 . xfeatures2d . SIFT_create ( nfeatures = 10 ) kp = sift . detect ( gray , None ) des = sift . compute ( gray , kp ) # 计算所有特征点的特征值 feature_value = des [ 1 ] # 拿到所有特征点的特征值 cv2 . drawKeypoints ( img1 , kp , img ) cv2 . drawKeypoints ( img1 , kp , img1 , flags = cv2 . DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS ) plt . subplot ( 121 )

OpenCV - Display ONLY the keypoints NOT the image using SIFT

允我心安 提交于 2019-12-14 04:03:33
问题 I am trying to only draw the keypoints ( without the image) using this example code: import cv2 import numpy as np img = cv2.imread('test.png') gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) sift = cv2.SIFT() kp = sift.detect(gray,None) img=cv2.drawKeypoints(gray,kp) cv2.imwrite('sift_keypoints.jpg',img) I tried cv2.drawKeypoints(None,kp) and cv2.drawKeypoints(kp) but to no avail. Any ideas how this could be achieved ? Thanks. 回答1: You can get ONLY the keypoints by drawing them on a solid black