ShapeContextDistanceExtractor
import { ShapeContextDistanceExtractor } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits ShapeDistanceExtractor.
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.
Constructors and members
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
setAngularBins
Establish the number of angular bins for the Shape Context Descriptor used in the shape matching pipeline.
setAngularBins(nAngularBins: number): void;nAngularBinsThe number of angular bins in the shape context descriptor.
getAngularBins
Read the angular bins.
Establish the number of angular bins for the Shape Context Descriptor used in the shape matching pipeline.
getAngularBins(): number;The number result.
setRadialBins
Establish the number of radial bins for the Shape Context Descriptor used in the shape matching pipeline.
setRadialBins(nRadialBins: number): void;nRadialBinsThe number of radial bins in the shape context descriptor.
getRadialBins
Read the radial bins.
Establish the number of radial bins for the Shape Context Descriptor used in the shape matching pipeline.
getRadialBins(): number;The number result.
setInnerRadius
Set the inner radius of the shape context descriptor.
setInnerRadius(innerRadius: number): void;innerRadiusThe value of the inner radius.
getInnerRadius
Read the inner radius.
Set the inner radius of the shape context descriptor.
getInnerRadius(): number;The number result.
setOuterRadius
Set the outer radius of the shape context descriptor.
setOuterRadius(outerRadius: number): void;outerRadiusThe value of the outer radius.
getOuterRadius
Read the outer radius.
Set the outer radius of the shape context descriptor.
getOuterRadius(): number;The number result.
setRotationInvariant
Set the rotation invariant used by this ShapeContextDistanceExtractor object.
setRotationInvariant(rotationInvariant: boolean): void;rotationInvariantrotation invariant argument (boolean).
getRotationInvariant
Return the rotation invariant configured on this ShapeContextDistanceExtractor object.
getRotationInvariant(): boolean;The boolean result.
setShapeContextWeight
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.
setShapeContextWeight(shapeContextWeight: number): void;shapeContextWeightThe weight of the shape context distance in the final distance value.
getShapeContextWeight
Read the shape context weight.
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.
getShapeContextWeight(): number;The number result.
setImageAppearanceWeight
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.
setImageAppearanceWeight(imageAppearanceWeight: number): void;imageAppearanceWeightThe weight of the appearance cost in the final distance value.
getImageAppearanceWeight
Read the image appearance weight.
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.
getImageAppearanceWeight(): number;The number result.
setBendingEnergyWeight
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.
setBendingEnergyWeight(bendingEnergyWeight: number): void;bendingEnergyWeightThe weight of the Bending Energy in the final distance value.
getBendingEnergyWeight
Read the bending energy weight.
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.
getBendingEnergyWeight(): number;The number result.
setImages
Set the images that correspond to each shape. This images are used in the calculation of the Image Appearance cost.
setImages(image1: Mat, image2: Mat): void;image1Image corresponding to the shape defined by contours1.
image2Image corresponding to the shape defined by contours2.
getImages
Read the images.
Set the images that correspond to each shape. This images are used in the calculation of the Image Appearance cost.
getImages(image1: Mat, image2: Mat): void;image1Output destination, filled by the native operation. image1 argument (Mat).
image2Output destination, filled by the native operation. image2 argument (Mat).
setIterations
Set the iterations used by this ShapeContextDistanceExtractor object.
setIterations(iterations: number): void;iterationsiterations argument (number).
getIterations
Return the iterations configured on this ShapeContextDistanceExtractor object.
getIterations(): number;The number result.
setCostExtractor
Set the algorithm used for building the shape context descriptor cost matrix.
setCostExtractor(comparer: HistogramCostExtractor | null): void;comparerSmart pointer to a HistogramCostExtractor, an algorithm that defines the cost matrix between descriptors.
getCostExtractor
Read the cost extractor.
Set the algorithm used for building the shape context descriptor cost matrix.
getCostExtractor(): HistogramCostExtractor | null;The HistogramCostExtractor | null result.
setStdDev
Set the value of the standard deviation for the Gaussian window for the image appearance cost.
setStdDev(sigma: number): void;sigmaStandard Deviation.
getStdDev
Read the std dev.
Set the value of the standard deviation for the Gaussian window for the image appearance cost.
getStdDev(): number;The number result.
setTransformAlgorithm
Set the algorithm used for aligning the shapes.
setTransformAlgorithm(transformer: ShapeTransformer | null): void;transformerSmart pointer to a ShapeTransformer, an algorithm that defines the aligning transformation.
getTransformAlgorithm
Read the transform algorithm.
Set the algorithm used for aligning the shapes.
getTransformAlgorithm(): ShapeTransformer | null;The ShapeTransformer | null result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.