[−][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 neigrhoods around a given set of seed points are grouped together.
The parameter radius
determines the size of neigrhood around a seed point.
Mean and Variance are the pixel statistics that are computed across all neigrhoods 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.
\begin{equation} [\mu - \alpha * \sigma, \mu + \alpha * \sigma] \end{equation} where
- $ \mu $ is the mean of the pixels in the seed neigrhood
- $ \sigma^2 $ is the variance of the pixels in the seed neigrhood
- $ \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 neigrhoods 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 neigrhood of the seed point).
Parameters
input
is the input imageseedx
contains the x coordinates of seeds in image coordinatesseedy
contains the y coordinates of seeds in image coordinatesradius
is the neigrhood region to be considered around each seed pointmultiplier
controls the threshold range computed from the mean and variance of seed point neigrhoodsiterations
is the number of times the segmentation in performedsegmented_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