merge all patches smaller than 5 pixels into bigger classes, using 8 connectivity (horizontal, vertical and diagonal)