Struct opencv::surface_matching::PPF3DDetector
source · pub struct PPF3DDetector { /* private fields */ }
Expand 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);
Implementations§
source§impl PPF3DDetector
impl PPF3DDetector
sourcepub fn default() -> Result<PPF3DDetector>
pub fn default() -> Result<PPF3DDetector>
\brief Empty constructor. Sets default arguments
sourcepub fn new(
relative_sampling_step: f64,
relative_distance_step: f64,
num_angles: f64
) -> Result<PPF3DDetector>
pub fn new( relative_sampling_step: f64, relative_distance_step: f64, num_angles: f64 ) -> Result<PPF3DDetector>
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.
§C++ default parameters
- relative_distance_step: 0.05
- num_angles: 30
sourcepub fn new_def(relative_sampling_step: f64) -> Result<PPF3DDetector>
pub fn new_def(relative_sampling_step: f64) -> Result<PPF3DDetector>
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.
§Note
This alternative version of [new] function uses the following default values for its arguments:
- relative_distance_step: 0.05
- num_angles: 30
Trait Implementations§
source§impl Boxed for PPF3DDetector
impl Boxed for PPF3DDetector
source§unsafe fn from_raw(
ptr: <PPF3DDetector as OpenCVFromExtern>::ExternReceive
) -> Self
unsafe fn from_raw( ptr: <PPF3DDetector as OpenCVFromExtern>::ExternReceive ) -> Self
Wrap the specified raw pointer Read more
source§fn into_raw(self) -> <PPF3DDetector as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <PPF3DDetector as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying raw pointer while consuming this wrapper. Read more
source§fn as_raw(&self) -> <PPF3DDetector as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <PPF3DDetector as OpenCVTypeExternContainer>::ExternSend
Return the underlying raw pointer. Read more
source§fn as_raw_mut(
&mut self
) -> <PPF3DDetector as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <PPF3DDetector as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying mutable raw pointer Read more
source§impl Debug for PPF3DDetector
impl Debug for PPF3DDetector
source§impl Drop for PPF3DDetector
impl Drop for PPF3DDetector
source§impl PPF3DDetectorTrait for PPF3DDetector
impl PPF3DDetectorTrait for PPF3DDetector
fn as_raw_mut_PPF3DDetector(&mut self) -> *mut c_void
source§fn set_search_params(
&mut self,
position_threshold: f64,
rotation_threshold: f64,
use_weighted_clustering: bool
) -> Result<()>
fn set_search_params( &mut self, position_threshold: f64, rotation_threshold: f64, use_weighted_clustering: bool ) -> Result<()>
Set the parameters for the search Read more
source§fn train_model(&mut self, model: &impl MatTraitConst) -> Result<()>
fn train_model(&mut self, model: &impl MatTraitConst) -> Result<()>
\brief Trains a new model. Read more
source§fn match_(
&mut self,
scene: &impl MatTraitConst,
results: &mut Vector<Pose3DPtr>,
relative_scene_sample_step: f64,
relative_scene_distance: f64
) -> Result<()>
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. Read more
source§fn match__def(
&mut self,
scene: &impl MatTraitConst,
results: &mut Vector<Pose3DPtr>
) -> Result<()>
fn match__def( &mut self, scene: &impl MatTraitConst, results: &mut Vector<Pose3DPtr> ) -> Result<()>
\brief Matches a trained model across a provided scene. Read more
source§impl PPF3DDetectorTraitConst for PPF3DDetector
impl PPF3DDetectorTraitConst for PPF3DDetector
fn as_raw_PPF3DDetector(&self) -> *const c_void
impl Send for PPF3DDetector
Auto Trait Implementations§
impl Freeze for PPF3DDetector
impl RefUnwindSafe for PPF3DDetector
impl !Sync for PPF3DDetector
impl Unpin for PPF3DDetector
impl UnwindSafe for PPF3DDetector
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Helper function to call OpenCV functions that allow in-place modification of a
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more