Merge binary images and smooth the edges
7 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am trying to extract the shape of a metallic droplet from the first picture and convert it into a binary image with edges as smooth as possible. So far I have been using the following commands: im2bw (with different thresholds), imfill (to fill any holes in the droplet), and imopen to smooth the edges. However, I am far from the results I would like to obtain.
In order: (1) photo that I want to process (2-3) im2bw with two different thresholds (4) manual merge of pictures 2-3 (5) example of what I would like to achieve.

Does anyone have a suggestion on how I can proceed?
0 件のコメント
回答 (1 件)
Rik
2021 年 5 月 11 日
I'm not getting as smooth as your example, but this should do as a first approximate.
IM=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/614215/image.png');
BW{1}=rgb2gray(IM);
BW{2}=edge(BW{1},'canny');
BW{3}=imclose(BW{2},ones(10));
BW{4}=imfill(BW{3},'holes');
BW{5}=imopen(BW{4},ones(20));
BW{6}=~BW{5};
for n=1:6
subplot(2,3,n),imshow(BW{n}),title(sprintf('step %d',n-1))
end
2 件のコメント
Rik
2021 年 5 月 11 日
You could try to use it to zoom in to the relevant sections of your image. My approximation is reasonable if you want to segment the droplet, but is grossly inadequate if you are looking for the angle.
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
