How do we fill this kind of gap with Matlab (without changing the size of the object)?

1 回表示 (過去 30 日間)
Gobert
Gobert 2022 年 4 月 25 日
編集済み: Gobert 2022 年 4 月 25 日
I need your help!
I have an image A (see below - left). Can you help me with a matlab function that can produce the image B (see below - right)
(A) (B)
Note that the below Matlab code does not work (since it works on holes inside a closed boundary of an object - which is not the case with image A where the boundary is open):
I = imread('');
B = imbinarize(I);
F = imfill(B,'holes');
figure, imshow(I), title('input')
figure, imshow(F), title('output')

採用された回答

Matt J
Matt J 2022 年 4 月 25 日
編集済み: Matt J 2022 年 4 月 25 日
We don't know thickness of the Image A veins in pixels (it's always good to attach your example images as .mat files), but whatever it is it would go in the appropriate place below.
B=imopen(B,strel('disk',vein_thickness))
  1 件のコメント
Gobert
Gobert 2022 年 4 月 25 日
編集済み: Gobert 2022 年 4 月 25 日
I have attached the images A and B. Thank you! It worked (when I used the thickness equals to 10 approx.)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by