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
VectorOfPointFSampling points used in image sampling.
initClusterSeedIndexes
VectorOfIntIndexes 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
VectorOfPointFSampling points used in image sampling.
initSeedCount
intNumber 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
intNumber of points used for image sampling.
initSeedCount
intNumber of initial clusterization seeds. Must be lower or equal to initSampleCount
pointDistribution
PCTSignatures.PointDistributionTypeDistribution 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
DistanceFunction
Distance function selector used for measuring distance between two points in k-means.
public PCTSignatures.PointDistributionType DistanceFunction { get; set; }
Property Value
DropThreshold
Remove centroids in k-means whose weight is lesser or equal to given threshold.
public float DropThreshold { get; set; }
Property Value
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
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
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
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
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
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
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
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
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
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
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
Methods
ComputeSignature(IInputArray, IOutputArray)
Computes signature of given image.
public void ComputeSignature(IInputArray image, IOutputArray signature)
Parameters
image
IInputArrayInput image of CV_8U type.
signature
IOutputArrayOutput 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
IInputArraySource image.
signature
IInputArrayImage signature.
result
IOutputArrayOutput result.
radiusToShorterSideRatio
floatDetermines maximal radius of signature in the output image.
borderThickness
intBorder thickness of the visualized signature.