Title: Image Processing and Analysis Image Gradient with Matlab
1Image Processing and Analysis Image Gradient
with Matlab
- Alexander Kolesnikov
- 03.11.2009
2Example Function 1
3Example Gradient field for the function 1
4Example Gradient magnitude
5Example Gradient magnitude
6Example 1 Matlab program
v -3.1253 X,Y meshgrid(v) Z
exp(-X.2 - Y.2) figure(21) white 1 1
1 set(gcf,'color',white') meshc(X,Y,Z) axis(-3
3 -3 3 0 1) set(gcf,'color',white') figure(22)
set(gcf,'color',white') px,py
gradient(Z,.2,.2) contour(v,v,Z), hold
on quiver(v,v,px,py), hold off figure(23)
set(gcf,'color',white') Mxpx.px
Mypy.py Msqrt(MxMy) meshz(X,Y,M)
7Example Function 2
8Example Gradient field for the functoin 2
9Function 2 Gradient Magnitude
10Function 2 Matlab program
v -3.1253 X,Y meshgrid(v) Z
X.exp(-X.2 - Y.2) figure(21) white 1 1
1 set(gcf,'color',white') meshc(X,Y,Z) axis(-3
3 -3 3 -0.4 0.5) set(gcf,'color',white') figure(
22) set(gcf,'color',white') px,py
gradient(Z,.2,.2) contour(v,v,Z), hold
on quiver(v,v,px,py), hold off
11Example Function 3
12Example Gradient field for the function 3
13Function 3 Matlab program
v -3.1253 X,Y meshgrid(v) Z
peaks(X,Y) figure(21) white 1 1
1 set(gcf,'color',white') meshc(X,Y,Z) axis(-3
3 -3 3 -10 5) set(gcf,'color',white') figure(22)
set(gcf,'color',white') px,py
gradient(Z,.2,.2) contour(v,v,Z), hold
on quiver(v,v,px,py), hold off
14Gradient operators in discrete space