Trait OdometryTraitConst

Source
pub trait OdometryTraitConst: AlgorithmTraitConst {
    // Required method
    fn as_raw_Odometry(&self) -> *const c_void;

    // Provided methods
    fn compute(
        &self,
        src_image: &impl MatTraitConst,
        src_depth: &impl MatTraitConst,
        src_mask: &impl MatTraitConst,
        dst_image: &impl MatTraitConst,
        dst_depth: &impl MatTraitConst,
        dst_mask: &impl MatTraitConst,
        rt: &mut impl ToOutputArray,
        init_rt: &impl MatTraitConst,
    ) -> Result<bool> { ... }
    fn compute_def(
        &self,
        src_image: &impl MatTraitConst,
        src_depth: &impl MatTraitConst,
        src_mask: &impl MatTraitConst,
        dst_image: &impl MatTraitConst,
        dst_depth: &impl MatTraitConst,
        dst_mask: &impl MatTraitConst,
        rt: &mut impl ToOutputArray,
    ) -> Result<bool> { ... }
    fn compute2(
        &self,
        src_frame: &mut Ptr<OdometryFrame>,
        dst_frame: &mut Ptr<OdometryFrame>,
        rt: &mut impl ToOutputArray,
        init_rt: &impl MatTraitConst,
    ) -> Result<bool> { ... }
    fn compute2_def(
        &self,
        src_frame: &mut Ptr<OdometryFrame>,
        dst_frame: &mut Ptr<OdometryFrame>,
        rt: &mut impl ToOutputArray,
    ) -> Result<bool> { ... }
    fn prepare_frame_cache(
        &self,
        frame: &mut Ptr<OdometryFrame>,
        cache_type: i32,
    ) -> Result<Size> { ... }
    fn get_camera_matrix(&self) -> Result<Mat> { ... }
    fn get_transform_type(&self) -> Result<i32> { ... }
}
Expand description

Constant methods for crate::rgbd::Odometry

Required Methods§

Provided Methods§

Source

fn compute( &self, src_image: &impl MatTraitConst, src_depth: &impl MatTraitConst, src_mask: &impl MatTraitConst, dst_image: &impl MatTraitConst, dst_depth: &impl MatTraitConst, dst_mask: &impl MatTraitConst, rt: &mut impl ToOutputArray, init_rt: &impl MatTraitConst, ) -> Result<bool>

Method to compute a transformation from the source frame to the destination one. Some odometry algorithms do not used some data of frames (eg. ICP does not use images). In such case corresponding arguments can be set as empty Mat. The method returns true if all internal computations were possible (e.g. there were enough correspondences, system of equations has a solution, etc) and resulting transformation satisfies some test if it’s provided by the Odometry inheritor implementation (e.g. thresholds for maximum translation and rotation).

§Parameters
  • srcImage: Image data of the source frame (CV_8UC1)
  • srcDepth: Depth data of the source frame (CV_32FC1, in meters)
  • srcMask: Mask that sets which pixels have to be used from the source frame (CV_8UC1)
  • dstImage: Image data of the destination frame (CV_8UC1)
  • dstDepth: Depth data of the destination frame (CV_32FC1, in meters)
  • dstMask: Mask that sets which pixels have to be used from the destination frame (CV_8UC1)
  • Rt: Resulting transformation from the source frame to the destination one (rigid body motion): dst_p = Rt * src_p, where dst_p is a homogeneous point in the destination frame and src_p is homogeneous point in the source frame, Rt is 4x4 matrix of CV_64FC1 type.
  • initRt: Initial transformation from the source frame to the destination one (optional)
§C++ default parameters
  • init_rt: Mat()
Source

fn compute_def( &self, src_image: &impl MatTraitConst, src_depth: &impl MatTraitConst, src_mask: &impl MatTraitConst, dst_image: &impl MatTraitConst, dst_depth: &impl MatTraitConst, dst_mask: &impl MatTraitConst, rt: &mut impl ToOutputArray, ) -> Result<bool>

Method to compute a transformation from the source frame to the destination one. Some odometry algorithms do not used some data of frames (eg. ICP does not use images). In such case corresponding arguments can be set as empty Mat. The method returns true if all internal computations were possible (e.g. there were enough correspondences, system of equations has a solution, etc) and resulting transformation satisfies some test if it’s provided by the Odometry inheritor implementation (e.g. thresholds for maximum translation and rotation).

§Parameters
  • srcImage: Image data of the source frame (CV_8UC1)
  • srcDepth: Depth data of the source frame (CV_32FC1, in meters)
  • srcMask: Mask that sets which pixels have to be used from the source frame (CV_8UC1)
  • dstImage: Image data of the destination frame (CV_8UC1)
  • dstDepth: Depth data of the destination frame (CV_32FC1, in meters)
  • dstMask: Mask that sets which pixels have to be used from the destination frame (CV_8UC1)
  • Rt: Resulting transformation from the source frame to the destination one (rigid body motion): dst_p = Rt * src_p, where dst_p is a homogeneous point in the destination frame and src_p is homogeneous point in the source frame, Rt is 4x4 matrix of CV_64FC1 type.
  • initRt: Initial transformation from the source frame to the destination one (optional)
§Note

This alternative version of OdometryTraitConst::compute function uses the following default values for its arguments:

  • init_rt: Mat()
Source

fn compute2( &self, src_frame: &mut Ptr<OdometryFrame>, dst_frame: &mut Ptr<OdometryFrame>, rt: &mut impl ToOutputArray, init_rt: &impl MatTraitConst, ) -> Result<bool>

One more method to compute a transformation from the source frame to the destination one. It is designed to save on computing the frame data (image pyramids, normals, etc.).

§C++ default parameters
  • init_rt: Mat()
Source

fn compute2_def( &self, src_frame: &mut Ptr<OdometryFrame>, dst_frame: &mut Ptr<OdometryFrame>, rt: &mut impl ToOutputArray, ) -> Result<bool>

One more method to compute a transformation from the source frame to the destination one. It is designed to save on computing the frame data (image pyramids, normals, etc.).

§Note

This alternative version of OdometryTraitConst::compute2 function uses the following default values for its arguments:

  • init_rt: Mat()
Source

fn prepare_frame_cache( &self, frame: &mut Ptr<OdometryFrame>, cache_type: i32, ) -> Result<Size>

Prepare a cache for the frame. The function checks the precomputed/passed data (throws the error if this data does not satisfy) and computes all remaining cache data needed for the frame. Returned size is a resolution of the prepared frame.

§Parameters
  • frame: The odometry which will process the frame.
  • cacheType: The cache type: CACHE_SRC, CACHE_DST or CACHE_ALL.
Source

fn get_camera_matrix(&self) -> Result<Mat>

§See also

setCameraMatrix

Source

fn get_transform_type(&self) -> Result<i32>

§See also

setTransformType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§