[gdal-dev] erosion/dilation in gdal

Vikalpa Jetly vjetly at i3.com
Tue Feb 3 12:41:19 EST 2009


> Johan Nouvel wrote:
> Hello all,
>
> Is there a way to do erosion/dilatation on image in gdal ?
>
> I've looked in alg.h, but I've seen no straight way to do such thing.


Johan,
On the Python side there is the ndimage package that is included in scipy
(http://www.scipy.org/SciPyPackages/Ndimage) that has erosion and dilation
functions that you might want to consider. Take a look at binary and grey
scale morphology here:

http://stsdas.stsci.edu/numarray/numarray-1.5.html/module-numarray.ndimage.h
tml

If they do what you need, then you can read an image into a numpy array
using gdal,perform erosion/dilation, write a new image out with the result
and rewrite extent and projection to the image.

Vikalpa










More information about the gdal-dev mailing list