该类允许加载和匹配 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模型的类。典型用法
cout << "Poses: " << endl;
detector.match(pcTest, results, 1.0/5.0,0.05);
允许加载和匹配3D模型的类。典型用法
定义 ppf_match_3d.hpp:98
匹配过程以姿态的获得而结束。然而,由于多个匹配点、错误假设、姿态平均等因素,这样的姿态非常容易受到噪声影响,并且很多时候远非完美。尽管在该阶段获得的视觉结果令人满意,但定量评估显示存在约 \(10\) 度的变化(误差),这是一个可接受的匹配水平。很多时候,要求可能会远远超出这个范围,因此需要对计算出的姿态进行细化。
◆ PPF3DDetector() [1/2]
| cv::ppf_match_3d::PPF3DDetector::PPF3DDetector |
( |
| ) |
|
| Python |
|---|
| cv.ppf_match_3d.PPF3DDetector( | | ) -> | <ppf_match_3d_PPF3DDetector object> |
| cv.ppf_match_3d.PPF3DDetector( | relativeSamplingStep[, relativeDistanceStep[, numAngles]] | ) -> | <ppf_match_3d_PPF3DDetector object> |
◆ 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 object> |
| cv.ppf_match_3d.PPF3DDetector( | relativeSamplingStep[, relativeDistanceStep[, numAngles]] | ) -> | <ppf_match_3d_PPF3DDetector object> |
带参数的构造函数
- 参数
-
| [输入] | relativeSamplingStep | 相对于对象直径的采样距离。首先均匀采样模型以提高效率。减小此值会导致更密集的模型和更准确的姿势估计,但模型越大,训练速度越慢。增加该值会导致姿势计算不太准确,但模型更小,模型生成和匹配速度更快。使用小值时请注意内存消耗。 |
| [输入] | relativeDistanceStep | 点对距离相对于模型直径的离散距离。该值对哈希表有直接影响。使用小值会导致过于精细的离散化,从而导致哈希表 bin 中的歧义。太大的值会导致特征向量没有区分度,并且不同的点对特征将被分配到同一个 bin 中。此参数默认为 RelativeSamplingStep 的值。对于嘈杂的场景,可以增加该值以提高匹配对嘈杂点的鲁棒性。 |
| [输入] | numAngles | 将点对方向的离散化设置为角度的细分数量。该值相当于方向的 RelativeDistanceStep。增加该值会提高匹配的精度,但会降低对不正确法线方向的鲁棒性。减小该值会降低匹配的精度,但会提高对不正确法线方向的鲁棒性。对于法线方向无法准确计算的非常嘈杂的场景,该值可以设置为 25 或 20。 |
◆ ~PPF3DDetector()
| virtual cv::ppf_match_3d::PPF3DDetector::~PPF3DDetector |
( |
| ) |
|
|
virtual |
◆ clearTrainingModels()
| void cv::ppf_match_3d::PPF3DDetector::clearTrainingModels |
( |
| ) |
|
|
保护 |
◆ match()
| void cv::ppf_match_3d::PPF3DDetector::match |
( |
const Mat & | scene, |
|
|
std::vector< Pose3DPtr > & | 结果, |
|
|
const double | relativeSceneSampleStep = 1.0/5.0, |
|
|
const double | relativeSceneDistance = 0.03 ) |
| Python |
|---|
| cv.ppf_match_3d.PPF3DDetector.match( | scene[, relativeSceneSampleStep[, relativeSceneDistance]] | ) -> | 结果 |
在提供的场景中匹配训练好的模型。
- 参数
-
| [输入] | scene | 场景的点云 |
| [输出] | 结果 | 输出姿势列表 |
| [输入] | relativeSceneSampleStep | 在以 relativeSceneDistance 采样后用于匹配的场景点数的比率。例如,如果此值设置为 1.0/5.0,则场景中每 5 个点用于姿势估计。此参数允许在匹配的速度和精度之间轻松权衡。增加该值会导致使用较少的点,从而导致姿势计算更快但不太准确。减小该值具有相反的效果。 |
| [输入] | 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 ) |
设置搜索参数
- 参数
-
| [输入] | positionThreshold | 控制平移相似性的位置阈值。取决于校准/模型的单位。 |
| [输入] | rotationThreshold | 控制旋转相似性的位置阈值。此参数可以被视为角度差的阈值 |
| [输入] | useWeightedClustering | 该算法默认情况下对姿势进行聚类而不进行加权。非零值表示姿势聚类应将票数作为权重,并执行加权平均而不是简单平均。 |
◆ trainModel()
| void cv::ppf_match_3d::PPF3DDetector::trainModel |
( |
const Mat & | Model (模型) | ) |
|
| Python |
|---|
| cv.ppf_match_3d.PPF3DDetector.trainModel( | Model (模型) | ) -> | 无 |
训练新模型。
- 参数
-
| [输入] | Model (模型) | 具有法线的输入点云 (Nx6) |
使用构造函数中设置的参数来降采样并学习新模型。当模型被学习后,实例就可以调用 "match" 了。
◆ write()
| void cv::ppf_match_3d::PPF3DDetector::write |
( |
FileStorage & | fs | ) |
const |
◆ angle_step
| double cv::ppf_match_3d::PPF3DDetector::angle_step |
|
保护 |
◆ angle_step_radians
| double cv::ppf_match_3d::PPF3DDetector::angle_step_radians |
|
保护 |
◆ angle_step_relative
| double cv::ppf_match_3d::PPF3DDetector::angle_step_relative |
|
保护 |
◆ distance_step
| double cv::ppf_match_3d::PPF3DDetector::distance_step |
|
保护 |
◆ distance_step_relative
| double cv::ppf_match_3d::PPF3DDetector::distance_step_relative |
|
保护 |
◆ hash_nodes
| THash* cv::ppf_match_3d::PPF3DDetector::hash_nodes |
|
保护 |
◆ hash_table
◆ num_ref_points
| int cv::ppf_match_3d::PPF3DDetector::num_ref_points |
|
保护 |
◆ position_threshold
| double cv::ppf_match_3d::PPF3DDetector::position_threshold |
|
保护 |
◆ ppf
| Mat cv::ppf_match_3d::PPF3DDetector::ppf |
|
保护 |
◆ rotation_threshold
| double cv::ppf_match_3d::PPF3DDetector::rotation_threshold |
|
保护 |
◆ sampled_pc
| Mat cv::ppf_match_3d::PPF3DDetector::sampled_pc |
|
保护 |
◆ sampling_step_relative
| double cv::ppf_match_3d::PPF3DDetector::sampling_step_relative |
|
保护 |
◆ scene_sample_step
| int cv::ppf_match_3d::PPF3DDetector::scene_sample_step |
|
保护 |
◆ use_weighted_avg
| bool cv::ppf_match_3d::PPF3DDetector::use_weighted_avg |
|
保护 |
此类文档由以下文件生成