sift

error: (-5) image is empty or has incorrect depth (!=CV_8U) in function cv::SIFT::operator ()

谁说我不能喝 提交于 2019-12-25 01:18:40
问题 I am trying to run basic script found on a tutorial for object detection. I have tried everything I could find on web but failed to solve it. Already tried different suggested methods to convert image to CV_U8. Also used 8 bit images as input, still without progress. Here is the code: import cv2 import numpy as np MIN_MATCH_COUNT=30 detector=cv2.SIFT() FLANN_INDEX_KDITREE=0 flannParam=dict(algorithm=FLANN_INDEX_KDITREE,tree=5) flann=cv2.FlannBasedMatcher(flannParam,{}) trainImg=cv2.imread(

SIFT 尺度不变特征变换 简单易懂

試著忘記壹切 提交于 2019-12-24 14:41:22
很详细的一个英文博客: http://aishack.in/tutorials/sift-scale-invariant-feature-transform-introduction/ SIFT (Scale-invariant feature transform, 尺度不变特征变换) 是 局部特征描述子 ,尺度不变性 尺度空间:所有尺度上的图像位置,高斯微分函数来识别潜在对于尺度和旋转不变的兴趣点。 1.1 构建 高斯金字塔 ,先将图像放大一倍,每一组(Octave) a1a2a3an(不同blur level)是由不断高斯模糊 通过卷积高斯核 构成,下一组第一张是当前组最后一张降采样构成,组内不同层插值用于构建高斯金字塔。 LoG估计。 2.1 基于 Difference of Gaussian 近似--> Laplacian of Gaussian 基于模糊后的二阶导 , 相邻层相减构建差分高斯金字塔。 关键点检测。 3.1 让候选点与周围如图26个点比较,如为极大值或极小值则初步认为是近似关键点。基于这些点结合**泰勒展开(拉格朗日定理)**和插值法找到极值subpixel位置作为关键点。 剔除低部分关键点通过对比度检测和边缘检测。 4.1 通过指定 阈值 剔除低对比度点;基于 Hessian Matrix 通过梯度找到角点,两个方向梯度都小是flat region

OpenCV-Python Dense SIFT Settings

大兔子大兔子 提交于 2019-12-24 01:14:29
问题 This is a follow-up question to the previously posted question about using OpenCVs dense sift implementation in python (OpenCV-Python dense SIFT). Using the suggested code for a dense sift dense=cv2.FeatureDetector_create("Dense") kp=dense.detect(imgGray) kp,des=sift.compute(imgGray,kp) I have the following questions: Can I access any of the DenseFeatureDetector properties in python? Set or at least read? What is the logic behind c++s FeatureDetector::create becoming pythons FeatureDetector

Linking opencv nonfree components (SIFT features and OCL specifically)

巧了我就是萌 提交于 2019-12-23 12:45:20
问题 I am having trouble compiling some code after a OS upgrade (Ubuntu 12.04 to 14.04) and a re-install of opencv. The general issue is with the "nonfree" parts of opencv which I compiled from source using the following procedure: mkdir ~/OpenCV && cd ~/OpenCV wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.10/opencv-2.4.10.zip unzip opencv-2.4.10.zip cd opencv-2.4.10 cmake -D WITH_CUDA=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr . make sudo make

Why is RANSAC not working for my code?

為{幸葍}努か 提交于 2019-12-23 04:52:18
问题 I am trying to find fundamental matrix between 2 images and then transform them using RANSAC. I first use SIFT to detect keypoints and then apply RANSAC: img1 = cv2.imread("im0.png", 0) # queryImage img2 = cv2.imread("im1.png", 0) # trainImage # Initiate SIFT detector sift = sift = cv2.xfeatures2d.SIFT_create() # find the keypoints and descriptors with SIFT kp1, des1 = sift.detectAndCompute(img1, None) kp2, des2 = sift.detectAndCompute(img2, None) src = np.float32([points.pt for points in kp1

module object has no attribute 'DescriptorExtractor_create()'

落爺英雄遲暮 提交于 2019-12-22 08:10:07
问题 I installed opencv3.1.0 with opencv_contrib correctly installed but I am getting the error no module 'DescriptorExtractor_create()' and everything is fine. Suggestions??? :) 回答1: In OpenCV 3.x, SIFT and SURF have been removed because they are patented algorithms and as such are not installed by default. However they are available in the 'opencv_contrib' package which is not installed by default with the normal OpenCV installation. You need to install them manually. Consider this for details

OpenCV Python Feature Detection: how to provide a mask? (SIFT)

大兔子大兔子 提交于 2019-12-22 06:42:14
问题 I am building a simple project in Python3, using OpenCV3, trying to match jigsaw pieces to the "finished" jigsaw image. I have started my tests by using SIFT. I can extract the contour of the jigsaw piece and crop the image but since most of the high frequencies reside, of course, around the piece (where the piece ends and the floor starts), I want to pass a mask to the SIFT detectAndCompute() method, thus forcing the algorithm to look for the keypoints only within the piece. test_mask = np

Compute Dense SIFT features in OpenCV 3.0

◇◆丶佛笑我妖孽 提交于 2019-12-22 04:54:50
问题 Since version 3.0, DenseFeatureDetector is no longer available. Could anybody please show me how to compute Dense SIFT features in OpenCV 3.0? I couldn't find it in the documentation. Thank you very much in advance! 回答1: Here's how I used dense SIFT in OpenCV 3 C++: SiftDescriptorExtractor sift; vector<KeyPoint> keypoints; // keypoint storage Mat descriptors; // descriptor storage // manual keypoint grid int step = 10; // 10 pixels spacing between kp's for (int y=step; y<img.rows-step; y+

how to use SIFT in opencv

試著忘記壹切 提交于 2019-12-20 14:15:39
问题 I am learning C++ and OpenCV these days. Given an image, I want to extract its SIFT features. From http://docs.opencv.org/modules/nonfree/doc/feature_detection.html, we can know that OpenCV 2.4.8 has the SIFT module. See here: But I do not know how to use it. Currently, to use SIFT, I need to first call the class SIFT to get a SIFT instance. Then, I need to use SIFT::operator()() to do SIFT. But what is OutputArray , InputArray , KeyPoint ? Could anyone give a demo to show how to use SIFT

how to use SIFT in opencv

旧城冷巷雨未停 提交于 2019-12-20 14:14:45
问题 I am learning C++ and OpenCV these days. Given an image, I want to extract its SIFT features. From http://docs.opencv.org/modules/nonfree/doc/feature_detection.html, we can know that OpenCV 2.4.8 has the SIFT module. See here: But I do not know how to use it. Currently, to use SIFT, I need to first call the class SIFT to get a SIFT instance. Then, I need to use SIFT::operator()() to do SIFT. But what is OutputArray , InputArray , KeyPoint ? Could anyone give a demo to show how to use SIFT