Trait opencv::hub_prelude::PCTSignaturesConst
source · pub trait PCTSignaturesConst: AlgorithmTraitConst {
Show 22 methods
fn as_raw_PCTSignatures(&self) -> *const c_void;
fn compute_signature(
&self,
image: &dyn ToInputArray,
signature: &mut dyn ToOutputArray
) -> Result<()> { ... }
fn compute_signatures(
&self,
images: &Vector<Mat>,
signatures: &mut Vector<Mat>
) -> Result<()> { ... }
fn get_sample_count(&self) -> Result<i32> { ... }
fn get_grayscale_bits(&self) -> Result<i32> { ... }
fn get_window_radius(&self) -> Result<i32> { ... }
fn get_weight_x(&self) -> Result<f32> { ... }
fn get_weight_y(&self) -> Result<f32> { ... }
fn get_weight_l(&self) -> Result<f32> { ... }
fn get_weight_a(&self) -> Result<f32> { ... }
fn get_weight_b(&self) -> Result<f32> { ... }
fn get_weight_contrast(&self) -> Result<f32> { ... }
fn get_weight_entropy(&self) -> Result<f32> { ... }
fn get_sampling_points(&self) -> Result<Vector<Point2f>> { ... }
fn get_init_seed_indexes(&self) -> Result<Vector<i32>> { ... }
fn get_init_seed_count(&self) -> Result<i32> { ... }
fn get_iteration_count(&self) -> Result<i32> { ... }
fn get_max_clusters_count(&self) -> Result<i32> { ... }
fn get_cluster_min_size(&self) -> Result<i32> { ... }
fn get_joining_distance(&self) -> Result<f32> { ... }
fn get_drop_threshold(&self) -> Result<f32> { ... }
fn get_distance_function(&self) -> Result<i32> { ... }
}
Expand description
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.
Required Methods§
fn as_raw_PCTSignatures(&self) -> *const c_void
Provided Methods§
sourcefn compute_signature(
&self,
image: &dyn ToInputArray,
signature: &mut dyn ToOutputArray
) -> Result<()>
fn compute_signature(
&self,
image: &dyn ToInputArray,
signature: &mut dyn ToOutputArray
) -> Result<()>
Computes signature of given image.
Parameters
- image: Input image of CV_8U type.
- signature: Output computed signature.
sourcefn compute_signatures(
&self,
images: &Vector<Mat>,
signatures: &mut Vector<Mat>
) -> Result<()>
fn compute_signatures(
&self,
images: &Vector<Mat>,
signatures: &mut Vector<Mat>
) -> Result<()>
Computes signatures for multiple images in parallel.
Parameters
- images: Vector of input images of CV_8U type.
- signatures: Vector of computed signatures.
sourcefn get_sample_count(&self) -> Result<i32>
fn get_sample_count(&self) -> Result<i32>
Number of initial samples taken from the image.
sourcefn get_grayscale_bits(&self) -> Result<i32>
fn get_grayscale_bits(&self) -> Result<i32>
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.
sourcefn get_window_radius(&self) -> Result<i32>
fn get_window_radius(&self) -> Result<i32>
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).
sourcefn get_weight_x(&self) -> Result<f32>
fn get_weight_x(&self) -> Result<f32>
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)
sourcefn get_weight_y(&self) -> Result<f32>
fn get_weight_y(&self) -> Result<f32>
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)
sourcefn get_weight_l(&self) -> Result<f32>
fn get_weight_l(&self) -> Result<f32>
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)
sourcefn get_weight_a(&self) -> Result<f32>
fn get_weight_a(&self) -> Result<f32>
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)
sourcefn get_weight_b(&self) -> Result<f32>
fn get_weight_b(&self) -> Result<f32>
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)
sourcefn get_weight_contrast(&self) -> Result<f32>
fn get_weight_contrast(&self) -> Result<f32>
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)
sourcefn get_weight_entropy(&self) -> Result<f32>
fn get_weight_entropy(&self) -> Result<f32>
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)
sourcefn get_sampling_points(&self) -> Result<Vector<Point2f>>
fn get_sampling_points(&self) -> Result<Vector<Point2f>>
Initial samples taken from the image. These sampled features become the input for clustering.
sourcefn get_init_seed_indexes(&self) -> Result<Vector<i32>>
fn get_init_seed_indexes(&self) -> Result<Vector<i32>>
** clusterizer ***
- Initial seeds (initial number of clusters) for the k-means algorithm.
sourcefn get_init_seed_count(&self) -> Result<i32>
fn get_init_seed_count(&self) -> Result<i32>
Number of initial seeds (initial number of clusters) for the k-means algorithm.
sourcefn get_iteration_count(&self) -> Result<i32>
fn get_iteration_count(&self) -> Result<i32>
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).
sourcefn get_max_clusters_count(&self) -> Result<i32>
fn get_max_clusters_count(&self) -> Result<i32>
Maximal number of generated clusters. If the number is exceeded, the clusters are sorted by their weights and the smallest clusters are cropped.
sourcefn get_cluster_min_size(&self) -> Result<i32>
fn get_cluster_min_size(&self) -> Result<i32>
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.
sourcefn get_joining_distance(&self) -> Result<f32>
fn get_joining_distance(&self) -> Result<f32>
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.
sourcefn get_drop_threshold(&self) -> Result<f32>
fn get_drop_threshold(&self) -> Result<f32>
Remove centroids in k-means whose weight is lesser or equal to given threshold.
sourcefn get_distance_function(&self) -> Result<i32>
fn get_distance_function(&self) -> Result<i32>
Distance function selector used for measuring distance between two points in k-means.