Larger regions draw first: they calculated based on corresponding bin value within a neighbour area.
To avoid inclusion of upper small and same color layers on top of existing regions: I used considered the gray values for certain thresholds, where: the region will be drawn if the difference of grays between the upper region and previous color on the canvas is more than a threshold. The idea did not work well, as I expected. Region size changes based on the k-mean clusters.
targetsize = targetsize * pr; where pr is the probably of the bin that current seed fall into it to the neighbour count. pr = bin[q]/(nxn) From left to right, K = 8, 16, 32, 64. The right most image used fixed region reduction value. Image on the left uses all seeds from SLIC regions. In the middle image, seeds on the contours of the connected components removed. in the right image, seeds on the contours and also on the canny edges are removed.
Many holes got filled and also fixed some of the leakages on the regions on latter layers (smaller). |
Categories |