【发布时间】:2016-10-08 18:00:23
【问题描述】:
我正在使用 MATLAB 2012b。
我能够获得图像中的对象轮廓:
使用主动轮廓分割的方法,结果是二进制掩码:
如何用原始 rgb 图像填充二进制图像的白色区域?
基本上我想要的是使背景完全变黑。
这是我的代码:
gambarOri = imread(pathGambar);
A = rgb2gray(gambarOri );
mask = zeros(size(A)); mask(10:end-10,10:end-10) = 1;
BW = activecontour(A, mask, 500);
figure, subplot(1, 2, 1), imshow(A), title('Grayscale');
subplot(1, 2, 2), imshow(BW), title('Segmented image in Binary');
【问题讨论】:
标签: matlab image-segmentation imagefilter