opencv on mbed
ShapeContextDistanceExtractor Class Reference
[Shape Distance and Matching]
Implementation of the Shape Context descriptor and matching algorithm. More...
#include <shape_distance.hpp>
Inherits cv::ShapeDistanceExtractor.
Public Member Functions | |
virtual CV_WRAP void | setAngularBins (int nAngularBins)=0 |
Establish the number of angular bins for the Shape Context Descriptor used in the shape matching pipeline. | |
virtual CV_WRAP void | setRadialBins (int nRadialBins)=0 |
Establish the number of radial bins for the Shape Context Descriptor used in the shape matching pipeline. | |
virtual CV_WRAP void | setInnerRadius (float innerRadius)=0 |
Set the inner radius of the shape context descriptor. | |
virtual CV_WRAP void | setOuterRadius (float outerRadius)=0 |
Set the outer radius of the shape context descriptor. | |
virtual CV_WRAP void | setShapeContextWeight (float shapeContextWeight)=0 |
Set the weight of the shape context distance in the final value of the shape distance. | |
virtual CV_WRAP void | setImageAppearanceWeight (float imageAppearanceWeight)=0 |
Set the weight of the Image Appearance cost in the final value of the shape distance. | |
virtual CV_WRAP void | setBendingEnergyWeight (float bendingEnergyWeight)=0 |
Set the weight of the Bending Energy in the final value of the shape distance. | |
virtual CV_WRAP void | setImages (InputArray image1, InputArray image2)=0 |
Set the images that correspond to each shape. | |
virtual CV_WRAP void | setCostExtractor (Ptr< HistogramCostExtractor > comparer)=0 |
Set the algorithm used for building the shape context descriptor cost matrix. | |
virtual CV_WRAP void | setStdDev (float sigma)=0 |
Set the value of the standard deviation for the Gaussian window for the image appearance cost. | |
virtual CV_WRAP void | setTransformAlgorithm (Ptr< ShapeTransformer > transformer)=0 |
Set the algorithm used for aligning the shapes. | |
virtual CV_WRAP float | computeDistance (InputArray contour1, InputArray contour2)=0 |
Compute the shape distance between two shapes defined by its contours. | |
virtual CV_WRAP void | clear () |
Clears the algorithm state. | |
virtual void | write (FileStorage &fs) const |
Stores algorithm parameters in a file storage. | |
virtual void | read (const FileNode &fn) |
Reads algorithm parameters from a file storage. | |
virtual bool | empty () const |
Returns true if the Algorithm is empty (e.g. | |
virtual CV_WRAP void | save (const String &filename) const |
Saves the algorithm to a file. | |
virtual CV_WRAP String | getDefaultName () const |
Returns the algorithm string identifier. | |
Static Public Member Functions | |
template<typename _Tp > | |
static Ptr< _Tp > | read (const FileNode &fn) |
Reads algorithm from the file node. | |
template<typename _Tp > | |
static Ptr< _Tp > | load (const String &filename, const String &objname=String()) |
Loads algorithm from the file. | |
template<typename _Tp > | |
static Ptr< _Tp > | loadFromString (const String &strModel, const String &objname=String()) |
Loads algorithm from a String. |
Detailed Description
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.
Definition at line 78 of file shape_distance.hpp.
Member Function Documentation
virtual CV_WRAP void clear | ( | ) | [virtual, inherited] |
Clears the algorithm state.
Reimplemented in DescriptorMatcher, and FlannBasedMatcher.
virtual CV_WRAP float computeDistance | ( | InputArray | contour1, |
InputArray | contour2 | ||
) | [pure virtual, inherited] |
Compute the shape distance between two shapes defined by its contours.
- Parameters:
-
contour1 Contour defining first shape. contour2 Contour defining second shape.
virtual bool empty | ( | ) | const [virtual, inherited] |
virtual CV_WRAP String getDefaultName | ( | ) | const [virtual, inherited] |
Returns the algorithm string identifier.
This string is used as top level xml/yml node tag when the object is saved to a file or string.
static Ptr<_Tp> load | ( | const String & | filename, |
const String & | objname = String() |
||
) | [static, inherited] |
Loads algorithm from the file.
- Parameters:
-
filename Name of the file to read. objname The optional name of the node to read (if empty, the first top-level node will be used)
This is static template method of Algorithm. It's usage is following (in the case of SVM):
Ptr<SVM> svm = Algorithm::load<SVM>("my_svm_model.xml");
In order to make this method work, the derived class must overwrite Algorithm::read(const FileNode& fn).
static Ptr<_Tp> loadFromString | ( | const String & | strModel, |
const String & | objname = String() |
||
) | [static, inherited] |
Loads algorithm from a String.
- Parameters:
-
strModel The string variable containing the model you want to load. objname The optional name of the node to read (if empty, the first top-level node will be used)
This is static template method of Algorithm. It's usage is following (in the case of SVM):
Ptr<SVM> svm = Algorithm::loadFromString<SVM>(myStringModel);
Reads algorithm from the file node.
This is static template method of Algorithm. It's usage is following (in the case of SVM):
Ptr<SVM> svm = Algorithm::read<SVM>(fn);
In order to make this method work, the derived class must overwrite Algorithm::read(const FileNode& fn) and also have static create() method without parameters (or with all the optional parameters)
Reimplemented in DescriptorMatcher, and FlannBasedMatcher.
virtual void read | ( | const FileNode & | fn ) | [virtual, inherited] |
Reads algorithm parameters from a file storage.
Reimplemented in DescriptorMatcher, and FlannBasedMatcher.
virtual CV_WRAP void save | ( | const String & | filename ) | const [virtual, inherited] |
Saves the algorithm to a file.
In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
virtual CV_WRAP void setAngularBins | ( | int | nAngularBins ) | [pure virtual] |
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.
virtual CV_WRAP void setBendingEnergyWeight | ( | float | bendingEnergyWeight ) | [pure virtual] |
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.
virtual CV_WRAP void setCostExtractor | ( | Ptr< HistogramCostExtractor > | comparer ) | [pure virtual] |
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.
virtual CV_WRAP void setImageAppearanceWeight | ( | float | imageAppearanceWeight ) | [pure virtual] |
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.
virtual CV_WRAP void setImages | ( | InputArray | image1, |
InputArray | image2 | ||
) | [pure virtual] |
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.
virtual CV_WRAP void setInnerRadius | ( | float | innerRadius ) | [pure virtual] |
Set the inner radius of the shape context descriptor.
- Parameters:
-
innerRadius The value of the inner radius.
virtual CV_WRAP void setOuterRadius | ( | float | outerRadius ) | [pure virtual] |
Set the outer radius of the shape context descriptor.
- Parameters:
-
outerRadius The value of the outer radius.
virtual CV_WRAP void setRadialBins | ( | int | nRadialBins ) | [pure virtual] |
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.
virtual CV_WRAP void setShapeContextWeight | ( | float | shapeContextWeight ) | [pure virtual] |
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.
virtual CV_WRAP void setStdDev | ( | float | sigma ) | [pure virtual] |
Set the value of the standard deviation for the Gaussian window for the image appearance cost.
- Parameters:
-
sigma Standard Deviation.
virtual CV_WRAP void setTransformAlgorithm | ( | Ptr< ShapeTransformer > | transformer ) | [pure virtual] |
Set the algorithm used for aligning the shapes.
- Parameters:
-
transformer Smart pointer to a ShapeTransformer, an algorithm that defines the aligning transformation.
virtual void write | ( | FileStorage & | fs ) | const [virtual, inherited] |
Stores algorithm parameters in a file storage.
Reimplemented in DescriptorMatcher, and FlannBasedMatcher.
Generated on Tue Jul 12 2022 16:42:44 by 1.7.2