File Exchange

image thumbnail

Removing blob(s) from a binary image

version 1.0.0.0 (2.17 KB) by Mathijs van Vulpen
'bwremove' removes the blob(s) in the seed image that is overlapped by the blob(s) in the mask image

2 Downloads

Updated 03 May 2016

View License

BWREMOVE Removes objects in binary image.
BW3 = BWREMOVE(BW1,BW2) returns a binary image BW3 where the objects from the mask image that overlap the seed image are removed. Both the seed BW1 and the mask BW2 images can have multiple blobs.
[BW3, BW4] = BWREMOVE(BW1,BW2) returns the binary image BW4 which contains the removed blob(s).

Class Support
-------------
The input images BW1 and BW2 can be logical or any numeric type and must be 2-D and nonsparse. The output images BW3 and BW4 are logical.

Example
-------
BW1 = imread('text.png');
BW2 = zeros(size(BW1));
BW2(34,126) = 1;
BW3 = bwremove(BW1,BW2);
figure, imshow(BW1)
figure, imshow(BW3)

Cite As

Mathijs van Vulpen (2021). Removing blob(s) from a binary image (https://www.mathworks.com/matlabcentral/fileexchange/20114-removing-blob-s-from-a-binary-image), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Mathijs van Vulpen

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!