[GRASS-user] Fwd: How to obtain selected adjacent pixel values?

Nikos Alexandris nik at nikosalexandris.net
Sun Jun 30 14:49:23 PDT 2013


[..]

Markus Metz wrote: 
> # prepare a weights file with the contents
> 0 1 0
> 1 0 1
> 0 1 0

> r.neighbors in=raster_in out=raster_cardinalsum weight=weights method=sum

> r.mapcalc "RASTER_OUT = round(abs(4 * RASTER_IN - raster_cardinalsum))"

...easy, it is, to build a filter in GRASS :D

Thanks Markus,

N



More information about the grass-user mailing list