I'm looking for a way to convert a classified raster into polygons based on spatial clusters within each class. For the clusters to be considered as valid I need them to consist of a minimum percentage of cells from one of the classes.
For example: An area made up of 70 % (or more) cells of class "1" will be considered as a cluster of class "1" even though the area is mixed up with 30 % cells beloning to other classes. The clustering analysis therefore should be based on the distance between cells of the same class.
Another option could be to base the clustering on a minimum number of cells within a certain class, along with a definition of a maximum search area.
For example: Within a specified area there should be 100 cells of "class 1" for it to be considered a cluster.
Most tools related to clustering seem to work only for vectors. I´ve looked at the SAGA-tool Cluster-analysis but it didn't really fit my purpose. Any ideas for solving this or which other tools that may be helpful?