类,允许加载和匹配 3D 模型。典型用法:更多...
#include <opencv2/surface_matching/ppf_match_3d.hpp>
|
| PPF3DDetector () |
| 空构造函数。设置默认参数。
|
|
| PPF3DDetector (const double relativeSamplingStep, const double relativeDistanceStep=0.05, const double numAngles=30) |
|
virtual | ~PPF3DDetector () |
|
void | match (const Mat &scene, std::vector< Pose3DPtr > &results, const double relativeSceneSampleStep=1.0/5.0, const double relativeSceneDistance=0.03) |
| 在提供的场景中匹配训练好的模型。
|
|
void | read (const FileNode &fn) |
|
void | setSearchParams (const double positionThreshold=-1, const double rotationThreshold=-1, const bool useWeightedClustering=false) |
|
void | trainModel (const Mat &Model) |
| 训练一个新的模型。
|
|
void | write (FileStorage &fs) const |
|
类,允许加载和匹配 3D 模型。典型用法
vector<Pose3DPtr> results;
detector.match(pcTest, results, 1.0/5.0,0.05);
类,允许加载和匹配 3D 模型。典型用法
定义 ppf_match_3d.hpp:98
@ pc
定义 container_avi.private.hpp:136
◆ PPF3DDetector() [1/2]
cv::ppf_match_3d::PPF3DDetector::PPF3DDetector |
( |
| ) |
|
Python |
---|
| cv.ppf_match_3d.PPF3DDetector( | | ) -> | <ppf_match_3d_PPF3DDetector 对象> |
| cv.ppf_match_3d.PPF3DDetector( | relativeSamplingStep[, relativeDistanceStep[, numAngles]] | ) -> | <ppf_match_3d_PPF3DDetector 对象> |
◆ PPF3DDetector() [2/2]
cv::ppf_match_3d::PPF3DDetector::PPF3DDetector |
( |
const double |
relativeSamplingStep, |
|
|
const double |
relativeDistanceStep = 0.05 , |
|
|
const double |
numAngles = 30 |
|
) |
| |
Python |
---|
| cv.ppf_match_3d.PPF3DDetector( | | ) -> | <ppf_match_3d_PPF3DDetector 对象> |
| cv.ppf_match_3d.PPF3DDetector( | relativeSamplingStep[, relativeDistanceStep[, numAngles]] | ) -> | <ppf_match_3d_PPF3DDetector 对象> |
带参数的构造函数
- 参数
-
[in] | relativeSamplingStep | 相对于物体直径的采样距离。首先对模型进行均匀采样,以提高效率。减小此值会导致更密集的模型,以及更精确的姿态估计,但模型越大,训练速度越慢。增加该值会导致姿态计算精度降低,但模型更小,模型生成和匹配速度更快。注意使用较小值时的内存消耗。 |
[in] | relativeDistanceStep | 点对距离相对于模型直径的离散化距离。该值对哈希表有直接影响。使用较小的值会导致过细的离散化,从而导致哈希表中 bin 的歧义。过大的值会导致特征向量没有区分度,不同的点对特征会被分配到同一个 bin。此参数默认为 RelativeSamplingStep 的值。对于噪声场景,可以增加该值以提高匹配对噪声点的鲁棒性。 |
[in] | numAngles | 将点对方向的离散化设置为角度细分的数量。该值相当于方向的 RelativeDistanceStep。增加该值会提高匹配的精度,但会降低对不正确法线方向的鲁棒性。减小该值会降低匹配的精度,但会提高对不正确法线方向的鲁棒性。对于法线方向无法准确计算的非常嘈杂的场景,可以将该值设置为 25 或 20。 |
◆ ~PPF3DDetector()
virtual cv::ppf_match_3d::PPF3DDetector::~PPF3DDetector |
( |
| ) |
|
|
virtual |
◆ clearTrainingModels()
void cv::ppf_match_3d::PPF3DDetector::clearTrainingModels |
( |
| ) |
|
|
protected |
◆ match()
void cv::ppf_match_3d::PPF3DDetector::match |
( |
const Mat & |
scene, |
|
|
std::vector< Pose3DPtr > & |
results, |
|
|
const double |
relativeSceneSampleStep = 1.0/5.0 , |
|
|
const double |
relativeSceneDistance = 0.03 |
|
) |
| |
Python |
---|
| cv.ppf_match_3d.PPF3DDetector.match( | scene[, relativeSceneSampleStep[, relativeSceneDistance]] | ) -> | results |
在提供的场景中匹配训练好的模型。
- 参数
-
[in] | scene | 场景的点云 |
[out] | results | 输出姿态列表 |
[in] | relativeSceneSampleStep | 相对于模型直径使用用于匹配的场景点的比例,这些点是使用 relativeSceneDistance 进行采样的。例如,如果此值设置为 1.0/5.0,则来自场景的每 5 个点中就有 1 个用于姿态估计。此参数允许在匹配的速度和精度之间轻松权衡。增加该值会导致使用的点更少,进而导致姿态计算速度更快,但精度更低。减小该值的效果相反。 |
[in] | relativeSceneDistance | 设置相对于模型直径的距离阈值。此参数等效于训练阶段的 relativeSamplingStep。此参数充当使用 relativeSceneSampleStep 参数进行先验采样的作用。 |
◆ read()
void cv::ppf_match_3d::PPF3DDetector::read |
( |
const FileNode & |
fn | ) |
|
◆ setSearchParams()
void cv::ppf_match_3d::PPF3DDetector::setSearchParams |
( |
const double |
positionThreshold = -1 , |
|
|
const double |
rotationThreshold = -1 , |
|
|
const bool |
useWeightedClustering = false |
|
) |
| |
设置搜索参数
- 参数
-
[in] | positionThreshold | 控制平移相似度的位置阈值。取决于校准/模型的单位。 |
[in] | rotationThreshold | 控制旋转相似度的位置阈值。此参数可以被认为是角度差的阈值 |
[in] | useWeightedClustering | 该算法默认情况下对姿态进行聚类,而不加权。非零值表示姿态聚类应考虑投票数量作为权重,并执行加权平均而不是简单平均。 |
◆ trainModel()
void cv::ppf_match_3d::PPF3DDetector::trainModel |
( |
const Mat & |
Model | ) |
|
Python |
---|
| cv.ppf_match_3d.PPF3DDetector.trainModel( | Model | ) -> | None |
训练一个新的模型。
- 参数
-
使用构造函数中设置的参数对点云进行降采样并学习新的模型。当学习完模型后,实例就可以调用“match”方法。
◆ write()
void cv::ppf_match_3d::PPF3DDetector::write |
( |
FileStorage & |
fs | ) |
const |
◆ angle_step
double cv::ppf_match_3d::PPF3DDetector::angle_step |
|
protected |
◆ angle_step_radians
double cv::ppf_match_3d::PPF3DDetector::angle_step_radians |
|
protected |
◆ angle_step_relative
double cv::ppf_match_3d::PPF3DDetector::angle_step_relative |
|
protected |
◆ distance_step
double cv::ppf_match_3d::PPF3DDetector::distance_step |
|
protected |
◆ distance_step_relative
double cv::ppf_match_3d::PPF3DDetector::distance_step_relative |
|
protected |
◆ hash_nodes
THash* cv::ppf_match_3d::PPF3DDetector::hash_nodes |
|
protected |
◆ hash_table
◆ num_ref_points
int cv::ppf_match_3d::PPF3DDetector::num_ref_points |
|
protected |
◆ position_threshold
double cv::ppf_match_3d::PPF3DDetector::position_threshold |
|
protected |
◆ ppf
Mat cv::ppf_match_3d::PPF3DDetector::ppf |
|
protected |
◆ rotation_threshold
double cv::ppf_match_3d::PPF3DDetector::rotation_threshold |
|
protected |
◆ sampled_pc
Mat cv::ppf_match_3d::PPF3DDetector::sampled_pc |
|
protected |
◆ sampling_step_relative
double cv::ppf_match_3d::PPF3DDetector::sampling_step_relative |
|
protected |
◆ scene_sample_step
int cv::ppf_match_3d::PPF3DDetector::scene_sample_step |
|
protected |
◆ use_weighted_avg
bool cv::ppf_match_3d::PPF3DDetector::use_weighted_avg |
|
protected |
此类的文档从以下文件生成