SIFT算法中奇怪的八度值

SIFT算法中奇怪的八度值

本文介绍了SIFT算法中奇怪的八度值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在opencv代码中使用sift算法从图像中获取描述符和关键点。我的代码是

I am using sift algorithm in opencv code to get descriptors and keypoints from images.My code is

    Ptr<IplImage> image;
    vector<KeyPoint> keypoints;
    OutputArray des;

    Feature2D *descriptor_type = new SIFT()
    Mat image_mat(image);
    (*descriptor_type)(image_mat,noArray(),keypoints,des,false);

在这里,我可以在向量中获取图像的关键点< KeyPoint>。之后,我想得到每个KeyPoint的Octave以获取更多细节。但是,当我为一个图像输入每个关键点八度值时,我想确认它们是否正确似乎很奇怪。

Here I can get the keypoints of the image in vector < KeyPoint > .After that,I want to get the Octave of each KeyPoint for more details .But when I cout each keypoint octave value for one image,it seems so strange that I want to confirm whether they are right.

for(int i=0;i<keypoints.size();i++)
{
     cout<< (keypoints[i].octave) <<endl;
}

9765375
9765375
2621951
8323583
13763071
6488575
12845567
721407
3604991
12321279
9568767
7406079
8585727
4653567
7799295
7799295
5112319
10486271
9961983
6226431
1245951

如果我将SIFT算法更改为SURF算法,它会好起来的。

and if I change SIFT algorithm to SURF algorithm,it will be OK and seem right.

0
0
0
0
0
0
1
0
0
0
0
1
1
1
0
1
1
1
0
0
1
0

所以我想问一下在SIFT算法中Octave值的计算是否在opencv中是正确的?

So I want to ask whether the calculation of Octave value in SIFT algorithm is right in opencv?

推荐答案

刚刚遇到。

似乎SIFT关键点的 octave 值需要修补:

It seems like the octave value for SIFT keypoints needs to by "patched":

keyPoint.octave = keyPoint.octave & 0xFF;

这篇关于SIFT算法中奇怪的八度值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 22:37