PANDORE Version 6 |
GREYC-IMAGE |
pcontrastquadtree
Performs quadtree (or octree) segmentation based on contrast uniformity.
Synopsis
pcontrastquadtree threshold [-m mask] [im_in|-] [rg_out|-]
Description
pcontrastquadtree segments the input image im_in
into homogeneous regions. Homogeneous regions are regions that have
an inner contrast ≤ 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 contrast ≤ 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 uniformity degree is calculated from:
contrast(R)= MAX(R) - MIN(R).
For 3D image, the output region map is composed of octree regions.
Parameters
- threshold is the maximum contrast 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:
pcontrastquadtree 10 tangram.pan a.pan
See also
Segmentation
C++ prototype
Errc PContrastQuadtree( const Img2duc &im_in, Reg2d &rg_out, Uchar threshold );
Version française
Segmentation d'une image par quadtree (ou octree) selon le contraste.
Author: Laurent Quesnel