任意2D集的类似于RANSAC的实现 [英] RANSAC-like implementation for arbitrary 2D sets

查看:293
本文介绍了任意2D集的类似于RANSAC的实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL; DR:是否有RANSAC或其他健壮的对应算法的C ++实现,可自由用于任意2D点集?

TL;DR : Is there a C++ implementation of RANSAC or other robust correspondence algorithms that is freely usable with arbitrary 2D point sets?

我知道存在许多实现,其中包括或利用了相应的算法,例如RANSAC(随机采样共识).它们通常在计算机视觉应用程序中使用,并在诸如 OpenCV 列出不同的步骤.

I know that many implementations exist that include or make use of correspondence algorithms such as RANSAC (Random Sampling Consensus). They are often used in computer vision applications and found in libraries such as OpenCV, PCL, etc. The general algorithm is well known and various site lists the different steps.

现在,我发现的所有高级"实现(针对OpenCV,PCL等)都是针对具有基本假设集的特定类型的问题的.在OpenCV中,您希望找到第一张图像和第二张图像的一部分之间的单应性矩阵(

Now, all the "advanced" implementations (done for OpenCV, PCL, etc.) I have found are for specific types of problem with an underlying set of assumptions. In OpenCV, you want to find the homography matrix between a first image and a portion of a second image (this example). In PCL, you are in the realm of 3D point clouds and you are (to my knowledge) only able to match specific, already defined shapes (a line, a sphere, etc.).

我简单"想要做的是获取任意2D点集(可能包含一些噪声),并在更大的2D点集(也包含一些噪声和其他点)中找到对应关系.除了输入两组点之外,它不需要任何特定的模型训练.我正在自己用C ++实现它,但是:

What I "simply" want to do is to take an arbitrary 2D set of points (which may contain some noise) and find a correspondence in a bigger set of 2D points (which contain some noise and other points too). It has to require no specific model training other than inputting the two sets of points. I am in the process of implementing it myself in C++, but:

  • 我绝不是一个经验丰富的程序员,我需要整个程序非常快地执行.事实证明,由我自己执行的,众所周知的算法(边缘检测,高斯模糊等)的先前实现要比经过实践证明的实现慢很多(> 10倍).

  • I am by no mean an experienced programmer and I need the whole thing to executed quite fast; previous implementation done by myself of well known algorithms (edge detection, Gaussian blurring, etc.) have proven to be significantly slower (>10x) than proven implementation.

仅证明剥夺一个已经存在的开源实现(例如OpenCV)超出了我目前的能力(过多的依赖和虚拟实现模板等等)

Simply ripping off an already existing open source implementation (such as OpenCV's) have proven to be beyond my current capabilities (too much dependencies and virtual implementation-template and else...)

因此,如果有人知道我想念的可免费使用的(类似于BSD)和经过验证的C ++实现...

So, if anyone knows of a freely usable (BSD like) and proven C++ implementation that I have missed...

推荐答案

很难找到一种流行的,轻量级的,通用的RANSAC C ++实现.我刚刚在MIT许可下发布了我的通用RANSAC实现.

It's surprisingly hard to find a popular, lightweight, generic C++ implementation of RANSAC. I just released my generic RANSAC implementation under the MIT license.

https://github.com/drsrinathsridhar/GRANSAC

GRANSAC是通用,模板化,仅标头和多线程的.用户必须实现一个继承AbstractModel的类.然后可以对任何类型的模型(例如2D线,3D平面)进行RANSAC估算.

GRANSAC is generic, templated, header-only, and multithreaded. The user has to implement a class that inherits the AbstractModel. RANSAC estimation can then be done for any kind of model (eg.: 2D lines, 3D planes).

我仅针对2D线拟合进行了测试,但也应该针对其他问题进行测试.很乐意添加更多功能(例如自动选择迭代次数等)

I have tested this only for 2D line fitting but should work for other problems too. Would be happy to add more features (such as automatically choosing number of iterations, etc.)

这篇关于任意2D集的类似于RANSAC的实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆