Python-SRM — Statistical Region Merging in Python

Description

Python-SRM is a Python implementation of the Statistical Region Merging algorithm (SRM), as described in TPAMI'04 or PR'05 (see Bibliography for more details).

examples/lena.png examples/lena-segmented.png

See the Java applet for an online demonstration of the method.

Prerequisite

Usage

The SRM module contains one class called SRM. The class constructor expects two arguments:

After the initialization, the segmentation can be launched with the method run which expects no arguments.

See the following section for an example.

Example

from scipy.misc import imread
from matplotlib import pyplot

from SRM import SRM

im = imread("lena.png")

srm = SRM(im, 256)
segmented = srm.run()

pyplot.imshow(segmented/256)
pyplot.show()

Download

Directly: http://www.lix.polytechnique.fr/~schwander/python-srm/python-srm-0.1.tar.gz

On PyPI: http://pypi.python.org/pypi/python-srm

Darcs repository: http://www.lix.polytechnique.fr/~schwander/darcs/python-srm/

Bibliography

Other implementations

Licence

Python-srm is free software, released under the term of the BSD license.

Copyright 2010-2012 Olivier Schwander <schwander@lix.polytechnique.fr>