PANDORE Version 6 |
GREYC-IMAGE |
pmeanshiftsegmentation
Performs pixel classification on image using mean shift algorithm.
Synopsis
pmeanshiftsegmentation spatial-bandwidth range-bandwidth minimum-region-area accuracy-level [-m mask] [im_in|-] [rg_out|-]
Description
The pmeanshiftsegmentation classifies the input image pixels
into regions using color homogeneity. It is a procedure for
locating the maxima of a density function given discrete
data sampled from that function. The algorithm
is based on the detection of the modes of this density function.
The parameters controls the classification
process. The spatial-bandwidth controls the size of the search window
when computing mean shift. The range-bandwidth controls the color
vicinity for homogeneous regions. The more the spatial-bandwidth
and the range-bandwith, the less number of regions.
The result is the region map rg_out.
Parameters
- spatial-bandwidth specifies a spatial search window of size
(2r+1)*(2r+1) during the mean shift computation,
where r is the spatial bandwidth.
It's an integer value greater than zero.
- range-bandwidth specifies the bandwidth of the search
window in the range subspace during the computation of mean shift.
It's a real value greater than zero (should not be high, generally <10).
- minimum-region-area specifies the minimum allowable region
area (in pixels) contained in the segmented image. It's an integer
greater than zero given in pixels.
- accuracy-level determines the accuracy level used when
computing mean shift. Value is an integer in [0..2], where 2 is the maximum
accuracy level. However the more is the accuracy level, the less is
speed level. 2 gives the most accurate results.
Note that the size of the spatial-bandwidth parameter also
infers on the speed.
Inputs
Outputs
Result
Returns the number of regions or FAILURE.
Examples
Segments the tangram pieces:
pmeanshiftsegmentation 7 6.5 100 0 examples/tangram.pan a.pan
See also
Segmentation
C++ prototype
Errc PMeanShiftSegmentation( const Imc2duc &ims, Reg2d &rgd, int spatialBandwidth, float rangeBandwidth, int minimumRegionArea, int accuracyLevel );
Reference
D. Comanicu, P. Meer: "Mean shift: A robust approach toward feature space analysis." IEEE Trans. Pattern Anal. Machine Intell., 24, 603-619, May 2002
Author: Régis Clouard