Fuzzy C-Means Clustering
FUZZY
normalisation: normalized image using mean+2std
⬇
denoising: gaussian conv kernel with kernel_size=11, sigma=1.5 (gaussian bell-curve distribution, heavily weighting the center pixel VS box blur)
⬇
threshold: cmeans (two clusters centers of darker vs lighter pixels [0, 1])
⬇
trapezoid membership (4 vertices [a,b,c,d] in a trapezoid to represent [0-1], [1-1], [1-0] ranges), find degree of membership of a pixel to either [0, 1] cluster
e.g. uG(x) = degree of element X belongs to a member of Group G = (x-a)/(b-a) if a < x < b, means partial membership
by setting either ab or cd to the one cluster center and the counterparts cd or ab to the min/max from the smoothed map
find degree to either dark group or light group e.g. [:, :, 0] = 0.2, [:, :, 1] = 0.8
⬇
cleanup: median filter with window_size=3
⬇
normalisation: argmax on the 3rd axis => argmax([:, :, 0] = 0.2, [:, :, 1] = 0.8) = 1