Table of Contents

Class PCTSignatures

Namespace
OpenCvSharp.XFeatures2D
Assembly
OpenCvSharp.dll

Class implementing PCT (position-color-texture) signature extraction, as described in KrulisLS16. The algorithm is divided into a feature sampler and a clusterizer. The feature sampler produces samples at a given set of coordinates, and the clusterizer produces clusters of these samples using the k-means algorithm; the resulting set of clusters is the signature of the input image.

public class PCTSignatures : Algorithm, IDisposable
Inheritance
PCTSignatures
Implements
Inherited Members

Properties

ClusterMinSize

This parameter, multiplied by the index of iteration, gives the lower limit for cluster size. Clusters containing fewer points than specified by the limit have their centroid dismissed and points are reassigned.

DistanceFunction

Distance function selector used for measuring distance between two points in k-means.

DropThreshold

Remove centroids in k-means whose weight is lesser or equal to the given threshold.

GrayscaleBits

Color resolution of the greyscale bitmap represented in allocated bits (i.e., value 4 means that 16 shades of grey are used). The greyscale bitmap is used for computing contrast and entropy values.

InitSeedCount

Number of initial seeds (initial number of clusters) for the k-means algorithm.

IterationCount

Number of iterations of the k-means clustering. We use a fixed number of iterations, since the modified clustering is pruning clusters (not iteratively refining k clusters).

JoiningDistance

Threshold euclidean distance between two centroids. If two cluster centers are closer than this distance, one of the centroids is dismissed and points are reassigned.

MaxClustersCount

Maximal number of generated clusters. If the number is exceeded, the clusters are sorted by their weights and the smallest clusters are cropped.

SampleCount

Number of initial samples taken from the image.

WeightA

Weight (multiplicative constant) that linearly stretches the a (CIE Lab) axis of the feature space.

WeightB

Weight (multiplicative constant) that linearly stretches the b (CIE Lab) axis of the feature space.

WeightContrast

Weight (multiplicative constant) that linearly stretches the contrast axis of the feature space.

WeightEntropy

Weight (multiplicative constant) that linearly stretches the entropy axis of the feature space.

WeightL

Weight (multiplicative constant) that linearly stretches the L (lightness) axis of the feature space.

WeightX

Weight (multiplicative constant) that linearly stretches the x-axis of the feature space.

WeightY

Weight (multiplicative constant) that linearly stretches the y-axis of the feature space.

WindowRadius

Size of the texture sampling window used to compute contrast and entropy (center of the window is always in the pixel selected by x,y coordinates of the corresponding feature sample).

Methods

ComputeSignature(InputArray, OutputArray)

Computes signature of a given image.

ComputeSignatures(IEnumerable<Mat>)

Computes signatures for multiple images in parallel.

Create(IEnumerable<Point2f>, IEnumerable<int>)

Creates PCTSignatures algorithm using pre-generated sampling points and clusterization seed indexes.

Create(IEnumerable<Point2f>, int)

Creates PCTSignatures algorithm using pre-generated sampling points and number of clusterization seeds. It uses the provided sampling points and generates its own clusterization seed indexes.

Create(int, int, PCTSignaturesPointDistribution)

Creates PCTSignatures algorithm using sample and seed count. It generates its own sets of sampling points and clusterization seed indexes.

DrawSignature(InputArray, InputArray, OutputArray, float, int)

Draws signature in the source image and outputs the result. Signatures are visualized as a circle with radius based on signature weight and color based on signature color. Contrast and entropy are not visualized.

GenerateInitPoints(int, PCTSignaturesPointDistribution)

Generates initial sampling points according to the selected point distribution.

GetInitSeedIndexes()

Initial seeds (initial number of clusters) for the k-means algorithm.

GetSamplingPoints()

Initial samples taken from the image. These sampled features become the input for clustering.

SetInitSeedIndexes(IEnumerable<int>)

Initial seed indexes for the k-means algorithm.

SetSamplingPoints(IEnumerable<Point2f>)

Sets sampling points used to sample the input image.

SetTranslation(int, float)

Translations of the individual axes of the feature space.

SetTranslations(IEnumerable<float>)

Translations of the individual axes of the feature space.

SetWeight(int, float)

Weights (multiplicative constants) that linearly stretch individual axes of the feature space.

SetWeights(IEnumerable<float>)

Weights (multiplicative constants) that linearly stretch individual axes of the feature space.