1. Trang chủ
  2. » Giáo án - Bài giảng

chapter 9 erossion

61 309 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 61
Dung lượng 1,81 MB

Nội dung

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 Dilation and Erosion  DILATION: Adds pixels to the boundary of an object  EROSION: Removes pixels from the boundary of an object  Number of pixels added or removed depends on size and shape of structuring element 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 [...]... 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; A(30:40, 50:60)=1; A(80:85, 50:55)=1; A(5:15,5:15)=1; A(70:80, 25:35)=1; A (90 :95 , 40:45)=1; B=ones(8); A=logical(A); B=logical(B); subplot(1, 2, 1) imshow(A), title('original Image', 'FontSize',14) C=imerode(A, B); subplot(1, 2, 2),imshow(C),... 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); C=imopen(B, se); D=imclose(B, se); subplot(2, 2, 1) imshow(B) subplot(2, 2, 2) imshow(C) subplot(2, 2, 3), imshow(D) E=imclose(C, se); subplot(2, 2, 4) imshow(E) . Example clc clear all A=zeros(100); A(5:8,85:88)=1; A(35:45,85 :95 )=1; A(30:40, 50:60)=1; A(80:85, 50:55)=1; A(5:15,5:15)=1; A (70 :80, 25:35)=1; A (90 :95 , 40:45)=1; B=ones(8); A=logical(A); B=logical(B); subplot(1,. rule:    = otherwise 0 fits if 1 ),( fs yxg Example for Erosion 1101110001 Input image Structuring Element x7x6x5x4x1x3x2x1 Output Image 111 Erosion Example Structuring Element Original Image Processed Image

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

Xem thêm

TỪ KHÓA LIÊN QUAN