フィルターのクリア

How to fill part of an image using imfill?

2 ビュー (過去 30 日間)
Hadi Ghahremannezhad
Hadi Ghahremannezhad 2020 年 10 月 8 日
I have an image like this:
img
and I wanted to fill the bottom part using a mask like this as the location of seed points:
mask
This is what I tried but didn't work:
img = imread('img.jpg'); maskImg = imread('mask.png');
[Gmag, Gdir] = imgradient(img,'sobel');
mask = imbinarize(maskImg);
[rows,columns] = find(mask);
bw = imfill(Gmag, [rows(:) columns(:)]);
figure, imshow(bw);
How can I fill the road part of the image above?

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by