Sunteți pe pagina 1din 8

University of Aleppo

Faculty of Electrical and Electronic Engineering



Computer Engineer Section
/1 /! "# $ % &

( )

Image Morphological Segmentation Represent Pattern


processing and Recognition
Description

: ! " # $

$) - $ ) + ) - 7 ,

Morphological ( )
. %& '( & $) * + $ $) , - %& , . &$ , $/ %&
12 . 3 $) ( $ 4 5 .( 3 $) %& ( $ )+% ) & ! " +/ ( $ ) % - %
+8 9 3 $, -: 7 !8 $ # &* . 3 $) +8 $ 6 ,5
+8 ) . 1 5 + $ $ %& $ 7" $, $ ,5 . . .( 3 $)
.( $ ) &) .( 3 $)
6 ,5 $ 3(& . - (5 $$ 2) %& $ 5 8$2) $/ $ ) :
); $ ) +8 $6 $ ) % $, #" - (5 $ 45
: : !8$ 9 $ " $ 69 , $/$
Origin = floor (( size (nhood)+1)/2) nhood is neighborhood
. $ ) % 8 $ , #" +/ nhood 4 5

2009+2008 +1+ () )*
University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/1 /! "# $ % &

:strel $ )&= (1
SE = strel(shape, parameters)
:+ $(, 3 " A $6 > 5 ?$ $ )&= @ 7 / $#
SE = strel('arbitrary', NHOOD)
SE = strel('arbitrary', NHOOD, HEIGHT)

SE = strel('diamond', R)

SE = strel('disk', R, N)

SE = strel('line', LEN, DEG)

SE = strel('octagon', R)

SE = strel('pair', OFFSET)

SE = strel('periodicline', P, V)

SE = strel('rectangle', MN)

SE = strel('square', W)

2009+2008 +2+ () )*
University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/1 /! "# $ % &

: imdilate ( 7 $ )(( 7 (2
IM2 = imdilate(IM, SE)
IM2 = imdilate(IM, NHOOD)
$ ,5 %& ( -: C / ((&$ 63 $) +8 - A % , . ($(5% -: 8 B@ 7 / $#
.3 $) %& # " % +8 (. $ )
: D
a=imread('texter.tif');
imshow(a);
b=[0 1 0;1 1 1;0 1 0]; %or b=strel('diamond',1)
a2=imdilate(a,b);
figure;imshow(a2)

: imerode ( F ) E%# 7 (3
IM2 = imerode(IM,SE)
IM2 = imerode(IM,NHOOD)
$ ,5 %& ( -: C / ((&$ 63 $) +8 - A % , . ($(5% -: @ 7 / $#
.3 $) %& # " % +8 (. $ )
: D
a=imread('ft.tif');
imshow(a);
se=strel('disk',5);
b=imerode(a,se);
figure,imshow(b);
se=strel('disk',10);
b=imerode(a,se);
figure,imshow(b);
se=strel('disk',22);
b=imerode(a,se);
figure,imshow(b);

2009+2008 +3+ () )*
University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/1 /! "# $ % &

:( $ ) & $ 3 $) ) imopen - $ 3 $) G 8 (4
% : $ ) 12 (. 3 $) A 7 $ D E%# + % $#
IM2 = imopen(IM,SE)
IM2 = imopen(IM,NHOOD)
: D
I=imread('rice.png');
j=im2bw(I)
Imshow(j)
se=strel('disk',3);
I_opened=imopen(j,se);
figure,imshow(I_opened)

: imclose ' $ 3 $) !:H (5


% : $ ) 12 (. 3 $) A E%# D 7 $ + % $#
IM2 = imclose(IM,SE)
IM2 = imclose(IM,NHOOD)
2009+2008 +4+ () )*
University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/1 /! "# $ % &

: D
originalBW = imread('circles.png');
imshow(originalBW);
se = strel('disk',10);
closeBW = imclose(originalBW,se);
figure, imshow(closeBW)

: D
f=imread('images.jpg');
imshow(f);
se=strel('square',2);
fo=imopen(f,se);
figure,imshow(fo);
foc=imclose(fo,se);
figure,imshow(foc);

f=imread('shape.tif');
imshow(f);
se=strel('square',22);
fo=imopen(f,se);
figure,imshow(fo);
fc=imclose(f,se);
figure,imshow(fc);
foc=imclose(fo,se);
figure,imshow(foc);

2009+2008 +5+ () )*
University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/1 /! "# $ % &

: A D $) +8 - A ($(5 (6
B = bwboundaries(BW)
B = bwboundaries(BW,conn)
B = bwboundaries(BW,conn,options)

$# M 6- A C I +%. ( J$ 5 K 2 8 BL 3 $) +8 - A % , . ($(5 $#
(= N B ' % 3($,$ - A /$) = ($(5 $ (> ) , . - A % ($(5 C / E # @
:+ +8

.= ($ 2%. $ = B $ - A ($(5 4 5 A D 3 $) $ >, BW .(


8$2) %. 63 $) +8 - A ((& $/ p 4 5 p*1 :. 8$2) $/$ B $5 7 (
($(5 ($ &$ " - D (5 $ 5 8$2) " Q*2 8$2) $5 , :.
. A ($(5 -: ((& D Q 4 5 6 A

2009+2008 +6+ () )*
University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/1 /! "# $ % &

-: ((&) 8 $ 4 9$ O$ > ($(5 (& (. " # " ((5 conn


.8 +/ B 8O # .( " 3 $,

- A % K 2 . $/$ Options

: D
I = imread('coins.png');
BW = im2bw(I);
imshow(BW)
figure,imshow(I)
hold on;
BW_filled = imfill(BW,'holes');
boundaries = bwboundaries(BW_filled);
for k=1:10
b = boundaries{k};
plot(b(:,2),b(:,1),'g','LineWidth',3);
end

2009+2008 +7+ () )*
University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/1 /! "# $ % &

: A D $) +8 !" P% (7
BW2 = imfill(BW)
[BW2,locations] = imfill(BW)
BW2 = imfill(BW,locations)
BW2 = imfill(BW,'holes')
I2 = imfill(I)
BW2 = imfill(BW,locations,conn)
. " $ /R% ( #" Q &( $ A D BW 3 $) I ( #" P% 7 / $#
.1$ R (. "#
( (5 - R ? B +". 3 $) +8 3 . "# 7 $ ( . +8 Locations S
' :" BW A D 3 $) +8 2%. +8 P% = , .( +8 locations $ ( &$ 6 .( 3 $)%
" ( A D 3" "# - 5 +8$ 6p*1 ( $ locations ? +8 3 " "#
.3(5 $ "# D I8 " ($ 8$2) B locations ?
7" O + $ 2%. -: &$ , +/ 3$,2 4 5 6 A D 3 $) +8 - $,8 P% holes S
.3 $) +8 3($,$ $5 7 )
( -: #" I %& - $,2 C / $6 ( ( - $) +8 - $,8 P% S
.2 -: "5
.8 +/ B 8O # .( " 3 $, -: ((&) (. " # " ((5 conn S
: D
BW4 = im2bw(imread('coins.png'));
BW5 = imfill(BW4,'holes');
imshow(BW4), figure, imshow(BW5)

2009+2008 +8+ () )*

S-ar putea să vă placă și