OpenCV453
公開型 | 公開メンバ関数 | 静的公開メンバ関数 | 全メンバ一覧
cv::xfeatures2d::PCTSignatures クラスabstract

Class implementing PCT (position-color-texture) signature extraction as described in [KrulisLS16]. 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. [詳解]

#include <xfeatures2d.hpp>

cv::Algorithmを継承しています。

公開型

enum  DistanceFunction {
  L0_25 , L0_5 , L1 , L2 ,
  L2SQUARED , L5 , L_INFINITY
}
 Lp distance function selector.
 
enum  PointDistribution { UNIFORM , REGULAR , NORMAL }
 Point distributions supported by random point generator. [詳解]
 
enum  SimilarityFunction { MINUS , GAUSSIAN , HEURISTIC }
 Similarity function selector. [詳解]
 

公開メンバ関数

virtual CV_WRAP void computeSignature (InputArray image, OutputArray signature) const =0
 Computes signature of given image. [詳解]
 
virtual CV_WRAP void computeSignatures (const std::vector< Mat > &images, std::vector< Mat > &signatures) const =0
 Computes signatures for multiple images in parallel. [詳解]
 
virtual CV_WRAP int getSampleCount () const =0
 Number of initial samples taken from the image.
 
virtual CV_WRAP int getGrayscaleBits () const =0
 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.
 
virtual CV_WRAP void setGrayscaleBits (int grayscaleBits)=0
 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.
 
virtual CV_WRAP int getWindowRadius () const =0
 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).
 
virtual CV_WRAP void setWindowRadius (int radius)=0
 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).
 
virtual CV_WRAP float getWeightX () const =0
 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)
 
virtual CV_WRAP void setWeightX (float weight)=0
 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)
 
virtual CV_WRAP float getWeightY () const =0
 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)
 
virtual CV_WRAP void setWeightY (float weight)=0
 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)
 
virtual CV_WRAP float getWeightL () const =0
 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)
 
virtual CV_WRAP void setWeightL (float weight)=0
 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)
 
virtual CV_WRAP float getWeightA () const =0
 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)
 
virtual CV_WRAP void setWeightA (float weight)=0
 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)
 
virtual CV_WRAP float getWeightB () const =0
 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)
 
virtual CV_WRAP void setWeightB (float weight)=0
 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)
 
virtual CV_WRAP float getWeightContrast () const =0
 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)
 
virtual CV_WRAP void setWeightContrast (float weight)=0
 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)
 
virtual CV_WRAP float getWeightEntropy () const =0
 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)
 
virtual CV_WRAP void setWeightEntropy (float weight)=0
 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)
 
virtual CV_WRAP std::vector< Point2fgetSamplingPoints () const =0
 Initial samples taken from the image. These sampled features become the input for clustering.
 
virtual CV_WRAP void setWeight (int idx, float value)=0
 Weights (multiplicative constants) that linearly stretch individual axes of the feature space. [詳解]
 
virtual CV_WRAP void setWeights (const std::vector< float > &weights)=0
 Weights (multiplicative constants) that linearly stretch individual axes of the feature space. [詳解]
 
virtual CV_WRAP void setTranslation (int idx, float value)=0
 Translations of the individual axes of the feature space. [詳解]
 
virtual CV_WRAP void setTranslations (const std::vector< float > &translations)=0
 Translations of the individual axes of the feature space. [詳解]
 
virtual CV_WRAP void setSamplingPoints (std::vector< Point2f > samplingPoints)=0
 Sets sampling points used to sample the input image. [詳解]
 
virtual CV_WRAP std::vector< int > getInitSeedIndexes () const =0
 Initial seeds (initial number of clusters) for the k-means algorithm.
 
virtual CV_WRAP void setInitSeedIndexes (std::vector< int > initSeedIndexes)=0
 Initial seed indexes for the k-means algorithm.
 
virtual CV_WRAP int getInitSeedCount () const =0
 Number of initial seeds (initial number of clusters) for the k-means algorithm.
 
virtual CV_WRAP int getIterationCount () const =0
 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).
 
virtual CV_WRAP void setIterationCount (int iterationCount)=0
 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).
 
virtual CV_WRAP int getMaxClustersCount () const =0
 Maximal number of generated clusters. If the number is exceeded, the clusters are sorted by their weights and the smallest clusters are cropped.
 
virtual CV_WRAP void setMaxClustersCount (int maxClustersCount)=0
 Maximal number of generated clusters. If the number is exceeded, the clusters are sorted by their weights and the smallest clusters are cropped.
 
virtual CV_WRAP int getClusterMinSize () const =0
 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.
 
virtual CV_WRAP void setClusterMinSize (int clusterMinSize)=0
 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.
 
virtual CV_WRAP float getJoiningDistance () const =0
 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.
 
virtual CV_WRAP void setJoiningDistance (float joiningDistance)=0
 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.
 
virtual CV_WRAP float getDropThreshold () const =0
 Remove centroids in k-means whose weight is lesser or equal to given threshold.
 
virtual CV_WRAP void setDropThreshold (float dropThreshold)=0
 Remove centroids in k-means whose weight is lesser or equal to given threshold.
 
virtual CV_WRAP int getDistanceFunction () const =0
 Distance function selector used for measuring distance between two points in k-means.
 
virtual CV_WRAP void setDistanceFunction (int distanceFunction)=0
 Distance function selector used for measuring distance between two points in k-means. Available: L0_25, L0_5, L1, L2, L2SQUARED, L5, L_INFINITY.
 
- 基底クラス cv::Algorithm に属する継承公開メンバ関数
virtual CV_WRAP void clear ()
 Clears the algorithm state [詳解]
 
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage [詳解]
 
CV_WRAP void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 simplified API for language bindings これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
 
virtual CV_WRAP void read (const FileNode &fn)
 Reads algorithm parameters from a file storage [詳解]
 
virtual CV_WRAP bool empty () const
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read [詳解]
 
virtual CV_WRAP void save (const String &filename) const
 
virtual CV_WRAP String getDefaultName () const
 

静的公開メンバ関数

static CV_WRAP Ptr< PCTSignaturescreate (const int initSampleCount=2000, const int initSeedCount=400, const int pointDistribution=0)
 Creates PCTSignatures algorithm using sample and seed count. It generates its own sets of sampling points and clusterization seed indexes. [詳解]
 
static CV_WRAP Ptr< PCTSignaturescreate (const std::vector< Point2f > &initSamplingPoints, const int initSeedCount)
 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. [詳解]
 
static CV_WRAP Ptr< PCTSignaturescreate (const std::vector< Point2f > &initSamplingPoints, const std::vector< int > &initClusterSeedIndexes)
 Creates PCTSignatures algorithm using pre-generated sampling points and clusterization seeds indexes. [詳解]
 
static CV_WRAP void drawSignature (InputArray source, InputArray signature, OutputArray result, float radiusToShorterSideRatio=1.0/8, int borderThickness=1)
 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. [詳解]
 
static CV_WRAP void generateInitPoints (std::vector< Point2f > &initPoints, const int count, int pointDistribution)
 Generates initial sampling points according to selected point distribution. [詳解]
 
- 基底クラス cv::Algorithm に属する継承静的公開メンバ関数
template<typename _Tp >
static Ptr< _Tp > read (const FileNode &fn)
 Reads algorithm from the file node [詳解]
 
template<typename _Tp >
static Ptr< _Tp > load (const String &filename, const String &objname=String())
 Loads algorithm from the file [詳解]
 
template<typename _Tp >
static Ptr< _Tp > loadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String [詳解]
 

その他の継承メンバ

- 基底クラス cv::Algorithm に属する継承限定公開メンバ関数
void writeFormat (FileStorage &fs) const
 

詳解

Class implementing PCT (position-color-texture) signature extraction as described in [KrulisLS16]. 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. [KrulisLS16] [BeecksUS10]

列挙型メンバ詳解

◆ PointDistribution

Point distributions supported by random point generator.

列挙値
UNIFORM 

Generate numbers uniformly.

REGULAR 

Generate points in a regular grid.

NORMAL 

Generate points with normal (gaussian) distribution.

◆ SimilarityFunction

Similarity function selector.

参照
Christian Beecks, Merih Seran Uysal, Thomas Seidl. Signature quadratic form distance. In Proceedings of the ACM International Conference on Image and Video Retrieval, pages 438-445. ACM, 2010. [BeecksUS10]
覚え書き
For selected distance function:

\[ d(c_i, c_j) \]

and parameter:

\[ \alpha \]

列挙値
MINUS 

\[ -d(c_i, c_j) \]

GAUSSIAN 

\[ e^{ -\alpha * d^2(c_i, c_j)} \]

HEURISTIC 

\[ \frac{1}{\alpha + d(c_i, c_j)} \]

関数詳解

◆ computeSignature()

virtual CV_WRAP void cv::xfeatures2d::PCTSignatures::computeSignature ( InputArray  image,
OutputArray  signature 
) const
pure virtual

Computes signature of given image.

引数
imageInput image of CV_8U type.
signatureOutput computed signature.

◆ computeSignatures()

virtual CV_WRAP void cv::xfeatures2d::PCTSignatures::computeSignatures ( const std::vector< Mat > &  images,
std::vector< Mat > &  signatures 
) const
pure virtual

Computes signatures for multiple images in parallel.

引数
imagesVector of input images of CV_8U type.
signaturesVector of computed signatures.

◆ create() [1/3]

static CV_WRAP Ptr< PCTSignatures > cv::xfeatures2d::PCTSignatures::create ( const int  initSampleCount = 2000,
const int  initSeedCount = 400,
const int  pointDistribution = 0 
)
static

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

引数
initSampleCountNumber of points used for image sampling.
initSeedCountNumber of initial clusterization seeds. Must be lower or equal to initSampleCount
pointDistributionDistribution of generated points. Default: UNIFORM. Available: UNIFORM, REGULAR, NORMAL.
戻り値
Created algorithm.

◆ create() [2/3]

static CV_WRAP Ptr< PCTSignatures > cv::xfeatures2d::PCTSignatures::create ( const std::vector< Point2f > &  initSamplingPoints,
const int  initSeedCount 
)
static

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.

引数
initSamplingPointsSampling points used in image sampling.
initSeedCountNumber of initial clusterization seeds. Must be lower or equal to initSamplingPoints.size().
戻り値
Created algorithm.

◆ create() [3/3]

static CV_WRAP Ptr< PCTSignatures > cv::xfeatures2d::PCTSignatures::create ( const std::vector< Point2f > &  initSamplingPoints,
const std::vector< int > &  initClusterSeedIndexes 
)
static

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

引数
initSamplingPointsSampling points used in image sampling.
initClusterSeedIndexesIndexes of initial clusterization seeds. Its size must be lower or equal to initSamplingPoints.size().
戻り値
Created algorithm.

◆ drawSignature()

static CV_WRAP void cv::xfeatures2d::PCTSignatures::drawSignature ( InputArray  source,
InputArray  signature,
OutputArray  result,
float  radiusToShorterSideRatio = 1.0/8,
int  borderThickness = 1 
)
static

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.

引数
sourceSource image.
signatureImage signature.
resultOutput result.
radiusToShorterSideRatioDetermines maximal radius of signature in the output image.
borderThicknessBorder thickness of the visualized signature.

◆ generateInitPoints()

static CV_WRAP void cv::xfeatures2d::PCTSignatures::generateInitPoints ( std::vector< Point2f > &  initPoints,
const int  count,
int  pointDistribution 
)
static

Generates initial sampling points according to selected point distribution.

引数
initPointsOutput vector where the generated points will be saved.
countNumber of points to generate.
pointDistributionPoint distribution selector. Available: UNIFORM, REGULAR, NORMAL.
覚え書き
Generated coordinates are in range [0..1)

◆ setSamplingPoints()

virtual CV_WRAP void cv::xfeatures2d::PCTSignatures::setSamplingPoints ( std::vector< Point2f samplingPoints)
pure virtual

Sets sampling points used to sample the input image.

引数
samplingPointsVector of sampling points in range [0..1)
覚え書き
Number of sampling points must be greater or equal to clusterization seed count.

◆ setTranslation()

virtual CV_WRAP void cv::xfeatures2d::PCTSignatures::setTranslation ( int  idx,
float  value 
)
pure virtual

Translations of the individual axes of the feature space.

引数
idxID of the translation
valueValue of the translation
覚え書き
WEIGHT_IDX = 0; X_IDX = 1; Y_IDX = 2; L_IDX = 3; A_IDX = 4; B_IDX = 5; CONTRAST_IDX = 6; ENTROPY_IDX = 7;

◆ setTranslations()

virtual CV_WRAP void cv::xfeatures2d::PCTSignatures::setTranslations ( const std::vector< float > &  translations)
pure virtual

Translations of the individual axes of the feature space.

引数
translationsValues of all translations.
覚え書き
WEIGHT_IDX = 0; X_IDX = 1; Y_IDX = 2; L_IDX = 3; A_IDX = 4; B_IDX = 5; CONTRAST_IDX = 6; ENTROPY_IDX = 7;

◆ setWeight()

virtual CV_WRAP void cv::xfeatures2d::PCTSignatures::setWeight ( int  idx,
float  value 
)
pure virtual

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

引数
idxID of the weight
valueValue of the weight
覚え書き
WEIGHT_IDX = 0; X_IDX = 1; Y_IDX = 2; L_IDX = 3; A_IDX = 4; B_IDX = 5; CONTRAST_IDX = 6; ENTROPY_IDX = 7;

◆ setWeights()

virtual CV_WRAP void cv::xfeatures2d::PCTSignatures::setWeights ( const std::vector< float > &  weights)
pure virtual

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

引数
weightsValues of all weights.
覚え書き
WEIGHT_IDX = 0; X_IDX = 1; Y_IDX = 2; L_IDX = 3; A_IDX = 4; B_IDX = 5; CONTRAST_IDX = 6; ENTROPY_IDX = 7;

このクラス詳解は次のファイルから抽出されました: