![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176857/image.jpeg)
How do I isolate the layers of the given grayscale image?
2 次查看(过去 30 天)
显示 更早的评论
回答(1 个)
Takuji Fukumoto
2017-1-25
Here it is.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176857/image.jpeg)
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 个评论
Image Analyst
2017-1-26
Explain in detail what the imprecise terms "isolate" and "separate" mean? Do you want a masked image? One image or two? Assuming you had them, what would you do with them?
I see as many as 12 layers in that grayscale image. Which are the layers you want and what distinguishes them from the neighboring layers. Please post an annotated layer where you indicate the layers in a red outline or something.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!