pub trait ShapeContextDistanceExtractorTrait: ShapeContextDistanceExtractorTraitConst + ShapeDistanceExtractorTrait {
Show 14 methods
// Required method
fn as_raw_mut_ShapeContextDistanceExtractor(&mut self) -> *mut c_void;
// Provided methods
fn set_angular_bins(&mut self, n_angular_bins: i32) -> Result<()> { ... }
fn set_radial_bins(&mut self, n_radial_bins: i32) -> Result<()> { ... }
fn set_inner_radius(&mut self, inner_radius: f32) -> Result<()> { ... }
fn set_outer_radius(&mut self, outer_radius: f32) -> Result<()> { ... }
fn set_rotation_invariant(&mut self, rotation_invariant: bool) -> Result<()> { ... }
fn set_shape_context_weight(
&mut self,
shape_context_weight: f32
) -> Result<()> { ... }
fn set_image_appearance_weight(
&mut self,
image_appearance_weight: f32
) -> Result<()> { ... }
fn set_bending_energy_weight(
&mut self,
bending_energy_weight: f32
) -> Result<()> { ... }
fn set_images(
&mut self,
image1: &impl ToInputArray,
image2: &impl ToInputArray
) -> Result<()> { ... }
fn set_iterations(&mut self, iterations: i32) -> Result<()> { ... }
fn set_cost_extractor(
&mut self,
comparer: Ptr<HistogramCostExtractor>
) -> Result<()> { ... }
fn set_std_dev(&mut self, sigma: f32) -> Result<()> { ... }
fn set_transform_algorithm(
&mut self,
transformer: Ptr<ShapeTransformer>
) -> Result<()> { ... }
}
Expand description
Mutable methods for crate::shape::ShapeContextDistanceExtractor
Required Methods§
fn as_raw_mut_ShapeContextDistanceExtractor(&mut self) -> *mut c_void
Provided Methods§
sourcefn set_angular_bins(&mut self, n_angular_bins: i32) -> Result<()>
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.
sourcefn set_radial_bins(&mut self, n_radial_bins: i32) -> Result<()>
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.
sourcefn set_inner_radius(&mut self, inner_radius: f32) -> Result<()>
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.
sourcefn set_outer_radius(&mut self, outer_radius: f32) -> Result<()>
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 set_rotation_invariant(&mut self, rotation_invariant: bool) -> Result<()>
sourcefn set_shape_context_weight(&mut self, shape_context_weight: f32) -> Result<()>
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.
sourcefn set_image_appearance_weight(
&mut self,
image_appearance_weight: f32
) -> Result<()>
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.
sourcefn set_bending_energy_weight(
&mut self,
bending_energy_weight: f32
) -> Result<()>
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.
sourcefn set_images(
&mut self,
image1: &impl ToInputArray,
image2: &impl ToInputArray
) -> Result<()>
fn set_images( &mut self, image1: &impl ToInputArray, image2: &impl 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 set_iterations(&mut self, iterations: i32) -> Result<()>
sourcefn set_cost_extractor(
&mut self,
comparer: Ptr<HistogramCostExtractor>
) -> Result<()>
fn set_cost_extractor( &mut self, comparer: Ptr<HistogramCostExtractor> ) -> 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.
sourcefn set_std_dev(&mut self, sigma: f32) -> Result<()>
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.
sourcefn set_transform_algorithm(
&mut self,
transformer: Ptr<ShapeTransformer>
) -> Result<()>
fn set_transform_algorithm( &mut self, transformer: Ptr<ShapeTransformer> ) -> Result<()>
Set the algorithm used for aligning the shapes.
§Parameters
- transformer: Smart pointer to a ShapeTransformer, an algorithm that defines the aligning transformation.