920 likes | 1.03k Views
Introduction to Computer Vision. Lecture 11. Graduate Student Presentations. ALLMANN, JOSHUA BOSE, SANDEEP CHANDRA BRANDT, DAN JAGADEESAN, BHARATWAJ JASANI, ANKIT KARRI, SWETHA KHASGIWALA, AKASH LAD, DNYANESH LAVRICH, BRYAN MURALEEDHARAN, RAMESH PALACHARLA, HARI RAO, ANUP SARAVIA, JERRY .
E N D
Introduction to Computer Vision Lecture 11
Graduate Student Presentations ALLMANN, JOSHUABOSE, SANDEEP CHANDRABRANDT, DANJAGADEESAN, BHARATWAJJASANI, ANKITKARRI, SWETHA KHASGIWALA, AKASHLAD, DNYANESHLAVRICH, BRYAN MURALEEDHARAN, RAMESH PALACHARLA, HARI RAO, ANUPSARAVIA, JERRY
Last Thursday’s Optional Exam • 11 questions 100points • 8:05 – 9:45 Thursday • Covers ALL material covered in lecture, including Matlab • Several questions are ‘homework-like’ involving coding, either writing or understanding Matlab code • If you elect to take the test it will be graded and included in your exam average • “elect to take the test” means showing up and accepting a copy of the exam
Thursday’s Optional Exam • 70 – 79 1 • 80 – 89 5 • 90 – 100 7 (One each: 97, 99 and 100)
Binary Morphological Processing • Non-linear image processing technique • Order of sequence of operations is important • Linear: (3+2)*3 = (5)*3=15 3*3+2*3=9+6=15 • Non-linear: (3+2)2 = (5)2 =25 [sum, then square] (3)2 + (2)2 =9+4=13 [square, then sum] • Based on geometric structure • Used for edge detection, noise removal and feature extraction • Used to ‘understand’ the shape/form of a binary image
Image – Set of Pixels • Basic idea is to treat an object within an image as a set of pixels (or coordinates of pixels) • In binary images, pixels that are ‘off’, set to 0, are background and appear black. Foreground pixels (objects) are 1 and appear white
Neighborhood • Set of pixels defined by their location relation to the pixel of interest • Defined by structuring element • Specified by connectivity • Connectivity- • ‘4-connected’ • ‘8-connected’
Chapter 9 Morphological Image Processing From: Digital Image Processing, Gonzalez,Woods And Eddins
DILATION A A1 Object B is one point located at (a,0) A1: Object A is translated by object B Since dilation is the union of all the translations, A B = At where the set union is for all the b’s in B, the dilation of rectangle A in the positive x direction by a results in rectangle A1 (same size as A, just translated to the right)
Translation of Object A by vector b • Define Translation object A by vector b: At = { t I2 : t = a+b, a A } Where I2 is the two dimensional image space that contains the image • Definition of DILATION is the UNION of all the translations: A B = { t I2 : t = a+b, a A } for all b’s in B
DILATION – B has 2 Elements A A2 A1 (part of A1 is under A2) -a a -a a Object B is 2 points, (a,0), (-a,0) There are two translations of A as result of two elements in B Dilation is defined as the UNION of the objectsA1 and A2. NOT THE INTERSECTION
DILATION Rounded corners Round Structuring Element (SE) can be interpreted as rolling the SE around the contour of the object. New object has rounded corners and is larger by ½ width of the SE
DILATION Square corners Square Structuring Element (SE) can be interpreted as moving the SE around the contour of the object. New object has square corners and is larger by ½ width of the SE
DILATION • The shape of B determines the final shape of the dilated object. B acts as a geometric filter that changes the geometric structure of A
Chapter 9 Morphological Image Processing From: Digital Image Processing, Gonzalez,Woods And Eddins
Chapter 9 Morphological Image Processing From: Digital Image Processing, Gonzalez,Woods And Eddins
imdilate IM2 = IMDILATE(IM,NHOOD) dilates the image IM, where NHOOD is a matrix of 0s and 1s that specifies the structuring element neighborhood. This is equivalent to the syntax IIMDILATE(IM, STREL(NHOOD)). IMDILATE determines the center element of the neighborhood by FLOOR((SIZE(NHOOD) + 1)/2). >> se = imrotate(eye(3),90) se = 0 0 1 0 1 0 1 0 0 >> ctr=floor(size(se)+1)/2 ctr = 2 2
>> I = zeros([13 19]); >> I(6,6:8)=1; >> I2 = imdilate(I,se);
MATLAB Dilation Example >> I = zeros([13 19]); >> I(6, 6:12)=1; >> SE = imrotate(eye(5),90); >> I2=imdilate(I,SE); >> figure, imagesc(I) >> figure, imagesc(SE) >> figure, imagesc(I2)
DILATED IMAGE INPUT IMAGE SE
I I2 >> I(6:9,6:13)=1; >> figure, imagesc(I) >> I2=imdilate(I,SE); >> figure, imagesc(I2) SE
I I2 SE = 1 1 1 1 1 1 1 1 1
Chapter 9 Morphological Image Processing From: Digital Image Processing, Gonzalez,Woods And Eddins
Dilation and Erosion • DILATION: Adds pixels to the boundary of an object • EROSIN: Removes pixels from the boundary of an object • Number of pixels added or removed depends on size and shape of structuring element
MATLAB Erosion Example 2 pixel wide SE = 3x1 I3=imerode(I2,SE);
Chapter 9 Morphological Image Processing From: Digital Image Processing, Gonzalez,Woods And Eddins
Combinations • In most morphological applications dilation and erosion are used in combination • May use same or different structuring elements
Morphological Opening and Closing • Opening of A by B A B Erosion of A by B, followed by the dilation of the result by B Closing of A by B A B Dilation of A by B, followed by the erosion of the result by B MATLAB: imopen(A, B) imclose(A,B)
MATLAB Function strel • strel constructs structuring elements with various shapes and sizes • Syntax: se = strel(shape, parameters) • Example: • se = strel(‘octagon’, R); • R is the dimension – see help function
Opening of A by B A B • Erosion of A by B, followed by the dilation of the result by B Erosion- if any element of structuring element overlaps with background output is zero FIRST - EROSION >> se = strel('square', 20);fe = imerode(f,se);figure, imagesc(fe),title('fe')
Dilation of Previous Result Outputs 1 at center of SE when at least one element of SE overlaps object SECOND - DILATION >> se = strel('square', 20);fd = imdilate(fe,se);figure, imagesc(fd),title('fd')
What if we increased size of SE for DILATION operation?? se = 25 se = 30 se = strel('square', 25);fd = imdilate(fe,se);figure, imagesc(fd),title('fd') se = strel('square', 30);fd = imdilate(fe,se);figure, imagesc(fd),title('fd')
Closing of A by B A B Dilation of A by B Outputs 1 at center of SE when at least one element of SE overlaps object se = strel('square', 20);fd = imdilate(f,se);figure, imagesc(fd),title('fd')
Erosion of the result by B Erosion- if any element of structuring element overlaps with background output is zero
ORIGINAL OPENING CLOSING
Chapter 9 Morphological Image Processing From: Digital Image Processing, Gonzalez,Woods And Eddins
Hit or Miss Transformation • Useful to identify specified configuration of pixels, such as, isolated foreground pixels or pixels at end of lines (end points) • A B = (A B1) (AcB2) • A eroded by B1, intersection A complement eroded by B2 (two different structuring elements)
Hit or Miss Example • Find cross shape pixel configuration: MATLAB Function: C = bwhitmiss(A, B1, B2)
Original Image A and B1 A eroded by B1 Complement of Original Image and B2 Erosion of A complement And B2 Intersection of eroded images From: Digital Image Processing, Gonzalez,Woods And Eddins
Original Image A and B1 A eroded by B1 Complement of Original Image and B2 Erosion of A complement And B2 Intersection of eroded images From: Digital Image Processing, Gonzalez,Woods And Eddins
Original Image A and B1 A eroded by B1 Complement of Original Image and B2 Erosion of A complement And B2 Intersection of eroded images From: Digital Image Processing, Gonzalez,Woods And Eddins
Original Image A and B1 A eroded by B1 Complement of Original Image and B2 Erosion of A complement And B2 Intersection of eroded images From: Digital Image Processing, Gonzalez,Woods And Eddins
Original Image A and B1 A eroded by B1 Complement of Original Image and B2 Erosion of A complement And B2 Intersection of eroded images From: Digital Image Processing, Gonzalez,Woods And Eddins
Original Image A and B1 A eroded by B1 Complement of Original Image and B2 Erosion of A complement And B2 Intersection of eroded images From: Digital Image Processing, Gonzalez,Woods And Eddins
Hit or Miss • Have all the pixels in B1, but none of the pixels in B2
Hit or Miss Example #2 • Locate upper left hand corner pixels of objects in an image • Pixels that have east and south neighbors (Hits) and no NE, N, NW, W, SW Pixels (Misses) B1 = B2 = Don’t Care about SE