matlab components area

Solutions on MaxInterview for matlab components area by the best coders in the world

showing results for - "matlab components area"
April
18 Jan 2017
1A = randi([0 1], [10 10]);
2B = mat2gray(A);
3% To consider the horizontal or vertical connectivity set connectivity parameter = 4.
4cc = bwconncomp(B, 4);
5% Calculate area of individual connected component.
6Area = regionprops(cc,'Area');