You are on page 1of 43

1

CHAPTER 1
INTRODUCTION

1.1 INTRODUCTION TO OUR PROJECT


Images are considered as one of the most important medium of conveying information.
Understanding images and extracting the information from them such that the information
can be used for other tasks in an important aspect of machine learning.
One of the first steps in direction of understanding images is to segment them and find out
different objects in them. Thus image segmentation plays a vital role towards conveying
information that is represented by an image also assists in understanding the image
1.2

AIM OF OUR PROJECT


Our main aim of the project is to distinguish the objects in the image from the
background through their boundaries.

1.3 TOOLS REQUIRED/USED


MATLAB R2012a programming language can be used for implementation of the
proposed project importantly with image processing tool box.
1.4 ORGANIZATION OF REPORT
The project is organized as follows. Chapter 2 gives the concept of image segmentation
and various approaches. Chapter 3 reviews the general active contour model designed for
automatic image segmentation. Chapter 4 presents lattice Boltzmann method which
incorporates the user input and the initial segmentation giving result to an active contour
model Chapter 5 shows the experimental results to demonstrate the effectiveness of our
proposed method. Finally, Chapter 6 concludes this project.

CHAPTER 2
IMAGE SEGMENTATION

2. IMAGE SEGMENTATION
Image Segmentation is a process of dividing the given image in to regions homogeneous
with respect to certain features, and which hopefully correspond to real objects in the actual
scene. Segmentation plays a vital role to exact information from an image to create
homogeneous regions by classifying pixels in to groups thus forming regions of similarity.
The homogeneous regions formed as a result of segmentation indwell pixels having similarity
in which regions according to particular selection criteria e.g. intensity, color etc.
There are two main approaches in image segmentation: edge- and region- based. Edge
based segmentation partitions an image based on discontinuities among sub-regions, while
region-based segmentation does the same function based on the uniformity of a desired
property within a sub-region. In this chapter, we briefly discuss existing image segmentation
technologies as background.

2.1 Edge-based segmentation:


Edge-based segmentation looks for discontinuities in the intensity of an image. It is
more likely edge detection or boundary detection rather than the literal meaning of image
segmentation. An edge can be defined as the boundary between two regions with relatively
distinct properties. The assumption of edge-based segmentation is that every sub-region in an
image is sufficiently uniform so that the transition between two sub-regions can be
determined on the basis of discontinuities alone. When this assumption is not valid, regionbased segmentation, discussed in the next section, usually provides more reasonable
segmentation results.
Basically, the idea underlying most edge-detection techniques is the computation of a
local derivative operator. The gradient vector of an image I(x, y), given by

I / x
I
: 2

I / y

It is obtained by the partial derivatives I / x and I / y at every pixel location. The


local derivative operation can be done by convolving an image with kernels shown in fig 2.1

-1

-1

-1

0
1

(a)

(b)

Figure 2.1: Examples of gradient kernels along: (a) vertical direction, (b) horizontal direction
The magnitude of the first derivate

| I | (I / x) 2 (I / y ) 2 :
determines the presence of edges in an image
The Laplacian of an image function I(x, y) is the sum of the second-order derivatives, defined
as

2 I

2 I 2I

:
x 2 y 2

The general use of the Laplacian is in finding the location of edges using its zerocrossings. A critical disadvantage of the gradient operation is that the derivative enhances
noise. As a second-order derivative, the Laplacian is even more sensitive to noise. An
alternative is convolving an image with the Laplacian of a Gaussian (LoG) function given by

1
x 2 y 2
x2 y 2
L G ( x, y ) 4 1
exp
:

2 2
2 2

where a two-dimensional Gaussian function with the standard deviation

G x, y

is defined as

x 2 y 2
1
exp

:
2 2
2 2

The LoG function produces smooth edges as the Gaussian filtering provides smoothing
effect.
Sobel operation is performed by convolving an image with kernels shown in figure 2.2.
Sobel operators have the advantage of providing both a derivative and smoothing effect
gradient kernels shown in figure 2.1 because the derivative enhances noise.
5

-1

-2

-1

-1

-2

-1

(a)

(b)

Figure 2.2: Sobel operators along: (a) vertical direction, (b) horizontal direction
Edge detection by gradient operations generally work well only in the images with sharp
intensity transitions and relatively low noise. Due to its sensitivity to noise, some smoothing
operation is generally required as preprocessing, and the smoothing effect consequently blurs
the edge information. However, the computational cost is relatively lower than other
segmentation methods because the computation can be done by a local filtering operation, i.e.
convolution of an image with a kernel. Edge-based active contour models use the magnitude
of gradient | I | to determine the position of edges.

2.2 Region-based segmentation:


Region-based segmentation looks for uniformity within a sub-region, based on a desired
property, e.g. intensity, color, and texture. Region growing is a technique that merges pixels
or small sub-regions into a larger sub-region.
The simplest implementation of this approach is pixel aggregation, which starts with a set
of seed points and grows regions from these seeds by appending neighboring pixels if they
satisfy the given criteria. Figure 2.3 shows a simple example of pixel aggregation.
2

(a)

(b)
Figure 2.3: Pixel aggregation: (a) original image with seeds underlined; (b) segmentation
result with =4
Segmentation starts with two initial seeds, and then the regions grow if they satisfy a criterion
such as

| I x, y I ( seed ) |
Despite the simple nature of the algorithm, there are fundamental problems in region
growing: the selection of initial seeds and suitable properties to grow the regions. Selecting
initial seeds can be often based on the nature of applications or images. For example, the ROI
is generally brighter than the background in IR images. In this case, choosing bright pixels as
initial seeds would be a proper choice.
Additional criteria that utilize properties to grow the regions lead region growing into
more sophisticated methods, e.g. region competition. Region competition merges adjacent
sub-regions under criteria involving the uniformity of regions or sharpness of boundaries.
Strong criteria tend to produce over-segmented results, while weak criteria tend to produce
poor segmentation results by over-merging the sub-regions with blurry boundaries. An
alternative of region growing is split-and-merge, which partitions an image initially into a set
of arbitrary, disjointed sub-regions, and then merges and/or split the sub-regions in an attempt
to satisfy the segmentation criteria.

2.3 Histogram based methods:


Histogram-based methods are very efficient when compared to
other image segmentation methods because they typically require only
one pass through the pixels. In this technique, a histogram is computed
from all of the pixels in the image, and the peaks and valleys in the
histogram are used to locate the clusters in the
image. Color or intensity can be used as the measure.
A refinement of this technique is to recursively apply the histogram-seeking method to
clusters in the image in order to divide them into smaller clusters. This is repeated with
smaller and smaller clusters until no more clusters are formed.
One disadvantage of the histogram-seeking method is that it may be difficult to identify
significant peaks and valleys in the image. In this technique of image classification distance
metric and integrated region matching are familiar.
Histogram-based approaches can also be quickly adapted to occur over multiple frames,
while maintaining their single pass efficiency. The histogram can be done in multiple fashions
when multiple frames are considered. The same approach that is taken with one frame can be
applied to multiple, and after the results are merged, peaks and valleys that were previously
difficult to identify are more likely to be distinguishable. The histogram can also be applied
on a per pixel basis where the information result are used to determine the most frequent
color for the pixel location. This approach segments based on active objects and a static
environment, resulting in a different type of segmentation useful in Video tracking.

CHAPTER 3
ACTIVE CONTOUR MODEL

3. ACTIVE CONTOUR MODEL


Active contours are connectivity-preserving relaxation methods, applicable to the image
segmentation problems. Active contours have been used for image segmentation and
boundary tracking since the first introduction of snakes by Kass. The basic idea is to start
with initial boundary shapes represented in a form of closed curves, i.e. contours, and
iteratively modify them by applying shrink/expansion operations according to the constraints
of the image. Those shrink/expansion operations, called contour evolution, are performed by
the minimization of an energy function like traditional region-based segmentation methods or
by the simulation of a geometric partial differential equation (PDE).
An advantage of active contours as image segmentation methods is that they partition an
image into sub-regions with continuous boundaries, while the edge detectors based on
threshold or local filtering, e.g. Canny or Sobel operator, often result in discontinuous
boundaries. The use of level set theory has provided more flexibility and convenience in the
implementation of active contours. Depending on the implementation scheme, active
contours can use various properties used for other segmentation methods such as edges,
statistics, and texture.

3.1 Active Contours


The method of active contours has become quite popular for a range of applications,
mainly image segmentation and motion tracking, through the last decade. This methodology
is based upon the use of deformable contours which match to various object shapes and
motions. This section provides a theoretical setting of active contours and an indication of
existing active contour methods. There are two main approaches in active contours based on
the mathematic implementation: snakes and level sets. Snakes explicitly shift predefined
snake points based on an energy minimization method, while level set approaches move
contours completely as a particular level of a function. As image segmentation methods, there
are two kinds of active contour models according to the force evolving the contours: edgeand region-based. Edge- based active contours apply an edge detector, typically based on the
image gradient, to locate the boundaries of sub-regions and to draw the contours to the
10

detected boundaries. Edge-based approaches are closely connected to the edge-based


segmentation. Region based active contours apply the statistical information of image
intensity inside each subset instead of searching geometrical boundaries. Region-based
approaches are also closely connected to the region-based segmentation.

3.2 Level Set Method


Level set theory, a formulation to apply active contours, was proposed by Osher and
Sethian. They represented a contour implicitly via a two dimensional Lipschitz - continuous
function

x, y :

defined on the image plane. The function

set function, and a particular level, generally the zero level, of

x, y

x, y

is called level

is defined as the

contour.
The level set technique is a general framework for tracking dynamic interfaces and
shapes. It was first developed as a way to model fluid boundaries, such as a flame front. In
computer vision and pattern recognition the level set method (LSM) had been widely used for
image segmentation. The attractive advantage of the LSM is its ability to extract complex
contours and to automatically handle topological changes, such as splitting and merging. The
LSM belongs to the active contours models (ACMs) which is based on the Eulerian
framework, i.e., the geometric representation of the active contour instead of the parametric
representation which is based on the Lagrangian framework. The basic idea of the LSM is to
evolve the zero-level of the level set function (LSF) in the image domain until it reaches the
boundaries of the regions of interest. The active curve evolution is governed by the level set
equation (LSE). It is a partial differential equation expressed as

=| |( V + .
)
t
| |
where is the level set function, V is the speed function which drives and attracts the active
contour towards the region boundaries. The second term of the right hand represents the
curvature and is used to smooth the contour. It is non-linear and computational expansive.
and are user-controlling parameters. Two approaches are usually used to stop the evolving
curve on the boundaries of the desired objects. The first one uses an edge indicator depending
on the gradient of the image like in classical snakes and active contour models, and the
methods belonging to this class are effective when detecting objects boundaries defined by
11

edges, i.e., high gradient but are more sensitive to noise and ineffective when the object of
interest is without edges. The second approach uses some regional attributes to stop the
evolving curve, and the methods belonging to this class are robust to noise, effective when
detecting objects without edges but have some difficulties when the boundaries between the
object and the background are only defined by high gradient.

3.2.1 Two phase level set method


In our project, we propose a two phase level set method which can allows the realization
of a binary segmentation, and can be easily expanded to the multi-phase case. The method
uses both edge and region information in order to effectively detect both objects defined by
edges and without edges. The sensitivity to noise introduced by local information, i.e., edge
information, is handled by the 2D gray-scale histogram based constraint.
The lattice Boltzmann method(LBM) is used as an alternative approach to solve the
LSE. It can better handle the problem of time consuming because the non-linear term that is
curvature term in LSE. LBM is discussed in the next chapter in detail.
Contour Initialization
For any active contour method, the contour needs to be initialized before the contour
evolution process.

12

CHAPTER 4
LATTICE BOLTZMANN METHOD

13

4.1 LATTICE BOLZMANN METHOD


Instead of using some computational expensive classical numerical methods based on
finite difference, finite element or finite volume approximations, the lattice bolzmann method
is as an alternative approach to solve the LSE. The LBM is of recent use in image
segmentation, but is highly promising because of its simplicity, explicit and highly
parallelizable nature. It is second order accuracy both in time and space and can better handle
the problem of time consuming because the non-linear term in the LSE, i.e., the curvature
term, is implicitly computed. The LBM is firstly designed to simulate NavierStokes equations
for an incompressible fluid. The evolution equation of LBM is

f i ( r +
ei , t+1 ) f i ( r , t )=
where fi is the particle distribution function and is, in this paper, the BhatnagerGross-Krook (BGK) collision model with body force

F .

1 eq
2 1
f i ( r , t ) f i ( r , t ) ] +
.F.
ei
[

where represents the relaxation time and the local equilibrium particle distribution
which can be expressed as follows when modeling typical diffusion phenomenon,

f ieq ( )= Ai

with

= f i
i

where is the macroscopic fluid density. By performing the Chapman-Enskog


expansion the following diffusion equation can be recovered from LBM

= div ( ) + F .
t
Substituting by the signed distance function in above Equation,the LSE can be
recovered. In our model we use the D2Q5 LBM lattice structure to solve the proposed new
LSE. The body force F acts as the link with image statistics for the LBM solver and is
defined from the proposed LSE.
A statistical description of a system can be explained by distribution function

f ( r , c ,t ) , where f ( r , c ,t )

is the number of molecules at time t positioned between r

and r+dr which have velocities between c and c+dc, as mentioned in the previous chapter. An
external force F acting on a gas molecule of unit mass will change the velocity of the
molecule from c to c+Fdt and its position from r to r+cdt.
The number of molecules, f(r,c,t). before applying the external force is equal to the
number of molecules after the disturbance, f(r+cdt,c+Fdt,t+dt), if no collisions take place
between the molecules. Hence,

f ( r + cdt , c+ Fdt ,t +dt ) drdcf ( r , c , t ) drdc=0


14

(1)

However, if collisions take place between the molecules there will be a net difference
between the numbers of molecules in the interval drdc: The rate of change between final and initial
status of the distribution function is called collision operator, . Hence, the equation for evolution
of the number of the molecules can be written as,

Fig:Position and velocity vector for a particle after and before applying a force, F

f ( r + cdt , c+ Fdt ,t +dt ) drdcf ( r , c , t ) drdc= ( f ) drdcdt

(2)

Dividing the above equation by dtdrdc and as the limit dt0, yields

df
=( f )
dt

(3)

The above equation states that the total rate of change of the distribution function is
equal to the rate of the collision. Since f is a function of r, c and t, then the total rate of change
can be expanded as,

df =

f
f
f
dr + d c + dt
dr
c
t

(4)

df f dr f dc f
=
+
+
dt r dt c dt t

(5)

Dividing by dt, yields

The vector r can be expressed in 3-D Cartesian coordinate system as r =xi + yj + zk,
where i, j, and k are unit vectors along x, y, and z-direction, respectively.
15

Above equation can be written as,

df f
f
f
= c + a+
dt r
c
t

(6)

where a is equal to dc/dt, the acceleration and can be related to force F by Newtons second
law, a=F/m:
Therefore, the Boltzmann transport equation (3) can be written as,

f f
F f
+ . c+ . =
t r
m c
f

The is a function of

(7)

and need to be determined to solve the Boltzmann equation.

For system without an external force, the Boltzmann equation can be written as

f
+ c . f =
t
Note that c and

(8)

f are vectors.

Equation(8) is an advection equation with a source term (), or advection with a


reaction term, which can be solved exactly along the characteristic lines that is tangent to the
vector c, if is explicitly known. The problem is that is a function of f and Eq(8) is an
integro-differential equation, which is difficult to solve.
The relation between the above equation and macroscopic quantities such as
fluid density,

; fluid velocity vector u , and internal energy e, is as follows

( r ,t )= mf ( r , c , t ) dc
( r ,t ) u ( r , t )= mcf ( r , c , t ) dc

( r ,t ) e ( r , t ) =
where m is the molecular mass and
the peculiar velocity,

ua

1
mu2a f ( r , c ,t ) dc

(9)
(10)
(11)

the particle velocity relative to the fluid velocity,

ua =c _ u.

Equations(9),(10) and (11) are conservation of mass, momentum, and energy,


respectively.
From the kinetic theory, as discussed before, the internal energy can be expressed as,

e=

3
K T
2m B

The BGKW Approximation

16

It is difficult to solve Boltzmann equation because the collision term is very


complicated. The outcome of two body collisions is not likely to influence significantly, the
values of many measured quantities (Cercignani, 1990). Hence, it is possible to approximate
the collision operator with simple operator without introducing significant error to the
outcome of the solution. Bhatnagar, Gross and Krook (BGK) in 1954 introduced a simplified
model for collision operator. At the same time Welander (1954), independently, introduced
similar operator. The collision operator is replaced as,

1 eq
eq
= ( f f ) = (f f )

(13)

where =1/
The coefficient is called the collision frequency and is called relaxation factor. The
local equilibrium distribution function is denoted by

f eq , which is MaxwellBoltzmann

distribution function.
After introducing BGKW approximation, the Boltzmann equation (Eq(8) without external
forces) can be approximated as,

f
1
+ c . f = (f eqf )
t

(14)

In Lattice Boltzmann method, the above equation is discretized and assumed it is valid
along specific directions, linkages. Hence, the discrete Boltzmann equation can be written
along a specified direction as,

fi
1
+ c f = (f eq f i)
t i i i

(15)

The above equation is the working horse of the lattice Boltzmann method and replaces
NavierStokes equation in CFD simulations. It is possible to derive NavierStokes equation
from Boltzmann equation. We can make comments as the followings about Eq.(15)
1. The equation is a linear partial differential equation.
2. The equation looks like an advection equation with a source term.
3. The right-hand side of the equation represents the advection (streaming).
4. The left-hand side term represents the collision process, source term.
Equation(15) can be discretized as

f i ( r + ci t ,t + t )=f i ( r ,t ) +

t eq
[f ( r , t )f i ( r , t ) ]
i

(16)

The local equilibrium distribution function with a relaxation time determine the type of
problem needed to be solved. The beauty of this equation lies in its simplicity and can be
applied for many physics by simply specifying a different equilibrium distribution function
and source term (external force). Adding a source term (force term) to the above equation is
straightforward. However, there are a few concerns, which will be discussed in the following
17

chapters. Also, the details of implementing the above equation for different problems, such as
momentum, heat and mass diffusion, advectiondiffusion without and with external forces,
will be presented in the following chapters. It is possible to use finite difference or finite
volume to solve partial differential equation(15). Some authors used this approach to solve
fluid dynamic problems on non-uniform grids. The main focus of the book is to solve Eq(15)
in two steps, collision and streaming.
In LBM, the solution domain need to be divided into lattices. At each lattice node, the
factitious particles (distribution function) reside. Some of these particles streams (move)
along specified directions to the neighboring nodes. The number of direction, linkage,
depends on the lattice arrangement. Different lattice arrangements will be discussed in the
following section.
Lattice Arrangements
The common terminology used in LBM is to refer to the dimension of the problem and
the number of speed is using DnQm, where n represent the dimension of the problem (1 for
1-D, 2 for 2-D and 3 for 3-D) and m refers to the speed model, number of linkages.
One-Dimensional
In general, two models can be used for lattice arrangements, called D1Q3Q and D1Q5Q.
D1Q3 is the most popular one. The black nodes are the central node, while the gray nodes are
neighboring nodes. The factitious particles stream from the central node to neighboring nodes
through linkages with a specified speed, called lattice speed.
D1Q3 and D1Q2
For D1Q3, there are three velocity vectors (c0; c1 and c2) for f0; f1and f2; which equal
to 0, 1, and -1, respectively. Note that we assumed that dx =dt; otherwise,
and

c 2= x / t , where

and

c 1= x / t

are the linkage length and time step,

respectively. For this arrangement, the total number of factitious particles at any instant of
time cannot exceed three particles. One stagnant particle (zero velocity) resides on the central
site. The other two particles move either to the left or to the right node in the streaming
process. The weighting factors,
respectively. The speed of sound,

i ; has values of 4/6, 1/6 and 1/6 for f0; f1and f2;
c s ; in lattice units for D1Q3 is
18

1
. It is also
3

possible to use other arrangement called D1Q2. The weighting factors i , has values of
1/2 and 1/2 for f1and f2; respectively. The speed of sound for this arrangement is 1/

These schemes, D1Q2 and D1Q3, are mostly used. However, it is possible to involve more
sites and use higher order schemes, such as, D1Q5.
D1Q5
For this arrangement, the total number of factitious particles at any instant of time
cannot exceeded five particles. The weighting factors,

are 6/12, 2/12, 2/12,1/12, and

1/12 for f0; f1; f2; f3; and f4; respectively. The speed of the sound in lattice units is 1/

Two-Dimensional

4.2 D2Q5 and D2Q4 Lattice Structure


D2Q5 model has four velocity vectors issued from the central nodes as shown in above
figure. One of the particle resides at the central node, hence its speed is zero, noted as c(0,0).
The distribution function f1and f2 move with c(1,0) and c(-1,0) (to the east and west),
respectively, while f3and f4 move with speed c(0,1) and c(0,-1) (to the north and south),
respectively. Note that it is assumed that

x= y= t .

The weighting factors for f0; f1; f2; f3; and f4 are 2/6, 1/6, 1/6, 1/6, and 1/6,
respectively. It is worthy to mention that this arrangement cannot be used to simulate fluid
flows. This issue will be discussed latter on. D2Q4 has four velocity vectors and there is no
particle residing on the centre node. The weighting factor for each direction is 1/4. We will
discuss implementations and applications of each scheme in the following chapters. The
numbering of lattice links is arbitrary.
However, for computer programming algorithm, proper numbering may reduce
simplifying the computer code.

4.3 GPU
The GPU has been developed for general-purpose computing. Since increasing the clock
speeds drive transistors to thermal limits, the multi-core technique became the evident
solution to increase the processing speed of computing hardware. The GPU has, therefore,
been recognized as one of the most promising techniques to accelerate scientific
computations.
19

The GPU architecture favors dense data and local computations because the
communications between microprocessor is time consuming. Since the majority of LBM is
local, it is thus suitable for GPU-based computation. In this paper, the proposed algorithm is
accelerated using an NVIDIA graphics processing units.
The proposed method is efficient and effective when detecting object with well-defined
edges, with weak edges and without edges. Furthermore the method is robust against noise,
although it uses edge information, and fast to enable real-time image segmentation.
Comparing to some mean-shift and graph-based segmentation method, the advantages of the
proposed method rely on the intrinsic nature of the level set method which allows the
straightforward passage to higher dimensions, for example from 2D to 3D. In addition,
contrary to graph-cut method, sub-pixel accuracy can be reached.

CHAPTER 5
EXPERIMENTAL RESULTS

20

5. EXPERIMENTAL RESULTS
5.1 Parameter Setting
Our proposed method has a few parameters, including {lambda, gamma, tau, mu, a}.
The parameter allows the user to control and adjust the impact of F on the active
contour motion. We empirically set to be 550 in our experiments.
The parameter a is set to 0.5, although the results are quite robust to different values of
a.
The parameters gamma and tau are relaxation coefficients. tau is made equal to
(9*gamma+2)/4; where gamma is set to 0.5.
The parameter is set to 2 empirically. Note that all the parameters are set in the same
way for all the experiments.
Number of iterations=2

5.2 Implementation
Some real images are read in to matlab and are initially converted in to gray scale
images.Later a default initial contour is given according to the programming in matlab which
sets level set function .Then body force of the images are developed depending on the image.
Then Lattice Boltzmann method is used to evolve the contour to align along the boundaries of
the objects in the image using above equations with the help of the parameters.
The following figures show the implementation of our method on different images
in the following figures 5.1, 5.2, 5.3, 5.4,6.1,6.2,6.3,6.4,6.5(a),(b)

21

22

Fig 5.1 An example image of bird for simulation

Fig 5.2 Initial contour given on the gray scale image

23

Fig 5.3 Updated contour along the boundaries of the bird

Fig5.4 Final binary image distinguishing the bird from the background through the boundary.
24

Fig 6.1 Another example of image for simulation

Fig 6.2 gray scale image for the above image with contour.
25

Fig 6.3 Resulting contour for above image

Fig 6.4 final binary image.

26

Fig 6.5 (a)

(b)

Two figures illustrating the difference between our proposed method (a)and chan vese
method(b).

5.3 Limitations
Nevertheless, the algorithm has the limitation of the lattice Boltzmann method which
results in the non-negligible memory complexity when storing the distribution functions.
Future work will be to handle this problem in order to use the method for GPU cluster
accelerated real-time volume images segmentation.

27

CHAPTER 6
CONCLUSION

28

6. CONCLUSION
6.1 Conclusion
In this paper, we have proposed an edge, region and 2D histogram information based
level set model. The use of the lattice Boltzmann method to solve the level set equation
enables the algorithm to be highly parallelizable and fast when implemented using an
NVIDIA graphics processing units. The method is effective when segmenting objects with
and without edges, robust against noise and quietly independent to the position of the initial
contour. Experimental results on a variety kind of images have demonstrated subjectively and
objectively the effectiveness of the proposed model.

6.2 Applications:

a) Medical imaging:
Medical imaging is the technique and process used to create images of the human
body (or parts and function thereof) for clinical purposes (medical procedures seeking to
reveal, diagnose, or examine disease) or medical science (including the study of
normal anatomy and physiology). Although imaging of removed organs and tissues can be
performed for medical reasons, such procedures are not usually referred to as medical
imaging, but rather are a part of pathology.

b) Object detection:
Object detection is a computer technology related to computer vision and image
processing that deals with detecting instances of semantic objects of a certain class (such as
humans, buildings, or cars) in digital images and videos. Well-researched domains of object
detection include face detection and pedestrian detection. Object detection has applications in
many areas of computer vision, including image retrieval and video surveillance.

29

c) Face detection:
Face detection is a computer technology that determines the locations and sizes of
human faces in arbitrary (digital) images. It detects facial features and ignores anything else,
such as buildings, trees and bodies.
Face detection can be regarded as a specific case of object-class detection. In
object-class detection, the task is to find the locations and sizes of all objects in an image that
belong to a given class. Examples include upper torsos, pedestrians, and cars.
Face detection can be regarded as a more general case of face localization. In face
localization, the task is to find the locations and sizes of a known number of faces (usually
one). In face detection, one does not have this additional information.
Early face-detection algorithms focused on the detection of frontal human faces,
whereas newer algorithms attempt to solve the more general and difficult problem of multiview face detection. That is, the detection of faces that are either rotated along the axis from
the face to the observer (in-plane rotation), or rotated along the vertical or left-right axis (outof-plane rotation), or both. The newer algorithms take into account variations in the image or
video by factors such as face appearance, lighting, and pose.
Face detection is used in biometrics, often as a part of (or together with) a facial
recognition system. It is also used in video surveillance, human computer interface and image
database management. Some recent digital cameras use face detection for autofocus. Face
detection is also useful for selecting regions of interest in photo slideshows that use a panand-scale Ken Burns effect.
Face detection is gaining the interest of marketers. A webcam can be integrated
into a television and detect any face that walks by. The system then calculates the race,
gender, and age range of the face. Once the information is collected, a series of
advertisements can be played that is specific toward the detected race/gender/age.

d) Facial recognition system:


A facial recognition system is a computer application for the automatically
identifying or verifying a person from a digital image or a video frame from a video source.
30

One of the ways to do this is by comparing selected facial features from the image and a
facial database.
It is typically used in security systems and can be compared to other
biometrics such as fingerprint or eye iris recognition systems.

e) Iris recognition:
Iris recognition is an automated method of biometric identification that uses
mathematical pattern-recognition techniques on video images of the irides of an
individual's eyes, whose complex random patterns are unique and can be seen from some
distance.
Not to be confused with another, less prevalent, ocular-based technology, retina
scanning, iris recognition uses camera technology with subtle infrared illumination to acquire
images of the detail-rich, intricate structures of the iris. Digital templates encoded from these
patterns by mathematical and statistical algorithms allow the identification of an individual or
someone pretending to be that individual. Databases of enrolled templates are searched by
matcher engines at speeds measured in the millions of templates per second per (single-core)
CPU, and with infinitesimally small False Match rates.
Many millions of persons in several countries around the world have been
enrolled in iris recognition systems, for convenience purposes such as passport-free
automated border-crossings, and some national ID systems based on this technology are
being deployed. A key advantage of iris recognition, besides its speed of matching and its
extreme resistance to False Matches is the stability of the iris as an internal, protected, yet
externally visible organ of the eye.

f) Machine vision:
Machine vision (MV) is the technology and methods used to provide imagingbased automatic inspection and analysis for such applications as automatic inspection,
process control, and robot guidance in industry

31

Machine vision methods are defined as both the process of defining and creating a
MV solution, and as the technical process that occurs during the operation of the solution.
Here the latter is addressed. As of 2006, there was little standardization in the interfacing and
configurations used in MV. This includes user interfaces, interfaces for the integration of
multi-component systems and automated data interchange. Nonetheless, the first step in the
MV sequence of operation is acquisition of an image, typically using cameras, lenses, and
lighting that has been designed to provide the differentiation required by subsequent
processing. MV software packages then employ various digital image processing techniques
to extract the required information, and often make decisions (such as pass/fail) based on the
extracted information.
Though the vast majority of machine vision applications are still solved using 2
dimensional imaging, machine vision applications utilizing 3D imaging are growing niche
within the industry.

g) Content based Image retrieval:


Content-based image retrieval (CBIR), also known as query by image
content (QBIC) and content-based visual information retrieval (CBVIR) is the application
of computer vision techniques to the image retrieval problem, that is, the problem of
searching for digital images in large databases(see this survey for a recent scientific overview
of the CBIR field). Content based image retrieval is opposed to concept based
approaches (see concept based image indexing).
"Content-based" means that the search will analyze the actual contents of the
image rather than the metadata such as keywords, tags, and/or descriptions associated with
the image. The term 'content' in this context might refer to colors, shapes, textures, or any
other information that can be derived from the image itself. CBIR is desirable because most
web based image search engines rely purely on metadata and this produces a lot of garbage in
the results. Also having humans manually enter keywords for images in a large database can
be inefficient, expensive and may not capture every keyword that describes the image. Thus a
system that can filter images based on their content would provide better indexing and return
more accurate results.

32

6.3 Future Scope


This paper can be extended in a few ways. For example, it might be beneficial to apply
the lattice Boltzmann method for other segmentation problems, such as image matting or
video segmentation. Also, it was interesting to adopt some advanced evaluation method, such
as the user simulation-based approach proposed in to fully evaluate the performance of
different interactive image segmentation methods

33

BIBLIOGRAPHY

34

REFERENCES

[1] G. Papandreou and P. Maragos, Multigrid geometric active contour models, IEEE Trans.
Image Process., vol. 16, no. 1, pp. 229240, Jan. 2007.
[2] K. Zhang, L. Zhang, H. Song, and W. Zhou, Active contours with selective local or global
segmentation: A new formulation and level set method, Image Vis. Comput., vol. 28, no. 4, pp.
668676, Apr. 2010.
[3] C. Li, C. Kao, J. Gore, and Z. Ding, Implicit active contours driven by local binary fitting
energy, in Proc. IEEE Conf. Comput. Vis. Pattern Recognit., Jun. 2007, pp. 17.
[4] S. Balla-Arab and X. Gao, A multiphase entropy-based level set algorithm for MR breast
image segmentation using lattice boltzmann model, in Proc. Sino, Foreign,Interchange Workshop
Intell. Sci. Intell.Data Eng., Oct. 2013, pp. 816.
[5] C. Li, R. Huang, Z. Ding, J. Chris, 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. 20072016, Jul. 2011.
[6] S. Zhu and A. Yuille, Region competition: Unifying snakes, region growing, and Bayes/MDL
for multiband image segmentation, IEEE Trans. Pattern Anal. Mach. Intell., vol. 18, no. 9, pp.
884900, Sep. 1996.
[7] C. Brun, N. Lepor, X. Pennec, Y. Chou, A. Lee, G. De Zubicaray,K. L. McMahon, M. J.
Wright, J. C. Gee, and P. M. Thompson, A non-conservative Lagrangian framework for statistical
fluid registration SAFIRA, IEEE Trans. Med. Imaging, vol. 30, no. 2, pp. 184202, Feb. 2011.
[8] X.-B. Gao, B. Wang, D. Tao, and X. Li, A relay level set method for automatic image
segmentation, IEEE Trans. Syst., Man, Cybern. Part B, Cybern., vol. 41, no. 2, pp. 518525, Apr.
2011.
[9] M. Kass, A. Witkin, and D. Terzopoulos, Snakes: Active contour models, Int. J. Comput.
Vis., vol. 1, no. 4, pp. 321331, Jan. 1988.
[10] L. Tao, A. Krupa, and C. Collewet, A robust parametric active contour based on fourier
descriptors, in Proc. IEEE Int. Conf. Image Process.,Sep. 2011, pp. 10371040.
[11] A. Nakhmani and A. Tannenbaum, Self-crossing detection and location for parametric active
contours, IEEE Trans. Image Process., vol. 21, no. 7, pp. 31503156, Jul. 2012.
[12] Y. Wang, W. Chen, T. Yu, and Y. Zhang, Hessian based image structure adaptive gradient
vector flow for parametric active contours, in Proc.IEEE Int. Conf. Image Process., Sep. 2010,
pp. 649652.
[13] R. Malladi, J. Sethian, and B. Vemuri, A topology independent shape modeling scheme,
Proc. SPIE, vol. 2031, pp. 246258, Jun. 1993.

35

[14] N. Paragios and R. Deriche, Geodesic active contours for supervised texture segmentation,
in Proc. IEEE Conf. Comput. Vis. Pattern Recognit., Nov. 1999, pp. 10341040.
[15] M. Silveira and S. Heleno, Separation between water and land in SAR images using regionbased level sets, IEEE Geosci. Remote Sens. Lett.,vol. 6, no. 3, pp. 471475, Jul. 2009.
[16] B. Wang, X.-B. Gao, D. Tao, and X. Li, A unified tensor level set for image segmentation,
IEEE Trans. Syst., Man, Cybern. Part B, Cybern., vol. 40, no. 3, pp. 857867, Jun. 2010.
[17] T. Chan and L. Vese, Active contours without edges, IEEE Trans. Image Process., vol. 10,
no. 2, pp. 266277, Feb. 2001.
[18] Y. Chen, Z. Yan, and

Y. Chu, Cellular automata based level set method for image

segmentation, in Proc. IEEE/ICME Int. Conf. Complex Med. Eng., May 2007, pp. 2327.
[19] S. Balla-Arab, B. Wang, and X.-B. Gao, Level set region based image segmentation using
lattice Boltzmann method, in Proc. 7th Int. Conf. Comput. Intell. Security, Dec. 2011, pp. 11591163.
[20] S. Balla-Arab, X. Gao, and B.Wang, A fast and robust level set method for image
segmentation using fuzzy clustering and lattice Boltzmann method, IEEE Trans. Syst., Man,
Cybern. Part B, Cybern., vol. PP, no. 99, pp. 111, 2012.
[21] S. Balla-Arab and X. Gao, Image multi-thresholding by combining the lattice Boltzmann
model and a localized level set algorithm, Neurocomputing, vol. 93, pp. 106114, Sep. 2012.
[22] S. Succi, The Lattice Boltzmann Equation For Fluid Dynamics And Beyond Numerical
Mathematics And Scientific Computation. New York, NY, USA: Oxford Univ. Press, Aug. 2001.
[23] Y. Zhao, Lattice Boltzmann based PDE solver on the GPU, Vis. Comput., vol. 24, no. 5,
pp. 323333, May 2007.
[24] X. He and L. Luo, Lattice Boltzmann model for incompressible NavierStokes equation,
J.Stat. Phys., vol. 88, nos. 34, pp. 927944, Aug. 1997.
[25] P. L. Bhatnager, E. P. Gross, and M. Krook, BhatnagarGrossKrook operator, Phys. Rev.
vol. 94, no. 3, pp. 511525, 1954.
[26] J. Buick and C. Greated, Gravity in a lattice Boltzmann model, Phys. Rev. E, vol. 61, no.
5, pp. 53075320, May 2000.

36

APPENDIX

37

SOURCE CODE

UI
UIUser Interference
OPOut put
Image

LOAD IMAGE

PRE-PROCESSING

START SEGMENTATION

OP

Code Algorithm

38

CODE
%%%%%%%%%%%%%%%%%% START %%%%%%%%%%%%%%%%%%%
clc
clear all
close all
% INITIAL DISTANCE FIELD
I= imread ('bird.jpg');
I=im2double(I);
I=rgb2gray(I);
lx = size(I,1);
ly = size(I,2);
Imean = zeros(lx,ly);
for x = 2:lx-1
for y = 2:ly-1
Imean(x,y) = (I(x-1,y-1)+I(x-1,y)+I(x-1,y+1)+I(x,y-1)+I(x,y)+I(x,y+1)+I(x+1,y-1)+I(x+1,y)
+I(x+1,y+1))/9;
end
end
figure(1);imshow(I);hold on;
[m n]=size(I);
phi=ones(m,n);
phi(50:m-50,50:n-50)=-1;
contour(phi, [0 0], 'r')
hold off;
% D2Q5 LATTICE CONSTANTS
ex = [0, 1, 0, -1, 0];
ey = [0, 0, 1, 0, -1];
A = [1/3, 1/6, 1/6, 1/6, 1/6];
% INITIALIZATION OF THE LBM DISTRIBUTION FUNCTION
Feq = zeros(5,lx,ly);
D = zeros(5,lx,ly);
Fout = zeros(5,lx,ly);
phi2 = phi;
for x = 1:lx
39

for y = 1:ly
for li = 1:5
Feq(li,x,y) = phi2(x,y).* A(li);
end
end
end
Fint = Feq;
% SETTING OF THE RELAXATION COEFFICIENT
gamma = 0.5;
tau = (9*gamma+2)/4;
% EDGE INFORMATION
n = 2;
[Dx, Dy] = gradient(I);
G = 1./(sqrt(Dx.^2 + Dy.^2) + 1).^n;
% PERFORMING STREAMING-COLLISIONS
lambda = 550;
mu = 2;
a = 0.5;
F = zeros(lx,ly);
tic;
for iterations = 1:2
% COMPUTATION OF THE EXTERNAL FORCE
%calculation of interior and exterior means
Img=I;
u=phi;
c1 = sum(sum(Img.*(u<=0)))/(sum(sum(u<=0)));%interior mean
c2 = sum(sum(Img.*(u>0)))/(sum(sum(u>0)));%exterior mean
for x = 1:lx
for y = 1:ly
F(x,y)= lambda*(I(x,y)-(0.95*c1+0.05*c2))*(G(x,y)+exp(mu*(abs(I(x,y)-Imean(x,y))-a)));
end
end

40

for x = 1:lx
for y = 1:ly
for li = 1:5
Feq(li,x,y) = phi2(x,y).* A(li);
end
end
end
for x = 2:lx-1
for y = 2:ly-1
for li = 1:5
Fout(li,x,y)= Fint(li,x,y)-1/tau .* (Fint(li,x,y)-Feq(li,x,y))+(2*tau-1)/(2*tau) .* F(x,y);
end
end
end
for x = 2:lx-1
for y = 2:ly-1
for li = 1:5
Fint(li,x+ex(li),y+ey(li)) = Fout(li,x,y);
end
end
end
% UPDATING OF THE DISTANCE VALUE
phi3= zeros(lx,ly);
for x = 1:lx
for y = 1:ly
for li = 1:5
phi3(x,y)=phi3(x,y) + Fint(li,x,y);
end
end
end
figure;imshow(I);
hold on;
contour(phi3,[0 0], 'r');
end
CPU_time = toc
41

phi4=zeros(lx,ly);
for x = 1:lx
for y = 1:ly
if phi3(x,y)<= 0
phi4(x,y) =0;
else
phi4(x,y) =1;
end
end
end
[Dx, Dy] = gradient(phi4);
G = 255.*sqrt(Dx.^2 + Dy.^2);
for x = 1:lx
for y = 1:ly
if G(x,y)~= 0
G(x,y) =255;
else
G(x,y) =0;
end
end
end
%figure; imshow(phi4);
figure; imshow(G);
imwrite(G,'Resulted_Contours.jpg');
%%%%%%%%%%%%%%%%%%% END %%%%%%%%%%%%%%%%%%%%

42

You might also like