igraphseg

Graph-based image segmentation

L = igraphseg(im, k, min) is a graph-based segmentation of the color image im (HxWx3). L (HxW) is an image where each element is the label assigned to the corresponding pixel in im. k is the scale parameter, and a larger value indicates a preference for larger regions, min is the minimum region size (pixels).

L = igraphseg(im, k, min, sigma) as above and sigma is the width of a Gaussian which is used to initially smooth the image (default 0.5).

[L,nreg] = igraphseg(im, k, min, sigma) as above but nreg is the number of regions found.

Example

im = iread('58060.jpg');
[labels,maxval] = igraphseg(im, 1500, 100, 0.5);
idisp(labels)

Reference

"Efficient graph-based image segmentation", P. Felzenszwalb and D. Huttenlocher, Int. Journal on Computer Vision, vol. 59, pp. 167–181, Sept. 2004.

Notes

Author

Pedro Felzenszwalb, 2006.

See also

ithresh, imser


Machine Vision Toolbox for MATLAB © 1990-2014 Peter Corke.