Computer Vision & Digital Image Processing. Edge linking and boundary detection



Similar documents
Mathematics. ( : Focus on free Education) (Chapter 5) (Complex Numbers and Quadratic Equations) (Class XI)

ab = c a If the coefficients a,b and c are real then either α and β are real or α and β are complex conjugates

G.H. Raisoni College of Engineering, Nagpur. Department of Information Technology


521466S Machine Vision Assignment #7 Hough transform

Summary: Transformations. Lecture 14 Parameter Estimation Readings T&V Sec Parameter Estimation: Fitting Geometric Models

Jiří Matas. Hough Transform

2D Geometric Transformations

CIRCLE COORDINATE GEOMETRY

Lecture 9: Lines. m = y 2 y 1 x 2 x 1

Vector and Matrix Norms

4. How many integers between 2004 and 4002 are perfect squares?

POINT OF INTERSECTION OF TWO STRAIGHT LINES

Section 9.1 Vectors in Two Dimensions

Rotation Matrices and Homogeneous Transformations

Projective Geometry: A Short Introduction. Lecture Notes Edmond Boyer

THE COMPLEX EXPONENTIAL FUNCTION

BALTIC OLYMPIAD IN INFORMATICS Stockholm, April 18-22, 2009 Page 1 of?? ENG rectangle. Rectangle

Algebra I Vocabulary Cards

Solutions to Exercises, Section 5.1

Area and Arc Length in Polar Coordinates

Computing Euler angles from a rotation matrix

Parametric Equations and the Parabola (Extension 1)

Co-ordinate Geometry THE EQUATION OF STRAIGHT LINES

TWO-DIMENSIONAL TRANSFORMATION

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

Math 241, Exam 1 Information.

Chapter 19. General Matrices. An n m matrix is an array. a 11 a 12 a 1m a 21 a 22 a 2m A = a n1 a n2 a nm. The matrix A has n row vectors

1 if 1 x 0 1 if 0 x 1

COMPLEX NUMBERS. a bi c di a c b d i. a bi c di a c b d i For instance, 1 i 4 7i i 5 6i

DESARGUES THEOREM DONALD ROBERTSON

Arithmetic and Algebra of Matrices

CURVE FITTING LEAST SQUARES APPROXIMATION

Answer Key for California State Standards: Algebra I

Solutions to old Exam 1 problems

Least-Squares Intersection of Lines

Trigonometry Review with the Unit Circle: All the trig. you ll ever need to know in Calculus

Largest Fixed-Aspect, Axis-Aligned Rectangle

C relative to O being abc,, respectively, then b a c.

SOLUTIONS. f x = 6x 2 6xy 24x, f y = 3x 2 6y. To find the critical points, we solve

Linear Programming. Solving LP Models Using MS Excel, 18

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

3.3. Solving Polynomial Equations. Introduction. Prerequisites. Learning Outcomes

Scan Conversion of Filled Primitives Rectangles Polygons. Many concepts are easy in continuous space - Difficult in discrete space

Review of Fundamental Mathematics

3. INNER PRODUCT SPACES

Solutions for Review Problems

Understanding Poles and Zeros

Lecture 8. Generating a non-uniform probability distribution

Geometry of Vectors. 1 Cartesian Coordinates. Carlo Tomasi

MATH2210 Notebook 1 Fall Semester 2016/ MATH2210 Notebook Solving Systems of Linear Equations... 3

a.) Write the line 2x - 4y = 9 into slope intercept form b.) Find the slope of the line parallel to part a

More Local Structure Information for Make-Model Recognition

II. Linear Systems of Equations

Geometric Transformation CS 211A

[1] Diagonal factorization

Elements of a graph. Click on the links below to jump directly to the relevant section

A Study on M2M-based AR Multiple Objects Loading Technology using PPHT

3D Scanner using Line Laser. 1. Introduction. 2. Theory

A vector is a directed line segment used to represent a vector quantity.

DEFINITION A complex number is a matrix of the form. x y. , y x

Solutions to Homework 10

Geometric Transformations

Chapter 6 Circular Motion

x(x + 5) x 2 25 (x + 5)(x 5) = x 6(x 4) x ( x 4) + 3

Introduction to the Smith Chart for the MSA Sam Wetterlin 10/12/09 Z +

z 0 and y even had the form

jorge s. marques image processing

Core Maths C2. Revision Notes

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Lecture 3: Coordinate Systems and Transformations

Chapter 17. Orthogonal Matrices and Symmetries of Space

Scalar Valued Functions of Several Variables; the Gradient Vector

EQUATIONS and INEQUALITIES

Machine Learning and Data Mining. Regression Problem. (adapted from) Prof. Alexander Ihler

LINES AND PLANES IN R 3

THREE DIMENSIONAL GEOMETRY

3. KINEMATICS IN TWO DIMENSIONS; VECTORS.

Review B: Coordinate Systems

H.Calculating Normal Vectors

1.2 GRAPHS OF EQUATIONS. Copyright Cengage Learning. All rights reserved.

Mechanics 1: Conservation of Energy and Momentum

5.3 The Cross Product in R 3

Complex Algebra. What is the identity, the number such that it times any number leaves that number alone?

PRACTICE FINAL. Problem 1. Find the dimensions of the isosceles triangle with largest area that can be inscribed in a circle of radius 10cm.

What does the number m in y = mx + b measure? To find out, suppose (x 1, y 1 ) and (x 2, y 2 ) are two points on the graph of y = mx + b.

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

9 Multiplication of Vectors: The Scalar or Dot Product

Chapter 4. Forces and Newton s Laws of Motion. continued

Algebra 2 PreAP. Name Period

Factoring Patterns in the Gaussian Plane

Section 1.1 Linear Equations: Slope and Equations of Lines

+ 4θ 4. We want to minimize this function, and we know that local minima occur when the derivative equals zero. Then consider

Mechanics lecture 7 Moment of a force, torque, equilibrium of a body

Section 9.5: Equations of Lines and Planes

Mohr s Circle. Academic Resource Center

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives

Figure 1.1 Vector A and Vector F

Transcription:

Computer Vision & Digital Image Processing Edge Linking and Boundary Detection Dr. D. J. Jackson Lecture 17-1 Edge linking and boundary detection Ideally, edge detection techniques yield pixels lying only on the boundaries between regions In practice, this pixel set seldom characterizes a boundary completely because of noise breaks in the boundary due to non-uniform illumination other effects that introduce spurious discontinuities Thus, edge detection algorithms are usually followed by linking and other boundary detection procedures designed to assemble edge pixels into meaningful boundaries Dr. D. J. Jackson Lecture 17-2

Edge linking: local processing Basic idea: Analyze the characteristics of pixels in a small neighborhood (3x3, 5x5, etc) for every point (x,y) that has undergone edge detection All points that are similar are linked, forming a boundary of pixels that share some common property Two principal properties for establishing similarity The strength of the response of the gradient operator used to produce the edge pixels The direction of the gradient α ( x, y) = tan 1 G G y x Dr. D. J. Jackson Lecture 17-3 Edge linking: local processing (cont.) An edge pixel at (x,y ) in the neighborhood centered at (x,y) is similar in magnitude to the pixel at (x,y) if f ( x, y) f ( x', y' ) T where T is a predetermined threshold An edge pixel at (x,y ) in the neighborhood centered at (x,y) is similar in angle to the pixel at (x,y) if α ( x, y) α( x', y' ) A where A is a predetermined angle threshold A point in the neighborhood of (x,y) is linked to (x,y) if both magnitude and angle criteria are satisfied Dr. D. J. Jackson Lecture 17-4

Global processing: Hough transform Now consider global relationships between pixels Suppose that, for n points in an image, we want to find all subsets of these points that lie on straight lines Consider a point (x i,y i ) and the equation for a straight line y i =ax i +b Infinitely many lines pass through the point (x i,y i ), all satisfying the equation for varying values of a and b However, writing the equation as b=-x i a+y i and considering the ab plane (also called the parameter space) yields the equation of a single line for a fixed point (x i,y i ) Dr. D. J. Jackson Lecture 17-5 The Hough transform (continued) A second point (x j,y j ) also has a line in the parameter space associated with it This line intersects the line associated with (x i,y i ) at (a,b ) a is the slope and b is the intercept of the line containing both (x i,y i ) and (x j,y j ) in the xy plane In fact, all points that lie on this line have corresponding lines in the parameter space that intersect at (a,b ) y b b (x i,y i ) (x j,y j ) a x a b= -x i a+y i b= -x j a+y j ) Dr. D. J. Jackson Lecture 17-6

Hough transform: accumulator cells The computational attractiveness of the Hough transform arises from the subdivision of the parameter space into accumulator cells (a min,a max ) and (b min,b max ) are expected ranges of slope and intercept values b min 0 a min b max 0 a max Dr. D. J. Jackson Lecture 17-7 Hough transform: accumulator cells The cell at coordinates (i,j), with cell value A(i,j), corresponds to the square associated with parameter space coordinates (a i,b j ) The collection of accumulator cells is commonly called the Hough matrix (or Hough array) and are computed as 1. Set all cells to zero. 2. For every point (x k,y k ) in the image plane, let a equal each of the allowed subdivision values on the a axis and solve for b using b=-x k a+y k 3. The resulting b s are rounded off to the nearest allowed value in the b axis 4. If a choice of a p results in solution b q, we let A(p,q)=A(p,q)+1 5. At the end of the procedure, a value of M in A(i,j) corresponds to M points in the xy plane lying on the line y=a i x+b j The accuracy of the collinearity of these points is determined by the number of subdivisions in the ab plane Dr. D. J. Jackson Lecture 17-8

The Hough transform (continued) A problem with this representation is that the slope and intercept approach infinity as the line approaches the vertical Solution: use the normal representation of a line given by x cosθ + y sinθ = ρ θ ρ y θ min 0 ρ min 0 ρ max x θ max Dr. D. J. Jackson Lecture 17-9 The Hough transform (continued) Instead of straight lines in the ab plane, we now have sinusoidal curves in the ρθ plane M collinear points lying on the line x cosθ + y sinθ = ρ j yields M sinusoidal curves that intersect at (ρ i,θ j ) in the parameter space The range of θ is ±90, measured with respect to the x axis A horizontal line has θ=0, with ρ equal to the positive x intercept A vertical line has θ=+90, with ρ equal to the positive y intercept or θ=-90, with ρ equal to the negative y intercept The range of ρ is ±(2) ½ D. Where D is the distance between corners in the image j i Dr. D. J. Jackson Lecture 17-10

Hough transform: MATLAB code function res=hough(im,rho_max,theta_max) % % Name: hough(im,rho_max,theta_max % % Arguments % im: is the input,binary, image. If the % image is not binary pixels having % non-zero values are considered. % RHO_MAX: is an integer number specifying % the rho quantization. % THETA_MAX: is an integer number % specifying the theta quantization % % Example: v=hough(im,256,256) % input is the image im, and the % quantization is d_rho=x/256 and d_theta=pi/256 % if the size of the image is 256 by 256 % d_rho=1. % % v is the number of votes in the % parameter space. v(i,j) is the number % of votes for the strip having distance from % the center of the image equal to % (i-rho_max/2)*d_rho (d_rho=x/rho_max, the % image is X by X pixels),and its normal has % angle j*d_theta,(d_theta=pi/theta_max) [X,Y]=size(im); d_rho=x/rho_max; d_theta=pi/theta_max; theta=0:d_theta:pi-d_theta; smat=sin(theta); cmat=cos(theta); fprintf('finding feature points.\n'); [x,y]=find(im); % translation by a pixel so that low left pixel has % (0,0) coordinates x=x-1; y=y-1; fprintf('translating so the origin is in the middle of the image.\n'); fprintf('doing the Hough Transform.\n'); h1=((y-y/2) * smat + (x-x/2) * cmat )/d_rho; h2=h1+rho_max/2; fprintf('rounding.\n'); h3=round(h2); fprintf('summing the votes.\n'); res=zeros(rho_max,theta_max); for j=0:rho_max-1 temp=(h3==j); res(j+1,:)=sum(temp); end Dr. D. J. Jackson Lecture 17-11 Hough transform (example 1) image(a);colormap(gray(256)); Original image matrix image(v);colormap(gray(16)); Image of the Hough array Dr. D. J. Jackson Lecture 17-12

Hough transform (example 1 continued) 01 01 01 01 02 02 02 00 00 00 02 02 02 01 01 01 01 01 01 02 01 02 03 05 00 04 03 02 01 02 01 01 01 01 01 01 02 02 03 05 16 05 03 02 02 01 01 01 01 01 01 01 01 01 02 06 00 06 02 01 01 01 01 01 01 01 01 01 02 02 03 00 00 01 03 02 02 01 01 01 01 01 01 02 01 02 02 00 00 00 02 02 01 02 01 01 01 01 01 01 01 02 00 00 00 00 01 02 01 01 01 01 01 01 01 01 02 01 00 00 00 00 00 02 02 01 01 01 01 01 02 01 01 00 00 00 00 00 00 00 01 01 02 01 01 01 01 01 01 00 00 00 00 00 00 00 02 01 01 01 01 01 01 02 00 00 00 00 00 00 00 00 00 02 01 01 01 01 01 00 00 00 00 00 00 00 00 00 00 01 01 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 Dr. D. J. Jackson Lecture 17-13 Hough transform (example 2) image(a);colormap(gray(25 6)); Original image matrix image(v);colormap(gray(16 )); Image of the Hough array Dr. D. J. Jackson Lecture 17-14

Hough transform (example 2 continued) 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 00 00 00 00 00 00 00 00 00 00 01 01 01 01 01 02 02 00 00 00 00 00 00 00 01 02 01 01 01 01 01 01 01 02 00 00 00 00 00 01 01 01 01 01 01 01 01 01 02 02 02 00 00 00 01 02 02 01 01 01 01 01 01 01 01 01 02 01 00 00 02 01 01 01 01 01 01 01 01 01 01 02 03 05 00 05 03 02 01 01 01 01 01 01 01 02 02 02 03 05 16 05 03 02 02 02 01 01 01 01 01 01 01 02 02 05 00 05 02 02 01 01 01 01 01 01 02 01 02 02 03 00 00 01 03 02 02 01 02 01 01 01 01 01 01 01 01 00 00 00 02 01 01 01 01 01 01 01 01 01 01 02 00 00 00 00 00 02 01 01 01 01 01 01 01 02 02 00 00 00 00 00 00 01 02 02 01 01 01 01 01 01 00 00 00 00 00 00 00 00 01 01 01 01 01 01 01 00 00 00 00 00 00 00 00 00 00 01 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 01 01 Dr. D. J. Jackson Lecture 17-15 Hough transform (example 3) image(a);colormap(gray(256)); Original image matrix image(v);colormap(gray(16)); Image of the Hough array Dr. D. J. Jackson Lecture 17-16

Hough transform (example 3 continued) 00 00 00 00 00 00 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 01 01 00 00 00 00 00 00 00 00 00 02 02 01 01 01 01 01 01 00 00 00 00 00 00 00 02 01 01 01 01 01 01 01 01 01 00 00 00 00 00 02 02 02 01 01 01 01 01 01 02 02 01 00 00 00 01 02 01 01 01 01 01 01 01 01 01 01 02 00 00 00 05 03 02 01 01 01 01 01 01 01 01 01 01 02 00 16 05 03 02 02 02 01 01 01 01 02 01 02 02 03 01 00 05 02 02 01 01 01 01 01 01 01 01 01 02 02 05 00 00 03 02 02 01 02 01 01 01 01 02 02 02 03 05 00 00 01 01 01 01 01 01 01 01 01 01 01 02 03 05 00 00 00 02 01 01 01 01 01 01 01 01 01 01 02 00 00 00 00 00 02 02 01 01 01 01 01 01 02 02 01 00 00 00 00 00 00 01 01 01 01 01 01 01 01 01 00 00 00 00 00 00 00 00 01 01 01 01 01 02 01 00 00 00 00 00 00 00 00 00 00 01 01 01 01 00 00 00 00 00 Dr. D. J. Jackson Lecture 17-17 Hough transform (example 4) image(a);colormap(gray(256)); Original image matrix image(v);colormap(gray(16)); Image of the Hough array Dr. D. J. Jackson Lecture 17-18

Hough transform (example 4 continued) 01 01 01 00 00 00 01 01 01 01 00 00 00 00 00 00 01 01 01 01 00 01 01 01 01 01 01 00 00 00 01 01 01 01 01 02 04 02 01 01 01 01 01 01 01 02 01 01 01 01 01 03 02 03 01 01 01 01 01 02 02 01 01 01 01 01 03 03 04 03 03 01 01 01 02 04 04 02 01 01 01 02 03 02 02 02 03 02 01 01 03 02 02 03 01 01 01 06 04 03 02 03 04 06 01 06 04 03 02 02 03 01 16 05 03 03 03 03 03 05 16 05 04 03 04 04 04 02 01 06 03 03 02 03 03 06 01 06 03 02 01 02 03 06 01 01 05 03 04 03 05 01 01 02 04 04 04 03 04 05 01 01 02 02 02 02 02 01 01 01 03 02 02 03 04 06 01 01 01 03 02 03 01 01 01 01 01 03 02 02 03 01 01 01 01 02 04 02 01 01 01 01 01 02 04 04 02 01 01 01 01 01 00 01 01 01 01 01 01 01 02 02 01 01 01 01 01 00 00 00 01 01 01 01 01 02 01 01 01 01 01 01 00 00 00 00 00 01 01 01 01 00 00 00 01 01 Dr. D. J. Jackson Lecture 17-19 Hough transform (example 5) image(a);colormap(gray(256)); Original image matrix image(v);colormap(gray(16)); Image of the Hough array Dr. D. J. Jackson Lecture 17-20

Hough transform (example 5 continued) 01 01 01 01 01 01 01 01 01 00 00 00 00 00 00 00 01 01 01 01 01 01 01 01 01 00 00 00 00 00 00 00 01 01 00 01 01 01 00 01 01 01 00 00 00 00 00 00 01 01 01 00 00 00 01 01 01 02 00 00 00 00 00 02 01 01 01 01 01 01 01 01 01 01 02 00 00 00 01 01 01 00 01 01 01 01 01 00 01 01 02 00 00 00 02 01 01 01 00 00 00 00 00 01 01 02 02 03 00 02 02 02 01 01 01 01 01 01 01 01 01 01 02 04 00 04 02 01 01 01 01 01 01 01 01 01 01 01 01 03 16 03 01 01 01 01 01 01 01 01 01 01 01 01 02 04 00 04 02 01 01 01 00 00 00 00 00 01 01 02 02 02 00 03 02 02 01 00 01 01 01 01 01 00 01 01 02 00 00 00 02 01 01 01 01 01 01 01 01 01 01 01 01 00 00 00 02 01 01 01 01 00 00 00 01 01 01 02 00 00 00 00 00 02 01 01 00 01 01 01 00 01 01 00 00 00 00 00 00 01 01 01 01 01 01 01 01 01 01 00 00 00 00 00 00 00 Dr. D. J. Jackson Lecture 17-21