img = imread('blobDilate.jpg');
img = rgb2gray(img);
img(img < 50) = 0;
[rows, cols] = size(img);
figure, imshow(img), title('Original Image');
largestBlob = bwareafilt(logical(img), 1);
figure, imshow(largestBlob)
resizeImg = imresize(largestBlob, [rows + 50, cols + 50]);
removeRows = [1:25, size(resizeImg,1)-24:size(resizeImg,1)];
removeCols = [1:25, size(resizeImg,2)-24:size(resizeImg,2)];
resizeImg(removeRows,:) = [];
resizeImg(:,removeCols) = [];
figure, imshow(resizeImg)
props = regionprops(logical(resizeImg),'Area');
resizedBlobArea = [props.Area];
fprintf('%s %d\n', 'newResizedBlobArea: ', resizedBlobArea)
finalImg = logical(img + uint8(resizeImg));
figure, imshow(finalImg), title('Largest Blob resized Image')
Best Answer