# [−][src]Function arrayfire::confidence_cc

pub fn confidence_cc<InOutType>(    input: &Array<InOutType>,     seedx: &Array<u32>,     seedy: &Array<u32>,     radius: u32,     multiplier: u32,     iterations: u32,     segmented_val: f64) -> Array<InOutType> where    InOutType: ConfidenceCCInput,

Segment image based on similar pixel characteristics

This filter is similar to regions with additional criteria for segmentation. In regions, all connected pixels are considered to be a single component. In this variation of connected components, pixels having similar pixel statistics of the neighborhoods around a given set of seed points are grouped together.

The parameter radius determines the size of neighborhood around a seed point.

Mean and Variance are the pixel statistics that are computed across all neighborhoods around the given set of seed points. The pixels which are connected to seed points and lie in the confidence interval are grouped together. Given below is the confidence interval.

$$[\mu - \alpha * \sigma, \mu + \alpha * \sigma]$$ where

• $\mu$ is the mean of the pixels in the seed neighborhood
• $\sigma^2$ is the variance of the pixels in the seed neighborhood
• $\alpha$ is the multiplier used to control the width of the confidence interval.

This filter follows an iterative approach for fine tuning the segmentation. An initial segmenetation followed by a finite number iterations of segmentations are performed. The user provided parameter iterations is only a request and the algorithm can prempt the execution if variance approaches zero. The initial segmentation uses the mean and variance calculated from the neighborhoods of all the seed points. For subsequent segmentations, all pixels in the previous segmentation are used to re-calculate the mean and variance (as opposed to using the pixels in the neighborhood of the seed point).

# Parameters

• input is the input image
• seedx contains the x coordinates of seeds in image coordinates
• seedy contains the y coordinates of seeds in image coordinates
• radius is the neighborhood region to be considered around each seed point
• multiplier controls the threshold range computed from the mean and variance of seed point neighborhoods
• iterations is the number of times the segmentation in performed
• segmented_value is the value to which output array valid pixels are set to

# Return Values

Segmented(based on pixel characteristics) image(Array) with regions surrounding the seed points