surf

BFMatcher match in OpenCV throwing error

旧巷老猫 提交于 2019-11-30 13:15:44
问题 I am using SURF descriptors for image matching. I am planning to match a given image to a database of images. import cv2 import numpy as np surf = cv2.xfeatures2d.SURF_create(400) img1 = cv2.imread('box.png',0) img2 = cv2.imread('box_in_scene.png',0) kp1,des1 = surf.detectAndCompute(img1,None) kp2,des2 = surf.detectAndCompute(img2,None) bf = cv2.BFMatcher(cv2.NORM_L1,crossCheck=True) #I am planning to add more descriptors bf.add(des1) bf.train() #This is my test descriptor bf.match(des2) The

stitching microscope images of a microchip

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 07:11:59
So, I'm trying to stitch images taken by a microscope of a microchip, but it's very hard to have all the features aligned. I already have a 50% overlap between two adjacent images, but even with that, it's not always a good fit. I'm using SURF with OpenCV to extract the keypoints and find the homographic matrix. But still, it's far from being an acceptable result. My objective is to be able to stitch perfectly 2x2 images, so this way, I can repeat that process recursively until I have the final image. Do you have any suggestion ? A nice algorithm to approach this problem. Or maybe a way to

OpenCV - undefined reference: SurfFeatureDetector and BruteForceMatcher

◇◆丶佛笑我妖孽 提交于 2019-11-30 06:26:34
I'm making a program in C++ that uses 2 images to detect SURF Features, compute the matches with a bruteforcematcher and draws it. Here's the code #include <cstdio> #include <string> #include <vector> #include "opencv/cv.h" #include "opencv/highgui.h" #include "opencv2/features2d/features2d.hpp" using namespace cv; using namespace std; int main(int argc, char **argv){ if (argc <3) { cout << "Usage: " << argv[0] << " imageLocation1 imageLocation2" << endl; return -1; } Mat source1 = imread(argv[1],CV_LOAD_IMAGE_GRAYSCALE); Mat source2 = imread(argv[2],CV_LOAD_IMAGE_GRAYSCALE); if(source1.empty(

emgu finding image a in image b [duplicate]

删除回忆录丶 提交于 2019-11-30 05:09:16
This question already has an answer here: opencv finding image cordinates on another image 3 answers I'm new to emgu and would like some advice on where to start. I've looked through the shape detection but its far too complex for what i need .. i think.. and my surfexample isn't working. I get this error: Cannot get SURF example in EMGU.CV to work? Anyway, this is what i would like to do: Find image A in image B. Image A is a simple square which always has the same grey 1 pixel border and always the same size (i believe) but the inner colour could be black or one of about 7 other colours

Detecting truck wheels

假如想象 提交于 2019-11-29 21:28:38
I am currently working on a project which we have a set of photos of trucks going by a camera. I need to detect what type of truck it is (how many wheels it has). So I am using EMGU to try to detect this. Problem I have is I cannot seem to be able to detect the wheels using EMGU's HoughCircle detection, it doesn't detect all the wheels and will also detect random circles in the foliage. So I don't know what I should try next, I tried implementing SURF algo to match wheels between them but this does not seem to work either since they aren't exactly the same, is there a way I could implement a

stitching microscope images of a microchip

自古美人都是妖i 提交于 2019-11-29 08:48:22
问题 So, I'm trying to stitch images taken by a microscope of a microchip, but it's very hard to have all the features aligned. I already have a 50% overlap between two adjacent images, but even with that, it's not always a good fit. I'm using SURF with OpenCV to extract the keypoints and find the homographic matrix. But still, it's far from being an acceptable result. My objective is to be able to stitch perfectly 2x2 images, so this way, I can repeat that process recursively until I have the

include nonfree openCV 2.4.10 on ubuntu

百般思念 提交于 2019-11-29 08:00:02
问题 I've installed OpenCV on ubuntu using this link and I'm trying to use SURF descriptor. I knew that they changed the location of these type of descriptors to the nonfree module so we need to include it, which is something like this: #include "opencv2/nonfree/features2d.hpp" . The problem is that I'm getting this error at compile time: opencv2/nonfree/features2d.hpp no such file or directory. Any idea how to fix it? EDITED: The other parts of openCV are working fine. I'm including the following

OpenCV - undefined reference: SurfFeatureDetector and BruteForceMatcher

拟墨画扇 提交于 2019-11-29 06:11:55
问题 I'm making a program in C++ that uses 2 images to detect SURF Features, compute the matches with a bruteforcematcher and draws it. Here's the code #include <cstdio> #include <string> #include <vector> #include "opencv/cv.h" #include "opencv/highgui.h" #include "opencv2/features2d/features2d.hpp" using namespace cv; using namespace std; int main(int argc, char **argv){ if (argc <3) { cout << "Usage: " << argv[0] << " imageLocation1 imageLocation2" << endl; return -1; } Mat source1 = imread

opencv FLANN with ORB descriptors?

时光怂恿深爱的人放手 提交于 2019-11-29 01:25:55
I am trying to use FLANN with ORB descriptors, but opencv crashes with this simple code: vector<vector<KeyPoint> > dbKeypoints; vector<Mat> dbDescriptors; vector<Mat> objects; /* load Descriptors from images (with OrbDescriptorExtractor()) */ FlannBasedMatcher matcher; matcher.add(dbDescriptors); matcher.train() //> Crash! If I use SurfDescriptorExtractor() it works well. How can I solve this? OpenCV says: OpenCV Error: Unsupported format or combination of formats (type=0 ) in unknown function, file D:\Value\Personal\Parthenope\OpenCV\modules\flann\sr c\miniflann.cpp, line 299 Flann needs the

OpenCV 2.4.3 - warpPerspective with reversed homography on a cropped image

我的梦境 提交于 2019-11-29 00:38:10
When finding a reference image in a scene using SURF, I would like to crop the found object in the scene, and "straighten" it back using warpPerspective and the reversed homography matrix. Meaning, let's say I have this SURF result: Now, I would like to crop the found object in the scene: and "straighten" only the cropped image with warpPerspective using the reversed homography matrix. The result I'm aiming at is that I'll get an image containing, roughly, only the object, and some distorted leftovers from the original scene (as the cropping is not a 100% the object alone). Cropping the found