Monday, January 17, 2011

Test images for geodesic region growing (watersheed with gray seeds)

Two new 8bits images, made with the gimp, to test watershed with seeds:
cg.jpeg: a grayscale image of a circle
s.jpeg: a grayscale image of two seeds within the circle.

Now let the seeds  grow inside the circle. Using Mahotas from pycrust, here is a python session:

PyCrust 0.9.8 - The Flakiest Python Shell
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import readmagick
import mahotas
print c.shape
(100, 100, 3)
print s.shape
(100, 100)
cg=c[:,:,0]#converts the 3 channels image into a 1 channel grayscale image.
print c.shape
(100, 100, 3)
import pymorph

#converts the 3 channels image into a 1 channel grayscale image.

print cg.shape
(100, 100)
print s.shape
(100, 100)
lab=mahotas.cwatershed(cg, s)
#save the image in jpeg, blogspot doesn't like tif
After watershed the labelled region:

The inner circle region is ok, but outside ...

Post a Comment