This class implements a very efficient and robust variant of the iterative closest point (ICP) algorithm. The task is to register a 3D model (or point cloud) against a set of noisy target data. The variants are put together by myself after certain tests. The task is to be able to match partial, noisy point clouds in cluttered scenes, quickly. You will find that my emphasis is on the performance, while retaining the accuracy. This implementation is based on Tolga Birdal's MATLAB implementation in here:
http://www.mathworks.com/matlabcentral/fileexchange/47152-icp-registration-using-efficient-variants-and-multi-resolution-scheme
The main contributions come from:
[詳解]
#include <icp.hpp>
|
enum |
{
ICP_SAMPLING_TYPE_UNIFORM
= 0 ,
ICP_SAMPLING_TYPE_GELFAND
= 1 } |
|
|
CV_WRAP |
ICP
(const int iterations, const float tolerence=0.05f, const float rejectionScale=2.5f, const int numLevels=6, const int sampleType=ICP::ICP_SAMPLING_TYPE_UNIFORM, const int numMaxCorr=1) |
|
ICPデフォルトの引数を持つコンストラクタ.[【詳解】(英語]
|
|
CV_WRAP int |
registerModelToScene
(const
Mat
&srcPC, const
Mat
&dstPC, CV_OUT double &residual, CV_OUT
Matx44d
&pose) |
|
レジストレーションの実行[【詳解】(英語]
|
|
CV_WRAP int |
registerModelToScene
(const
Mat
&srcPC, const
Mat
&dstPC, CV_IN_OUT std::vector<
Pose3DPtr
> &poses) |
|
複数の初期ポーズでレジストレーションを実行[【詳解】(英語]
|
|
◆
ICP()
CV_WRAP cv::ppf_match_3d::ICP::ICP
|
( |
const int |
iterations,
|
|
|
const float |
tolerence
=
0.05f ,
|
|
|
const float |
rejectionScale
=
2.5f ,
|
|
|
const int |
numLevels
=
6 ,
|
|
|
const int |
sampleType
=
ICP::ICP_SAMPLING_TYPE_UNIFORM ,
|
|
|
const int |
numMaxCorr
=
1 |
|
) |
|
|
|
inline
|
ICPデフォルトの引数を持つコンストラクタ.
- 引数
-
[in]. |
iterations |
|
[in]. |
tolerence |
の各反復において,レジストレーションの精度を制御します.ICP. |
[in]. |
rejectionScale |
ロバスト性を高めるために,ロバストな外れ値除去が適用されます.この値は、実際には標準偏差係数に相当します。rejectionScale * &sigmaを持つポイントは、登録時に無視されます。 |
[in]. |
numLevels |
進行するピラミッドレベルの数。深いピラミッドは速度を上げるが、精度を下げる。粗すぎるピラミッドは、不正確な登録の上に計算上のオーバーヘッドがあるかもしれません。このパラメータは、バランスが最適になるように選択する必要があります。典型的な値は4から10です。 |
[in]. |
sampleType |
現在、このパラメータは無視され、均一なサンプリングのみが適用されます。0のままにしておいてください。 |
[in]. |
numMaxCorr |
現在、このパラメータは無視され、PickyICPのみが適用されます。1に設定してください。 |
◆
registerModelToScene()
[1/2]
CV_WRAP int cv::ppf_match_3d::ICP::registerModelToScene
|
( |
const
Mat
& |
srcPC,
|
|
|
const
Mat
& |
dstPC,
|
|
|
CV_IN_OUT std::vector<
Pose3DPtr
> & |
poses |
|
) |
|
|
複数の初期ポーズでレジストレーションを実行
- 引数
-
[in]. |
srcPC |
モデルの入力点群です。法線(Nx6)を持つことが期待されます.現在のところ,CV_32F が唯一サポートされているデータ型です. |
[in]. |
dstPC |
シーンの入力点群.現在のところ,CV_32F が唯一のサポートされるデータ型です. |
[in,out] |
poses |
最初に入力されるポーズですが,出力されるポーズのリストもあります. |
- 戻り値
- 正常に終了した場合,この関数は 0 を返します.
モデルがシーンに登録されていることを仮定しています.シーンは静止していますが,モデルは変形します.出力されるポーズは,モデルをシーン上に変換します.点から面への最小化のため、シーンは法線を持っていることが期待されます。法線(Nx6)があることが期待されます。
◆
registerModelToScene()
[2/2]
CV_WRAP int cv::ppf_match_3d::ICP::registerModelToScene
|
( |
const
Mat
& |
srcPC,
|
|
|
const
Mat
& |
dstPC,
|
|
|
CV_OUT double & |
residual,
|
|
|
CV_OUT
Matx44d
& |
pose |
|
) |
|
|
レジストレーションの実行
- 引数
-
[in]. |
srcPC |
モデルの入力点群です。法線(Nx6)を持つことが期待されます.現在のところ,CV_32F が唯一サポートされているデータ型です. |
[in]. |
dstPC |
シーンの入力点群。モデルがシーンに登録されていることを想定しています。シーンは静止しています。法線(Nx6)を持つことが期待されます.現在,サポートされているデータ型は CV_32F のみです. |
[out]. |
residual |
出力の登録エラー。 |
[out]. |
pose |
srcPC と dstPC の間で変換します. |
- 戻り値
- 正常に終了した場合,この関数は 0 を返します.
モデルがシーンに登録されていることを仮定しています.シーンは静止していますが,モデルは変形します.出力されるポーズは,モデルをシーン上に変換します.点から面への最小化のため、シーンは法線を持っていることが期待されます。法線(Nx6)があることが期待されます。
このクラス詳解は次のファイルから抽出されました: