[][src]Trait opencv::shape::ShapeContextDistanceExtractor

pub trait ShapeContextDistanceExtractor: ShapeDistanceExtractor {
    fn as_raw_ShapeContextDistanceExtractor(&self) -> *mut c_void;

    fn set_angular_bins(&mut self, n_angular_bins: i32) -> Result<()> { ... }
fn get_angular_bins(&self) -> Result<i32> { ... }
fn set_radial_bins(&mut self, n_radial_bins: i32) -> Result<()> { ... }
fn get_radial_bins(&self) -> Result<i32> { ... }
fn set_inner_radius(&mut self, inner_radius: f32) -> Result<()> { ... }
fn get_inner_radius(&self) -> Result<f32> { ... }
fn set_outer_radius(&mut self, outer_radius: f32) -> Result<()> { ... }
fn get_outer_radius(&self) -> Result<f32> { ... }
fn set_rotation_invariant(&mut self, rotation_invariant: bool) -> Result<()> { ... }
fn get_rotation_invariant(&self) -> Result<bool> { ... }
fn set_shape_context_weight(
        &mut self,
        shape_context_weight: f32
    ) -> Result<()> { ... }
fn get_shape_context_weight(&self) -> Result<f32> { ... }
fn set_image_appearance_weight(
        &mut self,
        image_appearance_weight: f32
    ) -> Result<()> { ... }
fn get_image_appearance_weight(&self) -> Result<f32> { ... }
fn set_bending_energy_weight(
        &mut self,
        bending_energy_weight: f32
    ) -> Result<()> { ... }
fn get_bending_energy_weight(&self) -> Result<f32> { ... }
fn set_images(
        &mut self,
        image1: &dyn ToInputArray,
        image2: &dyn ToInputArray
    ) -> Result<()> { ... }
fn get_images(
        &self,
        image1: &mut dyn ToOutputArray,
        image2: &mut dyn ToOutputArray
    ) -> Result<()> { ... }
fn set_iterations(&mut self, iterations: i32) -> Result<()> { ... }
fn get_iterations(&self) -> Result<i32> { ... }
fn set_cost_extractor(
        &mut self,
        comparer: &PtrOfHistogramCostExtractor
    ) -> Result<()> { ... }
fn get_cost_extractor(&self) -> Result<PtrOfHistogramCostExtractor> { ... }
fn set_std_dev(&mut self, sigma: f32) -> Result<()> { ... }
fn get_std_dev(&self) -> Result<f32> { ... } }

Implementation of the Shape Context descriptor and matching algorithm

proposed by Belongie et al. in "Shape Matching and Object Recognition Using Shape Contexts" (PAMI 2002). This implementation is packaged in a generic scheme, in order to allow you the implementation of the common variations of the original pipeline.

Required methods

Loading content...

Provided methods

fn set_angular_bins(&mut self, n_angular_bins: i32) -> Result<()>

Establish the number of angular bins for the Shape Context Descriptor used in the shape matching pipeline.

Parameters

  • nAngularBins: The number of angular bins in the shape context descriptor.

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

fn set_radial_bins(&mut self, n_radial_bins: i32) -> Result<()>

Establish the number of radial bins for the Shape Context Descriptor used in the shape matching pipeline.

Parameters

  • nRadialBins: The number of radial bins in the shape context descriptor.

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

fn set_inner_radius(&mut self, inner_radius: f32) -> Result<()>

Set the inner radius of the shape context descriptor.

Parameters

  • innerRadius: The value of the inner radius.

fn get_inner_radius(&self) -> Result<f32>

fn set_outer_radius(&mut self, outer_radius: f32) -> Result<()>

Set the outer radius of the shape context descriptor.

Parameters

  • outerRadius: The value of the outer radius.

fn get_outer_radius(&self) -> Result<f32>

fn set_rotation_invariant(&mut self, rotation_invariant: bool) -> Result<()>

fn get_rotation_invariant(&self) -> Result<bool>

fn set_shape_context_weight(&mut self, shape_context_weight: f32) -> Result<()>

Set the weight of the shape context distance in the final value of the shape distance. The shape context distance between two shapes is defined as the symmetric sum of shape context matching costs over best matching points. The final value of the shape distance is a user-defined linear combination of the shape context distance, an image appearance distance, and a bending energy.

Parameters

  • shapeContextWeight: The weight of the shape context distance in the final distance value.

fn get_shape_context_weight(&self) -> Result<f32>

fn set_image_appearance_weight(
    &mut self,
    image_appearance_weight: f32
) -> Result<()>

Set the weight of the Image Appearance cost in the final value of the shape distance. The image appearance cost is defined as the sum of squared brightness differences in Gaussian windows around corresponding image points. The final value of the shape distance is a user-defined linear combination of the shape context distance, an image appearance distance, and a bending energy. If this value is set to a number different from 0, is mandatory to set the images that correspond to each shape.

Parameters

  • imageAppearanceWeight: The weight of the appearance cost in the final distance value.

fn get_image_appearance_weight(&self) -> Result<f32>

fn set_bending_energy_weight(
    &mut self,
    bending_energy_weight: f32
) -> Result<()>

Set the weight of the Bending Energy in the final value of the shape distance. The bending energy definition depends on what transformation is being used to align the shapes. The final value of the shape distance is a user-defined linear combination of the shape context distance, an image appearance distance, and a bending energy.

Parameters

  • bendingEnergyWeight: The weight of the Bending Energy in the final distance value.

fn get_bending_energy_weight(&self) -> Result<f32>

fn set_images(
    &mut self,
    image1: &dyn ToInputArray,
    image2: &dyn ToInputArray
) -> Result<()>

Set the images that correspond to each shape. This images are used in the calculation of the Image Appearance cost.

Parameters

  • image1: Image corresponding to the shape defined by contours1.
  • image2: Image corresponding to the shape defined by contours2.

fn get_images(
    &self,
    image1: &mut dyn ToOutputArray,
    image2: &mut dyn ToOutputArray
) -> Result<()>

fn set_iterations(&mut self, iterations: i32) -> Result<()>

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

fn set_cost_extractor(
    &mut self,
    comparer: &PtrOfHistogramCostExtractor
) -> Result<()>

Set the algorithm used for building the shape context descriptor cost matrix.

Parameters

  • comparer: Smart pointer to a HistogramCostExtractor, an algorithm that defines the cost matrix between descriptors.

fn get_cost_extractor(&self) -> Result<PtrOfHistogramCostExtractor>

fn set_std_dev(&mut self, sigma: f32) -> Result<()>

Set the value of the standard deviation for the Gaussian window for the image appearance cost.

Parameters

  • sigma: Standard Deviation.

fn get_std_dev(&self) -> Result<f32>

Loading content...

Implementors

Loading content...