Table of Contents

Class ShapeContextDistanceExtractor

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Implementation of the Shape Context descriptor and matching algorithm

public class ShapeContextDistanceExtractor : ShapeDistanceExtractor, IDisposable, ICvPtrHolder
Inheritance
ShapeContextDistanceExtractor
Implements
Inherited Members

Remarks

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

Constructors

ShapeContextDistanceExtractor(nint)

protected ShapeContextDistanceExtractor(nint p)

Parameters

p nint

Properties

AngularBins

The number of angular bins in the shape context descriptor.

public int AngularBins { get; set; }

Property Value

int

BendingEnergyWeight

The weight of the Bending Energy in the final distance value.

public float BendingEnergyWeight { get; set; }

Property Value

float

ImageAppearanceWeight

The weight of the appearance cost in the final distance value.

public float ImageAppearanceWeight { get; set; }

Property Value

float

InnerRadius

The value of the inner radius.

public float InnerRadius { get; set; }

Property Value

float

Iterations

public int Iterations { get; set; }

Property Value

int

OuterRadius

The value of the outer radius.

public float OuterRadius { get; set; }

Property Value

float

RadialBins

The number of radial bins in the shape context descriptor.

public int RadialBins { get; set; }

Property Value

int

RotationInvariant

public bool RotationInvariant { get; set; }

Property Value

bool

ShapeContextWeight

The weight of the shape context distance in the final distance value.

public float ShapeContextWeight { get; set; }

Property Value

float

StdDev

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

public float StdDev { get; set; }

Property Value

float

Methods

Create(int, int, float, float, int)

Complete constructor

public static ShapeContextDistanceExtractor Create(int nAngularBins = 12, int nRadialBins = 4, float innerRadius = 0.2, float outerRadius = 2, int iterations = 3)

Parameters

nAngularBins int

The number of angular bins in the shape context descriptor.

nRadialBins int

The number of radial bins in the shape context descriptor.

innerRadius float

The value of the inner radius.

outerRadius float

The value of the outer radius.

iterations int

Returns

ShapeContextDistanceExtractor

DisposeManaged()

Releases managed resources

protected override void DisposeManaged()

GetImages(OutputArray, OutputArray)

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

public void GetImages(OutputArray image1, OutputArray image2)

Parameters

image1 OutputArray

Image corresponding to the shape defined by contours1.

image2 OutputArray

Image corresponding to the shape defined by contours2.

SetImages(InputArray, InputArray)

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

public void SetImages(InputArray image1, InputArray image2)

Parameters

image1 InputArray

Image corresponding to the shape defined by contours1.

image2 InputArray

Image corresponding to the shape defined by contours2.