You are on page 1of 76

Table of Contents

1 INTRODUCTION ...................................................................................................................................... 5
2 Need of image segmentation ................................................................................................................. 5
3 Steps to Implement this Project ............................................................................................................. 6
4 Software and technology used ............................................................................................................... 6
4.1 Software ......................................................................................................................................... 6
4.2 Technology Used ............................................................................................................................ 6
5 Matlab..................................................................................................................................................... 7
5.1 Introduction to Matlab ................................................................................................................... 7
5.2 Interfacing with other languages:................................................................................................... 8
5.3 License: ........................................................................................................................................... 8
5.4 Basic features: ................................................................................................................................ 9
5.4.1 Starting MATLAB ..................................................................................................................... 9
5.4.2 Shortcut icon (MATLAB 7.0.4) on your Windows desktop. When you start MATLAB, a ........ 9
5.4.3 Other windows. The major tools within or accessible from the desktop are: ....................... 9
5.5 Using MATLAB as a calculator: ..................................................................................................... 11
6 Basic arithmetic operators ................................................................................................................... 12
6.1 Quitting MATLAB .......................................................................................................................... 12
7 Getting started...................................................................................................................................... 12
7.1 Creating MATLAB variables .......................................................................................................... 12
7.2 Overwriting variable ..................................................................................................................... 13
7.3 Error messages ............................................................................................................................. 13
7.4 Making corrections ....................................................................................................................... 14
7.5 Controlling the hierarchy of operations or precedence ............................................................... 14
7.6 Table 1.2: Hierarchy of arithmetic operations............................................................................. 15
7.7 Now, consider another example: ................................................................................................. 15
7.8 Managing the workspace ............................................................................................................. 16
7.9 Miscellaneous commands ............................................................................................................ 16
8 Getting help .......................................................................................................................................... 16
9 BASIC PLOTTING OF GRAPHS: ............................................................................................................... 19
9.1 Overview ....................................................................................................................................... 19
9.2 Creating simple plots .................................................................................................................... 19
9.3 Adding titles, axis labels, and annotations ................................................................................... 22
9.4 Multiple data sets in one plot ....................................................................................................... 22
9.5 Specifying line styles and colors ................................................................................................... 24
10 Introduction Matrix Computation: ................................................................................................... 25
10.1 Matrix generation ......................................................................................................................... 25
10.2 Entering a vector .......................................................................................................................... 25
10.3 Entering a matrix .......................................................................................................................... 27
10.4 Matrix indexing: ............................................................................................................................ 28
10.5 Colon operator: ............................................................................................................................ 29
10.6 Linear spacing ............................................................................................................................... 30
10.7 Colon operator in a matrix ........................................................................................................... 30
10.8 Deleting row or column: ............................................................................................................... 34
11 Array operations: .............................................................................................................................. 41
12 Summary of commands: ................................................................................................................... 49
13 Array Operators: ............................................................................................................................... 50
14 Relational and logical Operators: ..................................................................................................... 50
15 Managing Workspace and File Commands: ..................................................................................... 51
16 Predefined Variables and Math Constants: ...................................................................................... 52
17 IMAGE ACQUISITION TOOLBOX: ....................................................................................................... 55
17.1 Basic Image Acquisition Procedure .............................................................................................. 55
17.2 IMAGE PROCESSING TOOLBOX: .................................................................................................... 56
18 Introduction: ..................................................................................................................................... 58
19 Working formats in Matlab .............................................................................................................. 59
19.1 Intensity image (gray scale image) ............................................................................................... 60
19.2 Binary image ................................................................................................................................. 60
19.3 RGB image .................................................................................................................................... 60
19.4 Multiframe image ......................................................................................................................... 61
20 How to convert between different formats ..................................................................................... 61
21 How to convert between double and uint8 ..................................................................................... 62
22 How to read files ............................................................................................................................... 62
23 Loading and saving variables in Matlab ............................................................................................ 63
24 Image Segmentation ......................................................................................................................... 64
25 Gamma Mapping .............................................................................................................................. 64
26 Step By step results .......................................................................................................................... 65
26.1 Original Image ............................................................................................................................... 65
26.2 Gray scale image of the Original Image ........................................................................................ 65
26.3 Binary image ................................................................................................................................. 66
26.4 Gamma mapped Image ................................................................................................................ 66
26.5 Binary of Gamma .......................................................................................................................... 67
26.6 Cleaned Binary Image ................................................................................................................... 67
26.7 Noise removed.............................................................................................................................. 68
26.8 Color highlight .............................................................................................................................. 68
26.9 Boxed Image ................................................................................................................................. 69
27 Flow Chart ......................................................................................................................................... 70
28 Explanation of Block diagram ........................................................................................................... 71
28.1 Load Image ................................................................................................................................... 71
28.2 Color to Gray scale image ............................................................................................................. 71
28.3 convert image to binary ............................................................................................................... 71
28.4 Gamma mapping .......................................................................................................................... 71
28.5 Noise remove ................................................................................................................................ 71
29 Application ........................................................................................................................................ 73
30 Conclusion ........................................................................................................................................ 74















Abstract

The main aim of this project is to develop an algorithm to
segment the houses from the satellite image. This part of the
image can be further used to access location of a remote area,
to point out the hide outs of terrorist in forest which are out of
reach of the radars and any other equipment.
This project is based on an important area of the image
processing know as image segmentation. In every part of the
image processing techniques image segmentation plays an
important role so that every part of the image can processed
properly and hence can have the better results.
Image segmentation is a whole new branch of image
processing which consist of so many algorithm to perform the
task. We have used one the popular techniques but in a whole
new context known as gamma mapping. Gamma mapping is
technique in which image is segmented by taking reference of
the gamma correction of the image. Gamma is used to vary
contrast of the image according the need.
In our project we have used Matlab and image processing tool
box to segment the Image. This project finds can further
develop segment different components of satellite image like
water, mountains etc.




1 INTRODUCTION
Image segmentation is the most important eld of image analysis and its
processing. It is used in many scientic elds including medical imaging, object and
face recognition, engineering and technology. The major challenge of image
segmentation is the over-segmentation caused by noise and incorrect spread of
intensity on the object. The main goal of this article is to propose methods
improving image segmentation in the case of overlapping objects. Prior to applying
dierent segmentation methods, it is necessary to perform specic pre-processing
methods preceding application of further segmentation methods, such as de-
noising and adjusting of intensity.
Image segmentation is an important part of image processing and it also has
various applications in engineering, biomedicine and other areas. So far, a number
of methods has been developed with the aim to identify the distinct region of
objects in the image. This paper is devoted to application of three dierent
methods of segmentation which are the watershed distance transform, gradient
watershed transform and region growing method on microscopic crystal image.
Before segmentation, the image was enhanced by pre-processing methods, such
as de- nosing and adjusting of intensity. Segmentation is considered for both
overlapping and non- overlapping objects by all method.
2 NEED OF IMAGE SEGMENTATION
Image segmentation has now become a very essential part of image processing,
we can see image segmentation anywhere in the digital world, like in cricket when
commentators explain what type bawl was bowled by the baller, in how many
direction batsman hit the shots, in news channel highlighting a person, in digital
camera face detection etc.
However image method of image segmentation varies with the type of image. An
image of a person and of an object is different this means for every type of image
there will be another type of method. So we chose a satellite image from which we
will show the houses on the ground.
This image segmentation covers a huge area of application which includes defense,
contour designing, remote area monitoring etc. A satellite image is different from
any other image in so many ways. A satellite image is taken from above the earth
from a special type of camera which is capable of see beneath the layers of dusty
atmosphere. But the image contains the high amount of noise which as to be
processed before segmentation. For this purpose we have used special type of
filter which filters the image on the basis of gamma correction, and hence our
project is named as gamma mapping. ,
Using the gamma mapping technique we can segment the interested part of the
image.
3 STEPS TO IMPLEMENT THIS PROJECT
Following are the steps we followed during making our project
1. To understand what is an Image and its component
2. How to read an image into the software and then make this image in a
format which can manipulated and computed.
3. How to use MATLAB image processing tool Box.
4. What is Gamma and gamma mapping
5. How an image can be extracted using Gamma factor
4 SOFTWARE AND TECHNOLOGY USED
4.1 SOFTWARE
6. MATLAB v 7.14
7. Image acquisition tool Box v 4.3 (R2012a)
4.2 TECHNOLOGY USED
8. Gamma Mapping
5 MATLAB
5.1 INTRODUCTION TO MATLAB
The name MATLAB stands for MATrix LABoratory. MATLAB was written originally
to provide easy access to matrix software developed by the LINPACK (linear system
package) and EISPACK (Eigen system package) projects.
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming environment. Furthermore, MATLAB
is a modern programming language environment: it has sophisticated data
structures, contains built-in editing and debugging tools, and supports object-
oriented programming.
These factors make MATLAB an excellent tool for teaching and research. MATLAB
has many advantages compared to conventional computer languages (e.g., C,
FORTRAN) for solving technical problems. MATLAB is an interactive system whose
basic data element is an array that does not require dimensioning. The software
package has been commercially available since 1984 and is now considered as a
standard tool at most universities and industries worldwide.
It has powerful built-in routines that enable a very wide variety of computations.
In 2004, MATLAB had around one million users across industry and academia.
MATLAB users come from various backgrounds of engineering, science, and
economics. MATLAB is widely used in academic and research institutions as well as
industrial enterprises.
Cleve Moler, the chairman of the computer-science department at the University
of New Mexico, started developing MATLAB in the late 1970s. He designed it to
give his students access to LINPACK and EISPACK without them having to learn
Fortran. It soon spread to other universities and found a strong audience within
the applied mathematics community. Jack Little, an engineer, was exposed to it
during a visit Moler made to Stanford University in 1983. Recognizing its
commercial potential, he joined with Moler and Steve Bangert. They rewrote
MATLAB in C and founded MathWorks in 1984 to continue its development. These
rewritten libraries were known as JACKPAC. In 2000, MATLAB was rewritten to use
a newer set of libraries for matrix manipulation, LAPACK.

MATLAB was first adopted by researchers and practitioners in control engineering,
Little's specialty, but quickly spread to many other domains. It is now also used in
education, in particular the teaching of linear algebra and numerical analysis, and
is popular amongst scientists involved in image processing.
5.2 INTERFACING WITH OTHER LANGUAGES:
MATLAB can call functions and subroutines written in the C programming language
or Fortran. A wrapper function is created allowing MATLAB data types to be
passed and returned. The dynamically loadable object files created by compiling
such functions are termed "MEX-files" (for MATLAB executable).
Libraries written in Java, ActiveX or .NET can be directly called from MATLAB and
many MATLAB libraries (for example XML or SQL support) are implemented as
wrappers around Java or ActiveX libraries. Calling MATLAB from Java is more
complicated, but can be done with MATLAB extension, which is sold separately by
MathWorks, or using an undocumented mechanism called JMI (Java-to-Matlab
Interface), which should not be confused with the unrelated Java Metadata
Interface that is also called JMI.

As alternatives to the MuPAD based Symbolic Math Toolbox available from
MathWorks, MATLAB can be connected to Maple or Mathematica. Libraries also
exist to import and export MathML.
5.3 LICENSE:
MATLAB is a proprietary product of MathWorks, so users are subject to vendor
lock-in. Although MATLAB Builder can deploy MATLAB functions as library files
which can be used with .NET or Java application building environment, future
development will still be tied to the MATLAB language.
Each toolbox is purchased separately. If an evaluation license is requested, the
MathWorks sales department requires detailed information about the project for
which MATLAB is to be evaluated. Overall the process of acquiring a license is
expensive in terms of money and time. If at all granted (which happens often), the
evaluation license is valid for two weeks. Student versions of MATLAB are sold at
bookstores and what the professors encourages them to buy, though standard
version is what the universities and colleges installed in labs.
5.4 BASIC FEATURES:
A minimum MATLAB session
The goal of this minimum session (also called starting and exiting sessions) is to
learn the
first steps:
How to log on
Invoke MATLAB
Do a few simple calculations
How to quit MATLAB

5.4.1 Starting MATLAB
After logging into your account, you can enter MATLAB by double-clicking on the
MATLAB
5.4.2 Shortcut icon (MATLAB 7.0.4) on your Windows desktop. When you start MATLAB, a
Special window called the MATLAB desktop appears. The desktop is a window that
contains
5.4.3 Other windows. The major tools within or accessible from the desktop are:

The Command Window
The Command History
The Workspace
The Current Directory
The Help Browser
The Start button







Figure 1. Graphical interface to MATLAB workspace
When MATLAB is started for the first time, the screen looks like the one that
shown in the Figure 1. This illustration also shows the default configuration of the
MATLAB desktop. You can customize the arrangement of tools and do comments
to suit your needs. Now, we are interested in doing some simple calculations. We
will assume that you have sufficient understanding of your computer under which
MATLAB is being run. You are now faced with the MATLAB desktop on your
computer, which contains the prompt (>>) in the Command Window. Usually,
there are 2 types of prompt:
>> for full version
EDU> for educational version
Note: To simplify the notation, we will use this prompt, >>, as a standard prompt
sign, though our MATLAB version is for educational purpose.
5.5 USING MATLAB AS A CALCULATOR:
As an example of a simple interactive calculation, just type the expression you
want to evaluate. Lets start at the very beginning. For example, lets suppose you
want to calculate the expression, 1 + 23. You type it at the prompt command (>>)
as follows,
>> 1+2*3
ans =
7
You will have noticed that if you do not specify an output variable, MATLAB uses a
default variable ans, short for answer, to store the results of the current
calculation. Note that the variable ans is created (or overwritten, if it is already
existed). To avoid this, you may assign a value to a variable or output argument
name. For example,
>> x = 1+2*3
x =
7
will result in x being given the value 1 + 2

3 = 7. This variable name can always be used to refer to the results of the previous
computations. Therefore, computing x will result in
>> 4*x
ans =
28.0000
Before we conclude this minimum session, below given table shows the partial list
of arithmetic operators.

6 BASIC ARITHMETIC OPERATORS
Symbol Operation Example
+ Addition 2 + 3
- Subtraction 2-3
* Multiplication 2*3
/ Division 2/3
6.1 QUITTING MATLAB
To end your MATLAB session, type quit in the Command Window, or select File-
Exit MATLAB in the desktop main menu.
7 GETTING STARTED
After learning the minimum MATLAB session, we will now learn to use some
additional operations.
7.1 CREATING MATLAB VARIABLES
MATLAB variables are created with an assignment statement. The syntax of
variable assignment is variable name = a value (or an expression)
For example,
>> x = expression
where expression is a combination of numerical values, mathematical operators,
variables, and function calls. On other words, expression can involve:
manual entry
built-in functions
user-defined functions

7.2 OVERWRITING VARIABLE
Once a variable has been created, it can be reassigned. In addition, if you do not
wish to see the intermediate results, you can suppress the numerical output by
putting a semicolon (;) at the end of the line. Then the sequence of commands
looks like this:
>> t = 5;
>> t = t+1
t =
6
7.3 ERROR MESSAGES
If we enter an expression incorrectly, MATLAB will return an error message. For
example, in the following, we left out the multiplication sign, *, in the following
expression
>> x = 10;
>> 5x
??? 5x
|
Error: Unexpected MATLAB expression.
7.4 MAKING CORRECTIONS
To make corrections, we can, of course retype the expressions. But if the
expression is lengthy, we make more mistakes by typing a second time. A
previously typed command can be recalled with the up-arrow key. When the
command is displayed at the command prompt, it can be modified if needed and
executed.
7.5 CONTROLLING THE HIERARCHY OF OPERATIONS OR PRECEDENCE
Lets consider the previous arithmetic operation, but now we will include
parentheses. For example, 1 + 23 will become (1 + 2)3
>> (1+2)*3
ans =
9
and, from previous example
> > 1+2*3
ans =
7
By adding parentheses, these two expressions give di erent results: 9 and 7. The
order in which MATLAB performs arithmetic operations is exactly that taught in
high school algebra courses. Exponentiations are done first, followed by
multiplications and divisions, and finally by additions and subtractions. However,
the standard order of precedence of arithmetic operations can be changed by
inserting parentheses. For example, the result of 1 +23 is quite different than the
similar expression with parentheses (1+2) 3.
The results are 7 and 9 respectively. Parentheses can always be used to overrule
priority, and their use is recommended in some complex expressions to avoid
ambiguity. Therefore, to make the evaluation of expressions unambiguous,
MATLAB has established a series of rules. The order in which the arithmetic
operations are evaluated is given in Table 1.2. MATLAB arithmetic operators obey
the same precedence rules as those in most computer programs. For operators of
equal precedence, evaluation is from left to right.
7.6 TABLE 1.2: HIERARCHY OF ARITHMETIC OPERATIONS
Precedence Mathematical operations
First The contents of all parentheses are evaluated first, starting from
the innermost parentheses and working outward.
Second All exponentials are evaluated, working from left to right
Third All multiplications and divisions are evaluated, working from left
to right
Fourth All additions and subtractions are evaluated, starting from left to
right

7.7 NOW, CONSIDER ANOTHER EXAMPLE:
In MATLAB, it becomes
>> 1/(2+3^2)+4/5*6/7
ans =
0.7766
or, if parentheses are missing,
>> 1/2+3^2+4/5*6/7
ans =
10.1857

7.8 MANAGING THE WORKSPACE
The contents of the workspace persist between the executions of separate
commands. Therefore, it is possible for the results of one problem to have an
eect on the next one. To avoid this possibility, it is a good idea to issue a clear
command at the start of each new independent calculation.
>> clear
The command clear or clear all removes all variables from the workspace. This
frees up system memory. In order to display a list of the variables currently in the
memory, type
>> who
while, whos will give more details which include size, space allocation, and class
of the variables.
7.9 MISCELLANEOUS COMMANDS
Here are few additional useful commands:
To clear the Command Window, type clc
To abort a MATLAB computation, type ctrl-c
To continue a line, type . . .

8 GETTING HELP
To view the online documentation, select MATLAB Help from Help menu or
MATLAB Help directly in the Command Window. The preferred method is to use
the Help Browser. The Help Browser can be started by selecting the ? icon from
the desktop toolbar. On the other hand, information about any command is
available by typing
>> help Command
Another way to get help is to use the lookfor command. The lookfor command
differs from the help command. The help command searches for an exact function
name match, while the lookfor command searches the quick summary information
in each function for a match. For example, suppose that we were looking for a
function to take the inverse of a matrix. Since MATLAB does not have a function
named inverse, the command help inverse will produce nothing. On the other
hand, the command lookfor inverse will produce detailed information, which
includes the function of interest, inv.
>> lookfor inverse
Note - At this particular time of our study, it is important to emphasize one main
point.
Because MATLAB is a huge program; it is impossible to cover all the details of each
function one by one. However, we will give you information how to get help. Here
are some examples:
Use on-line help to request info on a special function
>> help sqrt
In the current version (MATLAB version 7), the doc function opens the on-
line version of the help manual. This is very helpful for more complex
commands.
>> doc plot
Use lookfor to nd functions by keywords. The general form is
>> lookfor FunctionName




Mathematical functions
MATLAB offers many predefined mathematical functions for technical computing
which contains a large set of mathematical functions. Typing help elfun and help
specfun calls up full lists of elementary and special functions respectively.
There is a long list of mathematical functions that are built into MATLAB. These
functions are called built-ins. Many standard mathematical functions, such as
sin(x), cos(x), tan(x), ex, ln(x), are evaluated by the functions sin, cos, tan, exp, and
log respectively in MATLAB.
Table 2.1 lists some commonly used functions, where variables x and y can be
numbers, vectors, or matrices.

Table 2: Elementary functions:
cos(x) Cosine abs(x) Absolute value
sin(x) Sine sign(x) Signum function
tan(x) Tangent max(x) Maximum value
acos(x) Arc cosine min(x) Minimum value
asin(x) Arc sine ceil(x) Round towards +1
atan(x) Arc tangent floor(x) Round towards 1
exp(x) Exponential round(x) Round to nearest integer
sqrt(x) Square root rem(x) Remainder after division
log(x) Natural log angle(x) Phase angle
log10(x) Common log conj(x) Complex conjugate


In addition to the elementary functions, MATLAB includes a number of
predefined constant values. A list of the most common values is given in Table 3
Table 3: Predefined constant values
pi The pi number, pi= 3.14159
i,j The imaginary unit i,sqrt 1
Inf The infinity
NaN Not a number




9 BASIC PLOTTING OF GRAPHS:
9.1 OVERVIEW
MATLAB has an excellent set of graphic tools. Plotting a given data set or the
results of computation is possible with very few commands. You are highly
encouraged to plot mathematical functions and results of analysis as often as
possible. Trying to understand mathematical equations with graphics is an
enjoyable and very ecient way of learning mathematics. Being able to plot
mathematical functions and data freely is the most important step, and this
section is written to assist you to do just that.
9.2 CREATING SIMPLE PLOTS
The basic MATLAB graphing procedure, for example in 2D, is to take a vector of x-
coordinates, x = (x1; : : : ; xN), and a vector of y-coordinates, y = (y1; : : : ; yN),
locate the points (xi; yi), with i = 1; 2; : : : ; n and then join them by straight lines.
You need to prepare x and y in an identical array form; namely, x and y are both
row arrays or column arrays of the same length. The MATLAB command to plot a
graph is plot(x,y). The vectors x = (1; 2; 3; 4; 5; 6) and y = (3;1; 2; 4; 5; 1) produce
the picture shown in Figure 2.
>> x = [1 2 3 4 5 6];
>> y = [3 -1 2 4 5 1];
>> plot(x,y)
Note: The plot function has different forms depending on the input arguments. If y
is a vector plot(y) produces a piecewise linear graph of the elements of y versus
the index of the elements of y. If we specify two vectors, as mentioned above,
plot(x,y) produces a graph of y versus x.
For example, to plot the function sin (x) on the interval [0; 2pi], we first create a
vector of x values ranging from 0 to 2pi, then compute the sine of these values,
and finally plot the result:







>> x = 0:pi/100:2*pi;
>> y = sin(x);
>> plot(x,y)
Notes:
0:pi/100:2*pi yields a vector that
- starts at 0,
- takes steps (or increments) of pi=100,
- stops when 2pi is reached.
If you omit the increment, MATLAB automatically increments by 1.

9.3 ADDING TITLES, AXIS LABELS, AND ANNOTATIONS
MATLAB enables you to add axis labels and titles. For example, using the graph
from the previous example, add an x- and y-axis labels. Now label the axes and add
a title. The character \pi creates the symbol pi. An example of 2D plot is shown in
Figure 3.
9.4 MULTIPLE DATA SETS IN ONE PLOT
Multiple (x; y) pairs arguments create multiple graphs with a single call to plot. For
example, these statements plot three related functions of x: y1 = 2 cos(x), y2 =
cos(x), and y3 = 0:5 cos(x), in the interval 0 x 2.
>> x = 0:pi/100:2*pi;
>> y1 = 2*cos(x);
>> y2 = cos(x);
>> y3 = 0.5*cos(x);
>> plot(x,y1,'--',x,y2,'-',x,y3,':')
>> xlabel('0 \leq x \leq 2\pi')
>> ylabel('Cosine functions')
>> legend('2*cos(x)','cos(x)','0.5*cos(x)')
>> title('Typical example of multiple plots')
>> axis([0 2*pi -3 3])





9.5 SPECIFYING LINE STYLES AND COLORS
It is possible to specify line styles, colors, and markers (e.g., circles, plus signs, . . . )
using
the plot command:
plot(x,y,'style_color_marker')
where style_color_marker is a triplet of values from Table 2.3.
To find additional information, type help plot or doc plot.



10 INTRODUCTION MATRIX COMPUTATION:
Matrices are the basic elements of the MATLAB environment. A matrix is a two-
dimensional array consisting of m rows and n columns. Special cases are column
vectors (n = 1) and row vectors (m = 1).

In this section we will illustrate how to apply dierent operations on matrices. The
following topics are discussed: vectors and matrices in MATLAB, the inverse of a
matrix, determinants, and matrix manipulation.

MATLAB supports two types of operations, known as matrix operations and array
opera-tions. Matrix operations will be discussed first.

10.1 MATRIX GENERATION
Matrices are fundamental to MATLAB. Therefore, we need to become familiar
with matrix generation and manipulation. Matrices can be generated in several
ways.

10.2 ENTERING A VECTOR
A vector is a special case of a matrix. The purpose of this section is to show how to
create vectors and matrices in MATLAB. As discussed earlier, an array of dimension
1n is called a row vector, whereas an array of dimension m 1 is called a column
vector.

The elements of vectors in MATLAB are enclosed by square brackets and are
separated by spaces or by commas. For example, to enter a row vector, v, type
>> v = [1 4 7 10 13]
v =
1 4 7 10 13
Column vectors are created in a similar way, however, semicolon (;) must separate
the components of a column vector,
>> w = [1;4;7;10;13]
w =
1
4
7
10
13
On the other hand, a row vector is converted to a column vector using the
transpose operator.
The transpose operation is denoted by an apostrophe or a single quote (').
>> w = v'
w =
1
4
7
10
13
Thus, v(1) is the rst element of vector v, v(2) its second element, and so forth.
Furthermore, to access blocks of elements, we use MATLAB's colon notation (:).
For example, to access the first three elements of v, we write,
>> v(1:3)
ans =
1 4 7
Or, all elements from the third through the last elements,

>> v(3,end)
ans =
7 10 13
where end signifies the last element in the vector. If v is a vector, writing
>> v(:)
produces a column vector, whereas writing
>> v(1:end)
produces a row vector.


10.3 ENTERING A MATRIX
A matrix is an array of numbers. To type a matrix into MATLAB you must
begin with a square bracket, [
separate elements in a row with spaces or commas (,)
use a semicolon (;) to separate rows
end the matrix with another square bracket, ].


Here is a typical example. To enter a matrix A, such as,
>> A=
1 2 3
4 5 6
7 8 9

type,

>> A = [1 2 3; 4 5 6; 7 8 9]



MATLAB then displays the 33 matrix as follows,

A =
1 2 3
4 5 6
7 8 9

Note that the use of semicolons (;) here is di erent from their use mentioned
earlier to
Suppress the output or to write multiple commands in a single line.

Once we have entered the matrix, it is automatically stored and
remembered in the
Workspace.

We can refer to it simply as matrix A. We can then view a particular element
in
a matrix by specifying its location. We write,

>> A(2,1)
ans =
4

A(2,1) is an element lo cated in the second row and first column. Its value is
4.



10.4 MATRIX INDEXiNG:


We select elements in a matrix just as we did for vectors, but now we need
two indices.
The element of row
i
and column
j
of the matrix A is denoted by A(i,j). Thus, A(i,j)
in MATLAB refers to the element A of matrix A. The first index is the row
number and ij the second index is the column number. For example, A(1,3)
is an element of first row and third column. Here, A(1,3)=3.
Correcting any entry is easy through indexing. Here we substitute A(3,3)=9
by
A(3,3)=0.
The result is
>> A(3,3) = 0
A =
1 2 3
4 5 6
7 8 0


Single elements of a matrix are accessed as A(i,j), where i 1 and j 1. Zero
or negative subscripts are not supported in MATLAB.

10.5 COLON OPERATOR:

The colon operator will prove very useful and understanding how it works is
the key to efficient and convenient usage of MATLAB. It occurs in several
different forms.

Often we must deal with matrices or vectors that are too large to enter one
element at a time. For example, suppose we want to enter a vector x
consisting of points
(0; 0:1; 0:2; 0:3; ; 5). We can use the command

>> x = 0:0.1:5;

The row vector has 51 elements.

10.6 LINEAR SPACING
On the other hand, there is a command to generate linearly spaced vectors:
linspace. It
is similar to the colon operator (:), but gives direct control over the number
of points. For
example,

y = linspace(a,b)
generates a row vector y of 100 points linearly spaced between and
including a and b.

y = linspace(a,b,n)

generates a row vector y of n points linearly spaced between and including a
and b. This is useful when we want to divide an interval into a number of
subintervals of the same length.
For example,
>> theta = linspace(0,2*pi,101)

divides the interval [0; 2] into 100 equal subintervals, then creating a
vector of 101 elements.

10.7 COLON OPERATOR IN A MATRIX
The colon operator can also be used to pick out a certain row or column. For
example, the statement A(m:n,k:l species rows m to n and column k to l.
Subscript expressions refer to portions of a matrix. For example,


>> A(2,:)
ans =
4 5 6

is the second row elements of A.

The colon operator can also be used to extract a sub-matrix from a matrix A.

>> A(:,2:3)
ans =
2 3
5 6
8 0

A(:,2:3) is a sub-matrix with the last two columns of A.

A row or a column of a matrix can be deleted by setting it to a null vector, [ ].

>> A(:,2)=[]
ans =
1 3
4 6
7 0



Creating a sub-matrix:


To extract a submatrix B consisting of rows 2 and 3 and columns 1 and 2 of
the matrix A, do the following


>> B = A([2 3],[1 2])
B =
4 5
7 8


To interchange rows 1 and 2 of A, use the vector of row indices together
with the colon
operator.

>> C = A([2 1 3],:)
C =
4 5 6
1 2 3
7 8 0

It is important to note that the colon operator (:) stands for all columns or all
rows. To
create a vector version of matrix A, do the following


>> A(:)
ans =
1
2
3
4
5
6
7
8
9
0



The submatrix comprising the intersection of rows p to q and columns r to s
is denoted by A(p:q,r:s).

As a special case, a colon (:) as the row or column specier covers all entries
in that row or column; thus

A(:,j) is the jth column of A, while
A(i,:) is the ith row, and
A(end,:) picks out the last row of A.
The keyword end, used in A(end,:), denotes the last index in the specified
dimension.

Here are some examples:

>> A
A =
1 2 3
4 5 6
7 8 9

>> A(2:3,2:3)
ans =
5 6
8 9

>> A(end:-1:1,end)
ans =
9
6
3
24






>> A([1 3],[2 3])
ans =
2 3
8 9



10.8 DELETING ROW OR COLUMN:
To delete a row or column of a matrix, use the empty vector operator,[ ].


>> A(3,:) = []

A =
1 2 3
4 5 6

Third row of matrix A is now deleted. To restore the third row, we use a
technique for
creating a matrix

>> A = [A(1,:);A(2,:);[7 8 0]]
A =
1 2 3
4 5 6
7 8 0

Matrix A is now restored to its original form.













1. Dimension:
To determine the dimensions of a matrix or vector, use the command size.
For example,

>> size(A)
ans =
3 3

means 3 rows and 3 columns.
Or more explicitly with,

>> [m,n]=size(A)




2. Continuation
If it is not possible to type the entire input on the same line, use consecutive
periods, called an ellipsise , to signal continuation, then continue the input
on the next line.

B = [4/5 7.23*tan(x) sqrt(6); ...
1/x^2 0 3/(x*log(x)); ...
x-7 sqrt(3) x*sin(x)];

Note that blank spaces around +, , = signs are optional, but they improve
readability.

3. Transposing a matrix:
The transpose operation is denoted by an apostrophe or a single quote (').
It ips a matrix
about its main diagonal and it turns a row vector into a column vector. Thus,

>> A'
ans =
1 4 7
2 5 8
3 6 0

By using linear algebra notation, the transpose of m n real matrix A is the n
m matrix
that results from interchanging the rows and columns of A. The transpose
matrix is denoted AT .


4. Concatenating matrices
Matrices can be made up of sub-matrices. Here is an example. First, let's
recall our previous matrix A.

A =
1 2 3
4 5 6
7 8 9
The new matrix B will be,

>> B = [A 10*A; -A [1 0 0; 0 1 0; 0 0 1]]
B =
1 2 3 10 20 30
26
4 5 6 40 50 60
7 8 9 70 80 90
-1 -2 -3 1 0 0
-4 -5 -6 0 1 0
-7 -8 -9 0 0 1





5. Matrix generators
MATLAB provides functions that generates elementary matrices. The matrix
of zeros, the
matrix of ones, and the identity matrix are returned by the functions zeros,
ones, and eye, respectively.



For a complete list of elementary matrices and matrix manipulations, type
help elmat or doc elmat. Here are some examples:

1.
>> b=ones(3,1)
b =
1
1
1
Equivalently, we can dene b as >> b=[1;1;1]








2.
>> eye(3)
ans =
1 0 0
0 1 0
0 0 1
3. >> c=zeros(2,3)
c =
0 0 0
0 0 0

In addition, it is important to remember that the three elementary
operations of ad-
dition (+), subtraction (), and multiplication () apply also to matrices
whenever the
dimensions are compatible.

Two other important matrix generation functions are rand and randn, which
generate
matrices of (pseudo-)random numbers using the same syntax as eye.

In addition, matrices can be constructed in a block form. With C defined by

C = [1 2; 3 4], we may create a matrix D as follows

>> D = [C zeros(2); ones(2) eye(2)]
D =
1 2 0 0
3 4 0 0
1 1 1 0
1 1 0 1


6. Special matrices

MATLAB provides a number of special matrices (see Table 2.5). These
matrices have interesting properties that make them useful for constructing
examples and for testing algorithms.


For more information, see MATLAB documentation.






11 ARRAY OPERATIONS:

MATLAB has two different types of arithmetic operations: matrix arithmetic
operations and array arithmetic operations. We have seen matrix arithmetic
operations in the previous lab. Now, we are interested in array operations.

1. Matrix arithmetic operations
As we mentioned earlier, MATLAB allows arithmetic operations: +, , , and
^ to be carried out on matrices. Thus,
A+B or B+A is valid if A and B are of the same size
A*B is valid if A's number of column equals B's number of rows
A^2 is valid if A is square and equals A*A
*A or A* multiplies each element of A by

2. Array arithmetic operations
On the other hand, array arithmetic operations or array operations for short,
are done element-by-element. The period character, distinguishes the array
operations from the matrix operations. However, since the matrix and array
operations are the same for addition (+) and subtraction (), the character
pairs (:+) and (:) are not used. The list of array operators is shown below in
Table 3.2. If A and B are two matrices of the same size with elements A =
[aij ] and B = [bij ], then the command.



>> C = A.*B

produces another matrix C of the same size with elements cij = aijbij . For
example, using the same 3 X 3 matrices,
A =
1 2 3
4 5 6
7 8 9

B=
10 20 30
40 50 60
70 80 90

we have,

>> C = A.*B

C =
10 40 90
160 250 360
490 640 810

To raise a scalar to a power, we use for example the command 10^2. If we
want the operation to be applied to each element of a matrix, we use .^2.
For example, if we want to produce a new matrix whose elements are the
square of the elements of the matrix A, we enter

>> A.^2
ans =
1 4 9
16 25 36
49 64 81
The relations below summarize the above operations. To simplify, let's
consider two vectors U and V with elements U = [ui] and V = [vj ].

Table 4. summary of matrix and array operations:


Solving linear equations:

One of the problems encountered most frequently in scientific computation
is the solution of systems of simultaneous linear equations. With matrix
notation, a system of simultaneous linear equations is written

Ax =b

where there are as many equations as unknown.
A is a given square matrix of order n, b is a given column vector of n
components, and x is an unknown column vector of n components.
In linear algebra we learn that the solution to
Ax=b




can be written as

x=A
-1
b

where A
-1
is the inverse of A


For example, consider the following system of linear equations

X+2y+3z=1
4x+5y+6z=1
7x+8y+9z=1

the coefficient matrix A is
1 2 3
4 5 6
7 8 9

And vector
b=
1
1
1

With matrix notation, a system of simultaneous linear equations is written
Ax = b
This equation can be solved for
x
using linear algebra. The result is
x= A
-1
b
There are typically two ways to solve for x
in MATLAB:
1. The first one is to use the matrix inverse, inv.

>> A = [1 2 3; 4 5 6; 7 8 0];
>> b = [1; 1; 1];
>> x = inv(A)*b
x =
-1.0000
1.0000
-0.0000
2. The second one is to use the
backslash
(
\
)operator. The numerical algorithm behind
this operator is computationally e cient. This is a numerically reliable way of
solving
system of linear equations by using a well-known process of Gaussian
elimination.
>> A = [1 2 3; 4 5 6; 7 8 0];
>> b = [1; 1; 1];
>> x = A\b
x =
-1.0000
1.0000
-0.0000
This problem is at the heart of many problems in scientific computation.
Hence it is impor-
tant that we know how to solve this type of problem e ciently.
Now, we know how to solve a system of linear equations. In addition to this,
we will
see some additional details which relate to this particular topic.
3.2.1 Matrix inverse
Lets consider the same matrix
A
.
1 2 3
A
=
4 5 6
7 8 0
Calculating the inverse of
A
manually is probably not a pleasant work. Here the hand-
calculation of
A
gives as a final result:
-
1
-
16 8
-
1
14
-
7 2
A
= 1
-
1
9
-
1 2
-
1
In MATLAB, however, it becomes as simple as the following commands:
33

>> A = [1 2 3; 4 5 6; 7 8 0];
>> inv(A)
ans =
-1.7778 0.8889 -0.1111
1.5556 -0.7778 0.2222
-0.1111 0.2222 -0.1111
which is similar to:
-
16 8
-
1
A
= 1
14
-
7 2
-
1
9
-
1 2
-
1
and the determinant of A is
>> det(A)
ans =
27







For further details on applied numerical linear algebra, see [10] and [11].
3.2.2 Matrix functions
MATLAB provides many matrix functions for various matrix/vector
manipulations


12 SUMMARY OF COMMANDS:









13 ARRAY OPERATORS:

14 RELATIONAL AND LOGICAL OPERATORS:



15 MANAGING WORKSPACE AND FILE COMMANDS:


16 PREDEFINED VARIABLES AND MATH CONSTANTS:












17 IMAGE ACQUISITION TOOLBOX:
What Is the Image Acquisition Toolbox?
The Image Acquisition Toolbox is a collection of functions that extend the
capability of the MATLAB numeric computing environment. The toolbox supports
a wide range of image acquisition operations, including Acquiring images through
many types of image acquisition devices, from professional grade frame grabbers
to USB-based Webcams Viewing a preview of the live video stream Triggering
acquisitions (includes external hardware triggers) Configuring callback functions
that execute when certain events occur Bringing the image data into the MATLAB
workspace Many of the toolbox functions are MATLAB M-files. You can view the
MATLAB code for these functions using the statement type
function_name
You can extend the capabilities of the Image Acquisition Toolbox by writing your
own M-files, or by using the toolbox in combination with other toolboxes, such as
the Image Processing Toolbox and the Data Acquisition Toolbox. The Image
Acquisition Toolbox also includes a Simulink block, called the Video Input block,
that can be used to bring live video data into a model.
17.1 BASIC IMAGE ACQUISITION PROCEDURE
This section illustrates the basic steps required to create an image acquisition
application by implementing a simple motion detection application.
The application detects movement in a scene by performing a pixel-to-pixel
comparison in pairs of incoming image frames. If nothing moves in the scene, pixel
values remain the same in each frame. When something moves in the image, the
application displays the pixels that have changed values.

17.2 IMAGE PROCESSING TOOLBOX:
The Image Processing Toolbox is a collection of functions that extend the capability
of the MATLABnumeric computing environment. The toolbox supports a wide
range of image processing operations, including

Spatial image transformations
Morphological operations
Neighborhood and block operations
Linear filtering and filter design
Transforms
Image analysis and enhancement
Image registration
Deblurring
Region of interest operations


Many of the toolbox functions are MATLAB M-files, a series of MATLAB
statements that implement specialized image processing algorithms. You
can view the MATLAB code for these functions using the statement type

function_name


Step 1: Read and Display an Image
Clear the MATLAB workspace of any variables and close open figure
windows. close allTo read an image, use the imread command. The example
reads one of the sample images included with the Image Processing Toolbox,
pout.tif,
and stores it in an array named I. I = imread('pout.tif');imread infers from
the file that the graphics file format is Tagged Image File Format (TIFF).
For the list of supported graphics file formats, see the imread function
reference documentation.

Now display the image. The toolbox includes two image display functions:
imshow and imtool. imshow is the toolbox's fundamental image display
function.

imtool starts the Image Tool which presents an integrated environment for
displaying images and performing some common image processing tasks.
The Image Tool provides all the image display capabilities of imshow but
also provides access to severa other tools for navigating and exploring
images, such as scroll bars, the Pixel Region tool, Image Information tool,
and the Contrast Adjustment tool. For more information, see Displaying and
Exploring Images.

You can use either function to display an image. This example uses imshow.
imshow(I)


18 INTRODUCTION:
This worksheet is an introduction on how to handle images in Matlab. When
working with images in Matlab, there are many things to keep in mind such
as loading an image, using the right format, saving the data as different data
types, how to display an image, conversion between different image formats,
etc. This worksheet presents some of the commands designed for these
operations. Most of these commands require you to have the Image
processing tool box installed with Matlab. To find out if it is installed, type
ver at the Matlab prompt. This gives you a list of what tool boxes that are
installed on your system.

For further reference on image handling in Matlab you are recommended to
use Matlab's help browser. There is an extensive (and quite good) on-line
manual for the Image processing tool box that you can access via Matlab's
help browser.

The first sections of this worksheet are quite heavy. The only way to
understand how the presented commands work, is to carefully work
through the examples given at the end of the worksheet. Once you can get
these examples to work, experiment on your own using your favorite image!


Fundamentals
A digital image is composed of pixels which can be thought of as small dots
on the screen. A digital image is an instruction of how to color each pixel.
We will see in detail later on how this is done in practice. A typical size of an
image is 512-by-512 pixels. Later on in the course you will see that it is
convenient to let the dimensions of the image to be a power of 2. For
example, 29=512. In the general case we say that an image is of size m-by-n
if it is composed of m pixels in the vertical direction and n pixels in the
horizontal direction.

Let us say that we have an image on the format 512-by-1024 pixels. This
means that the data for the image must contain information about 524288
pixels, which requires a lot of memory! Hence, compressing images is
essential for efficient image processing. You will later on see how Fourier
analysis and Wavelet analysis can help us to compress an image significantly.
There are also a few "computer scientific" tricks (for example entropy
coding) to reduce the amount of data required to store an image.


Image formats supported by Matlab
The following image formats are supported by Matlab:

BMP
HDF
JPEG
PCX
TIFF
XWB

Most images you find on the Internet are JPEG-images which is the name for
one of the most widely used compression standards for images. If you have
stored an image you can usually see from the suffix what format it is stored
in. For example, an image named myimage.jpg is stored in the JPEG format
and we will see later on that we can load an image of this format into
Matlab.

19 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 four common formats.


19.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). 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. The class uint8 only requires
roughly 1/8 of the storage compared to the class double. On the other hand,
many mathematical functions can only be applied to the double class. We
will see later how to convert between double and uint8.


19.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.




19.3 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.


19.4 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.


20 HOW TO CONVERT BETWEEN DIFFERENT FORMATS
The following table shows how to convert between the different formats
given above. All these commands require the Image processing tool box!

Image format conversion
(Within the parenthesis you type the name of the image you wish to
convert.)
Operation: Matlab command:

Convert between
intensity/indexed/RGB formats to
binary format.
dither()
Convert between intensity formats to
indexed format.
gray2ind()
Convert between indexed formats to
intensity format.
ind2gray()
Convert between indexed formats to
RGB format.
ind2rgb()
Convert a regular matrix to intensity
format by scaling.
mat2gray()
Convert between RGB formats to
intensity format.
rgb2gray()
Convert between RGB formats to
indexed format.
rgb2ind()

The command mat2gray is useful if you have a matrix representing an image
but the values representing the gray scale range between, let's say, 0 and
1000. The command mat2gray automatically re scales all entries so that they
fall within 0 and 255 (if you use the uint8 class) or 0 and 1 (if you use the
double class).


21 HOW TO CONVERT BETWEEN DOUBLE AND UINT8
When you store an image, you should store it as a uint8 image since this
requires far less memory than double. When you are processing an image
(that is performing mathematical operations on an image) you should
convert it into a double. Converting back and forth between these classes is
easy.

I=im2double(I);

converts an image named I from uint8 to double.

I=im2uint8(I);

converts an image named I from double to uint8.



22 HOW TO READ FILES
When you encounter an image you want to work with, it is usually in form of
a file (for example, if you down load an image from the web, it is usually
stored as a JPEG-file). Once we are done processing an image, we may want
to write it back to a JPEG-file so that we can, for example, post the
processed image on the web. This is done using the imread and imwrite
commands. These commands require the Image processing tool box!

Reading and writing image files
Operation: Matlab command:
Read an image.
(Within the parenthesis you type the name of the image file you wish to read.
Put the file name within single quotes ' '.) imread()
Write an image to a file.
(As the first argument within the parenthesis you type the name of the
image you have worked with.
As a second argument within the parenthesis you type the name of the file
and format that you want to write the image to.
Put the file name within single quotes ' '.) imwrite( , )

Make sure to use semi-colon ; after these commands, otherwise you will get
LOTS OF number scrolling on you screen... The commands imread and
imwrite support the formats given in the section "Image formats supported
by Matlab" above.


23 LOADING AND SAVING VARIABLES IN MATLAB
This section explains how to load and save variables in Matlab. Once you
have read a file, you probably convert it into an intensity image (a matrix)
and work with this matrix. Once you are done you may want to save the
matrix representing the image in order to continue to work with this matrix
at another time. This is easily done using the commands save and load. Note
that save and load are commonly used Matlab commands, and works
independently of what tool boxes that are installed.

Loading and saving variables
Operation: Matlab command:
Save the variable X . save X
Load the variable X . load X


24 IMAGE SEGMENTATION
Model of a segmented femur. It shows the outer surface
(red), the surface between compact bone and spongy bone
(green) and the surface of the bone marrow (blue).
In computer vision, image segmentation is the process of
partitioning a digital image into multiple segments (sets of
pixels, also known as superpixels). The goal of segmentation
is to simplify and/or change the representation of an image
into something that is more meaningful and easier to
analyze.
[1]
Image segmentation is typically used to locate
objects and boundaries (lines, curves, etc.) in images. More
precisely, image segmentation is the process of assigning a
label to every pixel in an image such that pixels with the same label share certain
visual characteristics.
25 GAMMA MAPPING

Gamma correction, gamma non-
linearity, gamma encoding, or often
simply gamma, is the name of a
nonlinear operation used to code and
decode luminance or tristimulus
values in video or still
image systems. Gamma correction is, in
the simplest cases, defined by the
following power-law expression:

Where A is a constant and the input and
output values are non-negative real
values; in the common case of A = 1,
inputs and outputs are typically in the range 01. A gamma value < 1 is
sometimes called an encoding gamma, and the process of encoding with this
compressive power-law nonlinearity is called gamma compression, conversely a
gamma value > 1 is called a decoding gamma and the application of the
expansive power-law nonlinearity is called gamma expansion.

26 STEP BY STEP RESULTS
26.1 ORIGINAL IMAGE


26.2 GRAY SCALE IMAGE OF THE ORIGINAL IMAGE


26.3 BINARY IMAGE

26.4 GAMMA MAPPED IMAGE

26.5 BINARY OF GAMMA


26.6 CLEANED BINARY IMAGE

26.7 NOISE REMOVED


26.8 COLOR HIGHLIGHT

26.9 BOXED IMAGE






27 FLOW CHART




























Load Image
converting
colored image to
Grayscale image
convert image
into Binary
Image
gamma Maping
binary iamge of
gamma mapped
iamge
Removing Noice
Object Extract
28 EXPLANATION OF BLOCK DIAGRAM
28.1 LOAD IMAGE
To load an image means to convert the image in matrix form which can be easily
done by a function name imread (image.jpg).
28.2 COLOR TO GRAY SCALE IMAGE
This step is very important as colors can distract our software during segmentation,
since we are working on the gamma correction, colors have not any effect in the
gamma of the image so our code is usable for any kind of color gray scale image. In
matlab it is done using rgb2gray (I)
28.3 CONVERT IMAGE TO BINARY
In this step we will detect the noise of the image.
1. Image will be converted into binary form using im2bw(I).

28.4 GAMMA MAPPING

28.5 NOISE REMOVE
For extracting an object from the image it is necessary to understand the
properties of the particular type of image, in our case it is satellite Image.
As we have already listed before that a satellite image is different from the image
taken on the earth due to light variations in outer space and on the earth. Which
make it even more difficult to process by normal method, so we adopted an
standard method named Gamma mapping which is commonly use in extracting
the satellite image.
bw_original=im2bw(I);
figure, imshow(bw_original); title(' Binary form of
original version')
%showing histogram of the image
imhist(I)

During segmentation it is necessary to make the image noise free, to make this
possible we have used certain filters which we created in Matlab and are shown

NOISE REMOVED IMAGE




















% image changes
se = strel('disk', 15);
%im_imcomlement = imcomplement(bw_adjust)
bw_open =
imcomplement(imopen(imcomplement(bw_imadjust), se));
figure, imshow(bw_open); title (' Cleaned Binary Form
of Gamma Mapped Image ');
% to remove noise, reopne the image and remove the
pixels of values smaller then 300
bw_noiseless = bwareaopen(bw_open,300);
figure, imshow(bw_noiseless); title(' Noise removed
from Cleaned Binary form of Gamma Mapped Image')

29 APPLICATION
There are so many applications of image segmentation, but
specifically for our project which is specially designed for
satellite images some applications are listed below.
1. In contour making in city planning.
2. To extract an element of a particular wavelength of the
satellite image. This technique was used to detect water
signs on the moon by the ISRO.
3. To point out the hide outs of the terrorists through
satellite image. This technique was used by USA defense
organizations.
4. To extract houses from the satellite image.
5. To extract other elements like water, mountain etc. from
the image.











30 CONCLUSION
From all of our research and implementation of the project we
conclude that the image segmentation is an essential part of
the digital image processing. This field of the Image processing
has still a lot to develop so as to ensure finest output of the
method.
We have used Gamma mapping to segment the image taken
from the satellite more specifically we designed a kind of filter
which will first remove the noise from the image and then
extract the houses from the image.
This method can be used in any kind of space research stations
and institute, or in defense to explore the unreachable area.
We have used Matlab as the tool to perform image processing
and filtering, however this can also be done by using OpenCV
and some other tools of Digital image processing. Matlab is
one of the finest research tool for the scientist and students
because it have readymade functions of so many thing which
reduces efforts and at the same time efficiency the code also.
Image segmentation is a whole new branch of image
processing which consist of so many algorithm to perform the
task. We have used one the popular techniques but in a whole
new context known as gamma mapping. Gamma mapping is
technique in which image is segmented by taking reference of
the gamma correction of the image. Gamma is used to vary
contrast of the image according the need.
There are always limitation in any kind project and so do we.
Our project is limited to satellite image only from which only
homes can be extracted, however this can be upgraded to
extract some other objects of a satellite image like mountains,
rivers, forest etc. this will make this project a complete
package to process a satellite image. This project can also be
commercialize in so many ways for example in digital cameras,
etc.
Model of a segmented femur. It shows the outer surface (red),
the surface between compact bone and spongy bone (green)
and the surface of the bone marrow (blue).
In computer vision, image segmentation is the process of
partitioning a digital image into multiple segments (sets of
pixels, also known as superpixels). The goal of segmentation is
to simplify and/or change the representation of an image into
something that is more meaningful and easier to analyze.[1]
Image segmentation is typically used to locate objects and
boundaries (lines, curves, etc.) in images. More precisely,
image segmentation is the process of assigning a label to every
pixel in an image such that pixels with the same label share
certain visual characteristics.

This image segmentation covers a huge area of application
which includes defense, contour designing, remote area
monitoring etc. A satellite image is different from any other
image in so many ways. A satellite image is taken from above
the earth from a special type of camera which is capable of see
beneath the layers of dusty atmosphere. But the image
contains the high amount of noise which as to be processed
before segmentation. For this purpose we have used special
type of filter which filters the image on the basis of gamma
correction, and hence our project is named as gamma
mapping. ,
Using the gamma mapping technique we can segment the
interested part of the image.

You might also like