MATLAB: Area calculation for patches patch area calculation Dear sir, I want to find the area of the patches,which is the no of pixels within the region.How it is calculated? also i want to calculate the area of patches in the black region only.Please help sir Best Answer I = imread('capture1.jpg'); [L,N] = superpixels(I,100); figureBW = boundarymask(L);imshow(imoverlay(I,BW,'cyan'),'InitialMagnification',67)% Area of each patch A = zeros(N,1) ;for i = 1:N A(i) = nnz(L==i) ; % area in pixels end Related SolutionsMATLAB: How to calculate area of an irregular shape region in a binary image Try this:props = regionprops(binaryImage, 'Area');allAreas = [props.Area] MATLAB: Fill a particular blob with black Please try this.L = bwlabel(BW);[r,c] = find(L == 4);BW(r,c) = 0;figure,imshow(BW) Related QuestionSir shows an error in line2Error using lazysnapping,Expected input number 3, foreground, to be integer-valued.
Best Answer