Dear all,<div><br></div><div>I have a raster map with categorical values.&nbsp;</div><div>I have many occurrence of alone-pixels, where all neighbours&nbsp;</div><div>are different from a central pixels. So I need to change all pixels</div>
<div>that differ from alll its neighbours for the &quot;mode&quot; value.</div><div><br></div><div>I know that &quot;r.neighbours ..method=mode&quot; return the mode value.</div><div>Now I need to identify only those pixels that differ from neighbours.</div>
<div>I think one way is count all occurrence the value of central pixel</div><div>on a windows (like 3x3, 5x5), and attrib it on a bynary map, where&nbsp;</div><div>&quot;ones&quot; is for those positons where central pixels have frequency 1,</div>
<div>and &quot;zeros&quot; for those potisions where central pixels have frequency &gt;1.</div><div><br></div><div>Any help are welcome.</div><div><br></div><div>Best wishes,</div><div><br></div><div>miltinho astronauta</div>
<div>brazil</div>