Vous êtes sur la page 1sur 60

Chapter 1 1-8

1. Introduction
1.2 Aim of the project
1.2.1 Objectivities of the thesis
Chapter 2 8-19
2. Introduction
2.1.2 History of Image Processing
2.2 Significance of Image Processing
2.3 Digital Image Processing
2.4 What is an Image?

2.4.1 Gray scale image

2.4.2 Representative color images

2.4.3 RGB image


2.5 Coordinate Convention
2.6 Fundamental Steps in Image Processing

2.6.1 Image Acquisition


2.6.2 Image Enhancement
2.6.3 Image Restoration
2.6.4 Color image Processing:
2.6.5 Wavelet and Multi-Resolution Processing
2.6.6 Compression
2.6.7 Morphological processing
2.6.8 Segmentation
2.6.9 Representation and description
2.6.10 Recognition
2.6.11 Knowledge base
Chapter 3 20-27

1
3.1 Image Segmentaton
3.2. Segmentation Techniques
3.2.1 Spatial Clustering
3.2.2 Split and Merge Segmentation
3.3 Methods

3.3.1 Thresholding

3.3.2 Region growing


3.3.3 Classifiers
3.3.4Clustering
3.3.5 Markov random field models
3.3.6 Other approaches
3.4 Medical Image Segmentation Technique
3.4.1 Initial Approach to MIST
3.4.2 Standard Edge Detection
3.4.3 Dimensionality
Chapter 4 28-42
4.1 Problem Description and Hypothesis of Our Model
4.2 Global and Local Energy Segmentation Model (GLE)
4.3 Contours
4.4 Energies for Contours
4.4.1 Internal energies
4.4.2 Constraint energies
4.4.3 External energies
4.5 Region-Based Energies
4.5.1 Mean Energy model
4.5.2 Gaussian Energy Model
4.6 Level Sets
4.6.1 Minimization of the Energy Function

2
4.7 GLE Parameter Settings
4.8 Quantitative Evaluation and Comparisons on Noisy Synthetic Images With
Inhomogeneities

Chapter 5
5.1 Introduction to MATLAB
5.1.2 Typical uses of MATLAB
5.1.3 Features of MATLAB

5.2MATLAB System
5.3 Some Basic Plot Commands:

5.4 Algebraic Operations In Matlab: Scalar Calculations

5.5 Matlab Working Environment

5. 5.1 MATLAB Desktop


5.5.2 Using the MATLAB Editor to create M-Files
5.5.3 Getting Help:
5.6 Data Types
5.7 Working formats in Matlab
5.7.1 Intensity image (gray scale image)
5.7.2 Binary image
5.7.3 Indexed image
5.7.4 RGB image
5.7.5 Multiframe image
Chapter 6
6.1 EXPERIMENTAL RESULT
Chapter 7
7. CONCLUSION

Chapter 8

3
8. REFERENCES

List of figures

Figure 2.1 Sample Image.

Figure 2.2: Pixel arrangement

Figure 2.3.: True color image

Figure 2.4: The additive model of RGB. Red, green, and blue are the primary stimuli
for human color perception and are the primary additive colors.

Figure 2.5 Fundamental Steps in Digital Image Processing

Figure 4.1 Contour Initialization

4
Figure4.2: Deformation of a snake. The left picture corresponds with the
initialization; the right picture shows the final shape of the snake after having
minimized the energy

Figure:4.3 Initial Contours of GLE LBF LSII

Figure.5.1 : Features and capabilities of MATLAB

Figure.5.2: MATLAB desktop

List of Tables

Table 5.6.1: Image Formats


Table 5.6.2:MATLAB functions

5
Chapter 1
1.1 INTRODUCTION
Contours are used in the field of digital image processing to find the contour
of an object. They are used in computer vision and image analysis to detect and
locate objects, and to describe their shape. Contour is a powerful tool for
segmentation in image processing. There are several advantages of contour models
over image segmentation methods, such as edge detection, thresholding, and region
grow.
Image segmentation is one of the substantial techniques in the field of image
processing. Image segmentation is defined as the partitioning of an image into non
overlapping regions made up of pixels.
The evolution of the interface is driven by minimizing an energy defined by
a variational formulation which mathematically expresses the properties of the object
to be segmented. Classically, the terms associated to image features are either edge-
based, such as the image gradient on the contour, or region-based terms, as
introduced by Chan and Vese. Region-based terms are known to be more robust to
noise than edge based contours and they do not need the initialization to be near the
solution. The work of Chan and Vese is based on evolving the interface according to
the variance of the gray-level values of both interior and exterior regions. This
approach has been extended, since then, to other features such as the Bayesian model
and histogram model. The latter approaches do define the inner and outer regions as
the whole inner and outer space, respectively, of the evolving contour. Thus, they
may fail if these features are not spatially invariant. This problem is tackled in that
proposes to compute the features in a band around the evolving contour. In the inner
and outer regions are defined at each point of the evolving region as the intersection
between a ball and the inside and outside space. Li et al. used a kernel function at
each point to define a region-scalable fitting term.

6
According to the representation of the evolving interface, contours may be
classified into parametric and geometric approaches. Geometric contours are used for
curve topologies and parametric contours are used for set of discrete points.
My work stems from the ideas of free-form deformation technique. Free-form
deformation has been actively used for medical image registration. However, to the
best of our knowledge, free-form deformation has not been used for parametric
contours. In our work, we use the mean value coordinates as the parameterization to
deform the evolving contour. Mean value coordinates have several advantages over
free-form deformation, namely that control points only need to form a closed
polygon that may have any shape. Any point of the space is inside or outside of this
polygon may be parameterized with respect to the control points. For free-form
deformation the control points need to form a regular shape and only interior points
may be parameterized with them. In our approach, we can easily deal with region-
based approaches. This is an advantage with respect to most previous parameterized
approaches, which are only able to deal with edge-based energies. According to our
knowledge, there is almost no work in the field of parametric-based approaches,
except in 3D, able to deal in a unified manner with the mean, Bayesian and
histogram model, which is the case in this paper. As with other similar parametric-
based approaches, in our approach the evolving contour is locally deformed as the
polygon vertices are moved. The deformation applied to the evolving contour is
implicitly regularized, as will be seen, according to the distance of the polygon to the
evolving interface. The versatility of our approach opens the door to new
applications such as medical image segmentation, where most of the times the
structure to be segmented has only one regular connected component.

1.2 Aim of the project


 In this work, the mean value coordinates are used as the parameterization to
deform the evolving contour.

7
 In this approach the evolving contour is locally deformed. The deformation
applied to the evolving contour is implicitly regularized.

1.2.1 Objectivities of the thesis


 In this approach, can easily deal with region-based approaches. This is an
advantage with respect to most previous parameterized approaches, which
are only able to deal with edge-based energies.
 According to our knowledge, there is almost no work in the field of
parametric-based approaches, able to deal in a unified manner with the
mean, Bayesian and histogram model.
 As with other similar parametric-based approaches, in our approach the
evolving contour is locally deformed as the polygon vertices are moved.
 The deformation applied to the evolving contour is implicitly regularized,
as will be seen, according to the distance of the polygon to the evolving
interface.
 The versatility of our approach opens the door to new applications such as
medical image segmentation, where most of the times the structure to be
segmented has only one regular connected component.
 Our technique also outperformed the region-based model when dealing
with images without intensity inhomogeneities and produce better
segmentation results than the graph-based algorithms including graph-cuts
and random walker when segmenting noisy images.

8
Chapter 2

2.1 Introduction to Image Processing


In electrical engineering and computer science, image processing is any
form of signal processing for which the input is an image and the output of image
processing may be either an image or, a set of characteristics or parameters related to
the image. It may also be considered as a technique in which the data from an image
are digitized and various mathematical operations are applied to the data, generally
with a digital computer, in order to create an enhanced image that is more useful or
pleasing to a human observer, or to perform some of the interpretation and
recognition tasks usually performed by humans.
Image processing usually refers to digital image processing, but optical and
analog image processing are also possible. Analog Image Processing refers to the
alteration of image through electrical means. The most common example is the
television image. The term digital image processing generally refers to processing of
a two-dimensional picture by a digital computer.

2.1.2 History of Image Processing


Interest in digital processing techniques dates back to the early 1920s when
digitized pictures of world news events were first transmitted by submarine cable
between New York and London. Some of the initial problems in improving the visual
quality of these early digital pictures were related to the selection of printing
procedures and the distribution of brightness levels. Application of digital image
processing concepts did not become widespread until 1960s, when third-generation
digital computers begin to offer the speed and storage capabilities required for
practical implementation of image processing algorithms. Since then, this area has
experienced vigorous growth, having been a subject of inter-disciplinary study and
research, in such fields as Engineering, Computer Science, Information Science,
Remote Sensing, Biology, Medicine, Physics and Chemistry.

9
2.2 Significance of Image Processing
Image processing is an active area of research in such diverse fields as
medicine, astronomy, microscopy, defense, industrial quality control, and the
publication and entertainment industries. The concept of an image has expanded to
include three-dimensional data sets (volume images), and even four-dimensional
volume-time data sets.

The analysis of a picture using techniques that can identify shades, colors
and relationships that cannot be perceived by the human eye. Image processing is
used to solve identification problems, such as in forensic medicine or in creating
weather maps from satellite pictures. It deals with images in bitmapped graphics
format that have been scanned in or captured with digital cameras. The principle
advantage of Digital Image Processing methods is its versatility, repeatability and the
preservation of original data precision.

2.3 Digital Image Processing


An image may be defined as a two-dimensional function f(x, y), where x & y
are spatial coordinates, & the amplitude of f at any pair of coordinates (x, y) is called
the intensity or gray level of the image at that point. When x, y & the amplitude
values of f are all finite discrete quantities, we call the image a digital image. The
field of DIP refers to processing digital image by means of digital computer. Digital
image is composed of a finite number of elements, each of which has a particular
location & value. The elements are called pixels.

Vision is the most advanced of our sensor, so it is not surprising that image
play the single most important role in human perception. However, unlike humans,
who are limited to the visual band of the EM spectrum imaging machines cover
almost the entire EM spectrum, ranging from gamma to radio waves. They can

10
operate also on images generated by sources that humans are not accustomed to
associating with image.

There is no general agreement among authors regarding where image processing


stops & other related areas such as image analysis& computer vision start.
Sometimes a distinction is made by defining image processing as a discipline in
which both the input & output at a process are images. This is limiting & somewhat
artificial boundary. The area of image analysis (image understanding) is in between
image processing & computer vision.

There are no clear-cut boundaries in the continuum from image processing at


one end to complete vision at the other. However, one useful paradigm is to consider
three types of computerized processes in this continuum: low,mid & high-level
processes. Low-level process involves primitive operations such as image processing
to reduce noise, contrast enhancement & image sharpening. A low- level process is
characterized by the fact that both its inputs & outputs are images. Mid-level process
on images involves tasks such as segmentation, description of that object to reduce
them to a form suitable for computer processing & classification of individual objects.
A mid-level process is characterized by the fact that its inputs generally are images
but its outputs are attributes extracted from those images. Finally higher- level
processing involves “Making sense” of an ensemble of recognized objects, as in
image analysis & at the far end of the continuum performing the cognitive functions
normally associated with human vision.

Digital image processing, as already defined is used successfully in a broad


range of areas of exceptional social & economic value.

2.4 What is an Image?


An image is represented as a two dimensional function f(x, y) where x and
y are spatial co-ordinates and the amplitude of ‘f’ at any pair of coordinates (x, y) is
called the intensity of the image at that point.

11
Figure2.1: Sample Image.

 Pixel :
A pixel (short for picture element) is a single point in a graphic image. Each
such information element is not really a dot, nor a square but an abstract sample.
Each element of the above matrix is known as a pixel where dark = 0 and light = 1. A pixel with
only 1 bit will represent a black and white image. If the numbers of bits are increased
then the number of gray levels will increase and a better picture quality is achieved.
All naturally occurring images are analog in nature. If the number of pixels is more
then the clarity is more. An image is represented as a matrix in Digital Image
Processing. In Digital Signal Processing we use only row matrices. Naturally
occurring images should be sampled and quantized to get a digital image. A good image
should have 1024*1024 pixels which is known as 1k * 1k = 1Mpixel.

12
Figure2.2: Pixel arrangement

Each pixel has a value from 0 (black) to 255 (white). The possible range of the pixel
values depend on the color depth of the image, here 8 bit = 256 tones or grayscales.
A normal grey scale image has 8 bit color depth = 256 grey scales. A “true color”
image has 24 bit color depth = 8 x 8 x 8 bits = 256 x 256 x 256 colors = ~16 million
colors.

Figure 2.3.: True color image

A true-color image assembled from three grayscale images colored red, green and
blue. Such an image may contain up to 16 million different colors. Some grayscale
images have more grayscales, for instance 16 bit = 65536 grayscales. In principle three
grayscale images can be combined to form an image with 281,474,976,710,656
grayscales.

13
2.4.1 Gray scale image:
A grayscale image is a function I (xylem) of the two spatial coordinates of the
image plane. I(x, y) is the intensity of the image at the point (x, y) on the image plane.
I (xylem) takes non-negative values assume the image is bounded by a rectangle [0,
a] [0, b]I: [0, a]  [0, b]  [0, info)
In a (8-bit) grayscale image each picture element has an assigned intensity that
ranges from 0 to 255. A grey scale image is what people normally call a black and
white image, but the name emphasizes that such an image will also include many
shades of grey.

2.4.2 Representative color images


If one or more of the images in a data set is taken through a filter that allows
radiation that lies outside the human vision span to pass – i.e. it records radiation
invisible to us - it is of course not possible to make a natural color image. But it is still
possible to make a color image that shows important information about the object.
This type of image is called a representative color image. Normally one would assign
colors to these exposures in chromatic order with blue assigned to the shortest
wavelength, and red to the longest. It can be represented by three functions, R
(xylem) for red, G (xylem) for green and B (xylem) for blue.

2.4.3 RGB image


The RGB color model relates very closely to the way we perceive color with
the r, g and b receptors in our retinas. RGB uses additive color mixing and is the
basic color model used in television or any other medium that projects color with
light. It is the basic color model used in computers and for web graphics, but it
cannot be used for print production.
The secondary colors of RGB – cyan, magenta, and yellow – are formed by
mixing two of the primary colors (red, green or blue) and excluding the third color.
Red and green combine to make yellow, green and blue to make cyan, and blue and
red form magenta. The combination of red, green, and blue in full intensity makes

14
white. The RGB color model is an additive color model in which red, green,
and blue light are added together in various ways to reproduce a broad array
of colors. The name of the model comes from the initials of the three additive
primary colors, red, green, and blue.

The main purpose of the RGB color model is for the sensing, representation,
and display of images in electronic systems, such as televisions and computers,
though it has also been used in conventional photography.

Figure 2.4: The additive model of RGB. Red, green, and blue are the primary stimuli
for human color perception and are the primary additive colors.

2.5 Coordinate Convention


The result of sampling and quantization is a matrix of real numbers. We use
two principal ways to represent digital images. Assume that an image f(x, y) is
sampled so that the resulting image has M rows and N columns. We say that the
image is of size M X N. The values of the coordinates (xylem) are discrete quantities.
For notational clarity and convenience, we use integer values for these discrete
coordinates. In many image processing books, the image origin is defined to be at
(xylem)=(0,0).The next coordinate values along the first row of the image are
(xylem)=(0,1).It is important to keep in mind that the notation (0,1) is used to signify
the second sample along the first row. It does not mean that these are the actual
values of physical coordinates when the image was sampled. Following figure shows

15
the coordinate convention. Note that x ranges from 0 to M-1 and y from 0 to N-1 in
integer increments.
The coordinate convention used in the toolbox to denote arrays is different
from the preceding paragraph in two minor ways. First, instead of using (xylem) the
toolbox uses the notation (race) to indicate rows and columns. Note, however, that
the order of coordinates is the same as the order discussed in the previous
paragraph, in the sense that the first element of a coordinate topples, (alb), refers to a
row and the second to a column. The other difference is that the origin of the
coordinate system is at (r, c) = (1, 1); thus, r ranges from 1 to M and c from 1 to N in
integer increments. IPT documentation refers to the coordinates. Less frequently the
toolbox also employs another coordinate convention called spatial coordinates which
uses x to refer to columns and y to refers to rows. This is the opposite of our use of
variables x and y.

2.6 Fundamental Steps in Image Processing

16
Figure 2.5 Fundamental Steps in Digital Image Processing

The figure shows the fundamental steps that are involved in digital image
processing. This shows two broad categories of methods- one whose input and
output are images, and methods whose inputs may images, but whose outputs are
attributes extracted from those images.

2.6.1 Image Acquisition


Acquisition could be as simple as being an image that is already in digit form.
Generally , the image acquisition stage involves preprocessing, such as scaling.

2.6.2 Image Enhancement


It is the process of manipulating an image so that the result is more suitable
than the original for a specific application. The word specific is important, because it
establishes at the outset that enhancement techniques are problem oriented.

2.6.3 Image Restoration


Image restoration is an area that also deals with improving the appearance of
an image. However , unlike enhancement , which is subjective, image restoration is
objective, in the sense that restoration techniques tend to be based on mathematical
or probabilistic models of image degradation. Enhancement, on the other hand, is
based on human subjective preferences regarding what constitutes a “good”
enhancement result. Thus, restoration techniques are oriented toward modeling the
degradation and applying the inverse process in order to recover the original image.
This approach usually involves formulating a criterion of goodness that will yield an
optimal estimate of the desired result.

2.6.4 Color image Processing:


Color image processing is based on that any color can be obtained by mixing
3 basic colors red, green and blue. Hence 3 matrices are necessary each one
representing each color.

17
2.6.5 Wavelet and Multi-Resolution Processing
Wavelets are the foundation for representing images in various degrees of
resolution. In particular for image data compression and for pyramidal
representation, in which images are subdivided successively into smaller
regions.Wavelet transform is capable of providing the time and frequency
information simultaneously, hence giving a time-frequency representation of the
signal. Although the time and frequency resolution problems are results of a physical
phenomenon (the Heisenberg uncertainty principle) and exist regardless of the
transform used, it is possible to any signal by using an alternative approach called
the multi-resolution analysis (MRA).
MRA analyzes the signal at different frequencies with different resolutions. MRA is
designed to give good time resolution and poor frequency resolution at high
frequencies and good frequency resolution and poor time resolution at low
frequencies.

2.6.6 Compression
Compression deals with techniques for reducing the storage required to save
an image, or the bandwidth required to transmit it. Although storage technology has
improved significantly over the past decade, the same cannot be said for
transmission capacity. This is true particularly in uses of the internet, which are
characterized by significant pictorial content. Image compression is familiar to most
users of computers in the form of image file extensions, such as the jpg file extension
used in the JPEG(Joint Photographic Experts Group) .

2.6.7 Morphological processing


Morphological processing deals with tools for extracting image components
that are useful in the representation and description of shape and a transition from
processes that output images to processes the output image attributes.

2.6.8 Segmentation

18
Segmentation procedures partition an image into its constituent parts or
objects. A rugged segmentation procedure brings the process a long way toward
successful solution of imaging problems that require objects to be identified
individually.

2.6.9 Representation and description


It always follows the output of a segmentation stage, which usually is raw
pixel data, constituting either the boundary of a region or all the points in the region
itself. Boundary representation is appropriate when the focus is on external shape
characteristics, such as corners and inflections. Regional representation is
appropriate when the focus is on internal properties, such as texture or skeletal
shape. Description, also called feature selection, deals with extracting attributes that
result in some quantitative information of interest or are basic for differentiating one
class of objects from another.

2.6.10 Recognition
It is the process that assigns a label (e.g., “vehicle”) to an object based on its
descriptors. The scope of digital image processing includes recognition of individual
image regions, which are also, can be called as object or patterns. The approaches to
pattern recognition developed into two principal areas Decision and structural. The
first category deals with patterns described using quantitative descriptors, such as
length, area, and texture. The second category deals with patterns best described by
qualitative descriptors, such as relational descriptors.

2.6.11 Knowledge base


It is the interaction between the processing modules. Knowledge about a
problem domain is coded into an image processing system in the form of a
knowledge database.
This knowledge may be as simple as detailing regions of an image where
the information of interest is known to be located, thus limiting the search that has to
be conducted in seeking that information.

19
Chapter 3

Literature survey

3.1 IMAGE SEGMENTATION


Segmentation is one of the most important techniques for image
processing. The purpose of segmentation is to partition an image into distinct,
semantically meaningful entities by defining boundaries between features and
objects in an image based on some constraint, or homogeneity predicate. Specifically,
the segmentation problem is defined as sufficiently partitioning an image into non-
overlapping regions. Segmentation can therefore be formally defined as follows:
If F is the set of all pixels and P( ) is a homogeneity predicate defined on groups of
connected pixels, then segmentation is a partitioning of the set F into a set of
connected subsets or regions (S1, S2, …, Sn) such that:

The homogeneity predicate P(Si) = true for all regions (Si) and P(Si U
Sj)=false, when Si is adjacent to Sj. Homogeneity predicates are usually based on
image intensity, color, texture, etc. Image segmentation can be classified into these
categories: spatial clustering split and merge schemes, and region growing schemes.

3.2. Segmentation Techniques


3.2.1 Spatial Clustering
Haralick and Shapiro present that the difference between clustering and
segmentation is that in image segmentation, grouping is done in the spatial domain
of the image, while clustering is done in measurement space. It is also possible for
clustering to result in overlapping regions, while that is not the case for segmentation
results. Clustering and spatial segmentation can be combined to form spatial

20
clustering, which combine histogram techniques with spatial linkage techniques for
better results.

3.2.2 Split and Merge Segmentation


Regions in an image are a group of connected pixels with similar
properties. The split method begins with the entire image, and repeatedly splits each
segment into quarters if the homogeneity criterion is not satisfied. These splits can
sometimes divide portions of one object. The merge method joins adjacent segments
of the same object. In intensity based segmentation, the boundaries that separate
regions may need to be redefined due to under- or over-segmentation of regions.
Split and merge segmentation can also handle this task. Under-segmented regions
are corrected by adding boundaries to, or splitting, certain regions that contain parts
of different objects. Over segmented regions are corrected by eliminating false
boundaries and merging adjacent regions if they belong to the same object or feature.

3.3 Methods
In this section, we briefly describe several common approaches that have
appeared in the recent literature on image segmentation. We define each method,
provide an overview of how the method is implemented, and discuss its advantages
and disadvantages. Although each technique is described separately, multiple
techniques are often used in conjunction with one another for solving different
segmentation problems. We divide segmentation methods into eight categories: (1)
thresholding approaches, (2) region growing approaches, (3) classifiers, (4) clustering
approaches, (5) Markov random field models. Of the methods discussed in this
section, thresholding, classifier, clustering, and Markov random field approaches can
be considered pixel classification methods.
Most of the image segmentation methods that we will describe can be
posed as optimization problems where the desired segmentation minimizes some
energy or cost function defined by the particular application. In probabilistic
methods, this is equivalent to maximizing a likelihood or a posteriori probability.

21
Defining an appropriate E is a major difficulty in designing segmentation algorithms
because of the wide variety of image properties that can be used, such as intensity,
edges, and texture. In addition to information derived from the image, prior
knowledge can also be incorporated to further improve performance. The advantage
of posing segmentation as an optimization problem is that it precisely defines what is
desirable in the segmentation. It is clear that for different applications, different
energy functions are necessary. Several general surveys on image segmentation exist
in the literature. Additional surveys on image segmentation specifically for medical
images have also appeared.

3.3.1 Thresholding
Thresholding approaches segment scalar images by creating a binary
partitioning of the image intensities. A thresholding procedure attempts to determine
an intensity value, called the threshold, which separates the desired classes. The
segmentation is then achieved by grouping all pixels with intensity greater than the
threshold into one class, and all other pixels into another class. Determination of
more than one threshold value is a process called multi-thresholding. Thresholding is
a simple yet often effective means for obtaining segmentation in images where
different structures have contrasting intensities or other quantifiable features. The
partition is usually generated interactively, although automated methods do exist.
For scalar images, interactive methods can be based on an operator’s visual
assessment of the resulting segmentation since the thresholding operation is
implementable in real-time.
Thresholding is often used as an initial step in a sequence of image
processing operations. Its main limitations are that in its simplest form only two
classes are generated and it cannot be applied to multi-channel images. In addition,
thresholding typically does not take into account the spatial characteristics of an
image. This causes it to be sensitive to noise and intensity inhomogeneities, which
can occur in magnetic resonance images. Both these artifacts essentially corrupt the

22
histogram of the image, making separation more difficult. For these reasons,
variations on classical thresholding have been proposed for medical image
segmentation that incorporate information based on local intensities and
connectivity.

3.3.2 Region growing


Region growing is a technique for extracting a region of the image that is
connected based on some predefined criteria. This criteria can be based on intensity
information and/or edges in the image. In its simplest form, region growing requires
a seed point that is manually selected by an operator, and extracts all pixels
connected to the initial seed with the same intensity value. Like thresholding, region
growing is not often used alone but within a set of image processing operations,
particularly for the delineation of small, simple structures such as tumors and
lesions. Its primary disadvantage is that it requires manual interaction to obtain the
seed point. Thus, for each region that needs to be extracted, a seed must be planted.
Split and merge algorithms are related to region growing but do not require a seed
point. Region growing can also be sensitive to noise, causing extracted regions to
have holes or even become disconnected. Conversely, partial volume effects can
cause separate regions to become connected. To help alleviate these problems, a
homotopic region growing algorithm has been proposed that preserves the topology
between an initial region and an extracted region. Fuzzy analogies to region growing
have also been developed.

3.3.3 Classifiers
Classifier methods are pattern recognition techniques that seek to partition a
feature space derived from the image using data with known labels. A feature space
is the range space of any function of the image, with the most common feature space
being the image intensities themselves. A histogram is an example of a 1-D feature
space. All pixels with their associated features on the left side of the partition would
be grouped into one class. Although the features used can be related to texture or

23
other properties, we assume for simplicity that the features are simply intensity
values.
Classifiers are known as supervised methods since they require training data
that are manually segmented and then used as references for automatically
segmenting new data. There are a number of ways in which training data can be
applied in classifier methods. A simple classifier is the nearest-neighbor classifier,
where each pixel or voxel is classified in the same class as the training datum with
the closest intensity. The k-nearest-neighbor (kNN) classifier is a generalization of
this approach, where the pixel is classified according to the majority vote of the k
closest training data. The kNN classifier is considered a nonparametric classifier
since it makes no underlying assumption about the statistical structure of the data.
Another nonparametric classifier is the Parzen window, where the classification is
made according to the majority vote within a predefined window of the feature space
centered at the unlabeled pixel intensity.
A commonly-used parametric classifier is the maximum likelihood (ML) or Bayes
classifier. It assumes that the pixel intensities are independent samples from a
mixture of probability distributions, usually Gaussian. This mixture, called a finite
mixture model, is given by the probability density function.

3.3.4 Clustering
Clustering algorithms essentially perform the same function as classifier
methods without the use of training data. Thus, they are termed unsupervised
methods. In order to compensate for the lack of training data, clustering methods
iterate between segmenting the image and characterizing the properties of the each
class. In a sense, clustering methods train themselves using the available data. Three
commonly used clustering algorithms are the K-means or ISODATA algorithm, the
fuzzy c-means algorithm, and the expectation-maximization (EM) algorithm. The K-
means clustering algorithm clusters data by iteratively computing a mean intensity
for each class and segmenting the image by classifying each pixel in the class with

24
the closest mean. The number of classes was assumed to be three, representing (from
dark gray to white) cerebrospinal fluid, gray matter, and white matter. The fuzzy c-
means algorithm generalizes the K-means algorithm, allowing for soft segmentations
based on fuzzy set theory. The EM algorithm applies the same clustering principles
with the underlying assumption that the data follows a Gaussian mixture model. It
iterates between computing the posterior probabilities and computing maximum
likelihood estimates of the means, co-variances, and mixing coefficients of the
mixture model. Although clustering algorithms do not require training data, they do
require an initial segmentation (or equivalently, initial parameters). The EM
algorithm has demonstrated greater sensitivity to initialization than the K-means or
fuzzy c-means algorithms. Like classifier methods, clustering algorithms do not
directly incorporate spatial modeling and can therefore be sensitive to noise and
intensity in homogeneities. This lack of spatial modeling, however, can provide
significant advantages for fast computation. Work on improving the robustness of
clustering algorithms to intensity in homogeneities in MR images has demonstrated
excellent success.

3.3.5 Markov random field models


Markov random field (MRF) modeling itself is not a segmentation method
but a statistical model which can be used within segmentation methods. MRFs model
spatial interactions between neighboring or nearby pixels. These local correlations
provide a mechanism for modeling a variety of image properties. In medical
imaging, they are typically used to take into account the fact that most pixels belong
to the same class as their neighboring pixels. In physical terms, this implies that any
anatomical structure that consists of only one pixel has a very low probability of
occurring under a MRF assumption.
MRFs are often incorporated into clustering segmentation algorithms such
as the K-means algorithm under a Bayesian prior model. The segmentation is then
obtained by maximizing the a posteriori probability of the segmentation given the

25
image data using iterative methods such as iterated conditional modes or simulated
annealing. The segmentation is much smoother than the non-MRF result a difficulty
associated with MRF models is proper selection of the parameters controlling the
strength of spatial interactions. Too high a setting can result in an excessively smooth
segmentation and a loss of important structural details. In addition, MRF methods
usually require computationally intensive algorithms. Despite these disadvantages,
MRFs are widely used not only to model segmentation classes, but also to model
intensity in homogeneities that can occur in MRimages and texture properties.
3.3.6 Other approaches
Model-fitting is a segmentation method that typically fits a simple
geometric shape such as an ellipse or parabola to the locations of extracted image
features in an image. It is a technique which is specialized to the structure being
segmented but is easily implemented and can provide good results when the model
is appropriate. A more general approach is to fit spline curves or surfaces to the
features. The main difficulty with model-fitting is that image features must first be
extracted before the fitting can take place.
The watershed algorithm uses concepts from mathematical morphology to partition
images into homogeneous regions. This method can suffer from over segmentation,
which occurs when the image is segmented into an unnecessarily large number of
regions. Thus, watershed algorithms in medical imaging are usually followed by a
post-processing step to merge separate regions that belong to the same structure.

3.4 Medical Image Segmentation Technique


In this chapter, we describe an automatic segmentation technique used in the
Medical Image Segmentation Tool (MIST), and applied to the Visible Human’s cross
section data. The segmentation algorithm assumes minimal knowledge about the
organ or muscle tissue to be extracted. The user supplies the initial seed pixel that
identifies the region of interest. This region of interest is then segmented from a stack
of sequential 2D cross section images using a seeded region growing approach.
3.4.1 Initial Approach to MIST

26
The initial approach to solving the segmentation problem in this application was to
use a technique that would produce closed contours of the anatomical objects in the
image. The idea of a closed contour simplifies the segmentation process. Once the
user identifies the region of interest by supplying a seed point, whichever contour
contained that point is identified as the object of interest. Next, a contour filling
algorithm would be used to extract only this area from the rest of the image, using
the closed contour as the boundary.
3.4.2 Standard Edge Detection
To use this approach, we examined a number of standard edge detectors. The goal
was to find the “best” edge detector for our application. The best edge detector is the
one that produce a closed contour of one pixel thick edges. In gradient edge detection
methods, the assumption is that edges are formed by pixels with a high gradient. A
fast rate of change of intensity at some direction given by the angle of the gradient
vector is observed at edge pixels. The magnitude of the gradient indicates the
strength of the edge. All of the edge detectors in the gradient class approximate the
first derivative. A common disadvantage of these operators is their failure to provide
reliable segmentation due to their gradient-based nature. In the following
descriptions, (x,y) represents the pixel location in the input image.
3.4.3 Dimensionality
Dimensionality refers to whether a segmentation method operates in a 2-D image
domain or a 3-D image domain. Methods that rely solely on image intensities are
independent of the image domain. However, certain methods, such as deformable
models, Markov random fields (MRFs), and region growing (described below),
incorporate spatial information and may therefore operate differently depending on
the dimensionality of the image. Generally, 2-D methods are applied to 2-D images,
and 3-D methods are applied to 3-D images. In some cases, however, 2-D methods
are applied sequentially to the slices of a 3-D image. This may arise because of
practical reasons such as ease of implementation, lower computational complexity,

27
and reduced memory requirements. In addition, certain structures are more easily
defined along 2-D slices.

Chapter 4

Proposed method

4.1 Problem Description and Hypothesis of Our Model


A given image I : Ω →ℜ on a two-dimensional (2D) image domain can
be represented as M disjoint regions: ∪iM Ω i = Ω and ∩i Ω i = ∅. A given
2D image I (x ) consists of N pixels and is indexed as x = 1, 2 , · · · , N.
Normally, the intensity inhomogeneities (or called bias field) b(x ) is
modeled as a multiplicative-dimensional random vector [25] for the
given images corrupted by the slowly varying shading artifacts
introduced by deviant imaging sensors and modalities or inherent in
the structure being imaged, as below:

I (x) = b(x)u(x) + n(x)


where u(x) is the clean image free of noise and shading artifacts, and
n(x) is the noise.
The noise n(x) cannot be assumed as only Gaussian noise since various
types of other noise, including salt and pepper noise and speckle noise,
are often introduced during imaging. In response to our problem
description, we need to define the region descriptor to properly
describe the unique region and eliminate the impact of intensity
inhomogeneities and image noise on the image classification
simultaneously.

4.2 Global and Local Energy Segmentation Model (GLE)


In general, it can be assumed that the intensity values of different
regions of the same object can be modelled as a finite Gaussian

28
distribution. Under this assumption, all the pixels belonging to the
same distribution would be assigned to the same class and our energy
function is defined as below:

where G is a full set of Gaussian parameters; μi and σi2 are the Gaussian
mean and the variance for the object i respectively.
Compared with the descriptor based on the mean constant, the
Gaussian distribution can better describe the region by using the mean
from the first derivative and variation from the second derivative.
When the noise is additive Gaussian noise with zero mean, only the
variation would be affected by additive Gaussian noise. Hence, the
Gaussian model can naturally suppress the impact of Gaussian noise
since the variation can be dynamically estimated during the
optimization procedure. As the salt and pepper noise has maximum or
minimum intensity value, the gray levels of this type of noise normally
fall outside of μi ± 3σi (called the 3-sigma rule); and therefore, the
impact of the noise on the energy function approaches zero.

The impact of noise would be further reduced when the contextual


constraint is taken into account as the classification weight of each
pixel. As discussed in, the Markov random field (MRF) theory
provides a convenient and consistent way to model context-dependent

29
entities such as image pixels and correlated features to characterize
mutual influences among image pixels. Thereby, we incorporate
contextual spatial property with the Gaussian model to improve the
insensitivity to noise of as below:

where the neighborhood pixels in the predefined local window (clique)


contribute their influence to the central pixel by using the convolution
kernel Z(|z − x |).
Generally, the form of MRF can be modeled equivalently by a Gibbs
distribution in the Hammersley-Clifford theorem [27]. In our model,
the MRF theory is modified as:

where α is a normalizing constant Σc∈ C Uc(x) is a sum of


clique potentials Uc(x) over all possible cliques C; and

Since the bias field b(x) is slowly varying in the given image, the value
change of bias field in a small local window of x can be approximated
as constant. Thereby, b(x) can be presented as below:

30
where b(y) is the bias field value of pixel y that belongs in the clique of
the central pixel x .
Accordingly, our energy functional is formulated as below:

4.3 Contours
Contours are used in the field of digital image processing to find the contour
of an object. They are used in computer vision and image analysis to detect and
locate objects, and to describe their shape. Contour is a powerful tool for
segmentation in image processing. There are several advantages of contour models
over image segmentation methods, such as edge detection, thresholding, and region
grow.
Contours have been used for image segmentation and boundary tracking
since the first introduction of snakes by Kass et al. The idea is to start with first
boundary shapes represented in a type of closed curves, i.e. contours, and iteratively
change them by applying shrink/expansion operations according to the constraints
of images. Those shrink/expansion operations, called contour evolution, are done by
the minimization of an energy function
The method of contours has become popular for a range of applications,
mainly image segmentation and motion tracking. This is based on the use of
deformable contours which match to various object shapes and motions. Contours
are used for identifying the shape of the object.

31
Figure 4.1 Contour Initialization

Contours model, also known as “snakes” because of the way the contour moves
during the evolution, are one of the most popular de- formable models. A snake
is an energy-minimizing contour guided by external constraint forces and
influenced by image forces that pull it toward features such as lines and edges
localizing them accurately. In the snake’s framework, the contour curve can be
described as:
 Point-based snakes. Te curve is an ordered collection of discrete points,
called snaxels.
 Parametric snakes. The curve is defined in a continuous parametric
from of the form r (s)  (r x (s), r y (s)) , using basis functions like b-spines or
Fourier exponentials defined at certain knots in the curve.
Point-based snakes can be regarded as an extreme case of parametric snakes,
where the curves are defined in terms of b-spines of degree zero with 2
parameters (position x and y) for each curve point. Point-based snakes thus
generally require more parameters than parametric snakes, resulting on
slower optimization algorithms. Moreover, parametric snakes can incorporate
the smoothness and other a priori constraints in the basis functions used,
eliminating the necessity of extra energy terms.

32
Figure4.2: Deformation of a snake. The left picture corresponds with the
initialization; the right picture shows the final shape of the snake after having
minimized the energy

4.4 Energies for Contours

4.4.1 Internal energies


As have been already mentioned, internal energies try to ensure the
smoothness of the contour. The most common internal energy is the one
introduced by Kass, which is a linear combination of the length of the curvature
and its curvature, defined as

int   1 (s) || r ' (s) || 2 ds   2 (s) || r"(s) || 2 ds


c c

By adjusting the weights λi of each term, the relative importance of having


shorter or smoother contours at each section of the curve can be tuned. The
parameter α1 controls the “tension”, while λ2 controls the “rigidity”.

As pointed, the second term only guarantees smoothness if the curve is


parameterized by its curve length, i.e. if the parameter s is the curvilinear
abscissa and the arc length between two knots is constant. To favor this
condition in parametric snakes includes an additional term called
“reparameterization energy” in the internal energy. Otherwise, the knot
points can accumulate in a certain section of the curve and generate pointy
curves.

33
4.4.2 Constraint energies
In interactive setups,constraint energies allow the user to enter a
priori knowledge specifying the points the curve should pass through. An
easy way to model this constraint into energy is using the distance from that
specified point to the closest point of the curve:
Nc
c   min || r (s)  rc,i ||2
1 s

Where rc ,i are the N c fixed points. This energy can be visualized as springs with

one end at fixed points and the other end sliding on the curve.

4.4.3 External energies


External energies, also known as image energies are the key
element of the snake’s framework to drive the contour curve to the desired
area of interest. We can divide these energies into edge-based and region-
based energies. The first ones compute a property of the curve considering
only the pixels on the evolving contour or close to it, while the second ones
take into account pixels belonging to the inside or the outside of the cure, if it
is closed.
4.5 Region-Based Energies
Region-based energies use statistical information about the pixels inside
and outside the segmentation regions. Since many of the regions to segment
involve closed contours, this kind of energies is becoming increasingly popular.
For instance, consider a white object placed on a black background. If we
initialize the contour far away from the object real boundary, the gradient energy
will probably get stuck in a plateau, but an energy that gets minimized when
all pixels inside the contour are white and all pixels outside it are black can
correctly drive the evolving contour towards the boundaries of the white object.

34
We propose three different region-based energy models based on the energies. The
proposed energy models are based on a discretization of the energy functional rather
than the corresponding evolution equations.

4.5.1 Mean Energy model


The first energy assumes that the gray-level of pixels inside 1 and  2 can be
modeled with a single value which corresponds to the mean. The measure of the
region energy can be defined as follows
2
1
 mean    ( I ( P)   h ) 2
h 1  h 2

Where the mean gray-level value of  h is defined as

1
h  
|  h | h
I ( P)

Since the objective is to minimize this energy, we need to compute its derivatives
with respect to the cage vertices V .The gradient of Emean with respect to v j is

2
 v j  mean    ( I ( P)   h )( j ( P)I ( P)   v j  h )
h 1  h

Where

1
 v j  mean  
|  h | h
I ( p) j ( P)

The previous formulation assumes a dependency of  h with respect to the region  h .

In classical level set approaches, do not take into account this dependency and use a
coordinate descent approach to minimize the functional: the mean  h and the

evolution equation are updated iteratively to evolve the equation. In the case of CAC,
we assume  v j  h = 0.

35
4.5.2 Gaussian Energy Model
The Gaussian energy decreases when the values of each region  h have

stable statistics  h and  h . In other words, the curve will stop evolving when each

region has points whose values have a higher probability.


2
Egauss     log( p ( I ( p)))
h
h 1 p h

Where h is the probability an intensity of p, I (p) belong to the normal distribution.

In order to minimize the energy, calculate the gradient the derivative of the energy
with respect to each control point v i to apply gradient descent:
2
I ( p)   h
 v j Egauss    I ( p)i ( p)
h 1 p h  h2

4.6 Level Sets


The level set method, consists on embedding an image in a higher dimensional
space through a function  so that the curve C is defined as the intersection at 0 of its

image. The energy is presented as a level set framework by representing the


disjoint regions with a number of level set functions, with a regularization term on
these level set functions. In the level set framework, the energy minimization can be
solved by using the curve implicitly via a level set function φ [1]. A level set function
takes positive and negative signs, which can be used to represent a partition of the
domain into two disjoint regions _1 and _2 where _1 ∪_2 = _ and _1 ∩ _2 = ∅ , and
this level set function is called two-phase. If more than one level set function is
presented, the multiphase formulation is required. In this paper, we focus on the
two-phase level set formation.
The Heaviside function H allows the level set function to take opposite signs and
represents the membership of two disjoint regions _1 and _2 by R1(φ(x)) = H(φ(x))
and R2(φ(x)) = 1 − H(φ(x)) respectively. Under the variational level set formulation

36
and minimization purpose, the above proposed energy Elg is used as the data term
to be defined as:

We introduce two other regularization terms to regulate the level set function in our
proposed energy function:

where υ ≥ 0 is a constant for the smoothness term and |∇ H (φ (x ))| d x is the


length of the zero level set contour of φ as the smoothness term. β ≥ 0 is a constant for
the regularization term. p(|∇φ (x )|) is defined by

37
Fig. The segmentation results (delineated in red color) from the synthetic images
corrupted by mixture of three types of image noise demonstrated in the 1st, 2nd
rows for the CV and GLE models respectively.

4.6.1 Minimization of the Energy Function

By minimizing the energy formulation, we can obtain the optimized result of image
segmentation given by the level set function φ. The energy minimization is achieved
by an iterative process. We give the solution to the energy minimization with respect
to its variables φ, b, μi and σi for inside and outside the contour as follows.

1) Energy Minimization With Respect to Gaussian Parameters μi & σi and Bias


Field b: The standard approach to determine Gaussian parameters is equivalent to
the maximum likelihood, which requires maximization of the log-likelihood
function. Firstly, we keep φ and b fixed to minimize the energy form E with respect
to the region descriptor μi and σi :

where ∗ is the convolution operation and ( .̂ ) are denoted as the intermediate values
for the variables during each iteration of optimization. And then, we keep φ and the
region descriptors μ1,μ2 and σ1, σ2 fixed to minimize the energy form E with respect
to the bias field b.

38
2) Energy Minimization With Respect to the Level Set Function φ: To maximize the
energy functional E with respect to φ, the associated Euler-Lagrange equation for φ is
applied.
A standard method [30] to minimize a fitting form E is to find the steady state
solution of the gradient flow equation by iteration t. The level set speed for φ(t, x) is
presented as below:

where ∇ is the gradient operator; div (・) is the divergence operator; the function dp is

defined as : and the functions g1 and g2 are defined as

w_ here 1w is the convolution function and defined by 1w(x) = W(|y − x|)dy, which
is a constant and equals to 1 in the image domain _ except at the boundary of the
image. Numerically, W( |y − x| ) is defined by using the Gaussian kernel in our
model:

39
4.7 GLE Parameter Settings

To investigate the impact of the parameter settings on the segmentation accuracy,


we conducted the experiements over 100 synthetic noisy images that were firstly
corrupted by GN and then further corrupted by shading artifacts.

1) Smoothing parameter υ : As discussed previously, the parameter υ in the functional


|∇ H (φ (x ))| d x controls smoothing level of zero level set by penalizing the length
of zero level set. To quantitatively evaluate the segmentation performance in terms
of setting υ to different values in our model, we fixed ω as 10 in our experimental
validation.

The corresponding average JD error rates of 19 different υ values (υ ∈ 1e−5 1 ) on the


100 experimental images were plotted in Fig. 2. As shown in Fig. 2, the averages of
JD error rates varied from 7.51% to 1.28%, which indicated that the performance
would be affected when the value of parameter υ increases. The greater the υ value
is, the smoother the segmentation boundaries are. If the value is too big, the level set
may not be able to trace the contours with sharp corners. And hence, we fixed υ as
0.0001 in our experimental validation.

2) Parameter ω: The parameter ω is the size of mask in the Gaussian kernel. To


quantitatively evaluate the performance over ω parameter in our model, we
conducted the accuacy analysis over the 100 synthetic noisy images. The average JD
error rates varied slightly for ω ∈ [5 15] as shown in Fig. 3; based on these results, we
set ω as 10 in our experimental validation.

4.8 Quantitative Evaluation and Comparisons on Noisy Synthetic Images With


Inhomogeneities

1) Gaussian Noise: In this section, all the synthetic images were firstly corrupted by
GN with zero mean and sigma = 5, 20, 30 and 40 respectively and then these images

40
were further cor-rupted by shading artifacts. We set the Gaussian kernel with sigma
= 6 in LBF and LSII models.

As shown in Fig. 4, all models successfully segmented the expected three objects
from the synthetic images with intensity inhomogeneities only and with GN with
sigma = 5. Both LBF and LSII models failed the segmentation when the GN levels
increased to more than sigma = 20. In contrast, our algorithm achieved satisfactory
segmentation results for the synthetic images corrupted by all these different levels
of Gaussian noise. According to the JD error rates in Fig. 5, the results from our
model were comparable to the other two models when the sigma of Gaussian noise is
smaller than 20. Our model significantly outperformed the two models when the
sigma of Gaussian noise increased. Moreover, the accuracy of our model
corresponding to different levels of GN demonstrates that the performance of our
model was insensitive to the levels of Gaussian noise.

2) Speckle Noise: Speckle noise (SN) is an inherent feature of ultrasound images, which
may have negative effect on diagnostic interpretation [32]. In this section, all the
synthetic images were firstly corrupted by GN with zero mean and sigma
3) Salt and Pepper Noise: Salt and pepper noise (SPN) or spike noise can be introduced
into images in situations where quick transients, such as faulty switching analog-to-
digital converter errors, or bit errors in the data transmission occur [26]. Random salt
and pepper noise densities of 0.02, 0.04 and 0.06 were added to all the synthetic
images after the images were corrupted by the shading artifacts. The segmentation
results from three models are shown in the Fig. 7. We set the Gaussian kernel with
sigma = 20 in the LBF and LSII models

41
Initial Contours GLE LBF LSII

42
Chapter 5
MATLAB

5.1 INTRODUCTION
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where
problems and solutions are expressed in familiar mathematical notation. MATLAB
stands for matrix laboratory, and was written originally to provide easy access to
matrix software developed by LINPACK (linear system package) and EISPACK
(Eigen system package) projects. MATLAB is therefore built on a foundation of
sophisticated matrix software in which the basic element is array that does not
require pre dimensioning which to solve many technical computing problems,
especially those with matrix and vector formulations, in a fraction of time.
5.1.2 Typical uses of MATLAB
The typical usage areas of MATLAB are
i. Math and computation
ii. Algorithm development
iii. Data acquisition
iv. Data analysis ,exploration and visualization
v. Scientific and engineering graphics
MATLAB is an interactive system whose basic data element is an array that
does not require dimensioning. This allows you to solve many technical computing
problems, especially those with matrix and vector formulations, in a fraction of the
time it would take to write a program in a scalar non-interactive language such as C
or FORTRAN.
MATLAB features a family of add-on application-specific solutions called
toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn
and apply specialized technology. Toolboxes are comprehensive collections of

43
MATLAB functions (M-files) that extend the MATLAB environment to solve
particular classes of problems. Areas in which toolboxes are available include signal
processing, image processing, control systems, and many others.

5.13 Features of MATLAB


 Advance algorithm for high performance numerical computation, especially
in the field matrix algebra.
 A large collection of predefined mathematical functions and the ability to
define one’s own functions.
 Two-and three dimensional graphics for plotting and displaying data.

44
MATLAB

MATLAB

Programming language

User written / built in functions

Graphics Computation External


interface
2-D graphics Linear algebra
Interface with C
3-D graphics Signal processing
and
Color and lighting Quadrature
FORTRAN
Tool boxes
Animation Etc
Programs
1. Signal processing
2. Image processing
3. Control systems
4. Neural Networks
5. Communications
6. Robust control
7. Statistics

Figure.5.1.3: Features and capabilities of MATLAB

5.2MATLAB System
The MATLAB system consists of five main parts:
a. Development Environment
b. The MATLAB Mathematical Function
c. The MATLAB Language
d. The Graphical User Interface(GUI) construction

45
e. The MATLAB Application Program Interface (API)

a. Development Environment
This is the set of tools and facilities that help you use MATLAB functions and
files. Many of these tools are graphical user interfaces. It includes the MATLAB
desktop and Command Window, a command history, an editor and debugger, and
browsers for viewing help, the workspace, files, and the search path.
b. MATLAB Mathematical Function
This is a vast collection of computational algorithms ranging from
elementary functions like sum, sine, cosine, and complex arithmetic, to more
sophisticated functions like matrix inverse, matrix Eigen values, Bessel functions, and
fast Fourier transforms.

c. MATLAB Language
This is a high-level matrix/array language with control flow statements,
functions, data structures, input/output, and object-oriented programming features.
It allows both "programming in the small" to rapidly create quick and dirty throw-
away programs, and "programming in the large" to create complete large and
complex application programs.

d. Graphics
MATLAB has extensive facilities for displaying vectors and matrices as
graphs, as well as annotating and printing these graphs. It includes high-level
functions for two-dimensional and three-dimensional data visualization, image
processing, animation, and presentation graphics. It also includes low-level functions
that allow you to fully customize the appearance of graphics as well as to build
complete graphical user interfaces on your MATLAB applications.

e. MATLAB Application Program Interface (API)


This is a library that allows you to write C and FORTRAN programs
that interact with MATLAB. It includes facilities for calling routines from MATLAB

46
(dynamic linking), calling MATLAB as a computational engine, and for reading and
writing MAT-files.

5.3 Some Basic Plot Commands:

Kinds of plots:
plot(x,y) creates a Cartesian plot of the vectors x & y
plot(y) creates a plot of y vs.the numerical values of the elements
in the y-vector

semilogx(x,y) plots log(x) vs y

semilogy(x,y) plots x vs log(y)

loglog(x,y) plots log(x) vs log(y)

polar(theta,r) creates a polar plot of the vectors r & theta where theta is
in radians

bar(x) creates a bar graph of the vector x. (Note also the


command stairs(x))

bar(x, y) creates a bar-graph of the elements of the vector y,


locating the bars according to the vector elements of 'x'

Plot description:

grid creates a grid on the graphics plot

title('text') places a title at top of graphics plot

xlabel('text') writes 'text' beneath the x-axis of a plot

ylabel('text') writes 'text' beside the y-axis of a plot

text(x,y,'text') writes 'text' at the location (x,y)

47
text(x,y,'text','sc') writes 'text' at point x,y assuming lower left corner is (0,0)
and upper right corner is (1,1)

axis([xmin xmax ymin ymax]sets scaling for the x- and y-axes on the current
plot

5.4 Algebraic Operations In Matlab: Scalar Calculations

+ Addition

- Subtraction

* Multiplication

/ Right division (a/b means a ÷ b)

\ left division (a\b means b ÷ a)

^ Exponentiation

For example 3*4 executed in 'matlab' gives ans=12

4/5 gives ans=0.8

Array products: Recall that addition and subtraction of matrices involved addition
or subtraction of the individual elements of the matrices. Sometimes it is desired to
simply multiply or divide each element of an matrix by the corresponding element of
another matrix 'array operations”. Array or element-by-element operations are
executed when the operator is preceded by a '.' (Period):

a .* b multiplies each element of a by the respective element of b

a ./ b divides each element of a by the respective element of b

48
a .\ b divides each element of b by the respective element of a

a .^ b raise each element of a by the respective b element

5.5 Matlab Working Environment

5. 5.1 MATLAB Desktop


Mat lab Desktop is the main Mat lab application window. The desktop
contains five sub windows, the command window, the workspace browser, the
current directory window, the command history window, and one or more figure
windows, which are shown only when the user displays a graphic.
The command window is where the user types MATLAB commands and
expressions at the prompt (>>) and where the output of those commands is
displayed. MATLAB defines the workspace as the set of variables that the user
creates in a work session.
The workspace browser shows these variables and some information about
them. Double clicking on a variable in the workspace browser launches the Array
Editor, which can be used to obtain information and income instances edit certain
properties of the variable.
The current Directory tab above the workspace tab shows the contents of the
current directory, whose path is shown in the current directory window. For
example, in the windows operating system the path might be as follows:
C:\MATLAB\Work, indicating that directory “work” is a subdirectory of the main
directory “MATLAB”; which is installed in drive C. clicking on the arrow in the
current directory window shows a list of recently used paths. Clicking on the button
to the right of the window allows the user to change the current directory.

49
Figure.5.5.1: MATLAB desktop

MATLAB uses a search path to find M-files and other MATLAB related files,
which are organize in directories in the computer file system. Any file run in
MATLAB must reside in the current directory or in a directory that is on search
path. By default, the files supplied with MATLAB and math works toolboxes are
included in the search path. The easiest way to see which directories are on the
search path. The easiest way to see which directories are soon the search paths, or to
add or modify a search path, is to select set path from the File menu the desktop,
and then use the set path dialog box. It is good practice to add any commonly used
directories to the search path to avoid repeatedly having the change the current
directory.
The Command History Window contains a record of the commands a user
has entered in the command window, including both current and previous

50
MATLAB sessions. Previously entered MATLAB commands can be selected and re-
executed from the command history window by right clicking on a command or
sequence of commands. This action launches a menu from which to select various
options in addition to executing the commands. This is useful to select various
options in addition to executing the commands. This is a useful feature when
experimenting with various commands in a work session.
5.5.2 Using the MATLAB Editor to create M-Files
The MATLAB editor is both a text editor specialized for creating M-files and a
graphical MATLAB debugger. The editor can appear in a window by itself, or it can
be a sub window in the desktop. M-files are denoted by the extension .m, as in
pixelup.m.

The MATLAB editor window has numerous pull-down menus for tasks such
as saving, viewing, and debugging files. Because it performs some simple checks and
also uses color to differentiate between various elements of code, this text editor is
recommended as the tool of choice for writing and editing M-functions.

To open the editor, type edit at the prompt opens the M-file filename.m in an
editor window, ready for editing. As noted earlier, the file must be in the current
directory, or in a directory in the search path.

5.5.3 Getting Help:


The principal way to get help online is to use the MATLAB help browser,
opened as a separate window either by clicking on the question mark symbol (?) on
the desktop toolbar, or by typing help browser at the prompt in the command
window. The help Browser is a web browser integrated into the MATLAB desktop
that displays a Hypertext Markup Language (HTML) documents. The Help Browser
consists of two panes, the help navigator pane, used to find information, and the
display pane, used to view the information. Self-explanatory tabs other than
navigator pane are used to perform a search. Representation of image in the

51
MATLAB most images are represented as two-dimensional arrays (matrices), in
which each element of the matrix corresponds to a single pixel in the displayed
image. Some images, such as RGB, require a three-dimensional array, where the first
plane in the third dimension represents the red pixel intensities, the second plane
represents the green pixel intensities, and the third plane represents the blue pixel
intensities.

The following sections describe the different data and image types, and give details
about how to read, write, work with, and display graphics images; how to alter the
display properties and aspect ratio of an image during display; how to print an
image; and how to convert the data type or graphics format of an image.

5.6 Data Types


MATLAB math supports three different numeric classes for image display:
 double-precision floating-point (double)
 16-bit unsigned integer (uint16)
 8-bit unsigned integer (uint8)
The image display commands interpret data values differently depending on the
numeric class the data is stored in. working with 8-Bit and 16-Bit Images includes
details on the inner workings of the storage for 8- and 16-bit images.
By default, most data occupy arrays of class double. The data in these arrays is
stored as double-precision (64-bit) floating-point numbers. All MATLAB functions
and capabilities work with these arrays.For images stored in one of the graphics file
formats supported by MATLAB functions, however, this data representation is not
always ideal. The number of pixels in such an image can be very large; for example, a
1000-by-1000 image has a million pixels. Since at least one array element represents
each pixel, this image requires about 8 megabytes of memory if it is stored as class
double.
Bit Depth

52
MATLAB input functions read the most commonly used bit depths (bits per
pixel) of any of the supported graphics file formats. When the data is in memory, it
can be stored as uint8, uint16, or double. For details on which bit depths are
appropriate for each supported format, see imread and imwrite.
Supported Image Formats
MATLAB commands read, write, and display several types of graphics file
formats for images. As with MATLAB generated images, once a graphics file format
image is displayed, it becomes a Handle Graphics image object. MATLAB supports
the following graphics file formats, along with others:
Table 5.6.1: Image Formats
FORMAT DESCRIPTION RECOGNIZED
NAME EXTENSION
TIFF Tagged Image File .tif, .tiff
Format
JPEG Joint Photograph .jpg, .jpeg
Experts Group

GIF Graphics .gif


Interchange
Format
BMP Windows Bit mat .bmp

PNG Portable Network .png


Graphics

XWD X Window Dump .xwd

For more information about the bit depths and image types supported for these
formats, see imread and imwrite.

53
Functions for Reading, Writing, and Displaying Images:

Images are essentially two-dimensional matrices, so many MATLAB functions can


operate on and display images. The following table lists the most useful ones. The
sections that follow describe these functions in more detail.

Table5.6.2:MATLAB functions

Function Purpose Function Group

axis Plot axis scaling and appearance. Display

image Display image (create image object). Display

imagesc Scale data and display as image. Display

imread Read image from graphics file. File I/O

imwrite Write image to graphics file. File I/O

imfinfo Get image information from graphics file. Utility

ind2rgb Convert indexed image to RGB image. Utility

5.7 Working formats in Matlab


If an image is stored as a JPEG-image on your disc we first read it into Matlab.
However, in order to start working with an image, for example perform a wavelet
transform on the image, we must convert it into a different format. This section
explains common formats.
5.7.1 Intensity image (gray scale image)
This is the equivalent to a "gray scale image" and this is the image we will
mostly work with in this course. It represents an image as a matrix where every
element has a value corresponding to how bright/dark the pixel at the
corresponding position should be colored. There are two ways to represent the
number that represents the brightness of the pixel: The double class (or data type).

54
This assigns a floating number ("a number with decimals") between 0 and 1 to each
pixel. The value 0 corresponds to black and the value 1 corresponds to white. The
other class is called uint8 which assigns an integer between 0 and 255 to represent the
brightness of a pixel. The value 0 corresponds to black and 255 to white.

5.7.2 Binary image


This image format also stores an image as a matrix but can only color a pixel
black or white (and nothing in between). It assigns a 0 for black and a 1 for white.

5.7.3 Indexed image


This is a practical way of representing color images. (In this course we will
mostly work with gray scale images but once you have learned how to work with a
gray scale image you will also know the principle how to work with color images.)
An indexed image stores an image as two matrices. The first matrix has the same size
as the image and one number for each pixel. The second matrix is called the color
map and its size may be different from the image. The numbers in the first matrix is
an instruction of what number to use in the color map matrix.

5.7.4 RGB image


This is another format for color images. It represents an image with three
matrices of sizes matching the image format. Each matrix corresponds to one of the
colors red, green or blue and gives an instruction of how much of each of these colors
a certain pixel should use.

5.7.5 Multiframe image


In some applications we want to study a sequence of images. This is very
common in biological and medical imaging where you might study a sequence of
slices of a cell. For these cases, the multiframe format is a convenient way of working
with a sequence of images. In case you choose to work with biological imaging later
on in this course, you may use this format

55
Chapter 6

6.1 EXPERIMENTAL RESULT


In this section, we present the experimental results of level set method on
synthetic and real images. Here we use uniform sampling and we constrain edges to
not cross between each other. Cage vertices are automatically placed in a uniform
way around the initial evolving contour. Fig. Shows the results for two synthetic
images, one X-ray Image of vessel. Our method successfully extracts the object
boundaries for these two synthetic images, as shown in Fig. 4. The third in Fig. 3
show the results of our method for real image of blood vessel. In this image, part of
the vessel boundaries is quite weak, which renders it a nontrivial task to segment the
vessels in the images.

56
Chapter 7

CONCLUSION
We have proposed a more general model for segmenting images with/without
intensity inhomogeneities and with different types of noise. Our proposed level set
energy function, which is dominated by the global Gaussian distribution and
constrained by local neighbor properties, can overcome the artifacts from both the
intensity inhomogeneity and image noise.

A quantitative comparison on synthetic images and experimental results on real


images showed that our model outperformed the LBF and LSII models designed
specifically for segmenting the images with intensity inhomogeneities. It was more
robust and accurate than the CV model when segmenting the images without
intensity inhomogeneities. It was also not sensitive to noise and produced better
segmentation results when compared to the graph-cuts and random walker
algorithms for segmenting noisy images.

57
REFERENCES
[1] S. Osher and J. Sethian, “Fronts propagating with curvature-dependent speed:
Algorithms based on Hamilton-Jacobi formulations,” J. Comput. Phys., vol. 79,
pp. 12–49, Nov. 1988.
[2] L. He, Z. Peng, B. Everding, X. Wang, C. Y. Han, K. L. Weiss, and W G. Wee,
“A comparative study of deformable contour methods on medical image
segmentation,” Image Vis. Comput., vol. 26, pp. 141–163, 2008.
[3] R. Tsai and S. Osher, “Level set methods and their applications in image
science,” Commun. Math. Sci., vol. 1, no. 4, pp. 1–20, 2003.
[4] Y. Boykov and O. Veksler, Handbook of Mathematical Models in Computer Vision.
New York, NY, USA: Springer-Verlag, 2006.
[5] G. Song and T. D. Bui, “Image segmentation and selective smoothing by using
Mumford-Shah model,” IEEE Trans. Image Process., vol. 14, no. 10, pp. 1537–
1549, Oct. 2005.
[6] D. Cremers, M. Rousson, and R. Deriche, “A review of statistical approaches
to level set segmentation: Integrating color, texture, motion and shape,” Int. J.
Comput. Vis., vol. 72, no. 2, pp. 195–215, 2007.
[7] V. Caselles, R. Kimmel, and G. Sapiro, “Geodesic active contours,” Int. j
Comput. Vis., vol. 22, no. 1, pp. 61–79, 1997.
[8] S. Kichenassamy, A. Kumar, P. Olver, A. Tannenbaum, and A. Yezzi,
“Gradient flows and geometric active contour models,” in Proc. Int. Conf.
Comput. Vis., Cambridge, MA, USA, 1995, pp. 810–815.
[9] R. Kimmel, A. Amir, and A. M. Bruckstein, “Finding shortest paths on
surfaces using level sets propagation,” IEEE Trans. Pattern Anal. Mach. Intell.,
vol. 17, no. 6, pp. 635–640, Jun. 1995.
[10] R. Malladi, J. A. Sethian, and B. C. Vemuri, “Shape modeling with front
propagation: A level set approach,” IEEE Trans. Pattern Anal. Mach. Intell., vol.
17, no. 2, pp. 158–175, Feb. 1995.

58
[11] A. Vasilevskiy and K. Siddiqi, “Flux maximizing geometric flows,”
IEEE Trans. Pattern Anal. Mach. Intell., vol. 24, no. 12, pp. 1565–1578, Dec. 2002.
[12] T. F. Chan and L. A. Vese, “Active contours without edges,” IEEE
Trans. Image Process., vol. 10, no. 2, pp. 266–277, Feb. 2001.
[13] C. Samson, L. Blanc-Feraud, G. Aubert, and J. Zerubia, “A variational
model for image classification and restoration,” IEEE Trans. Pattern Anal.
Mach. Intell., vol. 22, no. 5, pp. 460–472, May 2000.
[14] A. Tsai, A. Yezzi, and A. S. Willsky, “Curve evolution implementation
of the Mumford-Shah functional for image segmentation, denoising,
interpolation, and magnification,” IEEE Trans. Image Process., vol. 10, no. 8, pp.
1169–1186, Aug. 2001.
[15] L. Vese and T. Chan, “A multiphase level set framework for image
segmentation using the Mumford and Shah model,” Int. J. Comput. Vis., vol.
50, pp. 271–293, Dec. 2002.
[16] A. Yezzi, Jr., S. Kichenassamy, A. Kumar, P. Olver, and A.
Tannenbaum, “A geometric snake model for segmentation of medical
imagery,” IEEE Trans. Med. Imag., vol. 16, no. 2, pp. 199–209, Apr. 1997.
[17] G. Papandreou and P. Maragos, “Multigrid geometric active contour
models,” IEEE Trans. Image Process., vol. 16, no. 1, pp. 229–240, Jan. 2007.
[18] D. Mumford and J. Shah, “Optimal approximations by piecewise
smooth functions and associated variational problems,” Commun. Pure Appl.
Math., vol. 42, no. 5, pp. 577–685, 1989.
[19] N. Paragios and R. Deriche, “Geodesic active regions and level set
methods for supervised texture segmentation,” Int. J. Comput. Vis., vol. 46, no.
3, pp. 223–247, 2002.
[20] C. Li, C.-Y. Kao, J. C. Gore, and Z. Ding, “Minimization of region-
scalable fitting energy for image segmentation,” IEEE Trans. Image Process.,
vol. 17, no. 10, pp. 1940–1949, Oct. 2008.

59
[21] S. Lankton and A. Tannenbaum, “Localizing region-based active con-
tours,” IEEE Trans. Image Process., vol. 17, no. 11, pp. 2029–2039, Nov. 2008.
[22] C. Li, R. Huang, Z. Ding, J. C. Gatenby, D. N. Metaxas, and J. C. Gore,
“A level set method for image segmentation in the presence of intensity
inhomogeneities with application to MRI,” IEEE Trans. Image Process., vol. 20,
no. 7, pp. 2007–2016, Jul. 2011.

60

Vous aimerez peut-être aussi