How to get smoothed edges afeter background removal ?

4 次查看(过去 30 天)
How to get smoothed edges afeter background removal ? from below file exchange ?
My resutlts :
resultimage.png
  1 个评论
KALYAN ACHARJYA
KALYAN ACHARJYA 2019-12-31
编辑:KALYAN ACHARJYA 2019-12-31
There complete background is not yet remove. After only you should proceed for make smooth boundary.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2019-12-31
Take your binary image and smooth it then threshold at 0.5 and apply it.
windowSize = 9; % An odd number. Bigger = more smoothing.
kernel = ones(windowSize)/windowSize^2;
blurryMask = conv2(mask, kernel, 'same') > 0.5;
% Mask the image using bsxfun() function to multiply the mask by each channel individually.
maskedRgbImage = bsxfun(@times, rgbImage, cast(blurryMask, 'like', rgbImage));

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by