Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to hightlight the mask in a image
조회 수: 2 (최근 30일)
이전 댓글 표시
If I'm in Mathematica, I just run
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190973/image.png)
I can get what I want, but I cannot find the corresponding function in Matlab? How to implement it? This is my test image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190974/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190975/image.png)
댓글 수: 0
답변 (1개)
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
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!