Edge Detection Selim Aksoy Department of Computer Engineering Bilkent University

Slides:



Advertisements
Similar presentations
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Advertisements

Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University
Department of Computer Engineering
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University
Content-Based Image Retrieval Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University
Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Edge Detection Selim Aksoy Department of Computer Engineering Bilkent University
Edge Detection Selim Aksoy Department of Computer Engineering Bilkent University
Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Edge Detection Selim Aksoy Department of Computer Engineering Bilkent University
Fitting: The Hough transform. Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not.
Department of Computer Engineering
Department of Computer Engineering
Segmentation (2): edge detection
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Fitting: The Hough transform
Lecture 4 Edge Detection
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
Announcements Mailing list: –you should have received messages Project 1 out today (due in two weeks)
EE663 Image Processing Edge Detection 2 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Segmentation (Section 10.2)
Edges and Lines Readings: Chapter 10:
CS 376b Introduction to Computer Vision 04 / 14 / 2008 Instructor: Michael Eckmann.
Stockman MSU/CSE Fall 2009 Finding region boundaries.
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
Edge Detection.
1 Lines and Arcs Segmentation In some image sets, lines, curves, and circular arcs are more useful than regions or helpful in addition to regions. Lines.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
Fitting : Voting and the Hough Transform Monday, Feb 14 Prof. Kristen Grauman UT-Austin.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
Fitting: The Hough transform
CS654: Digital Image Analysis Lecture 24: Introduction to Image Segmentation: Edge Detection Slide credits: Derek Hoiem, Lana Lazebnik, Steve Seitz, David.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Many slides from Steve Seitz and Larry Zitnick
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
Fitting Thursday, Sept 24 Kristen Grauman UT-Austin.
Edges and Lines Readings: Chapter 10:
Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Computer Vision Image Features Instructor: Dr. Sherif Sami Lecture 4.
Instructor: Mircea Nicolescu Lecture 7
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Digital Image Processing CSC331
1 Edge Operators a kind of filtering that leads to useful features.
Fitting: Voting and the Hough Transform
Detection of discontinuity using
Edge Detection CS 678 Spring 2018.
Edge Detection EE/CSE 576 Linda Shapiro.
Fitting Curve Models to Edges
Computer Vision Lecture 9: Edge Detection II
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
a kind of filtering that leads to useful features
Edge Detection CSE 455 Linda Shapiro.
a kind of filtering that leads to useful features
Edge Detection Today’s readings Cipolla and Gee Watt,
Finding Line and Curve Segments from Edge Images
Winter in Kraków photographed by Marcin Ryczek
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
Edge Detection ECE P 596 Linda Shapiro.
Presentation transcript:

Edge Detection Selim Aksoy Department of Computer Engineering Bilkent University

CS 484, Spring 2015©2015, Selim Aksoy2 Edge detection Edge detection is the process of finding meaningful transitions in an image. The points where sharp changes in the brightness occur typically form the border between different objects or scene parts. Further processing of edges into lines, curves and circular arcs result in useful features for matching and recognition. Initial stages of mammalian vision systems also involve detection of edges and local features.

CS 484, Spring 2015©2015, Selim Aksoy3 Edge detection Sharp changes in the image brightness occur at: Object boundaries A light object may lie on a dark background or a dark object may lie on a light background. Reflectance changes May have quite different characteristics – zebras have stripes, and leopards have spots. Cast shadows Sharp changes in surface orientation

CS 484, Spring 2015©2015, Selim Aksoy4 Edge models

CS 484, Spring 2015©2015, Selim Aksoy5 Difference operators for 2D

CS 484, Spring 2015©2015, Selim Aksoy6 Difference operators for 2D

CS 484, Spring 2015©2015, Selim Aksoy7 Difference operators for 2D Adapted from Gonzales and Woods

CS 484, Spring 2015©2015, Selim Aksoy8 Difference operators for 2D

CS 484, Spring 2015©2015, Selim Aksoy9 Difference operators under noise Consider a single row or column of the image. Where is the edge? Adapted from Steve Seitz

CS 484, Spring 2015©2015, Selim Aksoy10 Difference operators under noise Solution is to smooth first: Adapted from Steve Seitz

CS 484, Spring 2015©2015, Selim Aksoy11 Difference operators under noise Differentiation property of convolution: Adapted from Steve Seitz

CS 484, Spring 2015©2015, Selim Aksoy12 Difference operators under noise Consider: Adapted from Steve Seitz Laplacian of Gaussian operator

Edge detection filters for 2D CS 484, Spring 2015©2015, Selim Aksoy13 Laplacian of Gaussian Gaussian derivative of Gaussian Adapted from Steve Seitz, U of Washington

CS 484, Spring 2015©2015, Selim Aksoy14 Difference operators for 2D

CS 484, Spring 2015©2015, Selim Aksoy15 Difference operators for 2D

CS 484, Spring 2015©2015, Selim Aksoy16 Difference operators for 2D sigma=2 sigma=4 Threshold=1 Threshold=4 Laplacian of Gaussian zero crossings Adapted from David Forsyth, UC Berkeley

CS 484, Spring 2015©2015, Selim Aksoy17 Edge detection Three fundamental steps in edge detection: 1. Image smoothing: to reduce the effects of noise. 2. Detection of edge points: to find all image points that are potential candidates to become edge points. 3. Edge localization: to select from the candidate edge points only the points that are true members of an edge.

CS 484, Spring 2015©2015, Selim Aksoy18 Canny edge detector Canny defined three objectives for edge detection: 1. Low error rate: All edges should be found and there should be no spurious responses. 2. Edge points should be well localized: The edges located must be as close as possible to the true edges. 3. Single edge point response: The detector should return only one point for each true edge point. That is, the number of local maxima around the true edge should be minimum.

CS 484, Spring 2015©2015, Selim Aksoy19 Canny edge detector 1. Smooth the image with a Gaussian filter with spread σ. 2. Compute gradient magnitude and direction at each pixel of the smoothed image. 3. Zero out any pixel response less than or equal to the two neighboring pixels on either side of it, along the direction of the gradient (non-maxima suppression). 4. Track high-magnitude contours using thresholding (hysteresis thresholding). 5. Keep only pixels along these contours, so weak little segments go away.

Canny edge detector CS 484, Spring 2015©2015, Selim Aksoy20 Original image (Lena) Adapted from Steve Seitz, U of Washington

Canny edge detector CS 484, Spring 2015©2015, Selim Aksoy21 Adapted from Steve Seitz, U of Washington Magnitude of the gradient

Canny edge detector CS 484, Spring 2015©2015, Selim Aksoy22 Adapted from Steve Seitz, U of Washington Thresholding

Canny edge detector CS 484, Spring 2015©2015, Selim Aksoy23 Adapted from Steve Seitz, U of Washington How to turn these thick regions of the gradient into curves?

CS 484, Spring 2015©2015, Selim Aksoy24 Canny edge detector Non-maxima suppression: Check if pixel is local maximum along gradient direction. Select single max across width of the edge. Requires checking interpolated pixels p and r. This operation can be used with any edge operator when thin boundaries are wanted.

Canny edge detector CS 484, Spring 2015©2015, Selim Aksoy25 Adapted from Steve Seitz, U of Washington Problem: pixels along this edge did not survive the thresholding

CS 484, Spring 2015©2015, Selim Aksoy26 Canny edge detector Hysteresis thresholding: Use a high threshold to start edge curves, and a low threshold to continue them.

CS 484, Spring 2015©2015, Selim Aksoy27 Canny edge detector Adapted from Martial Hebert, CMU

CS 484, Spring 2015©2015, Selim Aksoy28 Canny edge detector

CS 484, Spring 2015©2015, Selim Aksoy29 Canny edge detector

CS 484, Spring 2015©2015, Selim Aksoy30 Canny edge detector The Canny operator gives single-pixel-wide images with good continuation between adjacent pixels. It is the most widely used edge operator today; no one has done better since it came out in the late 80s. Many implementations are available. It is very sensitive to its parameters, which need to be adjusted for different application domains.

CS 484, Spring 2015©2015, Selim Aksoy31 Edge linking Hough transform Finding line segments Finding circles Model fitting Fitting line segments Fitting ellipses Edge tracking

Fitting: main idea Choose a parametric model to represent a set of features Membership criterion is not local Cannot tell whether a point belongs to a given model just by looking at that point Three main questions: What model represents this set of features best? Which of several model instances gets which feature? How many model instances are there? Computational complexity is important It is infeasible to examine every possible set of parameters and every possible combination of features CS 484, Spring 2015©2015, Selim Aksoy32 Adapted from Kristen Grauman

Example: line fitting Why fit lines? Many objects characterized by presence of straight lines CS 484, Spring 2015©2015, Selim Aksoy33 Adapted from Kristen Grauman

Difficulty of line fitting Extra edge points (clutter), multiple models: which points go with which line, if any? Only some parts of each line detected, and some parts are missing: how to find a line that bridges missing evidence? Noise in measured edge points, orientations: how to detect true underlying parameters? CS 484, Spring 2015©2015, Selim Aksoy34 Adapted from Kristen Grauman

Voting It is not feasible to check all combinations of features by fitting a model to each possible subset. Voting is a general technique where we let each feature vote for all models that are compatible with it. Cycle through features, cast votes for model parameters. Look for model parameters that receive a lot of votes. Noise and clutter features will cast votes too, but typically their votes should be inconsistent with the majority of “good” features. CS 484, Spring 2015©2015, Selim Aksoy35 Adapted from Kristen Grauman

CS 484, Spring 2015©2015, Selim Aksoy36 Hough transform The Hough transform is a method for detecting lines or curves specified by a parametric function. If the parameters are p 1, p 2, … p n, then the Hough procedure uses an n-dimensional accumulator array in which it accumulates votes for the correct parameters of the lines or curves found on the image. y = mx + b image m b accumulator Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2015©2015, Selim Aksoy37 Hough transform: line segments Adapted from Steve Seitz, U of Washington Connection between image (x,y) and Hough (m,b) spaces A line in the image corresponds to a point in Hough space To go from image space to Hough space: given a set of points (x,y), find all (m,b) such that y = mx + b x y m b m0m0 b0b0 Image spaceHough (parameter) space

CS 484, Spring 2015©2015, Selim Aksoy38 Hough transform: line segments Adapted from Steve Seitz, U of Washington Connection between image (x,y) and Hough (m,b) spaces A line in the image corresponds to a point in Hough space To go from image space to Hough space: given a set of points (x,y), find all (m,b) such that y = mx + b What does a point (x 0, y 0 ) in the image space map to? Answer: the solutions of b = -x 0 m + y 0 This is a line in Hough space x y m b Image spaceHough (parameter) space x0x0 y0y0

Hough transform: line segments CS 484, Spring 2015©2015, Selim Aksoy39 What are the line parameters for the line that contains both (x 0, y 0 ) and (x 1, y 1 )? It is the intersection of the lines b = –x 0 m + y 0 and b = –x 1 m + y 1 x y m b Image spaceHough (parameter) space x0x0 y0y0 b = –x 1 m + y 1 (x 0, y 0 ) (x 1, y 1 ) Adapted from Steve Seitz, U of Washington

CS 484, Spring 2015©2015, Selim Aksoy40 Hough transform: line segments y = mx + b is not suitable (why?) The equation generally used is: d = r sin(θ) + c cos(θ). d  r c d is the distance from the line to origin. θ is the angle the perpendicular makes with the column axis. Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2015©2015, Selim Aksoy41 Hough transform: line segments Adapted from Shapiro and Stockman

CS 484, Spring 2015©2015, Selim Aksoy42 Hough transform: line segments

CS 484, Spring 2015©2015, Selim Aksoy43 Hough transform: line segments

CS 484, Spring 2015©2015, Selim Aksoy44 Hough transform: line segments Extracting the line segments from the accumulators: 1. Pick the bin of A with highest value V 2. While V > value_threshold { 1. order the corresponding pointlist from PTLIST 2. merge in high gradient neighbors within 10 degrees 3. create line segment from final point list 4. zero out that bin of A 5. pick the bin of A with highest value V } Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2015©2015, Selim Aksoy45 Hough transform: line segments

CS 484, Spring 2015©2015, Selim Aksoy46 Adapted from Kristen Grauman

CS 484, Spring 2015©2015, Selim Aksoy47 Hough transform: circles Main idea: The gradient vector at an edge pixel points the center of the circle. Circle equations: r = r 0 + d sin(θ) r 0, c 0, d are parameters c = c 0 + d cos(θ) *(r,c) d Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2015©2015, Selim Aksoy48 Hough transform: circles Adapted from Shapiro and Stockman

CS 484, Spring 2015©2015, Selim Aksoy49 Hough transform: circles Adapted from Shapiro and Stockman

CS 484, Spring 2015©2015, Selim Aksoy50 Hough transform: circles Adapted from Shapiro and Stockman

CS 484, Spring 2015©2015, Selim Aksoy51 Model fitting Mathematical models that fit data not only reveal important structure in the data, but also can provide efficient representations for further analysis. Mathematical models exist for lines, circles, cylinders, and many other shapes. We can use the method of least squares for determining the parameters of the best mathematical model fitting the observed data.

CS 484, Spring 2015©2015, Selim Aksoy52 Model fitting: line segments Adapted from Martial Hebert, CMU

CS 484, Spring 2015©2015, Selim Aksoy53 Model fitting: line segments

CS 484, Spring 2015©2015, Selim Aksoy54 Model fitting: line segments

CS 484, Spring 2015©2015, Selim Aksoy55 Model fitting: line segments

CS 484, Spring 2015©2015, Selim Aksoy56 Model fitting: line segments Problems in fitting: Outliers Error definition (algebraic vs. geometric distance) Statistical interpretation of the error (hypothesis testing) Nonlinear optimization High dimensionality (of the data and/or the number of model parameters) Additional fit constraints

CS 484, Spring 2015©2015, Selim Aksoy57 Model fitting: ellipses

CS 484, Spring 2015©2015, Selim Aksoy58 Model fitting: ellipses Adapted from Andrew Fitzgibbon, PAMI 1999

CS 484, Spring 2015©2015, Selim Aksoy59 Model fitting: ellipses Adapted from Andrew Fitzgibbon, PAMI 1999

CS 484, Spring 2015©2015, Selim Aksoy60 Model fitting: incremental line fitting Adapted from David Forsyth, UC Berkeley

CS 484, Spring 2015©2015, Selim Aksoy61 Model fitting: incremental line fitting Adapted from Trevor Darrell, MIT

CS 484, Spring 2015©2015, Selim Aksoy62 Model fitting: incremental line fitting Adapted from Trevor Darrell, MIT

CS 484, Spring 2015©2015, Selim Aksoy63 Model fitting: incremental line fitting Adapted from Trevor Darrell, MIT

CS 484, Spring 2015©2015, Selim Aksoy64 Model fitting: incremental line fitting Adapted from Trevor Darrell, MIT

CS 484, Spring 2015©2015, Selim Aksoy65 Model fitting: incremental line fitting Adapted from Trevor Darrell, MIT

CS 484, Spring 2015©2015, Selim Aksoy66 Edge tracking Mask-based approach uses masks to identify the following events: start of a new segment, interior point continuing a segment, end of a segment, junction between multiple segments, corner that breaks a segment into two. junction corner Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2015©2015, Selim Aksoy67 Edge tracking: ORT Toolkit The algorithm is called Strider and is like a spider moving along pixel chains of an image, looking for junctions and corners. It identifies them by a measure of local asymmetry. When it is moving along a straight or curved segment with no interruptions, its legs are symmetric about its body. When it encounters an obstacle (i.e., a corner or junction) its legs are no longer symmetric. If the obstacle is small (compared to the spider), it soon becomes symmetrical. If the obstacle is large, it will take longer. The accuracy depends on the length of the spider and the size of its stride. The larger they are, the less sensitive it becomes.

CS 484, Spring 2015©2015, Selim Aksoy68 Edge tracking: ORT Toolkit L1: the line segment from pixel 1 of the spider to pixel N-2 of the spider L2: the line segment from pixel 1 of the spider to pixel N of the spider The angle must be <= arctan(2/length(L2)) angle 0 here The measure of asymmetry is the angle between two line segments. Longer spiders allow less of an angle. Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2015©2015, Selim Aksoy69 Edge tracking: ORT Toolkit The parameters are the length of the spider and the number of pixels per step. These parameters can be changed to allow for less sensitivity, so that we get longer line segments. The algorithm has a final phase in which adjacent segments whose angle differs by less than a given threshold are joined. Advantages: Works on pixel chains of arbitrary complexity. Can be implemented in parallel. No assumptions and parameters are well understood.

CS 484, Spring 2015©2015, Selim Aksoy70 Example: building detection by Yi University of Washington

CS 484, Spring 2015©2015, Selim Aksoy71 Example: building detection

CS 484, Spring 2015©2015, Selim Aksoy72 Example: object extraction by Serkan Kiranyaz Tampere University of Technology

CS 484, Spring 2015©2015, Selim Aksoy73 Example: object extraction

CS 484, Spring 2015©2015, Selim Aksoy74 Example: object extraction

CS 484, Spring 2015©2015, Selim Aksoy75 Example: object extraction

CS 484, Spring 2015©2015, Selim Aksoy76 Example: object recognition Mauro Costa’s dissertation at the University of Washington for recognizing 3D objects having planar, cylindrical, and threaded surfaces: Detects edges from two intensity images. From the edge image, finds a set of high-level features and their relationships. Hypothesizes a 3D model using relational indexing. Estimates the pose of the object using point pairs, line segment pairs, and ellipse/circle pairs. Verifies the model after projecting to 2D.

CS 484, Spring 2015©2015, Selim Aksoy77 Example: object recognition Example scenes used. The labels “left” and “right” indicate the direction of the light source.

CS 484, Spring 2015©2015, Selim Aksoy78

CS 484, Spring 2015©2015, Selim Aksoy79 Example: object recognition

CS 484, Spring 2015©2015, Selim Aksoy80 Example: object recognition

CS 484, Spring 2015©2015, Selim Aksoy81 Example: object recognition 1 coaxials- multi 3 parallel lines 2 ellipse encloses coaxial e e e c Relationship graph and the corresponding 2-graphs.

CS 484, Spring 2015©2015, Selim Aksoy82 Example: object recognition Learning phase: relational indexing by encoding each 2-graph and storing in a hash table. Matching phase: voting by each 2-graph observed in the image.

CS 484, Spring 2015©2015, Selim Aksoy83 Example: object recognition 1.The matched features of the hypothesized object are used to determine its pose. 2.The 3D mesh of the object is used to project all its features onto the image. 3.A verification procedure checks how well the object features line up with edges on the image. Incorrect hypothesis