mathematical morphology application

MATHEMATICAL MORPHOLOGY APPLICATION TO FEATURES EXTRACTION
IN DIGITAL IMAGES
Rodrigo Frigato
Erivaldo Silva
Universidade Estadual Paulista
Faculdade de Ciências e Tecnologia
Campus de Presidente Prudente
[email protected]
[email protected]
ABSTRACT
Image segmentation needs efficient procedures for the feature detection process. Feature extraction, in Cartography,
can be used in cartographic updating. The extraction process is a complex task, mainly for the existing types of
objects in the images. In this work, Remote Sensing data and Mathematical Morphological techniques are
integrated.. In order to test the proposed approach, some morphological operators related to pre-process, were
applied to the original images. The features of interest chosen were roads. Routines were implemented in the
MATLAB environment. Results indicated good performances by the operators. The integration of the technologies
aimed to carry out the semi-automatic extraction of linear features with the purpose to use them in processes of
cartographic updating.
Keywords - Mathematical Morphological, Remote Sensing, Erosion and Dilation, Semi-automatic extraction of
features
INTRODUCTION
In Brazil there are still many problems related to cartography due to the existing mapping base which is
outdated. Surveys conducted for the purpose of mapping date back from decades of the 60’s and 70’s, meaning the
maps are outdated by more than 3 decades.
It is imperative that a country with territorial size and population like Brazil needs a solid and updated mapping
base. It is of fundamental importance to urban planning and consequently for the management of the entire national
territory. Conducting conventional surveys in order to reduce the outdated mapping depends on processes which are
complicated and expensive task, due to the vast territorial extension of the country.
This study aimed to use Mathematical Morphology - MM in detection of the cartographic features of interest in
high-resolution digital images through the application of morphological operators.
THEORETICAL BASE
Brazil needs fast and inexpensive methods that can be used in cases of extraction and / or detection of relevant
cartographic features, for the purpose that they be used in conventional processes to upgrade the basic mapping.
One way to minimize the outdating mapping is the use of all products of Remote Sensing and techniques for
Digital Image Processing - PDI. Due to the large number of satellites in orbit it is possible to be continuously
watching all changes over time in land surface, which then can detect the features of interest through techniques of
Remote Sensing.
The images of Remote Sensing have contributed a lot in different areas of knowledge such as Cartography,
Precision Agriculture, Meteorology and others. Currently there are various techniques for PDI that can be used
together with images of Remote Sensing for cartographic purposes. In this work, the chosen one is Mathematical
Morphology.
Pecora 17 – The Future of Land Imaging…Going Operational
November 18 – 20, 2008 Š Denver, Colorado
According to Soille (1999), Mathematical Morphological (MM) can be defined such as a theory for analysis of
the spatial structures. It is called Morphological because it examines the form of objects. It is mathematical in the
sense that the analysis is based on an adjusted theory, geometry and algebra. However, the MM is not just a theory,
but is also a powerful technique for the analysis of images.
The Mathematical Morphology is considered a non-linear approach in digital image processing of images that
have made excellent results in the detection of cartographic features of interest in digital images.
The Mathematical Morphology has two basic operators, the erosion and dilation, from which all others
morphological operations are derived. Here is the definition of those two operators according to FACON (1996):
Binary Erosion
Erosion of a binary image in a series X by structuring element B is defined by FACON (1996) as:
ero B (X) = X ero B = { x ∈ ε : Bx ⊂ X }
(2.1)
This definition indicates that the structuring element B slides in the image and compares the surrounding area
of each pixel in the vicinity of the central point (which, in most cases correspond to the physical center of structuring
element) and preserve the pixels neighborhoods where it matches.
Binary Dilation
The expansion of a binary image in a series X by structuring element B is (FACON, 1996):
dil B (X) = X dil B = { x ∈ X : Bx ∩ X ≠ ∅ }
(2.2)
This definition indicates that when the structuring element is examining the image, the vicinity of the central point
should be a possible intersection with the relevant points of the image, making it so that more pixels are captured.
The images were used in levels of gray. However the theoretical principle applied to binary images remain the
same for the images in levels of gray. A new concept for such use is to consider a job as a topographic relief where
standards are seen as dark valleys and peaks as clear patterns.
Erosion in Tone of Gray
Erosion in tone of gray of a signal (function) f by a structural element g is defined as (FACON, 1996):
ero g (f (x)) = Min {f (y) – g (x- y) : y ∈ E }
(2.3)
The erosion in levels of gray of f to g is to verify that the structuring element is centered at x below the function
f, since it will not be defined at a point where the structuring element is above the signal f.
The effects of erosion in levels of gray are:
• darken the image;
• expand and widen the valleys (dark standards);
• connect nearby valleys;
• reduce and sometimes eliminate peaks (clear standards);
• separate nearby peaks ;
The visual result of the eroding image in levels of gray presents itself with a reduction of the peaks and extend
the dark regions, as illustrated in Figure 1.
Pecora 17 – The Future of Land Imaging…Going Operational
November 18 – 20, 2008 Š Denver, Colorado
Figure 1. Result of erosion in levels of gray with a structural element.
Source: Silva (1995).
Dilation in Tone of Gray
The dilation in tone of gray of a signal f by a structural element g is (FACON, 1996):
dil g (f (x)) = Max{ f (y) + g (x – y) : y ∈ E }
(2.4)
In which the dilation in levels of gray of f to g is to verify if the structuring element centered at x is above the
function f, not being defined at a point where the structuring element is below the signal f.
The effects of expansion in levels of gray are:
• lighten the image;
• extend the peaks (light standards);
• connect nearby peaks;
• reduce and sometimes eliminate valleys (dark standards);
• separate nearby valleys;
The visual result of the dilated image in levels of gray present itself with decreases in valleys and expanding in
light regions, and the idea of the effect of applying the operator is illustrated in Figure 2.
Figure 2. Result of dilation in levels of gray with a structural element.
Source: Silva (1995).
As mentioned, the operators’ erosion and dilation provide basic conditions for the construction of other
morphological operators such as targeting; detection of features, pattern recognition etc.
Pecora 17 – The Future of Land Imaging…Going Operational
November 18 – 20, 2008 Š Denver, Colorado
DEVELOPMENT
The methodology is based on the use of morphological operators contained in toolbox of Mathematical
Morphology developed by SDC Information Systems, which operates coupled to software MATLAB. The
application of routines in image processing is aimed initially to improve the visual quality of the features of interest
in digital images, which will then afterwards be extracted.
The image used in the morphological processing is in the region of Presidente Prudente in São Paulo state
and contains an excerpt from the Raposo Tavares highway-SP-280. This image was obtained from the sensor on
board the satellite QUICKBIRD, which has spatial resolution of 0.61 meters. This image was chosen because it
contains features of interest in the area of cartography, such as roads. Figure 3 illustrates the original image.
Figure 3. Original Image.
From the Figure 3 image initiated the procedure of pre-processing to facilitate the extraction of the feature.
This aimed to increase the contrast of the feature of interest and reduce the prominence of noise, the operator
openrec was applied in the image together with the structuring element sebox, this is designed to create a new image
through the infer-reconstruction of the original image. Operator addm followed with a threshold value 130, this
operator creates a new image showing the difference in pixel value in the image of the runway in relation to the
neighborhood "pixelwise."
Increasingly seeking to get improvement in quality of the extracted feature, the image was binarized through the
binary operator with threshold 230. The operator turned all the pixels under 230 to the value "0" (black) and those
who were even higher, at "1" (white). The choice of threshold was based in analysis of the histogram of the image.
Figure 4 represents the result of the application of this operator.
Pecora 17 – The Future of Land Imaging…Going Operational
November 18 – 20, 2008 Š Denver, Colorado
Figure 4. – Binarized Image.
Figure 4 shows the image with only two shades of gray (black or white) and is now possible to implement other
operators with the aim to eliminate the noise surrounding the feature of interest. The operator areaclose (threshold
5000) was applied to remove the maximum quantity of noise possible. The result of this application is illustrated in
Figure 5.
Figure 5. Noise Elimination.
Subtracting Figure 4 and 5 resulted in Figure 6 shown below.
Pecora 17 – The Future of Land Imaging…Going Operational
November 18 – 20, 2008 Š Denver, Colorado
Figure 6. Subtraction.
For the analysis of Figure 6 shows that there was a huge improvement in the extraction feature of interest, even
though noises are still visual in the bottom of the image. To minimize these noises the operator areaopen with
threshold value 4600 was applied. It also applied the operator subm again, subtracting the image of the previous
image. Finally the operator areaopen was applied with a threshold 2000 enabling the removal of the last remaining
noises, Figure 7 illustrates the final image of the feature extracted.
Figure 7. Detected Image.
The result obtained in Figure 7 was overlaid the original image and can be seen in Figure 8.
Pecora 17 – The Future of Land Imaging…Going Operational
November 18 – 20, 2008 Š Denver, Colorado
Figure 8. Final result.
The analysis of the results obtained in Figure 8 concluded that the process of morphological extracting was
conducted in a satisfactory manner. The observation made was that there was no displacement of the feature
regarding its position on the original image. This result showed that the features extracted through Mathematical
Morphology may be used in procedures to update mapping.
Another way to assess the quality of the result obtained by mathematical morphology is to compare it with
conventional filters for the detection and / or extraction of edges such as Sobel and Prewitt. The comparison is
shown in Figure 9.
Sobel Filter
Prewitt Filter
Mathematical Morphology
Figure 9. Comparison between filters and Mathematical Morphology.
The analysis of Figure 9 illustrates that the process with the best results, in visual terms, is Mathematical
Morphology. Thus, it also showed the feasibility of using morphological operators in the process of extraction of
cartographic features.
CONCLUSION
Extracting features of digital images obtained by Remote Sensing is not a simple task. PDI also involved many
techniques which can also be used for the purpose of extraction.
Pecora 17 – The Future of Land Imaging…Going Operational
November 18 – 20, 2008 Š Denver, Colorado
In this work, the technique employed was the PDI Mathematical Morphology, chosen to present operations
capable of doing the analysis of the geometric structure of the entities present in the images. The Mathematical
Morphology is based in theory of sets, which allows the authorities to quantify in terms of form.
The morphologic operations were effective in extracting the tracks. It appears that the final products obtained
meet the proposed objectives, but it is good to emphasize that the Mathematical Morphology is based on the type of
image, ie, for each feature there will always be a sequence of morphological operators which is the most appropriate
depending of choice of thresholds and structural elements as well as the type of feature and image used for
detection.
The choice of appropriate thresholds are based in analysis of histogram of the image. Thus, it appears that the
use of the morphological tool in mapping is an alternative means for the extraction of features, as it is completely
viable and showed good results in this work. The Mathematical Morphology may be used for the extraction of other
targets in the scene, according to the objective morphological routines depend to each type of feature that you want
to extract. You may want to, for example; extract urban areas, drainage networks and other such features.
Other important points were the work of verifying that the application of morphology did not cause any
positional shift of the feature in the original image. Also comparing the result of morphology with other techniques,
this presented itself the best routine for extraction of highways.
As a final comment the results confirmed the potential use of the Mathematical Morphology in the extraction of
cartographic features of interest and that they may also be used in conventional processes to update mapping.
REFERENCES
FACON, J. Morfologia Matemática: Teorias e Exemplos. Editora Universitária Champagnat da Pontifícia
Universidade Católica do Paraná. Curitiba. 1996. xii. 320p: il.
LEONARDI, F.; SILVA, E. A. The use of mathematical morphology theory in cartography. In: 7 setmana
geomàtica, 2007, Barcelona. Proceedings da 7 setmana geomàtica. Barcelona : Institut de Geomàtica, 2007.
SDC MORFHOLOGY “TOOLBOX” FOR MATLAB 5, SDC “Information Systems”, June 28, 1999.
SILVA, E. A. Viabilidade de uso de operadores morfológicos na extração de feições cartográficas em imagens
orbitais de Sensoriamento Remoto – (Livre Docência) – Universidade Estadual Paulista Julio de Mesquita UNESP, 2002.
SOILLE, P. Morphological image analysis: principles and applications. Springer-Verlag Berlin Heidelberg, 1999.
ROUTINE:
mmopenrec(mmsebox(2));
mmaddm(130);
mmbinary(230);
mmareaclose(5000);
mmsubm(mmareaclose, mmbinary);
mmareaopen(4600);
mmsubm(mmsubm, mmareaopen);
mmareaopen(2000);
Pecora 17 – The Future of Land Imaging…Going Operational
November 18 – 20, 2008 Š Denver, Colorado