I have a classified landcover raster which also contains the classes "clouds" (pixelvalue 5) and "shadows" (pixelvalue 10). I want to eliminate them by replacing these two classes by the majority of the surrounding classes e.g. "forest" (value 3) or "agriculture" (value 7). I want to do this automatically for the whole raster.
It does not matter whether the clouds are replaced only by the "biggest" neighbouring class or by percentage of the "biggest" and "smaller" neighbouring classes.
Here is an example: White are clouds, black shadows, green forest and yellow agriculture.
Cloud-Masking or mosaicing was not an option in my case. So, how can I postprocess the classification and elminate these classes using QGIS? Is it possible to perform a majority filter on a specific class?