Table of Contents

Class PCTSignatures

Namespace
Emgu.CV.XFeatures2D
Assembly
Emgu.CV.dll

Class implementing PCT (position-color-texture) signature extraction as described in: Martin Krulis, Jakub Lokoc, and Tomas Skopal. Efficient extraction of clustering-based feature signatures using GPU architectures. Multimedia Tools Appl., 75(13):8071–8103, 2016. The algorithm is divided to a feature sampler and a clusterizer. Feature sampler produces samples at given set of coordinates. Clusterizer then produces clusters of these samples using k-means algorithm. Resulting set of clusters is the signature of the input image. A signature is an array of SIGNATURE_DIMENSION-dimensional points.Used dimensions are: weight, x, y position; lab color, contrast, entropy.

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

Constructors

PCTSignatures(VectorOfPointF, VectorOfInt)

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

public PCTSignatures(VectorOfPointF initSamplingPoints, VectorOfInt initClusterSeedIndexes)

Parameters

initSamplingPoints VectorOfPointF

Sampling points used in image sampling.

initClusterSeedIndexes VectorOfInt

Indexes of initial clusterization seeds. Its size must be lower or equal to initSamplingPoints.size().

PCTSignatures(VectorOfPointF, 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.

public PCTSignatures(VectorOfPointF initSamplingPoints, int initSeedCount)

Parameters

initSamplingPoints VectorOfPointF

Sampling points used in image sampling.

initSeedCount int

Number of initial clusterization seeds. Must be lower or equal to initSamplingPoints.size().

PCTSignatures(int, int, PointDistributionType)

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

public PCTSignatures(int initSampleCount = 2000, int initSeedCount = 400, PCTSignatures.PointDistributionType pointDistribution = PointDistributionType.Uniform)

Parameters

initSampleCount int

Number of points used for image sampling.

initSeedCount int

Number of initial clusterization seeds. Must be lower or equal to initSampleCount

pointDistribution PCTSignatures.PointDistributionType

Distribution of generated points.

Properties

ClusterMinSize

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

public int ClusterMinSize { get; set; }

Property Value

int

DistanceFunction

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

public PCTSignatures.PointDistributionType DistanceFunction { get; set; }

Property Value

PCTSignatures.PointDistributionType

DropThreshold

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

public float DropThreshold { get; set; }

Property Value

float

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.

public int GrayscaleBits { get; set; }

Property Value

int

IterationCount

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

public int IterationCount { get; set; }

Property Value

int

JoiningDistance

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

public float JoiningDistance { get; set; }

Property Value

float

MaxClustersCount

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

public int MaxClustersCount { get; set; }

Property Value

int

WeightA

Weights (multiplicative constants) that linearly stretch individual axes of the feature space. (x,y = position. L,a,b = color in CIE Lab space. c = contrast. e = entropy)

public float WeightA { get; set; }

Property Value

float

WeightB

Weights (multiplicative constants) that linearly stretch individual axes of the feature space. (x,y = position. L,a,b = color in CIE Lab space. c = contrast. e = entropy)

public float WeightB { get; set; }

Property Value

float

WeightEntropy

Weights (multiplicative constants) that linearly stretch individual axes of the feature space. (x,y = position. L,a,b = color in CIE Lab space. c = contrast. e = entropy)

public float WeightEntropy { get; set; }

Property Value

float

WeightL

Weights (multiplicative constants) that linearly stretch individual axes of the feature space. (x,y = position. L,a,b = color in CIE Lab space. c = contrast. e = entropy)

public float WeightL { get; set; }

Property Value

float

WeightX

Weights (multiplicative constants) that linearly stretch individual axes of the feature space. (x,y = position. L,a,b = color in CIE Lab space. c = contrast. e = entropy)

public float WeightX { get; set; }

Property Value

float

WeightY

Weights (multiplicative constants) that linearly stretch individual axes of the feature space. (x,y = position. L,a,b = color in CIE Lab space. c = contrast. e = entropy)

public float WeightY { get; set; }

Property Value

float

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).

public int WindowRadius { get; set; }

Property Value

int

Methods

ComputeSignature(IInputArray, IOutputArray)

Computes signature of given image.

public void ComputeSignature(IInputArray image, IOutputArray signature)

Parameters

image IInputArray

Input image of CV_8U type.

signature IOutputArray

Output computed signature.

DisposeObject()

Release the unmanaged memory associated with this PCTSignatures object

protected override void DisposeObject()

DrawSignature(IInputArray, IInputArray, IOutputArray, 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.

public static void DrawSignature(IInputArray source, IInputArray signature, IOutputArray result, float radiusToShorterSideRatio = 0.125, int borderThickness = 1)

Parameters

source IInputArray

Source image.

signature IInputArray

Image signature.

result IOutputArray

Output result.

radiusToShorterSideRatio float

Determines maximal radius of signature in the output image.

borderThickness int

Border thickness of the visualized signature.