【问题标题】:relation between harris detector results in matlab and opencv哈里斯检测器结果在matlab和opencv中的关系
【发布时间】:2016-04-12 12:48:42
【问题描述】:

我正在使用哈里斯检测器进行角点特征检测。我使用以下代码在matlab中编写了程序检测图像中的特征来检测哈里斯特征

corners = detectHarrisFeatures(img, 'MinQuality', 0.0001); 
S = corners.selectStrongest(100);

然后我将所有程序从 matlab 转移到 opencv

我使用以下代码检测哈里斯角点

int thresh = 70;

for( int j = 0; j < dst_norm.rows && cont < 100; j++ )
{  
    for( int i = 0; i < dst_norm.cols && cont < 100; i++ )
    {
        if((int) dst_norm.at<float>(j, i) > thresh )
        {                        
            S.at<int>(cont, 0) = i;
            S.at<int>(cont, 1) = j;
            I.at<int>(cont, 0) = i;
            I.at<int>(cont, 1) = j;

            cont = cont + 1;                            
        }
    }
}

两个程序中提取的区域不同,我发现 harris 在 matlab 中检测到的角点与 harris 在 opencv 中检测到的角点不同。

如何使两个程序检测到的角点相同?

【问题讨论】:

    标签: matlab opencv image-processing computer-vision matlab-cvst


    【解决方案1】:

    dst_norm 是 Harris 角度量值的数组吗?在这种情况下,您选择角度量高于阈值的前 100 个像素,这是不正确的。

    在您的 MATLAB 代码中,detectHarrisFeatures 查找角度量的局部最大值点。然后selectStrongest 方法选择 100 个具有最高度量的点。所以,首先你必须找到局部最大值。然后你必须对它们进行排序,并获得前 100 名。

    即使那样,结果也不会完全相同,因为detectHarrisFeatures 使用插值以亚像素精度定位角点。

    【讨论】:

      猜你喜欢
      • 2016-12-20
      • 2015-06-11
      • 1970-01-01
      • 1970-01-01
      • 2014-12-14
      • 1970-01-01
      • 2020-04-15
      • 1970-01-01
      • 2016-03-16
      相关资源
      最近更新 更多