Image Processing
Image Processing
ir
www.MatlabKar.com ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر -ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ
www.newbook.ir
Q S 3 (0 / B # L % ?@ R # 8@ O P QL O P
/ # # 9! B # ! )(. O P B " )
Q S 3 (0 /C 7 R B B + & Q X( -
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
S 3 (0 / # ( 8 0 3 (0 + # %!@ 3 E 3 !O 7 Q 3E
/ B 3 # M #B -
"#
YZ '*D / > 6 & A# ?A# # A+ # ="# &B ?1
/ I X( & $ "# &
$
` 9 ' $ . != 6 $ . ! + _ ./ # W + ] ^& *0[\ D # A $ #
3 ". #" #! Y0 # ! + /% & . 5! # ; 3 !I! >9 () & 3 ! T
Q ( / > =
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
% 1j
') B ' # ( -T " . e % 0* ". e 3 K ( "# W % 1j _ .
# '! + ' # '(4 / '&# 2 6B % 1j # /% & 51W ". e R ".
Q M # 10
/M D + *! + *P
/3 # k .c 1
/ & (. " &I.#
/" #l 3 ?
! "# $
% ! &
A !O P 3 * ) _ : (Computer Vision) + ( _ :B + P
(High level) Z ' ] ^'& (Mid level) ' ] ^& A(Low level) + ] ^& &3 @+
/ O P
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Image Image
Restoration Segmentation Representation
& Description
Image Image
Acquisition Enhancement
Description of the Performing the
Objects cognitive functions
Image
(edges, contours, (Like human
Compression
objects) vision)
& Coding
& ' ! ( )
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
/ I '(! ' '& # 3 & N ^& M ! >V =" D #< B M*N B $ *"
I. " & ! D * # /% & ^; 3< # ( #M (. 3 #< (0 . # ;
'(. 3 N # ;/ uvv t + "# ; !% & s# ; B #< (0 . A !
.% & > &=+ # w # (. 3 uvv # ; > &= w #
# * x ? / (x,y)=(0,0) Q m D M#N 1A "2 ! "# - #
(. 3 # c -E B 3 & # * y ? ^&
' m D M#N 1, 7 + # A * 0 . # ? V Matlab # E( c ?
(r,c)=(1,1) Q
/ m D Matlab , 7 # V B 3 (0 M# N +
! *!
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
RGB '
Q -,. /+ , `
l X # c -E w # # * 3< " . # !% & " D " #< "#i V B dW #
# '.V ' M # 'N ' # ". # w # 1DT B A "#i V B /
c M×3 3< " !% & # & w # 1DT B Aw # 1DT V / (! - w # 1DT V
Acmap w '# 1DT " #< % & H ! X(i,j) " " #< " x# /% & RGB 1W c W ;
'0 AX '; '! % '& + ) ^ #+ ! O P cmap(X(i,j),:) c -E .w #
Q $ * # & & 3 # + /% & [1 length(cmap)] " # 7 7N
image (X);
colormap (cmap)
RGB '
& . RGB ) # I - & # S#: / cE " D (4 G ! A )#
%& cE < 91& A9 W ?
B
Cyan
Magenta
White
Black
G
R Yellow
Q0 1 ,. `
'T '^; . " 9 W 91& < 5N w # ) # T# " 0 % ?@ # I ! . ! # ^ *.
% ' 6+ ' ' '# / (! b c N @ w # A 5N ? .M 3 I! ! #
Yq S' AI' # ') # 7 B O P Z *D
Y # ! % & + % 50 y% - G & ( q N
# -' "# '! 'E( ' % - + E* 5N w # G ! )# 7 + + 6 % ?@ + # A # w #
/% & 0 WU & # T ( + # !" ) # I- &/ %W #
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Q# T P w # ."
> =+ # > =B # (D A (! b 0 I
Q # !i @ # .w # * (4
HSI ; RGB ; w #
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
&
&
9 W
91&
<
" 2W
,2 34 5 3.
+ ' D H '; ! I&# M P " .# 7 " # # . ". #< " 0 * c E I&# d + plot
/ (! c ) E I ;- H ^ & #
x=linspace (0,2*pi,30);
y=sin (x);
plot(x,y)
!y #" ) # & ## * ;6 # 7 0 x 2 " # ^; Ar 6 S#
' # '2< H ; I&# D / (! I&# # * " # #H ; (! x # H ; 3< U (& c
/ (! c ) E % &#H ^
/ ! I&# # * B " # # , (7( (4 3
z =cos(x)
plot(x,y,x,z)
/ (! 3# T# " I. # * . b # .3 #< G a (4
plot(x,y)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
, * Ixq 0 * w # *
+ 4 ^; Q ^; < b
+4, `` 91& g
d*T % q 0 } 9 W r
#& " 6 c
d s g# m
# % q0 x # y
"# d & k
+ # o 5S x & w
Z # o 5S ^
~4 # o 5S <
% &# # o 5S >
•( # & p
$ #& h
/ #! % q0 , " X # w # #B # # % q 0 Aw #
plot(x,y,'b:p',x,z, 'c-',x,1.2*z, 'm+')
title ('figure 25.4:linestyles and markers')
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Q B $% 1 C D2A 9 !) , 5 ,A
y=sin(x);
z=cos(x);
plot(x,y,x,z);
box off
xlable ('indcpendent variable x');
ylable ('dcpendent variable y and z');
title ('figare 25.5:sine curves,no box');
Q1 C !EC - ! & F
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
' " '*0 ';6 " '.# 7 $ * " 7 " ( T# " # 5 ! (! axis # & &
/
(E I X( # "# T # * M P " .# 7 7 axis [xmin xmax ymin ymax]
" .# 7 " . 7 c ! # " ^& "# X=axis
% & "# T
. # W\ 6$ % ?@ #M P # 7 " ( T# Axis outo
# ; ! # ) % j#M P " .# 7 " ( T# Axis manual
+ *. I. 3< # " .# * A on hold
/ ((! & M P " .# 7 7
I&# " . #M P #7 7 Axis light
. # W
(! I X( # : " .% 1- M P #7 7 Axis fill
O P "86 * M P #7 !"
! (! #! , ;6 (9 + / (! #
data aspect ratio mode plot box aspect ratio
/ manual M # N
x = linspace(0.2*pi , 30);
y = sin(x);
plot (x,y);
axis( [0 2*pi -1.5 2])
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
!)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
x = linspace(0,2*pi,30);
y = sin (x);
z = cos(x);
subplot(2,2,1)
plot(x,y);
axis([0,2*pi ,-1,1]);
subplot(2,2,2)
plot(x,z)
axis ([0,2*pi, -1 , 1]);
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
/ . 3 #9 1 n # # * Q Zoom(n)
/ (! D6 g # x*( #9 % ?@ Q Zoom off
t = (1:2:12)*pi / 8;
x = sin(t);
y = cos (t);
fill (x,y,'r');
axis square off
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
JPEG, TIFF, GIF, BMP, PNG, HDF, PCX, XWD, " .% 6 E6 " .c 6 Matlab •
" 8 '6 ' cameraman.tif ' ' " 3 ! # " qS /
Y P E6 c 6 3 (0 # ICO, CUR
QI (! & imread # & %& 6 ! Matlab
MyImage = imread('cameraman.tif','tif');
Q !O P # V (D A D 3 size d
size(f)
ans=
1024 1024
/ ! & 9 6 # r 6d 3
[M,N]=size(f);
/ (! O P # ( N) " .3 & (M) . ^& D r 6# &
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
"< D ! !7%
Q - ( /I (1 # % & lV B # !# I. Z@
imshow(Myimage)
QI (1 I. # I subplot# & &
YourImage = imread('tire.tif','tif');
Figure
subplot(1,2,1), imshow(MyImage), title('MyImage')
subplot(1,2,2), imshow(YourImage), title('YourImage')
Q% & cE d + ) 7
imshow (f,G)
/% & 3< \ 6 $ # ; /% & " -! p ^& DG V f !
imshow(f,[low high]) Q % 6 &
high " - #9 2< # ; ! .c -E & low " - *! 2< ; ! .c -E
/ 3 &A (
6 X # f I* -! high # ; f I* ( low # ; imshow(f,[ ]) Q% 6 &
/% & G&( # + A (-. *! E ( 7 "# !" " /
f = imread('c:\matlab7\work\gradiant.bmp'); Q S
(Current 5D6"# ! c:\matlab7\work\ ! 4 % 9 M#N # r 6# & 3
/% - - 3 " ƒ -7 Directory)
f= imread(‘gradiant.bmp');
imshow (f,[ ])
size(f)
ans =
512 512
& 3 # $ *
% 6 3 AFile " ( # Export
! l P?
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
! I .!
Q l P? % 6 B 3 (0 % 6 V B
imwrite (f, ‘filename’)
TIFF, JPEG, BMP, PNG, PGM, Q + " " .% 6
Q S
imwrite (f, ‘D:\gradiant2.tif’)
Q-,. - ( ) ! H I .!
Q . ##!+ # & ! 3 3 (0 B 3 # . + (4 I.
title('Please click & enter for get a point !');
! ) $ J K,
Imcrop d
' ') B dW # ! ƒ P c ^ - >c E =M#N # *-W 3 d +
'! + ' ') c E' ! TU # P " 7 3 ! AI (! P
/ ! # " # ". # # # P " 7 M P
')(. >B ' 5! % '& # ' B 5! ~ 4 3 9*.= shift 5! 3 # 6 %& # 3 imcrop ! )(.
/ c 1d c ^- X # c ^- ƒ P
I= imread('ic.tif');
I1=imcrop(I);
I2=imcrop(I,[60 40 100 90]);
I2=imcrop(I,rect) % rect= P " 7 M P [x min, y min , width , heath] %
! L 8 $CK 5D
Improfile
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
! B &J
[0 65535] ". " " ;" [0 255] A ". " " ;"
/
9' '. ' # W )# w # 1DT # ; + ? # # # ; Aimage d A "#i V "
/ '(! & 1& ( " ^; #! #: ! X # # ;+ < 3 (0 # uvv # ;
+ '( A% '& [1 length(Cmap)] A "#i V " Double " . ? *D " ! <
" ' ' # ; VE0 Double ". Double s". c 1"
/ ! 6 @
'; " # ')5*0 " 'T " + (‚ m D " . #< " # A # " . )5*0 A+ q0
Q S / (! c 1 Double G ?W # 2< % - % q 0 3 ] 7N
Xdouble = double (Xuint8)+1 ;
Xuint8 = uint (Xdouble -1);
/VE0 c 1 Double Xuint8 b # " A S+ # S"
M EC
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
" ' ' b 3 ' # " D & " .c E 3 # ! (! … @" #G & (G Axis vis3d
/ & - M P " .# 7
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
size (m(1).cdata)
ans =
412 369 3
! # J
! / B $%
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Area /% & b + # c 1? . % @ -
Centroid /% & # # G -4 "9! ^; > y x = M P b +
BoundingBox / O P G -4 ." # 24 b + #
MajorAxisLength /% & b + # #7 + #9 :
MinorAxisLength /%& b + # # 7 + E4 ! :
Eccentricity "9! I. `9! f
Orientation % DW O P % 2T &
ConvexHull >ƒ 7 = ) -T
ConvexImage >ƒ 7 = ) -T
ConvexArea % @ - >ƒ 7 = ) -T
Image /I # V + # # G -4 B
FilledImage >V = G -4
FilledArea > 0=G -4 1@ -
EulerNumber > 0B =
Extrema >" D #< B =
EquivDiameter >"# 0 0 B =" ^W "
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
a= stats(2).BoundingBox
b= stats(3).BoundingBox
d= stats(6).BoundingBox
e= stats(10).BoundingBox
:
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
D EC N !
T % 0 & o 0 ///////////////////////////////////////////////////////////ippl (1
d*T ////////////////////////////////////////////////////////imadd(2
‡ /////////////////////////////////////////////////imsubtract(3
I -; ///////////////////////////////////////////////////imdivide(4
ƒ ///////////////////////////////////////////////immultiply(5
c ‡ 5^ # W////////////////////////////////////////////imabsdiff(6
I* ////////////////////////////////////////imcomplement(7
^ G ! ///////////////////////////////////////////////imlincomb(8
IPPL Intel Performance Primitives Library
ipplK ! 5 24 O 5 24
TF= ippl
[TF B]= ippl
Q]
/% & intel" .# -& U & # , ;6 % & intel % ! ‹ P ippl (1
/% & ?A # #! () & # ! & & d 0* B " ippl (2
T " %0& 1& 7 d o0 %& #9 1DT d ippl (3
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
ippl 3 ! D6 g
(! m D # LPT_IPPL_OFF B system environment variables % *-W# ippl 3 ! D6 g "
/ . # W NO # 3< "
c (A ( (! B 5! prorerties " # ! B 5! % & # my computer ( " ##!+ "
/ (! # new % *-W" # system variable $ P # !ƒ P # advanced
ImaddN
/ (! d*T % j 0 B # B (! d*T I. # d +
Z= imadd(x,y)
Z= imadd(x,y,’w’)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Q]
/ (! lZ # # ! d*T y #< # x #< # & +
ZM # (+ # ! logical x E( ) /% & x U q! 1 z class
/% & Double
/ * f# #< # ; 7 y X d*T c N @ / ( I. I. x y
/ * f# 7 T # N (0 ( Uint8 y x qS
<% & 0A < % & "# 0 M # N T # N (0 + (a*.
/% & D6 ippl A single uint8 logical " 2&q ! E U q ! I. " #< y x
A ( Single uint8 uint16 " . U q ! E U q ! I. z x double ?E& 0B y
/% & D6 ippl
% j 0B B 3 ! d*T Q S
I = imread('rice.png');
J = imadd(I,50);
subplot(1,2,1), imshow(I)
subplot(1,2,2), imshow(J)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
QY x d*T
Z= imadd(x,y)
#<:Z A #< :y A #< :x
d*T Q S
I = imread(Image1);3
J = imread(Image2);
K = imadd(I,J,'uint16');
imshow(K,[])
J I
K:
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Imsubtract N
/ (! I! B # 0B (! ‡ ) B # B
Z= imsubtract(x,y)
Q]
Z= imsubtract(x,y)
I. y x / 9# Z #< # # (! I! y #< #x #<
/ * f# U q! # ; 7 Z ( U q ! I.
205 0 25
0 175 50
B 0B ‡
Z=imsubtract(X,Y);
> #<= :Z A ?E& 0B :y A > #<= :x
Q S
I = imread('rice.png');
Iq = imsubtract(I,50);
figure, imshow(I), figure, imshow(Iq)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
< ! P Q
> #<= :Z A > #<= :y A > #<= :x
Q S
I = imread('rice.png');
background = imopen(I,strel('disk',15));
Ip = imsubtract(I,background);
imshow(Ip,[])
/ *‡ A . K+ #Y
q ! (- ! .% *-W
/ > E 9 "# S71 AL ;# " 5•- # = ƒ ; % ?@ " " 5•- A ? D + " . # !
Imdivide N
% 2T YZ *D % ?@ + ! / (! I -; 0B # # B (! I -; I. # d +
/ & B ( #M $ .!
Z= imdivide(x,y)
Q]
/ (! l Z #< # # I (! I -; y #< # K( (0 #x #< (0 . # & +
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Z= x./y
Z# D "# 0 0A "# 0 0 B I -; c N @ / ( I. y x
/ * f# # ; 7 9 I -; c N @ ‚ P#
Q S
I = imread(‘rice.png’);
J = imdivide(I,2);
subplot(1,2,1), imshow(I)
subplot(1,2,2), imshow(J)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
; ! ! H < $R
Z= imdivide(x,y)
:Z A :y A :x
Q S
I = imread(‘rice.png’);
background = imopen(I,strel(‘disk’,15));
Ip = imdivide(I,background);
figure, imshow(Ip,[])
Immultiply N
M ' $ 96 % 2T # ! + Z *D / (!
Y ƒ B # # 0B (! ƒ I. # #
'* # A 'X ' 'X ƒ # ! % & 3< ( #M $ 96 % 50 & B ( #
" Z' # '2 ' " '.c -'E # ƒ ) E # . # * I. " .c -E
/% (.
Z= immultiply(x,y)
Q]
/ 9# Z #< # # (! ƒ y #< # 3< K ( (0 #x #< (0 . A# & +
Z= x.× y
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Q ! + 9T /% & xU q ! 1 ZU q ! / ( -E U q ! 9 & x y
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
< ! S T
:Z A :y A :x
Q S
I = imread('moon.tif');
I16 = uint16(I);
J = immultiply(I16,I16);
imshow(I), figure, imshow(J)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Imabsdiff N
! G T Q P 7C ,J
Z= imabsdiff(x,y)
Q]
Z=abs(x-y) %& M#N + d + T
# W U q! # ; 7 f# A T N (0 # ; / ( -E U q ! Z y x
/ *
/% & D6 ippl single uint8A logical" 2&q ! E 3 -E U q ! Z y x
Q S
X = uint8([ 255 10 75; 44 225 100]);
Y = uint8([ 50 50 50; 50 50 50 ]);
Z = imabsdiff(X,Y)
Z=
205 40 25
6 175 50
c ‡ 5^ # W
:Z A :y A :x
Q S
I = imread('cameraman.tif');
J = uint8(filter2(fspecial('gaussian'), I));
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
K = imabsdiff(I,J);
imshow(K,[]) % [] = scale data automatically
imcomplement N
! <) C
IM2= imcomplement(IM);
Q]
RGB grayscale A binaryQ d " #
/# " # 1 &q ! 9 & T Qd T
/ c 1 N B B N " ( " I* #
/ c 1 + # + # d + 5&
IM2= ~IM : " ( " #
IM2= 1-IM Q grayscale " #
IM2= 255-IM Q RGB " #
Q S
X= uint([255 10 75;44 225 100]);
X2= imcomplement(X);
X2=
0 245 180
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
211 30 155
Q S
bw = imread('text.png );
bw2 = imcomplement(bw);
subplot(1,2,1),imshow(bw)
subplot(1,2,2),imshow(bw2)
Qd + #! ?S
imlincomb N
! 78 B
Z= imlincomb(K1,A1,K2,A2,……..Kn,An)
Z= imlincomb(K1,A1,K2,A2,……..Kn,An,K)
Z= imlincomb(………output_class)
Q]
Q (! 1& 7 # # ; Z= imlincomb(K1,A1,K2,A2,……..Kn,An)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
K1*A1+K2*A2+……..+Kn*An
/ # A1 1 "9 & U q ! Z
Q (! 1& 7 # # ; 9 Z=imlincomb(K1,A1,K2,A2,……..Kn,An,K)
K1*A1+K2*A2+……..+Kn*An+K
Q% & D6 ippl # W ". # E
Z=imlincomb(1.0,A1,1.0,A2)
Z=imlincomb(1.0,A1,-1.0,A2)
Z=imlincomb(-1.0,A1,1.0,A2)
Z=imlincomb(1.0,A1,K)
Q (-. " . U q! E # -E U q ! A1,A2,K W
Single ,int 16,uint8
Q S
I = imread('cameraman.tif );
J = imlincomb(2,I );
Imshow(I), figure, imshow(J)
/ (! lj # (! ƒ 0# #I
3 ! d*T 0 # c c N @Q S
I = imread('cameraman.tif );
J = uint8(filter2(fspecial('gaussian'), I));
K = imlincomb(1,I,-1,J,128); % K(r,c) = I(r,c) - J(r,c) + 128
subplot(1,2,1), imshow(I)
subplot(1,2,2), imshow(J)
figure,imshow(K)
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
T U q! 3 ! O P d*T Q S
I = imread('rice.png');
J = imread('cameraman.tif');
K = imlincomb(1,I,1,J,'uint16');
subplot(1,2,1),imshow(I),subplot(1,2,2)
imshow(J),figure, imshow(K,[])
Q S
X = uint8([ 255 10 75; 44 225 100]);
Y = uint8([ 50 20 50; 50 50 50]);
Z = imdivide(imadd(X,Y),2)
Z=
128 15 63
47 128 75
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
! 8 V S
Bwselect d
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
/ #ƒ P A # #y H ; " ) x H ; E ! r,c # 3 3 I.
bw1= bwselect(bw1,c,r,n)
>% & H ; )& " ?| = n !
! *! F
map * (4
black: [0 0 0]
pure red: [1 0 0]
white: [1 1 1]
Gray : [0.5 0.5 0.5]
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
K !) ;
# N # ; " .c -E # & Y
qS / & " ( 3 ! )#" ! # T 5*0
/ (! c 1 <w # # " .c -E 9 Ww #
I= imread (apples.jpg');
BW = rgb2gray(I)
imshow(BW, [1 0 0 ,0 0 1]) 9 Ww # N # ; " .c -E 100
<w # # ; " .c -E 001
@ -! & V W /V
roifill N
M#N x @ _ i@ % 2T 3< ! %& I50 # I2 #! d 5*T
/ # # ! gray scale " ! & P?
Q & #
U B *! & M#N `z
G&(3 & ^& ; ,& P? 7 ƒ P `u
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Q%& M# N + d + ) 7
J= roifill(I,BW);
/ B & 3 (0 !% & I 9 & 3 *. " ( B BW A# & + #
' '7 = fill ( BW # " . c -E K( !I @ !M # N +
/>
/ . c ;- # : @ ." # # B roifill T @ + (4
[J,BW]= roifill(…)
/ 7 ! .c -E " #B & " ( # & +
# # '; H '; ') " ' " '0 # ; A (-. # @ # ! . c -E " BW dW #
/ (! + 9) T
Q%& M#N d + " ) 7
J= roifill(x,y,I,xi,yi)
(! & 3 7 " T E I-&B " y x 0 # & + #
I! 0 + # (! + D # + D D5 (4 U x# ! yi xi # " 7 !M # N +
/ . # # TM P # (!
Q roipoly N
/# & " # # 3 *. I. d + !/ roipoly d ( + # " ) d
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Q ! -! & V K
[bw2,idx]=bwfill(…)
! X!
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Y 5 8Z speckle X !
#: V # # ; ! VV # N +) d % (E # : ! 6 0B n !
/ 0/04 \ 6$
QX ! W /V
/ * _ i@ # B 6 9 3 medfilt2 d ,&
B=medfilt2( a ,[m n] )
" # # : c -E _ : ) -*. B [m n] / # 9 3 *. a !
\ 6$ #: ! " # c -E _ : m-by-n ) -*. # # ; , & c T c -E !
/ 3-by-3 ) -*. +
H ;" # ; ,& + (a*. . 1?" # N + i #" # (! "#i Zd + !
/ (! 1& 7 . 1? [m n]/2 3 #
D& 3. [
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
D&
D& 3. [
5 P \ C D EC
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
M ' 3' ' (D A ((! #! ( #M ‡ 1?" &# E < " . )5*0 " D
-T ( #3 " . 5W" #" I M 0q : + /I # # ! & 5N " . ( #
/I (!
c -E # > ( #M 3 = ‡ (* > = A c -E ( #M (* > =
QI # + (A
U P \ C D EC
• ' d'W # '! '((! ' # ! ( #M ‡ U & 1?" &# E < " .I # )? )
'. I ' Z # ! ) A% & + 2 ., " &# E < " %& ( #M 3 M b
3< m ?P 3 ) " &# ( #3 B , " &B # + ( A% & 1?B ,
'., +6 " /I , B c7 # ( #M 3 # # - b X( I V /
/I (! -T • # #3 b". N #i I
Q ^; # ‡ ^; # # M ) *
D& 3. [ ; )?
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
' ' ' ( 3 (! " " . )5*0 / # # #!+ • # 5.`# 3< V (! )5*0 A3 (!
# (. & ; (4 " . # #!/ 5! , # (! )5*0 " X@q c W " B a.
/% & . ) <
Q D&1 )?
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
Bw=edge(I,’sobel’,thresh,direction)
" . 1?d + ! (! O P !% & " # (D A (! O P # % 2T direction syntax + #
/ (! -T # . \ 6$ #: ! / (! -T # . " *0 ;6
‘horizontal’ Q ;6
‘vertical’ Q" *0
Bw=edge(I,’sobel’,…,options)
# I # )? M 5*0 % 0 & ‘nothinning’ # ! " # 3 (0 "# #B d # & + #
‘thinning’ # > = #i 6 " . 1? . 1?3 C 5@ # ! % 50 + Z
/ (! %& # 9 # C " . 1?I # )? AI (! ƒ P #
[Bw,thresh]=edge(I,’sobel’,…)
/ #> &<= threshold # ; # & +
[Bw,thresh,gv,gh]=edge(….)
/ 3 " . )5*0 T # (gv,gh) " *0 ;6 " . 1? # & + #
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
[Bw,thresh]=edge(I,’canny’,…)
/ (! O P #+ Z &< 3 9 ! # (*? # B Z # &
N , % 4 2C
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر
www.newbook.ir
BW1 = imread('rc.tif');
BW2 = imfill (BW1);
<JX C ! U - ;\ H - ] ! -,. :
www.MatlabKar.com ﻣﺮﺟﻊ ﭘﺮوژه ﻫﺎي آﻣﺎده و ﺷﺒﯿﻪ ﺳﺎزي ﺑﺎ ﻣﺘﻠﺐ- ﺳﺎﯾﺖ ﻣﺘﻠﺐ ﮐﺎر