The filled_win.mat matrix is not binarized. It can be binarized using
filled_win = imbinarize(filled_win);
Even after doing this,
CC = bwconncomp(filled_win);
doesn't work. Maybe my concept of connected components is wrong, or maybe I am not using the command in the right way. Please help.