【问题标题】:Opencv Surf and FlannIndex to find image in images databaseOpencv Surf 和 FlannIndex 在图像数据库中查找图像
【发布时间】:2016-10-12 12:49:01
【问题描述】:

我是 opencv 新手,在 C# 中使用 EMGU 作为包装器。我正在尝试从图像数据库中为查询图像获取最佳相似图像。

我按照 show here 的示例进行操作。

它使用SURF检测器检测图像特征,然后将所有数据库图像描述符组合在一个超级描述符矩阵中进行匹配。

然后它使用 Flann 索引来查找查询图像的最近邻。

问题是距离矩阵“dists”总是包含“0”值。

flannIndex.KnnSearch(queryDescriptors, indices, dists, 2, 24);

【问题讨论】:

    标签: c# opencv emgucv surf flann


    【解决方案1】:

    请在您的项目中输入以下代码:

    if (img.IndexStart <= indices[i, 0] && img.IndexEnd >= indices[i, 0])
                        //if (img.IndexStart <= i && img.IndexEnd >= i)
                        {
                            img.Similarity++;
                            break;
                        }
    

    改为:

        if (img.IndexStart <= indices[i, 1] && img.IndexEnd >= indices[i, 1])
                        //if (img.IndexStart <= i && img.IndexEnd >= i)
                        {
                            img.Similarity++;
                            break;
                        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-09
      • 2012-12-31
      • 2016-03-21
      • 1970-01-01
      • 2014-10-18
      • 1970-01-01
      • 1970-01-01
      • 2012-01-15
      相关资源
      最近更新 更多