Trait opencv::surface_matching::PPF3DDetectorTrait

source ·
pub trait PPF3DDetectorTrait: PPF3DDetectorTraitConst {
    // Required method
    fn as_raw_mut_PPF3DDetector(&mut self) -> *mut c_void;

    // Provided methods
    fn set_search_params(
        &mut self,
        position_threshold: f64,
        rotation_threshold: f64,
        use_weighted_clustering: bool
    ) -> Result<()> { ... }
    fn set_search_params_def(&mut self) -> Result<()> { ... }
    fn train_model(&mut self, model: &impl MatTraitConst) -> Result<()> { ... }
    fn match_(
        &mut self,
        scene: &impl MatTraitConst,
        results: &mut Vector<Pose3DPtr>,
        relative_scene_sample_step: f64,
        relative_scene_distance: f64
    ) -> Result<()> { ... }
    fn match__def(
        &mut self,
        scene: &impl MatTraitConst,
        results: &mut Vector<Pose3DPtr>
    ) -> Result<()> { ... }
}
Expand description

Required Methods§

Provided Methods§

source

fn set_search_params( &mut self, position_threshold: f64, rotation_threshold: f64, use_weighted_clustering: bool ) -> Result<()>

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.
§C++ default parameters
  • position_threshold: -1
  • rotation_threshold: -1
  • use_weighted_clustering: false
source

fn set_search_params_def(&mut self) -> Result<()>

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.
§Note

This alternative version of PPF3DDetectorTrait::set_search_params function uses the following default values for its arguments:

  • position_threshold: -1
  • rotation_threshold: -1
  • use_weighted_clustering: false
source

fn train_model(&mut self, model: &impl MatTraitConst) -> Result<()>

\brief Trains a new model.

§Parameters
  • Model: The input point cloud with normals (Nx6)

\details 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”.

source

fn match_( &mut self, scene: &impl MatTraitConst, results: &mut Vector<Pose3DPtr>, relative_scene_sample_step: f64, relative_scene_distance: f64 ) -> Result<()>

\brief Matches a trained model across a provided scene.

§Parameters
  • scene: Point cloud for the scene
  • results:[out] 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.
§C++ default parameters
  • relative_scene_sample_step: 1.0/5.0
  • relative_scene_distance: 0.03
source

fn match__def( &mut self, scene: &impl MatTraitConst, results: &mut Vector<Pose3DPtr> ) -> Result<()>

\brief Matches a trained model across a provided scene.

§Parameters
  • scene: Point cloud for the scene
  • results:[out] 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.
§Note

This alternative version of PPF3DDetectorTrait::match_ function uses the following default values for its arguments:

  • relative_scene_sample_step: 1.0/5.0
  • relative_scene_distance: 0.03

Object Safety§

This trait is not object safe.

Implementors§