pub trait PCTSignatures: AlgorithmTrait + PCTSignaturesConst {
Show 22 methods fn as_raw_mut_PCTSignatures(&mut self) -> *mut c_void; fn set_grayscale_bits(&mut self, grayscale_bits: i32) -> Result<()> { ... } fn set_window_radius(&mut self, radius: i32) -> Result<()> { ... } fn set_weight_x(&mut self, weight: f32) -> Result<()> { ... } fn set_weight_y(&mut self, weight: f32) -> Result<()> { ... } fn set_weight_l(&mut self, weight: f32) -> Result<()> { ... } fn set_weight_a(&mut self, weight: f32) -> Result<()> { ... } fn set_weight_b(&mut self, weight: f32) -> Result<()> { ... } fn set_weight_contrast(&mut self, weight: f32) -> Result<()> { ... } fn set_weight_entropy(&mut self, weight: f32) -> Result<()> { ... } fn set_weight(&mut self, idx: i32, value: f32) -> Result<()> { ... } fn set_weights(&mut self, weights: &Vector<f32>) -> Result<()> { ... } fn set_translation(&mut self, idx: i32, value: f32) -> Result<()> { ... } fn set_translations(&mut self, translations: &Vector<f32>) -> Result<()> { ... } fn set_sampling_points(
        &mut self,
        sampling_points: Vector<Point2f>
    ) -> Result<()> { ... } fn set_init_seed_indexes(
        &mut self,
        init_seed_indexes: Vector<i32>
    ) -> Result<()> { ... } fn set_iteration_count(&mut self, iteration_count: i32) -> Result<()> { ... } fn set_max_clusters_count(&mut self, max_clusters_count: i32) -> Result<()> { ... } fn set_cluster_min_size(&mut self, cluster_min_size: i32) -> Result<()> { ... } fn set_joining_distance(&mut self, joining_distance: f32) -> Result<()> { ... } fn set_drop_threshold(&mut self, drop_threshold: f32) -> Result<()> { ... } fn set_distance_function(&mut self, distance_function: i32) -> Result<()> { ... }
}

Required Methods

Provided Methods

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.

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

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)

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)

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)

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)

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)

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)

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)

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

Parameters
  • idx: ID of the weight
  • value: 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;

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

Parameters
  • 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;

Translations of the individual axes of the feature space.

Parameters
  • idx: ID of the translation
  • value: 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;

Translations of the individual axes of the feature space.

Parameters
  • 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;

Sets sampling points used to sample the input image.

Parameters
  • samplingPoints: Vector of sampling points in range [0..1)

Note: Number of sampling points must be greater or equal to clusterization seed count.

Initial seed indexes for the k-means algorithm.

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

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

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.

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.

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

Distance function selector used for measuring distance between two points in k-means. Available: L0_25, L0_5, L1, L2, L2SQUARED, L5, L_INFINITY.

Implementations

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

Parameters
  • initSampleCount: Number of points used for image sampling.
  • initSeedCount: Number of initial clusterization seeds. Must be lower or equal to initSampleCount
  • pointDistribution: Distribution of generated points. Default: UNIFORM. Available: UNIFORM, REGULAR, NORMAL.
Returns

Created algorithm.

C++ default parameters
  • init_sample_count: 2000
  • init_seed_count: 400
  • point_distribution: 0

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.

Parameters
  • initSamplingPoints: Sampling points used in image sampling.
  • initSeedCount: Number of initial clusterization seeds. Must be lower or equal to initSamplingPoints.size().
Returns

Created algorithm.

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

Parameters
  • initSamplingPoints: Sampling points used in image sampling.
  • initClusterSeedIndexes: Indexes of initial clusterization seeds. Its size must be lower or equal to initSamplingPoints.size().
Returns

Created algorithm.

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.

Parameters
  • 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.
C++ default parameters
  • radius_to_shorter_side_ratio: 1.0/8
  • border_thickness: 1

Generates initial sampling points according to selected point distribution.

Parameters
  • 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)

Implementors