[][src]Trait opencv::xfeatures2d::PCTSignatures

pub trait PCTSignatures: AlgorithmTrait {
    pub fn as_raw_PCTSignatures(&self) -> *const c_void;
pub fn as_raw_mut_PCTSignatures(&mut self) -> *mut c_void; pub fn compute_signature(
        &self,
        image: &dyn ToInputArray,
        signature: &mut dyn ToOutputArray
    ) -> Result<()> { ... }
pub fn compute_signatures(
        &self,
        images: &Vector<Mat>,
        signatures: &mut Vector<Mat>
    ) -> Result<()> { ... }
pub fn get_sample_count(&self) -> Result<i32> { ... }
pub fn get_grayscale_bits(&self) -> Result<i32> { ... }
pub fn set_grayscale_bits(&mut self, grayscale_bits: i32) -> Result<()> { ... }
pub fn get_window_radius(&self) -> Result<i32> { ... }
pub fn set_window_radius(&mut self, radius: i32) -> Result<()> { ... }
pub fn get_weight_x(&self) -> Result<f32> { ... }
pub fn set_weight_x(&mut self, weight: f32) -> Result<()> { ... }
pub fn get_weight_y(&self) -> Result<f32> { ... }
pub fn set_weight_y(&mut self, weight: f32) -> Result<()> { ... }
pub fn get_weight_l(&self) -> Result<f32> { ... }
pub fn set_weight_l(&mut self, weight: f32) -> Result<()> { ... }
pub fn get_weight_a(&self) -> Result<f32> { ... }
pub fn set_weight_a(&mut self, weight: f32) -> Result<()> { ... }
pub fn get_weight_b(&self) -> Result<f32> { ... }
pub fn set_weight_b(&mut self, weight: f32) -> Result<()> { ... }
pub fn get_weight_contrast(&self) -> Result<f32> { ... }
pub fn set_weight_contrast(&mut self, weight: f32) -> Result<()> { ... }
pub fn get_weight_entropy(&self) -> Result<f32> { ... }
pub fn set_weight_entropy(&mut self, weight: f32) -> Result<()> { ... }
pub fn get_sampling_points(&self) -> Result<Vector<Point2f>> { ... }
pub fn set_weight(&mut self, idx: i32, value: f32) -> Result<()> { ... }
pub fn set_weights(&mut self, weights: &Vector<f32>) -> Result<()> { ... }
pub fn set_translation(&mut self, idx: i32, value: f32) -> Result<()> { ... }
pub fn set_translations(&mut self, translations: &Vector<f32>) -> Result<()> { ... }
pub fn set_sampling_points(
        &mut self,
        sampling_points: Vector<Point2f>
    ) -> Result<()> { ... }
pub fn get_init_seed_indexes(&self) -> Result<Vector<i32>> { ... }
pub fn set_init_seed_indexes(
        &mut self,
        init_seed_indexes: Vector<i32>
    ) -> Result<()> { ... }
pub fn get_init_seed_count(&self) -> Result<i32> { ... }
pub fn get_iteration_count(&self) -> Result<i32> { ... }
pub fn set_iteration_count(&mut self, iteration_count: i32) -> Result<()> { ... }
pub fn get_max_clusters_count(&self) -> Result<i32> { ... }
pub fn set_max_clusters_count(
        &mut self,
        max_clusters_count: i32
    ) -> Result<()> { ... }
pub fn get_cluster_min_size(&self) -> Result<i32> { ... }
pub fn set_cluster_min_size(&mut self, cluster_min_size: i32) -> Result<()> { ... }
pub fn get_joining_distance(&self) -> Result<f32> { ... }
pub fn set_joining_distance(&mut self, joining_distance: f32) -> Result<()> { ... }
pub fn get_drop_threshold(&self) -> Result<f32> { ... }
pub fn set_drop_threshold(&mut self, drop_threshold: f32) -> Result<()> { ... }
pub fn get_distance_function(&self) -> Result<i32> { ... }
pub fn set_distance_function(
        &mut self,
        distance_function: i32
    ) -> Result<()> { ... } }

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

Required methods

Loading content...

Provided methods

pub fn compute_signature(
    &self,
    image: &dyn ToInputArray,
    signature: &mut dyn ToOutputArray
) -> Result<()>
[src]

Computes signature of given image.

Parameters

  • image: Input image of CV_8U type.
  • signature: Output computed signature.

pub fn compute_signatures(
    &self,
    images: &Vector<Mat>,
    signatures: &mut Vector<Mat>
) -> Result<()>
[src]

Computes signatures for multiple images in parallel.

Parameters

  • images: Vector of input images of CV_8U type.
  • signatures: Vector of computed signatures.

pub fn get_sample_count(&self) -> Result<i32>[src]

Number of initial samples taken from the image.

pub fn get_grayscale_bits(&self) -> Result<i32>[src]

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.

pub fn set_grayscale_bits(&mut self, grayscale_bits: i32) -> Result<()>[src]

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.

pub fn get_window_radius(&self) -> Result<i32>[src]

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

pub fn set_window_radius(&mut self, radius: i32) -> Result<()>[src]

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

pub fn get_weight_x(&self) -> Result<f32>[src]

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)

pub fn set_weight_x(&mut self, weight: f32) -> Result<()>[src]

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)

pub fn get_weight_y(&self) -> Result<f32>[src]

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)

pub fn set_weight_y(&mut self, weight: f32) -> Result<()>[src]

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)

pub fn get_weight_l(&self) -> Result<f32>[src]

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)

pub fn set_weight_l(&mut self, weight: f32) -> Result<()>[src]

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)

pub fn get_weight_a(&self) -> Result<f32>[src]

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)

pub fn set_weight_a(&mut self, weight: f32) -> Result<()>[src]

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)

pub fn get_weight_b(&self) -> Result<f32>[src]

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)

pub fn set_weight_b(&mut self, weight: f32) -> Result<()>[src]

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)

pub fn get_weight_contrast(&self) -> Result<f32>[src]

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)

pub fn set_weight_contrast(&mut self, weight: f32) -> Result<()>[src]

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)

pub fn get_weight_entropy(&self) -> Result<f32>[src]

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)

pub fn set_weight_entropy(&mut self, weight: f32) -> Result<()>[src]

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)

pub fn get_sampling_points(&self) -> Result<Vector<Point2f>>[src]

Initial samples taken from the image. These sampled features become the input for clustering.

pub fn set_weight(&mut self, idx: i32, value: f32) -> Result<()>[src]

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;

pub fn set_weights(&mut self, weights: &Vector<f32>) -> Result<()>[src]

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;

pub fn set_translation(&mut self, idx: i32, value: f32) -> Result<()>[src]

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;

pub fn set_translations(&mut self, translations: &Vector<f32>) -> Result<()>[src]

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;

pub fn set_sampling_points(
    &mut self,
    sampling_points: Vector<Point2f>
) -> Result<()>
[src]

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.

pub fn get_init_seed_indexes(&self) -> Result<Vector<i32>>[src]

** clusterizer ***

  • Initial seeds (initial number of clusters) for the k-means algorithm.

pub fn set_init_seed_indexes(
    &mut self,
    init_seed_indexes: Vector<i32>
) -> Result<()>
[src]

Initial seed indexes for the k-means algorithm.

pub fn get_init_seed_count(&self) -> Result<i32>[src]

Number of initial seeds (initial number of clusters) for the k-means algorithm.

pub fn get_iteration_count(&self) -> Result<i32>[src]

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

pub fn set_iteration_count(&mut self, iteration_count: i32) -> Result<()>[src]

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

pub fn get_max_clusters_count(&self) -> Result<i32>[src]

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

pub fn set_max_clusters_count(&mut self, max_clusters_count: i32) -> Result<()>[src]

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

pub fn get_cluster_min_size(&self) -> Result<i32>[src]

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.

pub fn set_cluster_min_size(&mut self, cluster_min_size: i32) -> Result<()>[src]

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.

pub fn get_joining_distance(&self) -> Result<f32>[src]

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.

pub fn set_joining_distance(&mut self, joining_distance: f32) -> Result<()>[src]

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.

pub fn get_drop_threshold(&self) -> Result<f32>[src]

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

pub fn set_drop_threshold(&mut self, drop_threshold: f32) -> Result<()>[src]

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

pub fn get_distance_function(&self) -> Result<i32>[src]

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

pub fn set_distance_function(&mut self, distance_function: i32) -> Result<()>[src]

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

Loading content...

Implementations

impl<'_> dyn PCTSignatures + '_[src]

pub fn create(
    init_sample_count: i32,
    init_seed_count: i32,
    point_distribution: i32
) -> Result<Ptr<dyn PCTSignatures>>
[src]

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

pub fn create_1(
    init_sampling_points: &Vector<Point2f>,
    init_seed_count: i32
) -> Result<Ptr<dyn PCTSignatures>>
[src]

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.

pub fn create_2(
    init_sampling_points: &Vector<Point2f>,
    init_cluster_seed_indexes: &Vector<i32>
) -> Result<Ptr<dyn PCTSignatures>>
[src]

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.

pub fn draw_signature(
    source: &dyn ToInputArray,
    signature: &dyn ToInputArray,
    result: &mut dyn ToOutputArray,
    radius_to_shorter_side_ratio: f32,
    border_thickness: i32
) -> Result<()>
[src]

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

pub fn generate_init_points(
    init_points: &mut Vector<Point2f>,
    count: i32,
    point_distribution: i32
) -> Result<()>
[src]

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

Loading content...