MATLAB: Hi All, My question is

contour detection and background fillingimage processingImage Processing Toolbox

I have a processed black and white image contour from edge detection command. I would like to fill the background completely black without any while line traces outside the contour. Can anyone please help me in getting it ?

Best Answer

Try bwareafilt():
binaryImage = bwareafilt(binaryImage, 1); % Take only the largest blob.
Related Question