フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to hightlight the mask in a image

2 ビュー (過去 30 日間)
Yode
Yode 2018 年 6 月 2 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
If I'm in Mathematica, I just run
I can get what I want, but I cannot find the corresponding function in Matlab? How to implement it? This is my test image

回答 (1 件)

Anton Semechko
Anton Semechko 2018 年 6 月 2 日
Here you go:
im=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/119871/test1.png'); % grayscale
bw=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/119872/test2.png'); % binary
B=bwboundaries(bw); % shape contours
% Superimpose contours on grayscale image
figure('color','w')
imshow(im)
hold on
for i=1:numel(B)
h=fill(B{i}(:,2),B{i}(:,1),'r');
set(h,'FaceAlpha',0.6,'EdgeColor','r','LineWidth',2)
end

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by