Introduction to MATLAB
[Link]
MATLAB Overview
What is MATLAB?
History of MATLAB
Who developed MATLAB
Why MATLAB was developed
Who currently maintains MATLAB
Strengths of MATLAB
Weaknesses of MATLAB
[Link]
What is MATLAB?
Matlab = Matrix laboratory
problem-solving environment
Designed
for
computations, esp.
convenient
numerical
matrix manipulation,
but also DEs, stats, and graphics
Developed by Cleve Moler in 1970s as a
teaching tool
[Link]
MATLAB
MATLAB is a program for doing numerical computation.
It was originally designed for solving linear algebra
type problems using matrices.
Its name is derived
from MATrix LABoratory.
MATLAB has since been expanded and now has built-in
functions for solving problems requiring data analysis,
signal processing, optimization, and several other
types of scientific computations.
It also contains
functions for 2-D and 3-D graphics and animation.
[Link]
What is MATLAB?
Originally FORTRAN; now C++/Java
Can call external C/FORTRAN routines
Interpreted
Customized graphical-user-interface
building
Has many specialized functions (Toolboxes)
[Link]
WHY MATLAB
Ease of use
Rapid prototyping/debugging of
sophisticated code
Can be used interactively
(scratchpad) or from scripts
[Link]
HISTROY OF MATLAB
MATLAB gained popularity primarily
through word of mouth because it was
not officially distributed
In the 1980s, MATLAB was rewritten in
C with more functionality (such as
plotting routines)
[Link]
CONTI
The Mathworks, Inc. was created in 1984
The Mathworks is now responsible for
development, sale, and support for MATLAB
The Mathworks is located in Natick, MA
The Mathworks is an employer that hires
co-ops through our co-op program
[Link]
STRENGTH OF MATLAB
MATLAB is relatively easy to learn
MATLAB code is optimized to be relatively quick
when performing matrix operations
MATLAB may behave like a calculator or as a
programming language
MATLAB is interpreted, errors are easier to fix
Although primarily procedural, MATLAB does have
some object-oriented elements
[Link]
WEAKNESS OF MATLAB
MATLAB is NOT a general purpose programming
language
MATLAB is an interpreted language (making it for
the most part slower than a compiled language
such as C++)
MATLAB is designed for scientific computation
and is not suitable for some things (such as
parsing text)
[Link]
MATLAB GUI
Launch Pad / Toolbox
Workspace
Current Directory
Command History
Command Window
[Link]
WORKSPACE
Allows access to data
Area of memory managed through the
Command Window
Shows Name, Size (in elements),
Number of Bytes and Type of Variable
[Link]
LAUNCH PAD / TOOL
Will not be covered
Launch Pad allows you to start
help/demos
Toolbox is for use with specialized
packages (Signal Processing)
[Link]
CURRENT DIRECTORY
MATLAB, like Windows or UNIX, has a
current directory
MATLAB functions can be called from
any directory
Your programs (to be discussed later)
are only available if the current directory
is the one that they exist in
[Link]
COMMAND HISTROY
Allows access to the commands used
during this session, and possibly previous
sessions
Clicking and dragging to the Command
window allows you to re-execute previous
commands
[Link]
COMMAND WINDOW
Probably the most important part of the
GUI
Allows you to input the commands that
will create variables, modify variables
and even (later) execute scripts and
functions you program yourself.
[Link]
SIMPLE COMMANDS
who
whos
save
clear
load
[Link]
WHO
who lists the variables currently in the
workspace.
As we learn more about the data
structures available in MATLAB, we will see
more uses of who
[Link]
WHOS
whos is similar to who, but also gives size and
storage information
s = whos(...) returns a structure with these
fields name variable name size variable size
bytes number of bytes allocated for the array
class class of variable and assigns it to the
variable s. (We will discuss structures more).
[Link]
SAVE
save saves workspace variables on disk
save filename stores all workspace variables
in the current directory in [Link]
save filename var1 var2 ... saves only the
specified
workspace
variables
in
[Link]. Use the * wildcard to save
only those variables that match the specified
pattern.
[Link]
CLEAR
clear removes items from workspace,
freeing up system memory
Examples of syntax:
clear
clear
name
clear name1 name2 name3 ...
[Link]
LOAD
load - loads workspace variables from
disk
Examples of Syntax:
load
load
filename
load filename X Y Z
[Link]
MATLAB FUNCTION
Functions are similar to scripts
Functions may take arguments
Functions may return one or more values
[Link]
CONTI
Example function
function [output] = square(input)
output = input*input;
Body of functions can contain code just like
scripts could
[Link]
MATH FUNCTION
Elementary functions (sin, cos, sqrt, abs,
exp, log10, round)
type
help elfun
Advanced functions (bessel, beta,
gamma, erf)
help specfun
type help elmat
type
[Link]
GRAPH FUNCTIONS
plot linear plot
stem discrete plot
grid add grid lines
xlabel add X-axis label
ylabel add Y-axis label
title add graph title
subplot divide figure window
figure create new figure window
pause wait for user response
[Link]
GETTING HELP
Using the Help Browser (.html, .pdf)
View [Link], [Link], using_ml.pdf
Type
help
help function, e.g. help plot
Running demos
type demos
type help demos
[Link]
ARITHMATIC OPERATIONS
1) plus
- Plus
+
2) uplus
- Unary plus
+
3) minus
- Minus
4) uminus
- Unary minus
5) mtimes
- Matrix multiply
*
6) times
- Array multiply
.*
7) mpower
- Matrix power
^
8) power
- Array power
.^
9) mldivide - Backslash or left matrix divide
10) mrdivide - Slash or right matrix divide
11) ldivide - Left array divide
.\
12) rdivide - Right array divide
./
[Link]
\
/
RELATIONAL OPERATIONS
1) eq
- Equal
- Not equal
==
2)
ne
3)
lt
4)
gt
- Greater than
>
5)
le
- Less than or equal
<=
6)
ge
- Less than
[Link]
- Greater
than or equal
~=
<
>=
LOGICAL OPERATORS
1)Short-circuit logical AND
&&
2)Short-circuit logical OR
||
3) and
- Element-wise logical AND
or
not
xor
any
nonzero
8) all
nonzero
4)
5)
6)
7)
- Element-wise logical OR
|
- Logical NOT
~
- Logical EXCLUSIVE OR
- True if any element of vector is
- True if all elements of vector are
[Link]
&
BITWISE OPERATORS
1) bitand
2)
bitcmp
3)
bitor
4)
bitmax
5)
6)
7)
8)
- Bit-wise AND.
- Complement bits.
- Bit-wise OR.
- Maximum floating point
integer.
bitxor
- Bit-wise XOR.
bitset
- Set bit.
bitget
- Get bit.
bitshift - Bit-wise shift.
[Link]
COMMAND SYNTAX
MATLAB is case-sensitive. All built-in commands are
in lower case. A command normally terminates with a
carriage return. Including a semicolon (;) at the end
of
a command suppresses MATLABs echoing to the
terminal (this is useful when dealing with large sets of
numbers.)
[Link]
FILE I/0
fopen
fclose
fprintf
fgetl / fgets
[Link]
VECTORS & matrix
A = [5,8,2,3,2,4,7,2,8,9,8,3,0,3] ;
S=[3,8,9;2,7,7;4,9,0];
[Link]
Save and load variable
A=5;
save A A;
load A
B=1;
C=A+B;
disp(C);
[Link]
graph
Clc
close all
clear all
t=0:0.25:7;
y = sin(t);
plot(t,y,'r--') ;
xlabel('Time');
ylabel('Frequency');
title('sin wave');
grid on;
gtext('X axis 1 cm = 1');
gtext('Y axis 1 cm = 0.2');
legend('contious sinwave');
print -djpeg075 [Link]
[Link]
IF LOOP
a=5;
if a > 6
disp('a is greater');
elseif a==0
disp('a is zero');
else
disp('a is smaller');
end
[Link]
FOR LOOP
a=5;
for i=1:5
a=a+1
end
disp(a);
ANS a =10
[Link]
While Loop
a=5;
while a < 10
a=a+1;
end
disp(a);
Ans a =10
[Link]
Function
function c=add(a,b);
c=a+b;
return
function c=mul(a,b);
c=a*b;
return
Main
a=5;
b=6;
c=add(a,b);
disp(c);
d=mul(a,b);
disp(d);
[Link]
Sample Program
load noissin;
figure;
plot(noissin);
figure;
c=cwt(noissin,[Link],'db4','plot');
[Link]
Signal generation
t=0:0.01:4;
x=sin(2*pi*t);
x=cos(2*pi*t);
figure;
plot(t,x);
axis([0 2 -1 1]);
xlabel('Time (sec)');
ylabel('amplitude (Volt)');
figure;
tem(t,x);
xis([0 5 -1 1]);
xlabel('Time (sec)');
ylabel('amplitude (Volt)');
[Link]
Exponential sequence
n=input('enter the length of exponential sequence =');
t=0:n;
a=input('Enter a value =');
y=exp(a*t);
figure;
stem(t,y);
axis([0 4 0 10]);
xlabel('Time (sec)');
ylabel('Amplitude (volt)');
title('Exponential Signal');
[Link]
Ramp Sequence
n=input('Enter the length of sequence=');
t=0:n;
figure;
stem(t,t);
xlabel('samples (n)-->');
ylabel('Amplitude (volt)');
title('Ramp Sequence');
[Link]
Unit Step Sequence
n=input('Enter the length of sequence =');
t=1:n;
y=ones(1,n);
stem(t,y);
xlabel('samples (n)-->');
ylabel('Amplitude (volt)');
title('Unit Step Sequence');
[Link]
Unit Impulse Sequence
n=input('Enter the length of sequence =');
t= -n:1:n;
y=[zeros(1,n),ones(1,1),zeros(1,n)];
stem(t,y);
xlabel('samples (n)-->');
ylabel('Amplitude (volt)');
title('Unit Impulse Sequence');
[Link]
Signal with noise
t = (0:0.001:1)';
y = sin(2*pi*50*t) + 2*sin(2*pi*120*t);
randn('state',0);
yn = y + 2*randn(size(t));
plot(t(1:50),yn(1:50));
[Link]
Sawtooth waveform
t=0:.001:1;
x=sawtooth(2*pi*50*t);
plot(t,x);
axis([0 .2 -1 1]);
[Link]
Square waveform
t=0:.01:10
x=square(t,15);
plot(t,x);
[Link]
Triangular waveform
t=-3:.1:3
y=tripuls(t);
plot(t,y);
[Link]
Rectangular waveform
t=-3:.1:3;
y=2*rectpuls(t);
plot(t,y);
axis([-3 3 0 3]);
[Link]
How to read an image
a =imread('[Link]');
imshow(a);
pixval on;
a =imread('[Link]');
imshow(a);
pixval on;
[Link]
How to read an audio file
a =wavread ('[Link]');
wavplay(a,44100);
Plot(a);
[Link]
How to read an video file
a=aviread('[Link]');
movie(a);
[Link]
Add two images
I = imread([Link]');
J = imread('[Link]');
K = imadd(I,J);
imshow(K,[])
I = imread('[Link]');
J = imadd(I,50);
subplot(1,2,1), imshow(I)
subplot(1,2,2), imshow(J)
[Link]
Subtract two images
I = imread('[Link]');
Iq = imsubtract(I,50);
subplot(1,2,1), imshow(I)
subplot(1,2,2), imshow(Iq)
[Link]
Convert image to gray and binary
clc;
clear;
close all
a= imread('[Link]');
subplot(2,2,1);
imshow(a);
subplot(2,2,2);
b=imresize(a,[256 256]);
imshow(b);
subplot(2,2,3);
c=rgb2gray(b);
imshow(c);
subplot(2,2,4);
d=im2bw(c);
imshow(d);
[Link]
RGB component
a=imread('[Link]');
subplot(2,2,1);
imshow(a);
[r c p]=size(a)
R=a;
G=a;
B=a;
R(:,:,2:3)=0;
subplot(2,2,2);
imshow(R);
G(:,:,1)=0;
G(:,:,3)=0;
subplot(2,2,3);
imshow(G);
B(:,:,1)=0;
B(:,:,2)=0;
subplot(2,2,4);
imshow(B);
[Link]
Convert Image into One dimensional
a = imread('[Link]');
[r c]=size(a);
Len=r*c;
b=reshape(a,[1 Len]);
[Link]
CONVER MOVIE TO FRAMES
file=aviinfo('[Link]');
% to get inforamtaion abt video
file
frm_cnt=[Link]
% [Link] frames in the video file
str2='.bmp'
h = waitbar(0,'Please wait...');
for i=1:frm_cnt
frm(i)=aviread(filename,i); % read the Video file
frm_name=frame2im(frm(i)); % Convert Frame to image file
frm_name=rgb2gray(frm_name);%convert gray
filename1=strcat(strcat(num2str(i)),str2);
imwrite(frm_name,filename1);
waitbar(i/frm_cnt,h)
% Write image file
[Link]
CONVERT FRAMES TO MOVIES
frm_cnt=5;
number_of_frames=frm_cnt;
filetype='.bmp';
display_time_of_frame=1;
mov = avifile('[Link]');
count=0;
for i=1:number_of_frames
name1=strcat(num2str(i),filetype);
a=imread(name1);
while count<display_time_of_frame
count=count+1;
imshow(a);
F=getframe(gca);
mov=addframe(mov,F);
end
count=0;
end
mov=close(mov);
[Link]
How to read a text file
fid = fopen('[Link]','r');
ice1= fread(fid);
s = char(ice1');
fclose(fid);
disp(s);
Ans hello
[Link]
How to write a text file
txt=[65 67 68 69];
fid = fopen('[Link]','wb');
fwrite(fid,char(txt),'char');
fclose(fid);
ANS =ACDE
[Link]
Store an Image,Audio
a =imread('[Link]');
imwrite(a,'[Link]');
a=wavread('[Link]');
wavwrite(d,44100,16,'[Link]');
[Link]
SAVE AND LOAD THE VARIABLE
A=5;
save A A;
load A
B=1;
C=A+B;
disp(C);
[Link]
NOISE AND FILTER
I = imread('[Link]');
J = imnoise(I,'salt & pepper',0.02);
K = medfilt2(J);
subplot(1,2,1);imshow(J)
subplot(1,2,2);imshow(K)
[Link]
M FILE & FUNCTION
CREATION
[Link]
There are four ways of doing code in
Matlab
terminal window
script M-file
function M-file
.mex files
[Link]
Terminal window
This method of doing calculations is
good for short.
one-time-only
calculations
or
for
calculations where one does not wish to
change any parameters.
[Link]
M file window
If we wish to execute repeatedly some
set of commands, and possibly change
input parameters as well, then one
should create a script M-file
A MATLAB script file is called as M-file.
The file is saved with the extension ".m".
When the file is run", the script is
carried out.
[Link]
Block Diagram of MATLAB
Series
of
Matlab
comma
nds
Matlab
Command
Dat
m-files
mat-files
Line
a
Command
sto
execution
Input functions
rag
like
DOS
Output
e/
command
loa
capabil
window
[Link]
din
ity
Function M file window
Most of the M-file that one ultimately
uses will be function M-file
These files again have the .m"
extension.
Function files have input and output
arguments.
[Link]
Conti
The syntax
definition is:
for
MATLAB
function
function [val1, , valn] = myfunc (arg1,
, argk)
where val1 through valn are the specified
returned values from the function.
arg1 through argk are the values sent to
the function.
[Link]
Conti
The word function appears at the start of
the file, and in lower case letters.
Function files are normally used to
combine functions in Matlab to get new
functions.
If it is not, the directory must be
changed before calling the function.
[Link]
Conti..
If MATLAB cannot find the function or its
syntax does not match the function call,
an error message will appear.
Failure to change directories often
results in the error message:
Undefined function or improper matrix
assignment
[Link]
Conti..
When the function file is not in the
current working directory, a cd or chdir
command may be issued to change the
directory.
cd E:\ OR
chdir E:\.
[Link]
IMAGE PROCESSING
[Link]
What is an Image
An image is an array, or a matrix, of
square pixels (picture elements)
arranged in columns and rows.
[Link]
Types of image
Black & white
Grayscale
RGB or Color image
[Link]
Image format
JPEG (Joint Pictures Expert Group)
GIF (Graphic Interchange Format)
TIFF (Tagged Image File Format)
PNG (Portable Network Graphics)
JPEG2000
BMP(Windows Bitmap)
[Link]
Binary or Black & White Image
Binary: Each pixel
is just black or
white. Since there
are
only
two
possible
values
for
each
pixel
(0,1), we only
need one bit per
pixel.
[Link]
Grayscale Image
Each pixel is a
shade of gray,
normally from 0
(black) to 255
(white).
This range means
that each pixel
can
be
represented
by
eight
bits,
or
[Link]
exactly one byte.
Color or RGB Image
Each pixel has a particular
color; that color is described
by the amount of red, green
and blue in it.
If each of these components
has a range 0255, this gives
a total of 2563 different
possible colors. Such an
image is a stack of three
matrices; representing the
red, green and blue values
for each pixel.
This means that for every
pixel there correspond 3
values.
[Link]
Conti
The secondary colors of
RGB cyan, magenta, and
yellow are formed by
mixing two of the primary
colors (red, green or blue)
and excluding the third
color.
Red and green combine to
make yellow, green and
blue to make cyan, and blue
and red form magenta.
The combination of red,
green, and blue in full
intensity makes white.
[Link]
Rotate image
a=imread([Link])
figure
imshow(a)
b=imrotate(a,45)
figure
imshow(b)
[Link]
Resize image
a=imread([Link])
figure
imshow(a)
b=imresize(a,10)
figure
imshow(b)
[Link]
Cropping an image
a=imread([Link])
figure
imshow(a)
b=imcrop(a,[10 20 30 40])
figure
imshow(b)
[Link]
Complement image
z=imread([Link])
figure
imshow(z)
g=imcomplement(z)
figure
imshow(g)
[Link]
Histogram an image
a=imread([Link])
figure
imhow(a)
j=histeq(a)
figure
imshow(j)
[Link]
IMTOOL
Image Display tool for performing basic
image processing task
The tools are,
Pixel region tool, Distance tool, Adjust
contrast, Crop tool, Image information
Example
imtool([Link]);
[Link]
Indexed Image
The syntax are ,
[X map]= rgb2ind(rgb,n);
[X map]=gray2ind(gray,n);
It gives pixel intensities and color map
values. n is size of color map.
It is used to increase the color resolution
of image.
rgb=ind2rgb(X,map);
gray=ind2gray(X,map);
[Link]
RGB->Indexed and gray->indexed
a = imread([Link]);
[x map]=rgb2ind(a, 10);
figure;
imshow(x,map);
b=imread([Link]);
[x1 map1]=gray2ind(b,50);
figure;
imshow(x1,map1);
[Link]
Color space conversions
Three color models :
HSV
YCbCr
YIQ
Computer display screen depth
>>get(0,ScreenDepth);
[Link]
Example
rgb=imread([Link]);
hsv=rgb2hsv(rgb);
figure;
imshow(hsv);
Yc=rgb2ycbcr(rgb);
Yi=rgb2ntsc(rgb);
figure; imshow(Yc);
figure; imshow(Yi);
[Link]
Image Enhancement
a=imread([Link]);
figure; subplot(2,1,1); imshow(a);
subplot(2,1,2); imhist(a);
b=imadjust(a);
figure; subplot(2,1,1); imshow(b);
subplot(2,1,2); imhist(b);
c=histeq(a);
figure; subplot(2,1,1); imshow(c);
subplot(2,1,2); imhist(c);
d=adapthisteq(a);
figure; subplot(2,1,1); imshow(d);
[Link]
subplot(2,1,2); imhist(d);
OVERVIEW
REGION OF INTEREST
DEBLURRING
EDGE DETECTION
[Link]
Region of Interest
a=imread([Link]);
Figure;imshow(b);
b=roipoly(a);
figure;
imshow(b);
[r c]=find(b==1);
xmin=min(r);xmax=max(r);
ymin=min(c);ymax=max(c);
D=a(xmin:xmax,ymin:ymax);
Figure;imshow(d);[Link]
Roipoly Example
a=imread([Link]);
figure;imshow(a);
b=roipoly(a);
loc=find(b==1); loc1=find(b ~= 1);
pri=zeros(r,c); pri(loc)=a(loc);
sec=zeros(r,c); sec(loc1)=a(loc1);
figure;
imshow(pri,[]);
figure;
imshow(sec,[]); [Link]
Roicolor example
a=imread([Link]);
Figure(1);
imshow(a);
b=roicolor(a,170,210);
Figure(2);
imshow(b);
[Link]
Roifill Example
a=imread([Link]);
figure(1);
Imshow(a);
bw=roipoly(a);
c=roifill(a,bw);
figure(2);
Imshow(c);
[Link]
Roifilter example
a=imread([Link]);
figure(1);
Imshow(a);
bw=roipoly(a);
F=fspecial(unsharp);
Out=roifilt2(F,a,bw);
figure(2);
Imshow(Out);
[Link]
Blurring effect on image
a=imread([Link]);
figure(1); imshow(a);
H = fspecial('motion',20,45)
Blurred =imfilter(a,H,circular);
figure(2);
imshow(Blurred);
title('Motion Blurred Image');
[Link]
Deblurring
a=imread([Link]);
figure(1); imshow(a);
H = fspecial('motion',20,45)
Blurred =imfilter(a,H,circular);
figure(2);
imshow(Blurred);
title('Motion Blurred Image');
De=deconvwnr(Blurred,H);
figure(3);
[Link]
Imshow(De);
Image analysis
a=imread([Link]);
figure(1); imshow(a);
P=impixel(a);
disp(P);
a=imread([Link]);
Figure(1); imshow(a);
b=improfile;
Disp(b);
a=imread([Link]);
imcontour(a,2);
title(Contour plot); [Link]
IMAGE PROCESSING
TECHNOLGIES &
APPLICATIONS
[Link]
Digital Image
Processing?...
An image can be defined as a two-dimensional
signal (analog or digital), that contains
intensity (grayscale), or color information
arranged along an x and y spatial axis.
Histogram, Co-Variance, Mean, Standard
Deviation these are all the some basic
calculation
process
in
Digital
Image
Processing.
Classification,
Resizing,
Extraction,
Recognition these are all the some basic
Process.
[Link]
Current Trends in Digital Image
Processing in Different Applications
Technologies
Compression
Steganography
Applications
Transmission & Storage
Secret Communications
Watermarking
Copyright Protection
Segmentation
Medical & Image Classifications
Image Retrieval
Web Applications
Recognition
Fusion
De-noising
Authentication
Medical & Satellite
Digital Cameras & Video codec
[Link]
Compression
The Process to remove the Redundancy (Duplication) in Image
Types of Compression
Lossless Compression
Data
can be completely recovered after decompression
Recovered
Lossy Compression
Data
cannot be completely recovered after decompression
Some
data is identical to original
information is lost for ever
Applications
All Multimedia Equipments such as Mobiles, DVD Players, TV, PC,
etc..,
[Link]
Compression Block Diagram
B
I
Input Image
Quantization
Entropy Encoding T
S
T
R
E
Reconstructed
De-quantization Decoding
A
Image
M
S
[Link]
Steganography
Hiding a Secret data in Digital Images without affecting the
quality of Medium.
This image is called as StegoImage.
Original Image
Stego Image
Application
Send secret communication
like Military applications
[Link]
Steganography Block Diagram
Original
Image
Preproces
s
Original
Image
Embeddin
g in Image
Stegoimag
e
Secret
Data
Extraction
from
Stegoimage
Secret
Data
[Link]
Watermarking
Water Marking Embed the secret image in an image or
any type of multimedia data.
We should hide the image without changing original
image quality.
Water marking is used only for copyright protection.
Types of Water Marking
Visible & Invisible
Applications
In telebroadcasting & web applications
[Link]
Watermarking Block Diagram
Input Image
Copyright Image
DWT
Key
Embedding Process
Water Marked Image
[Link]
Watermarking Extraction
Copyright Image
Water Marked Image
IDWT
Key
Extraction Process
Copyright output Image
[Link]
Segmentation
Segmentation refers to the process of partitioning a digital image into
multiple regions (sets of pixels).
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.
Each of the pixels in a region are similar with respect to some
characteristic or computed property, such as color, intensity, or texture.
Applications
In
Medical applications to find brain tumor, cancer detection & classify
the images in different domains
[Link]
Image Retrieval
Image retrieval techniques are useful in many imageprocessing applications.
In Image retrieval systems so many techniques are there.
Color Histogram based IR
Metadata based IR
Shape based IR
Applications
In web & medical applications to search particular image
form large database
[Link]
Fusion
Image Fusion is the process of combining relevant
information from two or more images into a single image.
The fused image should have more complete information
which is more useful for human or machine perception.
The resulting image will be more informative than any of
the input images.
Applications
Where we need the high information images in that
places like Medical & Satellite etc..,
[Link]
Basic Diagram of Image Fusion
[Link]
Simulation &
Implementation
[Link]
Simulation Result for
Steganography
[Link]
Original Image & StegoImage
[Link]
Fusion for Medical Application
[Link]
Fusion
[Link]
Simulation Result for Image
Retrieval
[Link]
Searching Process
[Link]
Input Video
[Link]
Compressed Video
[Link]
[Link]
TRANSFORMATION
Discrete Cosine Transform (DCT)
Discrete Wavelet Transform (DWT)
[Link]
Discrete Cosine Transform
The DCT is similar to the DFT since it
decomposes a signal into a series of
harmonic cosine functions.
It is sum of cosine function at different
frequency.
Cosine function are much more effective
compared to sine function.
It is dependent on time or frequency.
[Link]
Conti..
Here It separates the Image to number of
blocks.
In these blocks first block has the low frequency
information.
We can see clear information in low frequency
sub band
DC
w
lo
horizontal edges
[Link]
fr
cy
n
ue
q
e
vertical edges
le c y
d
i d u en
m eq
fr
Conti
The 2-D DCT and its inverse (IDCT) of an
N x N block are shown below:
2-D-DCT
N 1 N 1
2
(2 x 1)u
(2 y 1)v
F (u , v) C (u )C (v) f ( x, y ) cos[
] cos[
]
N
2N
2N
y 0 x 0
2-D-IDCT
2
f ( x, y )
N
(2 x 1)u
(2 y 1)v
C (u )C (v) F (u, v) cos[
] cos[
]
2N
2N
v 0 u 0
N 1 N 1
[Link]
Conti
One disadvantage of DCT has blocking
artifacts, due to Zigzag error during
reconstruction of image.
Itll overcome by wavelet transform.
[Link]
Conti
a=imread('[Link]
f');
subplot(1,3,1);
imshow(a,[]);
title(Input image)
b=dct2(a);
subplot(1,3,2);
imshow(b,[]);
title('DCT');
c=idct2(b);
subplot(1,3,3);
imshow(c,[]);
[Link]
Discrete Wavelet Transform
It has higher compression ratios avoid
blocking artifacts.
It is convert spatial domain to frequency
domain.
It is a type of signal representation that
can give the frequency content of the
signal at a particular instant of time or
spatial location.
[Link]
Conti
Allows good localization both in time and
spatial frequency domain.
It has more efficiency compare with DCT.
[Link]
DWT Calculation Procedure
Even + odd
Even + odd
Even odd
Image
Even - odd
HL
Even + odd
LL
LH
Even odd
[Link]
HH
Conti..
a=imread('[Link]')
;
[LL LH HL
HH]=dwt2(a,'haar');
Dec=[...
LL,LH
HL,HH
...
];
imshow(Dec,[]);
[Link]
GUI
[Link]
DIALOG BOX
warndlg('hello');
helpdlg('hello');
msgbox('hello');
[Link]
errordlg('hello');
ButtonName=questdlg('What is your wish?', ...
'Genie Question', ...
'Food','Clothing','Money','Money');
switch ButtonName,
case 'Food',
disp('Food is delivered');
case 'Clothing',
disp('The Emperor''s new clothes have arrived.')
case 'Money',
disp('A ton of money falls out the sky.');
end % switch
[Link]
USER INTERFACE GET FILE
[filename, pathname] = uigetfile('*.m', 'Pick an
M-file');
if isequal(filename,0) | isequal(pathname,0)
disp('User pressed cancel')
else
disp(['User selected ', fullfile(pathname,
filename)])
end
[Link]
USER INTERFACE PUT FILE
[filename, pathname] = uiputfile('*.m', 'Pick an M-file');
if isequal(filename,0) | isequal(pathname,0)
disp('User pressed cancel')
else
disp(['User selected ', fullfile(pathname, filename)])
end
[Link]
GUI
[Link]
GET IMAGE FILE
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
% eventdata reserved - to be defined in a future version of MATLAB
% handles
[filename, pathname] = uigetfile('*.jpg', 'Pick an Image');
handle to pushbutton1 (see GCBO)
structure with handles and user data (see GUIDATA)
if isequal(filename,0) | isequal(pathname,0)
warndlg('User pressed cancel')
else
M1 = imread( filename);
handles.M1 = M1;
axes(handles.axes1);
imshow(M1);
handles.filename1=filename;
%Update handles structure
guidata(hObject, handles);
end
[Link]
GUI
[Link]
MENU BAR
[Link]
PUSH BUTTON
[Link]
TOGGLE BUTTON
[Link]
RADIO BUTTON
[Link]
CHECKBOX
[Link]
EDIT TEXT
[Link]
STATIC TEXT
[Link]
SLIDER
[Link]
FRAME
[Link]
LISTBOX
[Link]
POPUP MENU
[Link]
AXES
[Link]
ALIGN OBJECTS
[Link]
MENU EDITOR
[Link]
M FILE EDITOR
[Link]
PROPERTY INSPECTOR
[Link]
[Link]
RUN
[Link]
EMPTY GUI
[Link]
GENERATED M FILE
[Link]
PUSH BUTTON
[Link]
RIGHT CLICK PUSH BUTTON & GO FOR
PROPERTY INSPECTOR
[Link]
CHANGE THE STRING AND TAG
VALUE
[Link]
CHANGE THE STRING AND TAG
VALUE
[Link]
RIGHT CLICK PUSH BUTTON & GO FOR M
FILE EDITOR
[Link]
GO FOR CALLBACK
[Link]
WRITE THE CODE BELOW THE
CALLBACK
a =imread('[Link]');
imshow(a);
[Link]
RUN THE PROGRAM OR PRESS F5
[Link]
CHOOSE AXES
[Link]
CHOOSE AXES
[Link]
RIGHT CLICK AXES & GO FOR PROPERTY
INSPECTOR
[Link]
CHANGE THE STRING AND TAG
VALUE
[Link]
WRITE THE CODE BELOW THE
CALLBACK
a =imread('[Link]');
axes([Link]);
imshow(a);
[Link]
RUN THE PROGRAM
[Link]
CODE
a =imread('[Link]');
axes([Link]);
imshow(a);
[Link]
TOGGLE BUTTON
[Link]
RIGHT CLICK TOGGLE & GO FOR
PROPERTY INSPECTOR
[Link]
CHANGE THE STRING AND TAG
VALUE
[Link]
RIGHT CLICK TOGGLE & GO FOR M FILE
EDITOR
[Link]
WRITE THE CODE BELOW THE
CALLBACK
a=get(hObject,'Value');
if a ==1
a =imread('[Link]');
axes([Link]);
imshow(a);
else
a =imread('[Link]');
axes([Link]);
imshow(a);
end
[Link]
RUN THE PROGRAM
[Link]
RIGHT CLICK RADIO BUTTON & GO FOR
PROPERTY INSPECTOR
[Link]
CHANGE THE STRING AND TAG
VALUE
[Link]
RIGHT CLICK CHECK BOX & GO FOR MFILE
EDITOR
[Link]
WRITE THE CODE BELOW THE
CALLBACK
[Link]
RUN THE PROGRAM
[Link]
RIGHT CLICK CHECK BOX & GO FOR
PROPERTY INSPECTOR
[Link]
CHANGE THE STRING AND TAG
VALUE
[Link]
RIGHT CLICK CHECK BOX & GO FOR M FILE
EDITOR
[Link]
WRITE THE CODE BELOW THE
CALLBACK
[Link]
RUN THE PROGRAM
[Link]
RIGHT CLICK FRAME & SEND TO
BACK
[Link]
RUN THE PROGRAM
[Link]
RIGHT CLICK LIST BOX & GO FOR
PROPERTY INSPECTOR
[Link]
EDIT THE STRING OPTIONS
[Link]
RIGHT CLICK LIST BOX & GO FOR M FILE
EDITOR
[Link]
WRITE THE CODE BELOW THE
CALLBACK
contents = get(hObject,'Value')
switch contents
case 1
a =imread('[Link]');
axes([Link]);
imshow(a);
case 2
a =imread('[Link]');
axes([Link]);
imshow(a);
case 3
a =imread('[Link]');
axes([Link]);
imshow(a);
otherwise
a =imread('[Link]');
axes([Link]);
imshow(a);
end
[Link]
CHOOSE POPUPMENU
[Link]
RIGHT CLICK POPUP MENU & GO FOR
PROPERTY INSPECTOR
[Link]
EDIT THE STRING OPTIONS
[Link]
WRITE THE CODE
contents = get(hObject,'Value')
switch contents
case 1
a =imread('[Link]');
axes([Link]);
imshow(a);
case 2
a =imread('[Link]');
axes([Link]);
imshow(a);
case 3
a =imread('[Link]');
axes([Link]);
imshow(a);
otherwise
a =imread('[Link]');
axes([Link]);
imshow(a);
end
[Link]
RIGHT CLICK EDIT TEXT & GO FOR
PROPERTY INSPECTOR
[Link]
EDIT STRING AND TAG
[Link]
RIGHT CLICK EDIT TEXT & GO FOR M FILE
EDITOR
[Link]
RIGHT CLICK AXES & GO FOR PROPERTY
INSPECTOR
[Link]
[Link]
WRITE THE CODE BELOW THE
CALLBACK
[Link]
WRITE THE CODE BELOW THE
CALLBACK
a=get(hObject,'String') ;
b=char(a);
c=imread(b);
axes([Link]);
imshow(c);
[Link]
RIGHT CLICK STATIC TEXT & GO FOR
PROPERTY INSPECTOR
[Link]
CHANGE THE STRING AND TAG
VALUE
[Link]
WRITE THE CODE BELOW THE
CALLBACK
a=get(hObject,'String') ;
set(handles.t1,'String',a);
b=char(a);
c=imread(b);
axes([Link]);
imshow(c);
[Link]
SLIDER
[Link]
RIGHT CLICK SLIDER & GO FOR PROPERTY
INSPECTOR
[Link]
DROP TWO AXES
[Link]
DROP PUSH BUTTON
[Link]
CHANGE THE STRING AND TAG
VALUE
[Link]
GO FOR CALLBACK
[Link]
WRITE THE CODE BELOW THE
CALLBACK
[filename, pathname] = uigetfile('*.bmp', 'Pick an Image');
if isequal(filename,0) | isequal(pathname,0)
warndlg('User pressed cancel')
else
a=imread(filename);
axes(handles.axes1);
imshow(a);
[Link]=filename;
guidata(hObject, handles);
end
[Link]
RIGHT CLICK SLIDER & GO FOR M FILE
EDITOR
[Link]
[Link]
WRITE THE CODE BELOW THE
CALLBACK
[Link]
RUN THE PROGRAM
a=get(hObject,'Value');
filename =[Link];
I = imread(filename);
J = imadd(I,50);
axes(handles.axes2);
imshow(J)
[Link]
MENU EDITOR
[Link]
[Link]
EDIT STRING AND TAG
[Link]
RUN
[Link]
Further contact
E-Mail:tripleninfotech@[Link]
project@[Link]
Contact No
+91-9566234284
+91-9566763284
Like Facebook page
[Link]
eprojecs
[Link]
CORPORATE OFFICE ADDRESS
Triple N Infotech-Chennai
Triple N Infotech-Trichy
No 33,(Old No 14/1),
No 73/5, 3rd Floor,
First Floor,
Kamachi Complex,
Madley Road,
Opp City Hospital,
[Link]
Salai Road,
Chennai-17
Trichy-18
044-42868371
0431-4050403
9566234284
7200021404
[Link]
[Link]
[Link]