Wavelet Based Image Segmentation: Andrea Gavlasov A, Ale S Proch Azka, and Martina Mudrov A
Wavelet Based Image Segmentation: Andrea Gavlasov A, Ale S Proch Azka, and Martina Mudrov A
Abstract
1 Introduction
Image segmentation is an essential step in many advanced techniques of multi-dimensional signal
processing and its applications. Texture analysis occupies an important place in many tasks
such as scene classification, shape determination or image processing. This paper describes the
technique of wavelet transform use for features extraction associated with individual image pixels
and comparison of this method with application of the watershed transform technique. For the
image decomposition and feature extraction the Haar transform has been applied as a basic
tool used in the wavelet transform. A specific part of the paper is devoted to the mathematical
analysis of Haar transform as a tool for image compression and image pixels features extraction
using decomposition and reconstruction matrices. The method described is used for description
of the whole system enabling perfect image reconstruction. The proposed algorithm of the
Haar wavelet image decomposition includes image feature based segmentation and comparison
of results with the watershed transform. Individual methods have been verified for simulated
images and then applied for processing of selected magnetic resonance biomedical images. All
methods were designed in the Matlab environment.
is an orthonormal matrix as its rows are orthogonal to each other (their dot products are zero).
Therefore T−1 = TT and it is possible [4] to recover x from y by relation
x(1) y(1)
= TT (2)
x(2) y(2)
To show more clearly what is happening we can use a specific matrix x of the form
a b 1 a+b+c+d a-b+c-d
x= imlying that y = √ (4)
c d 2 a+b-c-d a-b-c+d
These operations correspond to the following filtering processes:
Top left: 2-D lowpass filter (Lo-Lo).
Top right: horizontal highpass and vertical lowpass filter (Hi-Lo).
Lower left: horizontal lowpass and vertical highpass filter (Lo-Hi).
Lower right: 2-D highpass filter (Hi-Hi).
To apply this transform to a complete image, we group the pixels into 2 × 2 blocks and apply
Eq. (3) to each block. To view the result, all the top left components in Fig. 1(a) of the 2 × 2
blocks in y were grouped together to form the top left subimage in Fig. 1(b) and the same for
the components in the other three positions. It is clear from Fig. 1(b) that the most of the
energy is contained in the top left (Lo-Lo) subimage and the least energy is in the lower right
(Hi-Hi) subimage. The top right (Hi-Lo) and the lower left (Lo-Hi) subimage contains [4] the
edges.
(b) Image after multiplication
of 2x2 blocks of original image with (c) Image after Matlab Haar wavelet
the Haar transform matrix decomposition algorithm,
(a) Original image, total energy = 8345.1429 and reordered, total energy = 4729.5714 total energy = 4729.5714
Figure 1: Original image (a) was decomposed using wavelet image decomposition by the Haar
transform and result (b) was obtained by application of Eq. (3) to each 2 × 2 block after
reordering and (c) by Matlab wavelet decomposition function
b) computation of the co-occurrence matrix features energy and contrast given in Eqs (5)
and (6) from the detail coefficients, obtained from each subimage Ci,j
N
Contrast = (i − j)2 Ci,j (6)
i,j=1
Figure 2: Wavelet based image segmentation involves all the segmentation steps using the
CONTRAST feature
4 Watershed Transform
In geography a watershed is the ridge that divides areas drained by different river systems.
A catchment basin means in this sense an area from which rainfall flows into a river or reservoir.
The watershed transform applies these ideas to the gray-scale image processing to enable solution
of a variety of image segmentation problems. Understanding the watershed transform requires us
to consider a gray-scale image as a topological surface, where the values of f (x, y) are interpreted
as heights. The watershed transform finds the catchment basins and ridge lines in such a gray-
scale image. In terms of the problem related to image segmentation the key concept is to change
the starting image into another one whose catchment basins are the objects or regions we want
to identify as studied by [2, 3] for instance.
To use the distance transform we have to convert original gray-scale image to binary image
at first using optimal global image threshold using Otsu’s method [6]. In the next step image
complement is defined. Image transform using the watershed method should be applied to a
matrix after its proper preprocessing to obtain the best image objects contours. All zero pixels
of the complementary image have been assigned by −∞ at first.
Figure 3: The segmentation technique starts from (a) real biomedical image, which is converted
by thresholding to (b) binary image followed by the application of the distance transform in
image (c) and the watershed transform (d) resulting in estimation of image segments
The matrix processed by the watershed transform in the next step resulted in a labelled matrix
identifying the watershed regions with its integer elements greater than or equal to 0. Its zero
values identify image contours and nonzero elements belong to watershed regions. The final
operation consists of the assignment of values 1 to zero elements and values 0 to all nonzero
elements with results presented in Fig. 3.
Figure 4: Results after watershed segmentation using gradients present (a) original image, its
(b) gradient image after Sobel filter application, (c) over-segmented image after watershed
transform and (d) resulting image after gradient image smoothing and repeated watershed
transform
7 Results
The segmentation techniques discussed in the previous sections were applied on two simu-
lated images and for one real biomedical image of size 128 × 128. The set of images assigned
as (a1, a2, a3) were segmented using wavelet transform, as (b1, b2, b3) using distance trans-
form and watershed transform, and as (c1, c2, c3) using gradients and watershed transform.
Problems connected with wavelet segmentation are closely related to thresholding and skele-
tonizing. It is important to elect optimal thresholding to keep the main image contours. On
the other hand the spurious spots and artifacts were removed. Examples of these problems in
resulting skeletonized images are presented in Fig. 5 (a1, a2) and Fig. 5 (a3), where the problems
with the spurious artifacts are more visible in the case of real biomedical image Fig. 5 (a3) and
it is more difficult to recognize the main image segments. In the case of simulated images in
Fig. 5 (a1, a2) there were no problems with region segmentation.
The watershed transform requires to consider a gray-scale image as a topological surface, where
the values of f (x, y) are interpreted as heights. There are the problems to identify the watershed
ridge lines on the basis in case that the values of f (x, y) of the different image regions have the
similar heights. So the watershed ridge lines are not detected. This is in the case of a simulated
image in Fig. 5 (b1). On the other hand, too many regions with different values of f (x, y) result
in over-segmentation presented in Fig. 5 (b3).
The watershed transform using gradients to image pre-processing is based on edge detection.
In this case the Sobel filter is used. Crossing the region to another one the high (edges) and
low (everywhere else) gradients are detected and in the gradient image we get the contours
highlight. Many spurious lines result in over-segmentation. Therefore, the gradient image have
to be smoothed and then segmented again as presented in Fig. 4. Results of the third technique
are presented in Fig. 5 (c1, c2, c3).
9 Acknowledgements
The work has been supported by the research grant of the Faculty of Chemical Engineering
of the Institute of Chemical Technology, Prague No. MSM 6046137306.
References
[1] S. Arivazhagan and L. Ganesan. Texture Segmentation Using Wavelet Transform. Pattern
Recognition Letters, 24(16):3197–3203, December 2003.
[2] A. Gavlasová, A. Procházka, and M. Mudrová. Wavelet Use for Image Classification. 15th
International Conference on Process Control, Štrbské Pleso, 2005.
[3] R. C. Gonzales, R. E. Woods, and S. L. Eddins. Digital Image Processing Using MATLAB.
Prentice Hall, 2004.
[5] M. G. Mostafa, T. F. Gharib, and coll. Medical Image Segmentation Using a Wavelet-Based
Multiresolution EM Algorithm. IEEE International Conference on Industrial Electronics
Technology & Automation, December 2001.
[6] Inc. The Mathworks. Image Processing Toolbox User’s Guide. The Mathworks, Inc., 3 Aplle
Hill Drive, Natick, MA 01760-2098, 5 edition, 1993 – 2006.