本文介绍了将ORB特征与阈值匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目是基于android的草药识别.我使用ORB来获取关键点,功能以及与功能匹配.

My project is herbs recognition based on android. I use ORB to get keypoints, features, and matching the features.

我要使用此算法:

  1. 我使用4个参考图像,并将其特征image1匹配到image1、1-2、1-3、1-4、2-3、3,4.
  2. 然后,我将到数据库的最小和最大距离存储为阈值. (最低阈值=最低总数/6)
  3. 当我识别出新图像时,我会将新的最小和最大距离与数据库中的进行比较.但是我不知道该怎么做.

{

for (j=MinID; j<=MaxID; j++){
                        MatOfDMatch matches = DetectUtility.match(features, matFromJson(DB.GetORBFitur(j)));
                        List<DMatch> matchesList = matches.toList();
                        Double max_dist = 0.0;
                        Double min_dist = 100.0;
                        for (int i = 0; i < matchesList.size(); i++){
                            Double dist = (double) matchesList.get(i).distance;
                            if (dist < min_dist && dist != 0){
                                min_dist = dist;
                            }
                            if (dist > max_dist){
                                max_dist = dist;
                            }
                        }

此站点,我得到以下代码:

//-- Draw only "good" matches (i.e. whose distance is less than 3*min_dist )
std::vector< DMatch > good_matches;

for( int i = 0; i < descriptors_object.rows; i++ )
{ if( matches[i].distance < 3*min_dist )
 { good_matches.push_back( matches[i]); }
}

如何获得魔法数字3?我该怎么做才能达到最大距离?

How to get that magic number 3?and what must I do to the maximum distance?

我要使用的算法,之前使用不变矩和城市街区距离来匹配具有最小距离的图像.

The algoritma that I want to use, I used before on using Invariant Moment, and City Block Distance to matching the image with the smallest distance.

推荐答案

我也不知道.距离是特征点相似性的量度,越少越好. 原始ORB文件(图5,下图)显示了好和坏匹配的距离分布.可以肯定地说,好的"距离阈值大约为64.

I don`t know either. Distance is measure of the feature point similarity, less is better. The original ORB paper (fig. 5, below) shows distribution of the distances for good and bad matches. One can surely says that "good" distance threshold would be around 64.

更正确的是:

double dist_th = 64;
for( int i = 0; i < descriptors_object.rows; i++ )
{ if( matches[i].distance < dist_th )
 { good_matches.push_back( matches[i]); }
}

然后您仍然必须使用RANSAC来过滤不一致的匹配项.因此,最简单的解决方案是将查询图像与所有4个数据库图像进行匹配.

And then you still have to use RANSAC to filter inconsistent matches. So, the simplest solution is to do match you query image with all 4 database images.

但是我建议您使用一些分类器,而不仅仅是匹配.看到这个家伙的方法(有效,我认识他)- http://cmp.felk.cvut. cz/〜sulcmila/

But I`d advise you to use some classifier, not just matching. See this guy approach (it works, I know him) - http://cmp.felk.cvut.cz/~sulcmila/

这篇关于将ORB特征与阈值匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 16:50