PANDORE Version 6 |
GREYC-IMAGE |
pcontrast1quadtree
Performs quadtree (or octree) segmentation based on contrast criterion.
Synopsis
pcontrast1quadtree threshold [-m mask] [im_in|-] [rg_out|-]
Description
pcontrast1quadtree segments the input image im_in
into homogenous 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 contrast is calculated from:
contrast(R)= 1/N * SUM(max(C(s,t), t in V(s) and t in R))
and C(s,t)= | im_in[s] - im_in[t] |
where 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 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:
pcontrast1quadtree 10 tangram.pan a.pan
See also
Segmentation
C++ prototype
Errc PContrast1Quadtree( 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