Image Processing Toolbox | ![]() ![]() |
Syntax
Description
IM2 = imclose(IM,SE)
performs morphological closing on the grayscale or binary image IM
, returning the closed image, IM2
. The structuring element, SE
, must be a single structuring element object, as opposed to an array of objects.
IM2 = imclose(IM,NHOOD)
performs closing with the structuring element strel(NHOOD)
, where NHOOD
is an array of 0's and 1's that specifies the structuring element neighborhood.
Class Support
IM
can be any numeric or logical class and any dimension, and must be nonsparse. If IM
is logical, then SE
must be flat. IM2
has the same class as IM
.
Example
This examples closes an image to merge together the small features in the image that are close together. The example then opens the image to remove the isolated white pixels.
I = imread('pearlite.tif'); bw = ~im2bw(I,graythresh(I)); figure, imshow(bw), title('Step 1: threshold')
See Also
imopen
, imdilate
, imerode
, strel
![]() | imclearborder | imcomplement | ![]() |