Trait ContourFittingTrait

Source
pub trait ContourFittingTrait: AlgorithmTrait + ContourFittingTraitConst {
    // Required method
    fn as_raw_mut_ContourFitting(&mut self) -> *mut c_void;

    // Provided methods
    fn estimate_transformation(
        &mut self,
        src: &impl ToInputArray,
        dst: &impl ToInputArray,
        alpha_phi_st: &mut impl ToOutputArray,
        dist: &mut f64,
        fd_contour: bool,
    ) -> Result<()> { ... }
    fn estimate_transformation_def(
        &mut self,
        src: &impl ToInputArray,
        dst: &impl ToInputArray,
        alpha_phi_st: &mut impl ToOutputArray,
    ) -> Result<()> { ... }
    fn estimate_transformation_1(
        &mut self,
        src: &impl ToInputArray,
        dst: &impl ToInputArray,
        alpha_phi_st: &mut impl ToOutputArray,
        dist: &mut f64,
        fd_contour: bool,
    ) -> Result<()> { ... }
    fn estimate_transformation_def_1(
        &mut self,
        src: &impl ToInputArray,
        dst: &impl ToInputArray,
        alpha_phi_st: &mut impl ToOutputArray,
        dist: &mut f64,
    ) -> Result<()> { ... }
    fn set_ctr_size(&mut self, n: i32) -> Result<()> { ... }
    fn set_fd_size(&mut self, n: i32) -> Result<()> { ... }
    fn get_ctr_size(&mut self) -> Result<i32> { ... }
    fn get_fd_size(&mut self) -> Result<i32> { ... }
}
Expand description

Mutable methods for crate::ximgproc::ContourFitting

Required Methods§

Provided Methods§

Source

fn estimate_transformation( &mut self, src: &impl ToInputArray, dst: &impl ToInputArray, alpha_phi_st: &mut impl ToOutputArray, dist: &mut f64, fd_contour: bool, ) -> Result<()>

Fit two closed curves using fourier descriptors. More details in PersoonFu1977 and BergerRaghunathan1998

§Parameters
  • src: Contour defining first shape.
  • dst: Contour defining second shape (Target).
  • alphaPhiST: : inline formula=alphaPhiST(0,0), inline formula=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center
  • dist: distance between src and dst after matching.
  • fdContour: false then src and dst are contours and true src and dst are fourier descriptors.
§C++ default parameters
  • dist: 0
  • fd_contour: false
Source

fn estimate_transformation_def( &mut self, src: &impl ToInputArray, dst: &impl ToInputArray, alpha_phi_st: &mut impl ToOutputArray, ) -> Result<()>

Fit two closed curves using fourier descriptors. More details in PersoonFu1977 and BergerRaghunathan1998

§Parameters
  • src: Contour defining first shape.
  • dst: Contour defining second shape (Target).
  • alphaPhiST: : inline formula=alphaPhiST(0,0), inline formula=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center
  • dist: distance between src and dst after matching.
  • fdContour: false then src and dst are contours and true src and dst are fourier descriptors.
§Note

This alternative version of ContourFittingTrait::estimate_transformation function uses the following default values for its arguments:

  • dist: 0
  • fd_contour: false
Source

fn estimate_transformation_1( &mut self, src: &impl ToInputArray, dst: &impl ToInputArray, alpha_phi_st: &mut impl ToOutputArray, dist: &mut f64, fd_contour: bool, ) -> Result<()>

Fit two closed curves using fourier descriptors. More details in PersoonFu1977 and BergerRaghunathan1998

§Parameters
  • src: Contour defining first shape.
  • dst: Contour defining second shape (Target).
  • alphaPhiST: : inline formula=alphaPhiST(0,0), inline formula=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center
  • dist: distance between src and dst after matching.
  • fdContour: false then src and dst are contours and true src and dst are fourier descriptors.
§C++ default parameters
  • fd_contour: false
Source

fn estimate_transformation_def_1( &mut self, src: &impl ToInputArray, dst: &impl ToInputArray, alpha_phi_st: &mut impl ToOutputArray, dist: &mut f64, ) -> Result<()>

Fit two closed curves using fourier descriptors. More details in PersoonFu1977 and BergerRaghunathan1998

§Parameters
  • src: Contour defining first shape.
  • dst: Contour defining second shape (Target).
  • alphaPhiST: : inline formula=alphaPhiST(0,0), inline formula=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center
  • dist: distance between src and dst after matching.
  • fdContour: false then src and dst are contours and true src and dst are fourier descriptors.
§Note

This alternative version of ContourFittingTrait::estimate_transformation function uses the following default values for its arguments:

  • fd_contour: false
Source

fn set_ctr_size(&mut self, n: i32) -> Result<()>

set number of Fourier descriptors used in estimateTransformation

§Parameters
  • n: number of Fourier descriptors equal to number of contour points after resampling.
Source

fn set_fd_size(&mut self, n: i32) -> Result<()>

set number of Fourier descriptors when estimateTransformation used vector

§Parameters
  • n: number of fourier descriptors used for optimal curve matching.
Source

fn get_ctr_size(&mut self) -> Result<i32>

§Returns

number of fourier descriptors

Source

fn get_fd_size(&mut self) -> Result<i32>

§Returns

number of fourier descriptors used for optimal curve matching

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§