相关疑难解决方法(0)

OpenCV - 冲浪算法 - 给出大量误报

我正在学习OpenCV,并开始探索用于图像匹配的SURF算法.我通过修改Microsoft Windows 7提供的默认图像创建了一个示例图像库.

每个图像在同一文件夹中都有旋转,缩放,模糊和倾斜的版本.

我找到匹配图像的代码如下所示.从代码中可以看出,距离是由行dis/objectDescriptors-> total测量的,并且进一步的相似度由100 - (dis/objectDescriptors-> total)*100计算.

不幸的是,这给了我一些奇怪的误报.例如,它将image1与完全不同的image2(85%相似度)匹配,但与image1的轻微模糊版本仅显示60%的相似度.

我如何摆脱误报?

以下代码的灵感来自网站:http://opencvuser.blogspot.in/2012/07/surf-source-code-part-2.html

#include <cv.h>
#include <highgui.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h> 
#include <iostream>
#include <vector>

using namespace std;

static double dis=0;//For calculating the distance


IplImage *image = 0;

double
compareSURFDescriptors( const float* d1, const float* d2, double best, int length )
{
    double total_cost = 0;
    assert( length % 4 == 0 );
    for( int i = 0; i < length; i …
Run Code Online (Sandbox Code Playgroud)

c++ opencv surf sift

3
推荐指数
1
解决办法
3921
查看次数

标签 统计

c++ ×1

opencv ×1

sift ×1

surf ×1