口の輪郭検出について
15 ビュー (過去 30 日間)
古いコメントを表示
私は口の輪郭を検出し、埋め、面積の検出を試してみたいと考えています.以下のMATLABさんのサイトをほぼ参考に数値などを変えコードを試したのですが画像のようにあまり口の部分を埋めることができませんでした.
口の部分を埋めるよう輪郭検出するにはどうすればよいか、追加した方が良い処理や手法等教えていただければ幸いです.申し訳ありませんがよろしくお願いいたします.

以下が試したものです.
clc , close
RGB = imread('自撮り口.JPG');
B1 = rgb2gray(RGB);
%%
[~,threshold] = edge(B1,'sobel');
fudgeFactor = 0.8;
BWs = edge(B1,'sobel',threshold * fudgeFactor);
imshow(BWs)
title('Binary Gradient Mask')
se90 = strel('line',3,90);
se0 = strel('line',3,0);
se45 = strel('line',3,45);
se135 = strel('line',3,135);
BWsdil = imdilate(BWs,[se90 se0 se45 se135]);
imshow(BWsdil)
title('Dilated Gradient Mask')
BWdfill = imfill(BWsdil,'holes');
imshow(BWdfill)
title('Binary Image with Filled Holes')
0 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!