[GRASS-user] Probabilistic neighborhood analysis

Maris Nartiss maris.gis at gmail.com
Mon Jan 9 23:40:04 PST 2023


Hello Bernardo,
although a solution with r.mapcalc random could be made to work, I'd
say creating a new dedicated module is the way to go. Just an idea –
create neighbour count raster (how many cells with centre class are in
a sliding window), in second pass unroll classes based on their count
and then choose random class from obtained list.

I don't think it is so common to infill (inpaint) categorical values
in classification results of remote sensing.
Māris.

pirmd., 2023. g. 9. janv., plkst. 13:18 — lietotājs Bernardo Santos
via grass-user (<grass-user at lists.osgeo.org>) rakstīja:
>
> Hi Ken,
>
> The fuzzy logic tools seem interesting! But I am new to the concept so I did not really think about how could I set functions/rules that increase with the frequency of a land cover class...
> Do you know any example in this context?
>
> I thought that people working with satellite imagery classification and cloud cover would have experience with that, since sometimes it is necessary to somehow interpolate and fill values cover by clouds...
>
> Best
> B
>
> Em segunda-feira, 26 de dezembro de 2022 16:50:42 GMT+1, Ken Mankoff <mankoff at gmail.com> escreveu:
>
>
> What about using the fuzzy logic modules?
>
>   -k.
>
> Please excuse brevity. Sent from tiny pocket computer with non-haptic feedback keyboard.
>
> On Wed, Dec 14, 2022, 13:38 Bernardo Santos via grass-user <grass-user at lists.osgeo.org> wrote:
>
> Hi,
>
> I am trying to produce scenarios of past land cover, before hydropower reservoirs were built. To do so, I need to fill empty pixels from a raster in the locations where the reservoirs are currently present, using as input the actual land cover map. I tried doing that with r.neighbors (taking method=mode) with neighborhoods of increasing size, to replace null pixels with the most common land cover class in the neighborhood. I also tried that with r.fill.stats which is basically the same thing.
> However, the results gets very homogeneous, since the interpolated null cells always get the value of the most common land cover class.
>
> Do anyway know of a method in GRASS to perform a "probabilistic" neirighborhood analysis, where cells in a neighborhood are given weights (possibly related to the distance to the central cell and to their frequency) and these weights are used to stocastically sample a value to fill the central cell?
> If not in GRASS, does anyway know of such a method in a different platform, i.e. R?
>
> Thanks!
> Best
> Bernardo
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list