口の輪郭検出について

15 visualizaciones (últimos 30 días)
tmk
tmk el 2 de En. de 2021
 私は口の輪郭を検出し、埋め、面積の検出を試してみたいと考えています.以下の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')

Respuestas (0)

Categorías

Más información sobre C4ISR en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!