OpenCV 5.0.0
Open Source Computer Vision
読み込み中...
検索中...
見つかりません
🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
_3d

詳細説明

クラス

class  cv::RegionGrowing3D
 3D 点群における領域成長 (Region Growing) アルゴリズム。 続き...
 
class  cv::SACSegmentation
 3D 点群モデルのサンプルコンセンサス (Sample Consensus) アルゴリズムによるセグメンテーション。 続き...
 

列挙型

enum  cv::SacMethod { cv::SAC_METHOD_RANSAC }
 ロバスト推定アルゴリズムの種類 続き...
 
enum  cv::SacModelType {
  cv::SAC_MODEL_PLANE ,
  cv::SAC_MODEL_SPHERE
}
 

関数

int cv::farthestPointSampling (OutputArray sampled_point_flags, InputArray input_pts, float sampled_scale, float dist_lower_limit=0, RNG *rng=nullptr)
 
int cv::farthestPointSampling (OutputArray sampled_point_flags, InputArray input_pts, int sampled_pts_size, float dist_lower_limit=0, RNG *rng=nullptr)
 最遠点サンプリング (Farthest Point Sampling, FPS) による点群のサンプリング。
 
void cv::normalEstimate (OutputArray normals, OutputArray curvatures, InputArray input_pts, InputArrayOfArrays nn_idx, int max_neighbor_num=0)
 NN の結果から点群内の各点の法線と曲率を推定する。
 
void cv::randomSampling (OutputArray sampled_pts, InputArray input_pts, float sampled_scale, RNG *rng=nullptr)
 
void cv::randomSampling (OutputArray sampled_pts, InputArray input_pts, int sampled_pts_size, RNG *rng=nullptr)
 点をランダムに選択することによる点群のサンプリング。
 
int cv::voxelGridSampling (OutputArray sampled_point_flags, InputArray input_pts, float length, float width, float height)
 ボクセルグリッドフィルタによるダウンサンプリングを用いた点群のサンプリング。
 

列挙型詳解

◆ SacMethod

#include <opencv2/geometry/segment.hpp>

ロバスト推定アルゴリズムの種類

列挙値
SAC_METHOD_RANSAC 
Python: cv.SAC_METHOD_RANSAC

[95] で説明されている RANSAC アルゴリズム。

◆ SacModelType

#include <opencv2/geometry/segment.hpp>

列挙値
SAC_MODEL_PLANE 
Python: cv.SAC_MODEL_PLANE

3次元平面モデルの係数をリスト [a, b, c, d] で表したもので、方程式 \( ax + by + cz + d = 0 \) の係数に対応する。

SAC_MODEL_SPHERE 
Python: cv.SAC_MODEL_SPHERE

3次元球モデルの係数をリスト [center_x, center_y, center_z, radius] で表したもので、方程式 \( (x - center\_x)^2 + (y - center\_y)^2 + (z - center\_z)^2 = radius^2 \) の係数に対応する。

関数詳解

◆ farthestPointSampling() [1/2]

int cv::farthestPointSampling ( OutputArray sampled_point_flags,
InputArray input_pts,
float sampled_scale,
float dist_lower_limit = 0,
RNG * rng = nullptr )

#include <opencv2/geometry/segment.hpp>

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

引数
[out]sampled_point_flagsサンプリングされた点のフラグ(std::vector<int> や std::vector<char> などを渡す)。sampled_point_flags[i] が 1 の場合は i 番目の点が選択されていることを意味し、0 の場合は選択されていないことを意味する。
input_pts元の点群。Point3 のベクトルまたはサイズ Nx3/3xN の Mat
sampled_scaleRange (0, 1)。サンプリングされた点群の元のサイズに対する割合、すなわち sampled size = original size * sampled_scale。
dist_lower_limit最も遠い点から S までの距離が dist_lower_limit より小さくなった場合、サンプリングは早期に終了する。デフォルトは 0。
rngFPS のシード点を選択するために使用される省略可能な乱数生成器。nullptr の場合は代わりに theRNG () が使用される。
戻り値
実際にサンプリングされた点の数。

◆ farthestPointSampling() [2/2]

int cv::farthestPointSampling ( OutputArray sampled_point_flags,
InputArray input_pts,
int sampled_pts_size,
float dist_lower_limit = 0,
RNG * rng = nullptr )

#include <opencv2/geometry/segment.hpp>

最遠点サンプリング (Farthest Point Sampling, FPS) による点群サンプリング。

FPS Algorithm:

  • 入力: 点群 C, sampled_pts_size, dist_lower_limit
  • 初期化: サンプリング済み点群 S を空集合に設定する
  • Step:
    1. C からシード点をランダムに1つ取り、C から S へ移す;
    2. C の中で S から最も遠い点を見つけ、C から S へ移す; (点から集合 S までの距離は、その点から S 内のすべての点までの最小距離とする)
    3. C 内の点の S からの最遠距離が dist_lower_limit 未満になるか、S のサイズが sampled_pts_size に等しくなるまで、ステップ2 を繰り返す。
  • 出力: サンプリング済み点群 S
引数
[out]sampled_point_flagsサンプリングされた点のフラグ(std::vector<int> や std::vector<char> などを渡す)。sampled_point_flags[i] が 1 の場合は i 番目の点が選択されていることを意味し、0 の場合は選択されていないことを意味する。
input_pts元の点群。Point3 のベクトルまたはサイズ Nx3/3xN の Mat
sampled_pts_sizeサンプリング後に望ましい点群のサイズ。
dist_lower_limit最も遠い点から S までの距離が dist_lower_limit より小さくなった場合、サンプリングは早期に終了する。デフォルトは 0。
rngFPS のシード点を選択するために使用される省略可能な乱数生成器。nullptr の場合は代わりに theRNG () が使用される。
戻り値
実際にサンプリングされた点の数。

◆ normalEstimate()

void cv::normalEstimate ( OutputArray normals,
OutputArray curvatures,
InputArray input_pts,
InputArrayOfArrays nn_idx,
int max_neighbor_num = 0 )

#include <opencv2/geometry/segment.hpp>

NNの結果から、点群内の各点の法線と曲率を推定する。

PCA による法線推定:

  • 入力: 特定の点の最近傍点: \( pt\_set \)
  • Step:
    1. \( pt\_set \) の \( mean(\bar{x},\bar{y},\bar{z}) \) を計算する;
    2. \( mean^T \cdot mean \) によって 3x3 の共分散行列 \( cov \) を得る;
    3. \( cov \) の固有値( \( λ_2 \ge λ_1 \ge λ_0 \))と対応する固有ベクトル( \( v_2, v_1, v_0 \))を計算する;
    4. \( v0 \) が特定の点の法線であり、\( \frac{λ_0}{λ_0 + λ_1 + λ_2} \) がその点の曲率である;
  • 出力: 特定の点の法線と曲率。
引数
[out]normals各点の法線。vector<Point3f> およびサイズ Nx3 の Mat をサポートする。
[out]curvatures各点の曲率。vector<float> および Mat をサポートする。
input_pts元の点群。vector<Point3f> およびサイズ Nx3/3xN の Mat をサポートする。
nn_idxすべての点の最近傍のインデックス情報。各点の最初の最近傍はその点自身である。vector<vector<int>>、vector<Mat> およびサイズ NxK の Mat をサポートする。ある行の情報が [0, 2, 1, -5, -1, 4, 7 ... 負の数] である場合、負の数またはこの行の境界に達するまでの非負のインデックスのみを使用する。すなわち [0, 2, 1]。
max_neighbor_num自身を含めて使用したい近傍の最大数。非正の数またはデフォルトに設定すると、nn_idx の情報を使用する。

◆ randomSampling() [1/2]

void cv::randomSampling ( OutputArray sampled_pts,
InputArray input_pts,
float sampled_scale,
RNG * rng = nullptr )

#include <opencv2/geometry/segment.hpp>

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

引数
sampled_ptsサンプリング後の点群。cv::Mat(size * sampled_scale, 3, CV_32F)、std::vector<cv::Point3f> をサポートする。
input_pts元の点群。Point3 のベクトルまたはサイズ Nx3/3xN の Mat
sampled_scaleRange (0, 1)。サンプリングされた点群の元のサイズに対する割合、すなわち sampled size = original size * sampled_scale。
rngcv::randShuffle に使用される省略可能な乱数生成器。nullptr の場合は代わりに theRNG () が使用される。

◆ randomSampling() [2/2]

void cv::randomSampling ( OutputArray sampled_pts,
InputArray input_pts,
int sampled_pts_size,
RNG * rng = nullptr )

#include <opencv2/geometry/segment.hpp>

点をランダムに選択することによる点群サンプリング。

cv::randShuffle を使って点のインデックスリストをシャッフルし、リストの先頭部分に対応する点を取り出す。

引数
sampled_ptsサンプリング後の点群。cv::Mat(sampled_pts_size, 3, CV_32F)、std::vector<cv::Point3f> をサポートする。
input_pts元の点群。Point3 のベクトルまたはサイズ Nx3/3xN の Mat
sampled_pts_sizeサンプリング後に望ましい点群のサイズ。
rngcv::randShuffle に使用される省略可能な乱数生成器。nullptr の場合は代わりに theRNG () が使用される。

◆ voxelGridSampling()

int cv::voxelGridSampling ( OutputArray sampled_point_flags,
InputArray input_pts,
float length,
float width,
float height )

#include <opencv2/geometry/segment.hpp>

ボクセルグリッドフィルタによるダウンサンプリングを用いた点群サンプリング。

入力点群データの上に3次元ボクセルグリッド(空間中の微小な3Dボックスの集合)を作成し、各ボクセル(すなわち3Dボックス)内に存在するすべての点を、その重心に最も近い点で近似(すなわちダウンサンプリング)する。

引数
[out]sampled_point_flagsサンプリングされた点のフラグ(std::vector<int> や std::vector<char> などを渡す)。sampled_point_flags[i] が 1 の場合は i 番目の点が選択されていることを意味し、0 の場合は選択されていないことを意味する。
input_pts元の点群。Point3 のベクトルまたはサイズ Nx3/3xN の Mat
lengthグリッドの長さ。
widthグリッドの幅。
heightグリッドの高さ。
戻り値
実際にサンプリングされた点の数。