RTUEE / EC / EEEYr 2021 · Sem 72021

Q7Digital Image Processing

Question

16 marks

Q.4. (a) Discuss image opening morphological operation by writing its mathematical representation. [8]

(b) Discuss image closing morphological operation by using its mathematical representation. [8]

Answer

Opening (erosion followed by dilation, A o B = (A minus B) plus B) removes small protrusions and thin connections while preserving overall object shape; closing (dilation followed by erosion, A bullet B = (A plus B) minus B) fills small holes and gaps while similarly preserving overall shape, each smoothing contours from opposite sides.

(a) Image Opening

Opening is a morphological operation defined as an erosion operation followed immediately by a dilation operation, both performed using the same structuring element B. Mathematically, the opening of set A by structuring element B is written as:

In this expression, the erosion step (A ominus B) shrinks the object A, causing small protrusions, thin connecting bridges between larger regions, and isolated small noise specks to be eliminated entirely (since the structuring element cannot fit inside these narrow structures). The subsequent dilation step (using the same structuring element B) then grows the eroded result back outward, restoring the overall size and shape of the larger surviving object regions to approximately their original dimensions, since dilation is designed to compensate for the preceding erosion for sufficiently large shapes.

The net practical effect of opening is that small protrusions and thin connecting bridges are permanently removed (they do not reappear after the dilation step, because they were completely eliminated during erosion and dilation cannot recreate structure that no longer exists), while the overall shape and size of larger objects are largely preserved. Opening also has a smoothing effect on object contours, specifically smoothing the contour from outside the object (i.e., convex protrusions and jagged sharp corners sticking outward are rounded off or removed). Opening is commonly used for two main practical purposes: removing small noise specks or granular texture from a binary image, and separating (disconnecting) two or more objects that are touching via only a thin bridge, since that bridge is eliminated by the erosion step and not restored by dilation.

(b) Image Closing

Closing is the morphological dual operation to opening, defined as a dilation operation followed immediately by an erosion operation, again both performed with the same structuring element B. Mathematically, the closing of set A by structuring element B is written as:

Here, the dilation step (A oplus B) grows the object A outward, causing small holes, narrow gaps, and concavities within or between object regions to be filled in or bridged over (since the structuring element expands into and fills these small gaps). The subsequent erosion step (using the same structuring element B) then shrinks the dilated result back down, restoring the overall size and outer boundary of the object regions to approximately their original dimensions.

The net practical effect of closing is that small holes and narrow gaps within objects are permanently filled (they do not reopen after the erosion step, because they were completely filled during dilation and erosion cannot recreate a hole that no longer exists), while the overall shape and size of the objects are largely preserved. Closing has a smoothing effect on object contours from the inside of the object (i.e., concave notches, small holes, and inward-jutting gaps are filled in and smoothed over). Closing is commonly used to fill small holes and gaps that appear within objects (for example, holes left within a segmented blob due to noise) and to connect nearby object fragments that should logically belong to the same connected region but appear as separate touching-but-disconnected shapes due to noise or imperfect segmentation.

Opening: removes thin protrusionsOriginal (with thin spike)After opening (spike gone)Closing fills small internal gaps/holes similarly

Idempotence and Duality

Both opening and closing possess the important mathematical property of idempotence: applying the same operation a second time to an already-opened (or already-closed) image produces no further change, i.e., (A o B) o B = A o B, and similarly (A . B) . B = A . B. This is intuitively reasonable because the first application of opening has already removed every structure that the structuring element cannot fit inside, so a repeated erosion-dilation pass finds nothing further to remove; the same reasoning applies in reverse for closing and holes/gaps. This idempotence property is a key theoretical distinction between opening/closing and the more basic erosion/dilation operations, since repeated erosion (or repeated dilation) alone continues to shrink (or grow) an object indefinitely with each additional pass, never stabilizing to a fixed result the way opening and closing do.

Opening and closing are also mathematical duals of one another with respect to complementation: the opening of an image A by structuring element B is equivalent to the complement of the closing of the complement of A by the same structuring element B, i.e., (A o B)^c = A^c . B (where the superscript c denotes set complement, treating background as foreground and vice versa). This duality reflects the intuitive fact that opening removes small foreground protrusions in exactly the way that closing (applied to the inverted, background-as-foreground image) fills small background gaps, since a small foreground protrusion sticking out of an object is topologically the same kind of structure as a small background notch cutting into the complement of that object.

In combined practical use, opening followed by closing (or closing followed by opening) with the same or a similar structuring element is a very common preprocessing sequence applied to noisy binary images prior to further analysis such as object counting, shape measurement, or feature extraction: opening first removes small isolated noise specks and thin spurious protrusions, and the subsequent closing then fills in any small holes or gaps within the remaining objects, together producing a much cleaner, more topologically well-behaved binary representation of the true underlying objects in the scene, with their overall size and shape largely preserved from the original image.

It is useful to note the duality and complementary relationship between opening and closing: opening tends to remove small bright details/protrusions from an object (working on the foreground), while closing tends to fill small dark gaps/holes within or between objects (working from the background inward) - together, these two operations are frequently applied in sequence (for example, opening followed by closing) as a standard morphological noise-cleaning pipeline in practical image processing applications, since opening alone would leave small holes unfilled, and closing alone would leave small protrusions/noise specks intact, whereas the combined sequential application addresses both types of small-scale morphological irregularity while still preserving the overall size and shape of significant objects in the image.

Both opening and closing are idempotent operations, meaning that applying the same operation a second time to an already-opened or already-closed image produces no further change - this idempotency property is a useful practical characteristic, confirming that a single application of opening or closing achieves its full intended smoothing/cleanup effect, without requiring repeated iterations to reach a stable result.

Back to Paper