An opening does not destroy as much information as the erosion. An opening will discard small objects, but will keep the largest ones with a very similar shape in the original and the final image.
The opening by a disc, , is the combination of an erosion followed by a dilation by . The opened image is denoted or et .
Consider a disc as the structuring element. As shown in figure 1, the opening is achieved by sliding the disc inside the object and discarding all the parts where the disc cannot fit.
Figure 2 shows another example.
In this case, when the rectangle is totally included in the set , all the points of the rectangle are kept; in the case of the erosion, only the central pixel was kept. One may also notice that the largest particle has been split in two parts, and that it has lost its two small peaks. The other particle has not been modified.
A closing is similar to a dilation but also less destructive. Small objects may be joined to larger ones.
A closing by a disc is a dilation by followed by an erosion by . The closing of the image will be denoted or and is defined as: . A closing fills the holes inside the particles, eliminates the small details by smoothing the boundary from the outside and connects close particles.
As shown in figure 3, the closing is achieved by sliding the disc outside the particle and filling all the parts where the disc cannot fit into.