Class cv::ppf_match_3d::PPF3DDetector#

Class, allowing the load and matching 3D models. Typical Use: View details

Collaboration diagram for cv::ppf_match_3d::PPF3DDetector:

cv::ppf_match_3d::PPF3DDetector Node1 cv::ppf_match_3d::PPF3DDetector   + PPF3DDetector() + PPF3DDetector() + ~PPF3DDetector() + match() + read() + setSearchParams() + trainModel() + write() # clearTrainingModels() Node2 double     Node2->Node1 #angle_step #angle_step_radians #angle_step_relative #distance_step #distance_step_relative #position_threshold #rotation_threshold #sampling_step_relative Node3 cv::Mat   + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() and 152 more... + diag() + eye() + eye() + getDefaultAllocator() + getStdAllocator() + ones() + ones() + ones() + ones() + setDefaultAllocator() + zeros() + zeros() + zeros() + zeros() # forEach_impl() Node3->Node1 #ppf #sampled_pc Node4 int     Node4->Node1 #num_ref_points #scene_sample_step Node4->Node3 +cols +dims +dummy +flags +rows Node15 THash     Node4->Node15 +i +id +ppfInd Node5 uint8_t     Node5->Node3 +data +dataend +datalimit +datastart Node6 cv::MatAllocator   + MatAllocator() + ~MatAllocator() + allocate() + allocate() + copy() + deallocate() + download() + getBufferPoolController() + map() + unmap() + upload() Node6->Node3 +allocator Node7 UMatData *     Node7->Node3 +u Node8 MatSize     Node8->Node3 +size Node9 MatStep     Node9->Node3 +step Node10 hashtable_int     Node10->Node1 #hash_table Node11 size_t     Node11->Node10 +hashfunc +size Node12 hashnode_i     Node12->Node10 +nodes Node12->Node12 +next Node13 KeyType     Node13->Node12 +key Node14 void *     Node14->Node12 +data Node15->Node1 #hash_nodes Node16 bool     Node16->Node1 #use_weighted_avg

cv::ppf_match_3d::PPF3DDetector Node1 cv::ppf_match_3d::PPF3DDetector   + PPF3DDetector() + PPF3DDetector() + ~PPF3DDetector() + match() + read() + setSearchParams() + trainModel() + write() # clearTrainingModels() Node2 double     Node2->Node1 #angle_step #angle_step_radians #angle_step_relative #distance_step #distance_step_relative #position_threshold #rotation_threshold #sampling_step_relative Node3 cv::Mat   + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() and 152 more... + diag() + eye() + eye() + getDefaultAllocator() + getStdAllocator() + ones() + ones() + ones() + ones() + setDefaultAllocator() + zeros() + zeros() + zeros() + zeros() # forEach_impl() Node3->Node1 #ppf #sampled_pc Node4 int     Node4->Node1 #num_ref_points #scene_sample_step Node4->Node3 +cols +dims +dummy +flags +rows Node15 THash     Node4->Node15 +i +id +ppfInd Node5 uint8_t     Node5->Node3 +data +dataend +datalimit +datastart Node6 cv::MatAllocator   + MatAllocator() + ~MatAllocator() + allocate() + allocate() + copy() + deallocate() + download() + getBufferPoolController() + map() + unmap() + upload() Node6->Node3 +allocator Node7 UMatData *     Node7->Node3 +u Node8 MatSize     Node8->Node3 +size Node9 MatStep     Node9->Node3 +step Node10 hashtable_int     Node10->Node1 #hash_table Node11 size_t     Node11->Node10 +hashfunc +size Node12 hashnode_i     Node12->Node10 +nodes Node12->Node12 +next Node13 KeyType     Node13->Node12 +key Node14 void *     Node14->Node12 +data Node15->Node1 #hash_nodes Node16 bool     Node16->Node1 #use_weighted_avg

Detailed Description#

Class, allowing the load and matching 3D models. Typical Use:

// Train a model
ppf_match_3d::PPF3DDetector detector(0.05, 0.05);
detector.trainModel(pc);
// Search the model in a given scene
vector<Pose3DPtr> results;
detector.match(pcTest, results, 1.0/5.0,0.05);

Constructor & Destructor Documentation#

PPF3DDetector()#

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>

Empty constructor. Sets default arguments.

PPF3DDetector()#

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>

Constructor with arguments

Parameters

  • relativeSamplingStep — Sampling distance relative to the object’s diameter. Models are first sampled uniformly in order to improve efficiency. Decreasing this value leads to a denser model, and a more accurate pose estimation but the larger the model, the slower the training. Increasing the value leads to a less accurate pose computation but a smaller model and faster model generation and matching. Beware of the memory consumption when using small values.

  • relativeDistanceStep — The discretization distance of the point pair distance relative to the model’s diameter. This value has a direct impact on the hashtable. Using small values would lead to too fine discretization, and thus ambiguity in the bins of hashtable. Too large values would lead to no discrimination over the feature vectors and different point pair features would be assigned to the same bin. This argument defaults to the value of RelativeSamplingStep. For noisy scenes, the value can be increased to improve the robustness of the matching against noisy points.

  • numAngles — Set the discretization of the point pair orientation as the number of subdivisions of the angle. This value is the equivalent of RelativeDistanceStep for the orientations. Increasing the value increases the precision of the matching but decreases the robustness against incorrect normal directions. Decreasing the value decreases the precision of the matching but increases the robustness against incorrect normal directions. For very noisy scenes where the normal directions can not be computed accurately, the value can be set to 25 or 20.

~PPF3DDetector()#

cv::ppf_match_3d::PPF3DDetector::~PPF3DDetector()

Member Function Documentation#

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

Matches a trained model across a provided scene.

Parameters

  • scene — Point cloud for the scene

  • results — List of output poses

  • relativeSceneSampleStep — The ratio of scene points to be used for the matching after sampling with relativeSceneDistance. For example, if this value is set to 1.0/5.0, every 5th point from the scene is used for pose estimation. This parameter allows an easy trade-off between speed and accuracy of the matching. Increasing the value leads to less points being used and in turn to a faster but less accurate pose computation. Decreasing the value has the inverse effect.

  • relativeSceneDistance — Set the distance threshold relative to the diameter of the model. This parameter is equivalent to relativeSamplingStep in the training stage. This parameter acts like a prior sampling with the relativeSceneSampleStep parameter.

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 )

Set the parameters for the search

Parameters

  • positionThreshold — Position threshold controlling the similarity of translations. Depends on the units of calibration/model.

  • rotationThreshold — Position threshold controlling the similarity of rotations. This parameter can be perceived as a threshold over the difference of angles

  • useWeightedClustering — The algorithm by default clusters the poses without weighting. A non-zero value would indicate that the pose clustering should take into account the number of votes as the weights and perform a weighted averaging instead of a simple one.

trainModel()#

void cv::ppf_match_3d::PPF3DDetector::trainModel(const Mat & Model)

Python:

cv.ppf_match_3d.PPF3DDetector.trainModel(Model)

Trains a new model.

Uses the parameters set in the constructor to downsample and learn a new model. When the model is learnt, the instance gets ready for calling “match”.

Parameters

  • Model — The input point cloud with normals (Nx6)

write()#

void cv::ppf_match_3d::PPF3DDetector::write(FileStorage & fs)

clearTrainingModels()#

void cv::ppf_match_3d::PPF3DDetector::clearTrainingModels()

clusterPoses()#

void cv::ppf_match_3d::PPF3DDetector::clusterPoses(
std::vector< Pose3DPtr > & poseList,
int numPoses,
std::vector< Pose3DPtr > & finalPoses )

computePPFFeatures()#

void cv::ppf_match_3d::PPF3DDetector::computePPFFeatures(
const Vec3d & p1,
const Vec3d & n1,
const Vec3d & p2,
const Vec3d & n2,
Vec4d & f )

matchPose()#

bool cv::ppf_match_3d::PPF3DDetector::matchPose(
const Pose3D & sourcePose,
const Pose3D & targetPose )

Member Data Documentation#

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#

hashtable_int * cv::ppf_match_3d::PPF3DDetector::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

trained#

bool cv::ppf_match_3d::PPF3DDetector::trained

Source file#

The documentation for this class was generated from the following file: