Classification of 2D Objects by Length


This application uses concepts of thinning and opening by reconstruction. Our goal here is to extract the longest objects of the image shown in figure 1, i.e., the principal feature is the length. An useful operator to extract this feature is the Skel.by Thin. skeleton by thinning. The result of that operator is shown in figure 2.

fig. 1 - Original Image

fig. 2 - Skeleton

As the goal requires, it is necessary now to clear all the small objects from figure 2. This is possible using another morphological operator: the N-Thinning. The operator will cut each object by their ending points the necessary to clear only the small ones. The parameter N is set accordingly to the length of the small objects. The result of this operator is shown in figure 3.

fig. 3 - N-Thinning

Now, it is possible to reconstruct the longer objects applying Opening by Reconstr. and using the result of the N-Thinning as markers for the original image. The result is shown bellow.

fig. 4 - Reconstruction



Back to the initial page