21 กรกฎาคม 2552

http://www.mathworks.com/access/helpd...

Morphology Fundamentals: Dilation and Erosion
Dilation คือการเอาค่า maximum ใน neighborhood ทำให้ภาพพองออก
Erosion คือการเอาค่า minimum ใน neigborhood ทำให้ภาพเล็กลง (โดนกัดเซาะ)

Dilating an Image
BW = zeros(9,10);
BW(4:6,4:7) = 1
BW =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0

SE = strel('square',3)
SE =

Flat STREL object containing 3 neighbors.

Neighborhood:
1 1 1
1 1 1
1 1 1


BW2 = imdilate(BW,SE)


ส่วน Erosion ทำตรงกันข้าม
BW1 = imread('circbw.tif');
SE = strel('arbitrary',eye(5));
SE=

Flat STREL object containing 5 neighbors.

Neighborhood:
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
BW2 = imerode(BW1,SE);
imshow(BW1)
figure, imshow(BW2)






ดังนั้น morphological opening  คือการทำ Erosion ตามด้วย Dilation ด้วยมิติที่เท่ากัน

ไม่มีความคิดเห็น: