Professional Documents
Culture Documents
الدرس الثالث معالجة الصورة الرقمية باستخدام الماتلاب
الدرس الثالث معالجة الصورة الرقمية باستخدام الماتلاب
" # $ % &
-# ' ( #) ** + ,"
$" # !
, + im2bw %&' ( )*'# Binary Image
binary image=im2bw(image,level);
% / image - .
1'& )2 3 4 level 0
3' <=> 1 ? @ 9 ' - . [0 1] 9 : ; 1'& )2 5 67 8'
3' <=> 1 0 '1' B 7 / % level 1'& )2 A 4 5
E '0' B 7 " #/ % level 1'& )2 C D 5
I=imread('pillsetc.png');
imshow(I)
bw=im2bw(I,0.4);
figure, imshow(bw)
Binary Image : G '. H1> 1# 0 8 I 1'& )2 J.= F
E M 34 $LB 0 8+' 0 :0 K +' & %
+ 1'& )2 'NO7 & 1P 4M 5 1'& )2 81& F
[0 , 1] 9 : ; ?B D5 3P& 3' 7 graythresh %&' ()*'> 3%M0/
,3 ' + % 1' )2 8 +
level=graythresh(image);
I=imread('pillsetc.png');
imshow(I)
level=graythresh(I);
bw=im2bw(I,level);
figure, imshow(bw)
0 $1 D58 T / % GS@ M 34 F
E Object V > $ 0 D58 CP . T " #/ % U1 @ 0 L . 7
07 " ) < ). 7 ? 9 0 Y Z'V Object 8W X= 34 F
E '* 1>. " ) < ). 7 9
U O M \ 0 LB4 " #/ 7 / % % T 3]
$ M 34 & :'0 < ). 7 :0 ]7 34 Object
34 ) ^_4 1,2,3,4,………, num objects R D5 #
B 0 D58 ]8 82[ _4 ` ) 3 Objects M
% B 2 D58 7 object 97/ / % B 1 D58 7 " #/ %
E ` ]7 object - M / % B 3 D58 7 object 3 M /
, 4 b c`] d% Binary Image % / a8b
I=imread('pillsetc.png');
imshow(I)
level=graythresh(I);
bw=im2bw(I,level);
figure, imshow(bw)
[labeled,numObjects] = bwlabel(bw,4);
figure, imshow(labeled)
figure, imshow(pseudo_color)
numObjects
: pseudo_color
( )*'# labeled Image 82[ % e * 5 % 9
, + regionprops %&'
info=regionprops(labeled_image,property_name);
EQ > 9M 34 82[ e N ? @ f8
info=regionprops(labeled,'all')
]g 7
info h
Area
Centroid
BoundingBox
SubarrayIdx
MajorAxisLength
MinorAxisLength
Eccentricity
Orientation
ConvexHull
ConvexImage
ConvexArea
Image
FilledImage
FilledArea
EulerNumber
Extrema
EquivDiameter
Solidity
Extent
PixelIdxList
PixelList
Perimeter
E N 32 " @7 J.=
, 3% e * c`] 0 N 9 -.
,Q > 9M 34 97/ Object V . >0 48&0 " ^ \ =M0
info(1).Area
, 3] : ' 7
1173
). 7 " 7 ). 7 4 b 0 34 Object V < . >0 S* " ^ 7
, d ` ( B% cat %&' ( )*'#
Areas=cat(1,info.Area)
). 7 8P# 34 7
Areas=cat(2,info.Area)
E\i & Dj 7 8 1 + k N 0 " b'#O 8> % & c`]7