
How do I isolate the layers of the given grayscale image?
6 views (last 30 days)
Show older comments

0 Comments
Answers (1)
Takuji Fukumoto
on 25 Jan 2017
Here it is.

I = imread('point5.jpg');
Ig = rgb2gray(I);
imtool(Ig)
BW = Ig > 118;
BW2 = BW;
ext = logical(ones(numel(BW(:,1)),1));
BW2 = [ext BW2 ext];
% BW2(:,[1 end]) = 1;
BW2 = imdilate(BW2,ones(3));
BW2 = imfill(BW2,'holes');
BW2 = imerode(BW2,ones(3));
BWout = BW2(:,2:end-1);
figure ,imshow(BWout)
4 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!