morphology in image process

39 170 0
morphology in image process

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Morphology in image processing Morphology in image processing  Morphology generally concerned with shape and properties of objects.  Used for segmentation and feature extraction.  Segmentation = used for cleaning binary objects.  Two basic operations  erosion  dilation Digital Image Processing Erosion and Dilation Morphological operators are used to prepare binary images for object segmentation, recognition Binary images often suffer from noise (specifically salt-and-pepper noise) Binary regions also suffer from noise (isolated black pixels in a white region). Can also have cracks, picket fence occlusions, etc. Dilation and erosion are two binary morphological operations that can assist with these problems. Morphology in image processing Morphology in image processing A is a set in Z2 , a=(a1,a2) an element of A, a∈A If not, then a∉A ∅: null (empty) set A subset of B: A⊆B Union of A and B: C=A∪B Intersection of A and B: D=A∩B Disjoint sets: A∩B= ∅ Complement of A: Ac = {x|x∉A} Difference of A and B: A-B = {x|xA, x ∉ B} = A∩Bc Structuring Elements, Hits & Fits B A C Structuring Element Fit: All on pixels in the structuring element cover on pixels in the image Hit: Any on pixel in the structuring element covers an on pixel in the image All morphological processing operations are based on these simple ideas Structuring Elements Structuring elements can be any size and make any shape However, for simplicity we will use rectangular structuring elements with their origin at the middle pixel 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 1 0 1 1 1 0 1 0 Fitting & Hitting 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 B C A 1 1 1 1 1 1 1 1 1 Structuring Element 1 0 1 0 1 1 1 0 1 0 Structuring Element 2 Fundamental Operations Fundamentally morphological image processing is very like spatial filtering The structuring element is moved across every pixel in the original image to give a pixel in a new processed image The value of this new pixel depends on the operation performed There are two basic morphological operations: erosion and dilation Erosion Erosion of image f by structuring element s is given by f  s The structuring element s is positioned with its origin at (x, y) and the new pixel value is determined using the rule:    = otherwise 0 fits if 1 ),( fs yxg Erosion Example Structuring Element Original Image Processed Image With Eroded Pixels [...]... structuring element s is positioned with its origin at (x, y) and the new pixel value is determined using the rule: 1 if s hits f g ( x, y ) =  0 otherwise Dilation Example Original Image Processed Image Structuring Element Dilation Example Original Image Processed Image With Dilated Pixels Structuring Element Dilation Example Dilation Example Main Applications of Dilation Dilation Example Main Applications... subplot(2, 2, 3), imshow(D) E=imclose(C, se); subplot(2, 2, 4) imshow(E) se=strel(‘square', 20); (A) Original Image (C) closing (B) Opening (D) Closing of C se=strel('disk', 10); (A) Original Image (C) closing (B) Opening (D) Closing of C se=strel('square',3); (A) Original Image (C) closing (B) Opening (D) Closing of C ... D=imerode(C, se); subplot(1, 2, 1) imshow(B) subplot(1, 2, 2) imshow(D) Opening Dilation: expands image Erosion: shrink image erosion+dilation = original image ? Opening= erosion + dilation A B = (A B) ⊕ B Closing Dilation+erosion = erosion + dilation ? Closing = dilation + erosion A • B = ( A ⊕ B) B Example of opening and closing clear all; clc A=imread('C9_4.bmp'); B=im2bw(A); se=strel('disk', 10);... imshow(A), title('original Image' , 'FontSize',14) C=imerode(A, B); subplot(1, 2, 2),imshow(C), title('Erode by ones(8)', 'FontSize',14) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Erosion Example 2 Original image After erosion with a disc of radius 5 After erosion with a disc of radius 10 After erosion with a disc of radius 20 Dilation Dilation of image f by structuring element s is...Erosion Example Original Image Processed Image Structuring Element Example : Erosion d x d y 2 y 2 x y 2 x 2 Erosion Example A Erosion Example Erosion Example Erosion Example Erosion Example clc clear all A=zeros(100); A(5:8,85:88)=1; A(35:45,85:95)=1;... Applications of Dilation Main Applications of Dilation clear all; clc A=imread('OPEN1.bmp'); A=im2bw(A); B=imdilate(A, ones(3)); C=imerode(A, ones(3)); % se=strel('square', 8); % A=imopen(A, se); %A=imerode(A, ones(5)); subplot(1, 2, 1) imshow(A), title('original Image' , 'FontSize',14) subplot(1, 2, 2) imshow((B-A)), title('boundary', 'FontSize',14) Main Applications of Dilation Main Applications of Dilation . etc. Dilation and erosion are two binary morphological operations that can assist with these problems. Morphology in image processing Morphology in image processing A is a set in Z2 , a=(a1,a2) an element. Morphology in image processing Morphology in image processing  Morphology generally concerned with shape and properties of objects All on pixels in the structuring element cover on pixels in the image Hit: Any on pixel in the structuring element covers an on pixel in the image All morphological processing operations

Ngày đăng: 28/04/2014, 10:35

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan