# Granulometry by morphological opening and closing

I am trying to understand granulometry. I understand that it deals with determining the size distribution of particles in an image and uses the principles of opening and closing.

I have a smoothed image with marbles in different sizes and call it A and a structuring element B, which is a disk with variable radii. I get that when opening the image with the structuring element B, smaller marbles disappear and by increasing the radius of B, bigger marbles start to disappear.

What I do not understand is what will happen if I use closing instead of opening. Do the bigger marbles disappear with a smaller radius B? So, does the exact opposite happen with closing?

## 2 Answers

When you use the opening, the overall operation is called a granulometry. However, when you use a closing, it's called an anti-granulometry. It's the dual operation. Combined together, they form the Pattern Spectrum.

In your case, if you apply a closing, you will certainly measure the structures between the marbles.

However, it is definitely not recommended to apply a smoothing first, because it will smooth the edges and small particles. Consequently, the particles detection will be less accurate.

• It depends on the image quality, of course. If the image is fine, and there isn't residual noise present, then no preprocessing is necessary. Otherwise, a low pass filter with window size much smaller than your smallest particle is recommended to smooth out unnecessary details and noise in the image. – goldrik Dec 21 '17 at 10:31

You can think of closing as the dual operator to opening; while opening the image using structuring elemnts $B$ at different sizes gives you values for the Pattern Spectrum $P(k)$ at $k >= 0$, closing will give you values at $k < 0$. These give you an idea of the sizes of "holes" present in the image, rather than the actual objects.

Closing the image is also equivalent to opening the image complement.