PANDORE Version 6 |
GREYC-IMAGE |
pvariancequadtree
Performs quadtree (or octree) segmentation based on variance uniformity.
Synopsis
pvariancequadtree threshold [-m mask] [im_in|-] [rg_out|-]
Description
pvariancequadtree segments the input image im_in
into homogeneous regions. Homogeneous regions are regions that have
an inner variance degree ≤ threshold.
The principle of the algorithm is as follows:
- At the begin consider the image as the first block.
- If the block violates the uniformity predicate (i.e. inner variance ≤ threshold)
then split the block into four equally sized sub-blocks and
then apply the algorithm recursively on each sub-blocks.
Therefore, the result is composed of rectangular regions.
The variance degree is calculated from:
variance(R)= SUM((im_in[i] - mean(R))^2, i in R) / N
where im_in[i] are pixels of the region R, and
N is the number of pixels of the region R.
For 3D image, the output region map is composed of octree regions.
Parameters
- threshold is the maximum variance value
to decide if a region is homogeneous or not.
Values are from the gray scale
of the input image im_in (eg. 0-255 for Uchar image).
Inputs
- im_in: a grayscale image.
Outputs
Result
Returns the number of regions.
Examples
Builds the quadtree of tangram.pan:
pvariancequadtree 10 tangram.pan a.pan
See also
Segmentation
C++ prototype
Errc PVarianceQuadtree( const Img2duc &im_in, Reg2d &rg_out, float threshold );
Version française
Segmentation d'une image par quadtree (ou octree) selon la variance.
Author: Laurent Quesnel