我正在使用低分辨率 (VGA) 和 jpg 压缩的图像序列在移动机器人上进行视觉导航。目前我正在使用 SURF 来检测关键点并从图像中提取描述符,并使用 FLANN 来跟踪它们。在应用 RANSAC(通常会减少 20% 的匹配数量)之前,我每张图像得到 4000-5000 个特征,通常每对连续图像进行 350-450 个匹配
我正在努力增加比赛的数量(和质量)。我尝试了另外两种检测器:SIFT 和 ORB。SIFT 显着增加了特征的数量(总体上增加了 35% 的跟踪特征),但速度要慢得多。ORB 提取的特征大致与 SURF 一样多,但匹配性能要差得多(在最好的情况下大约为 100 个匹配)。我在 ORB 的 opencv 中的实现是:
cv::ORB orb = cv::ORB(10000, 1.2f, 8, 31);
orb(frame->img, cv::Mat(), im_keypoints, frame->descriptors);
frame->descriptors.convertTo(frame->descriptors, CV_32F); //so that is the same type as m_dists
Run Code Online (Sandbox Code Playgroud)
然后,在匹配时:
cv::Mat m_indices(descriptors1.rows, 2, CV_32S);
cv::Mat m_dists(descriptors1.rows, 2, CV_32F);
cv::flann::Index flann_index(descriptors2, cv::flann::KDTreeIndexParams(6));
flann_index.knnSearch(descriptors1, m_indices, m_dists, 2, cv::flann::SearchParams(64) );
Run Code Online (Sandbox Code Playgroud)
在处理低分辨率和嘈杂的图像时,最好的特征检测器和提取器是什么?我应该根据使用的特征检测器更改 FLANN 中的任何参数吗?
编辑:
我发布了一些相当容易跟踪的序列的图片。这些图片是我将它们提供给特征检测器方法的。它们已经过预处理以消除一些噪音(通过 cv::bilateralFilter())
opencv image feature-extraction feature-detection feature-tracking
在opencv中,我碰巧修改了一个作为常量传递给我的函数的变量:
void someFunction(const cv::Mat matrix)
{
double value = 5.0;
matrix /= value;
}
Run Code Online (Sandbox Code Playgroud)
它不仅编译,而且在调用之后矩阵仍然被修改someFunction(matrix),即使我没有matrix作为参考传递.我给这家代码编译的解释是,我没有真正改变的任何成员matrix中someFunction,但地址的内容由指针所指向data的matrix,但我真的不知道.由于我有点困惑,我尝试在一个小程序中重现这种情况:
#include <iostream>
using namespace std;
class Foo;
{
private:
int* ptr;
public:
Foo()
{
ptr = new int[1];
ptr[0] = 1;
}
const Foo& operator += ( const Foo& obj) const
{
this->ptr[0] += obj.ptr[0];
return *this;
}
};
void changeConst(const Foo var)
{
Foo foo;
var += foo;
}
int main()
{ …Run Code Online (Sandbox Code Playgroud)