public class PCTSignatures extends Algorithm
Modifier and Type | Field and Description |
---|---|
static int |
GAUSSIAN |
static int |
HEURISTIC |
static int |
L_INFINITY |
static int |
L0_25 |
static int |
L0_5 |
static int |
L1 |
static int |
L2 |
static int |
L2SQUARED |
static int |
L5 |
static int |
MINUS |
static int |
NORMAL |
static int |
REGULAR |
static int |
UNIFORM |
Modifier | Constructor and Description |
---|---|
protected |
PCTSignatures(long addr) |
Modifier and Type | Method and Description |
---|---|
static PCTSignatures |
__fromPtr__(long addr) |
void |
computeSignature(Mat image,
Mat signature)
Computes signature of given image.
|
void |
computeSignatures(List<Mat> images,
List<Mat> signatures)
Computes signatures for multiple images in parallel.
|
static PCTSignatures |
create()
Creates PCTSignatures algorithm using sample and seed count.
|
static PCTSignatures |
create(int initSampleCount)
Creates PCTSignatures algorithm using sample and seed count.
|
static PCTSignatures |
create(int initSampleCount,
int initSeedCount)
Creates PCTSignatures algorithm using sample and seed count.
|
static PCTSignatures |
create(int initSampleCount,
int initSeedCount,
int pointDistribution)
Creates PCTSignatures algorithm using sample and seed count.
|
static PCTSignatures |
create(MatOfPoint2f initSamplingPoints,
int initSeedCount)
Creates PCTSignatures algorithm using pre-generated sampling points
and number of clusterization seeds.
|
static PCTSignatures |
create(MatOfPoint2f initSamplingPoints,
MatOfInt initClusterSeedIndexes)
Creates PCTSignatures algorithm using pre-generated sampling points
and clusterization seeds indexes.
|
static void |
drawSignature(Mat source,
Mat signature,
Mat result)
Draws signature in the source image and outputs the result.
|
static void |
drawSignature(Mat source,
Mat signature,
Mat result,
float radiusToShorterSideRatio)
Draws signature in the source image and outputs the result.
|
static void |
drawSignature(Mat source,
Mat signature,
Mat result,
float radiusToShorterSideRatio,
int borderThickness)
Draws signature in the source image and outputs the result.
|
protected void |
finalize() |
static void |
generateInitPoints(MatOfPoint2f initPoints,
int count,
int pointDistribution)
Generates initial sampling points according to selected point distribution.
|
int |
getClusterMinSize()
This parameter multiplied by the index of iteration gives lower limit for cluster size.
|
int |
getDistanceFunction()
Distance function selector used for measuring distance between two points in k-means.
|
float |
getDropThreshold()
Remove centroids in k-means whose weight is lesser or equal to given threshold.
|
int |
getGrayscaleBits()
Color resolution of the greyscale bitmap represented in allocated bits
(i.e., value 4 means that 16 shades of grey are used).
|
int |
getInitSeedCount()
Number of initial seeds (initial number of clusters) for the k-means algorithm.
|
MatOfInt |
getInitSeedIndexes()
Initial seeds (initial number of clusters) for the k-means algorithm.
|
int |
getIterationCount()
Number of iterations of the k-means clustering.
|
float |
getJoiningDistance()
Threshold euclidean distance between two centroids.
|
int |
getMaxClustersCount()
Maximal number of generated clusters.
|
int |
getSampleCount()
Number of initial samples taken from the image.
|
MatOfPoint2f |
getSamplingPoints()
Initial samples taken from the image.
|
float |
getWeightA()
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.
|
float |
getWeightB()
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.
|
float |
getWeightContrast()
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.
|
float |
getWeightEntropy()
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.
|
float |
getWeightL()
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.
|
float |
getWeightX()
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.
|
float |
getWeightY()
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.
|
int |
getWindowRadius()
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).
|
void |
setClusterMinSize(int clusterMinSize)
This parameter multiplied by the index of iteration gives lower limit for cluster size.
|
void |
setDistanceFunction(int distanceFunction)
Distance function selector used for measuring distance between two points in k-means.
|
void |
setDropThreshold(float dropThreshold)
Remove centroids in k-means whose weight is lesser or equal to given threshold.
|
void |
setGrayscaleBits(int grayscaleBits)
Color resolution of the greyscale bitmap represented in allocated bits
(i.e., value 4 means that 16 shades of grey are used).
|
void |
setInitSeedIndexes(MatOfInt initSeedIndexes)
Initial seed indexes for the k-means algorithm.
|
void |
setIterationCount(int iterationCount)
Number of iterations of the k-means clustering.
|
void |
setJoiningDistance(float joiningDistance)
Threshold euclidean distance between two centroids.
|
void |
setMaxClustersCount(int maxClustersCount)
Maximal number of generated clusters.
|
void |
setSamplingPoints(MatOfPoint2f samplingPoints)
Sets sampling points used to sample the input image.
|
void |
setTranslation(int idx,
float value)
Translations of the individual axes of the feature space.
|
void |
setTranslations(MatOfFloat translations)
Translations of the individual axes of the feature space.
|
void |
setWeight(int idx,
float value)
Weights (multiplicative constants) that linearly stretch individual axes of the feature space.
|
void |
setWeightA(float weight)
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.
|
void |
setWeightB(float weight)
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.
|
void |
setWeightContrast(float weight)
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.
|
void |
setWeightEntropy(float weight)
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.
|
void |
setWeightL(float weight)
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.
|
void |
setWeights(MatOfFloat weights)
Weights (multiplicative constants) that linearly stretch individual axes of the feature space.
|
void |
setWeightX(float weight)
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.
|
void |
setWeightY(float weight)
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.
|
void |
setWindowRadius(int radius)
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).
|
clear, empty, getDefaultName, getNativeObjAddr, save
public static final int UNIFORM
public static final int REGULAR
public static final int NORMAL
public static final int L0_25
public static final int L0_5
public static final int L1
public static final int L2
public static final int L2SQUARED
public static final int L5
public static final int L_INFINITY
public static final int MINUS
public static final int GAUSSIAN
public static final int HEURISTIC
public static PCTSignatures __fromPtr__(long addr)
public static PCTSignatures create(int initSampleCount, int initSeedCount, int pointDistribution)
initSampleCount
- Number of points used for image sampling.initSeedCount
- Number of initial clusterization seeds.
Must be lower or equal to initSampleCountpointDistribution
- Distribution of generated points. Default: UNIFORM.
Available: UNIFORM, REGULAR, NORMAL.public static PCTSignatures create(int initSampleCount, int initSeedCount)
initSampleCount
- Number of points used for image sampling.initSeedCount
- Number of initial clusterization seeds.
Must be lower or equal to initSampleCount
Available: UNIFORM, REGULAR, NORMAL.public static PCTSignatures create(int initSampleCount)
initSampleCount
- Number of points used for image sampling.
Must be lower or equal to initSampleCount
Available: UNIFORM, REGULAR, NORMAL.public static PCTSignatures create()
public static PCTSignatures create(MatOfPoint2f initSamplingPoints, int initSeedCount)
initSamplingPoints
- Sampling points used in image sampling.initSeedCount
- Number of initial clusterization seeds.
Must be lower or equal to initSamplingPoints.size().public static PCTSignatures create(MatOfPoint2f initSamplingPoints, MatOfInt initClusterSeedIndexes)
initSamplingPoints
- Sampling points used in image sampling.initClusterSeedIndexes
- Indexes of initial clusterization seeds.
Its size must be lower or equal to initSamplingPoints.size().public float getDropThreshold()
public float getJoiningDistance()
public float getWeightA()
public float getWeightB()
public float getWeightContrast()
public float getWeightEntropy()
public float getWeightL()
public float getWeightX()
public float getWeightY()
public int getClusterMinSize()
public int getDistanceFunction()
public int getGrayscaleBits()
public int getInitSeedCount()
public int getIterationCount()
public int getMaxClustersCount()
public int getSampleCount()
public int getWindowRadius()
public MatOfPoint2f getSamplingPoints()
public MatOfInt getInitSeedIndexes()
public void computeSignature(Mat image, Mat signature)
image
- Input image of CV_8U type.signature
- Output computed signature.public void computeSignatures(List<Mat> images, List<Mat> signatures)
images
- Vector of input images of CV_8U type.signatures
- Vector of computed signatures.public static void drawSignature(Mat source, Mat signature, Mat result, float radiusToShorterSideRatio, int borderThickness)
source
- Source image.signature
- Image signature.result
- Output result.radiusToShorterSideRatio
- Determines maximal radius of signature in the output image.borderThickness
- Border thickness of the visualized signature.public static void drawSignature(Mat source, Mat signature, Mat result, float radiusToShorterSideRatio)
source
- Source image.signature
- Image signature.result
- Output result.radiusToShorterSideRatio
- Determines maximal radius of signature in the output image.public static void drawSignature(Mat source, Mat signature, Mat result)
source
- Source image.signature
- Image signature.result
- Output result.public static void generateInitPoints(MatOfPoint2f initPoints, int count, int pointDistribution)
initPoints
- Output vector where the generated points will be saved.count
- Number of points to generate.pointDistribution
- Point distribution selector.
Available: UNIFORM, REGULAR, NORMAL.
Note: Generated coordinates are in range [0..1)public void setClusterMinSize(int clusterMinSize)
clusterMinSize
- automatically generatedpublic void setDistanceFunction(int distanceFunction)
distanceFunction
- automatically generatedpublic void setDropThreshold(float dropThreshold)
dropThreshold
- automatically generatedpublic void setGrayscaleBits(int grayscaleBits)
grayscaleBits
- automatically generatedpublic void setInitSeedIndexes(MatOfInt initSeedIndexes)
initSeedIndexes
- automatically generatedpublic void setIterationCount(int iterationCount)
iterationCount
- automatically generatedpublic void setJoiningDistance(float joiningDistance)
joiningDistance
- automatically generatedpublic void setMaxClustersCount(int maxClustersCount)
maxClustersCount
- automatically generatedpublic void setSamplingPoints(MatOfPoint2f samplingPoints)
samplingPoints
- Vector of sampling points in range [0..1)
Note: Number of sampling points must be greater or equal to clusterization seed count.public void setTranslation(int idx, float value)
idx
- ID of the translationvalue
- Value of the translation
Note:
WEIGHT_IDX = 0;
X_IDX = 1;
Y_IDX = 2;
L_IDX = 3;
A_IDX = 4;
B_IDX = 5;
CONTRAST_IDX = 6;
ENTROPY_IDX = 7;public void setTranslations(MatOfFloat translations)
translations
- Values of all translations.
Note:
WEIGHT_IDX = 0;
X_IDX = 1;
Y_IDX = 2;
L_IDX = 3;
A_IDX = 4;
B_IDX = 5;
CONTRAST_IDX = 6;
ENTROPY_IDX = 7;public void setWeight(int idx, float value)
idx
- ID of the weightvalue
- Value of the weight
Note:
WEIGHT_IDX = 0;
X_IDX = 1;
Y_IDX = 2;
L_IDX = 3;
A_IDX = 4;
B_IDX = 5;
CONTRAST_IDX = 6;
ENTROPY_IDX = 7;public void setWeightA(float weight)
weight
- automatically generatedpublic void setWeightB(float weight)
weight
- automatically generatedpublic void setWeightContrast(float weight)
weight
- automatically generatedpublic void setWeightEntropy(float weight)
weight
- automatically generatedpublic void setWeightL(float weight)
weight
- automatically generatedpublic void setWeightX(float weight)
weight
- automatically generatedpublic void setWeightY(float weight)
weight
- automatically generatedpublic void setWeights(MatOfFloat weights)
weights
- Values of all weights.
Note:
WEIGHT_IDX = 0;
X_IDX = 1;
Y_IDX = 2;
L_IDX = 3;
A_IDX = 4;
B_IDX = 5;
CONTRAST_IDX = 6;
ENTROPY_IDX = 7;public void setWindowRadius(int radius)
radius
- automatically generatedGenerated on Wed Oct 9 2019 23:24:43 UTC / OpenCV 4.1.2