是否可以获得两个图像之间的旋转和缩放,只有每个的Surf描述符? [英] Is it possible to get the rotation and scale between two images with only a Surf Descriptor of each?

查看:174
本文介绍了是否可以获得两个图像之间的旋转和缩放,只有每个的Surf描述符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Surf进行地标识别。这是我想的过程:

I'm using Surf for landmark recognition. This is the process I thought:

1)为每个地标保存一个冲浪描述符

1) save before hand one Surf Descriptor for each landmark

用户拍摄地标(例如建筑物)的照片

2) A user takes a photo of a landmark (eg building)

3)为此图像(照片)计算冲浪描述符

3) A Surf Descriptor is computed for this image (the photo)

4)将该描述符与存储
的每个地标描述符进行比较,并且在11个最接近特征点之间具有最低DMatch距离的那个描述符被选择作为识别的地标

4) This descriptor is compared against each landmark descriptor stored and the one with the lowest DMatch.distance between the 11 closest Feature Points is choosen as the landmark recognized

5)我想计算所获得的图像和存储的
界标图像之间的旋转和缩放比。

5) I want to calculate the rotation and scale-ratio between the image obtained and the landmark image stored.

我的理解是,我只能通过关键点获得这个旋转和缩放比,因为
的特征描述符只是关键点的唯一缩减表示。因此,我将
必须保存每个地标的关键点和要素描述符。是这样吗?

My understanding is that I can only get this rotation and scale-ratio through keypoints, because the Feature Descriptor is only a Unique Reduced Representation for a Keypoint. As such I would have to save both the keypoints and Feature Descriptors for each landmark. Is that right?

这是我现在正在做的:

cv::SurfFeatureDetector surf(4000);
..
surf.detect(image1, keypoints1); 
surf.detect(image2, keypoints2);
..
cv::SurfDescriptorExtractor surfDesc;
surfDesc.compute(image1, keypoints1, descriptor1);
surfDesc.compute(image2, keypoints2, descriptor2);
..
vector<cv::DMatch> descriptorsMatch;
BruteForceMatcher<cv::L2<float> > brute;
brute.match(desc1, desc2, descriptorsMatch);

//Use only the 11 best matched keypoints;
nth_element( descriptorsMatch.begin(), descriptorsMatch.begin()+10, descriptorsMatch.end() );
descriptorsMatch.erase( descriptorsMatch.begin()+11, descriptorsMatch.end() );
..
for ( .. it = descriptorsMatch.begin(); it != descriptorsMatch.end() .. )
{
  distanceAcumulator +=it->distance;
  angleAcumulator += abs(keypoints1[it->queryIdx].angle - keypoints2[it->trainIdx].angle) % 180 ;
  scaleAcumulator1 +=keypoints1[it->queryIdx].size;
  scaleAcumulator2 +=keypoints2[it->trainIdx].size;
}
angleBetweenImages = angleAcumulator/11;
scaleBetweenImages = scaleAcumulator1/scaleAcumulator2;
similarityBetweenImages = distanceAcumulator/11;
.. 


推荐答案

他们的旋转是幼稚的,一般不会工作。你需要的是应用一些几何模型来找到照片之间的关系。在本书中查看更多 http://www.robots.ox.ac.uk/ 〜vgg / hzbook / ,尤其是第二部分:两视几何。

Just comparing scale of descriptors and their rotation is naive and generally will not work. What you need is applying some geometrical model to find relationship between photos. See more in this book http://www.robots.ox.ac.uk/~vgg/hzbook/, especially PART II: Two-View Geometry.

这篇关于是否可以获得两个图像之间的旋转和缩放,只有每个的Surf描述符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆