Edges & the Hough Transform Instructor - Simon Lucey 16-423 - Designing Computer Vision Apps
Today • Motivation. • What is an Edge? • Oriented Filters. • Hough Transform. • Advance Methods.
Today • Motivation. • What is an Edge? • Oriented Filters. • Advance Methods. • Hough Transform.
1968 Canny edge detector original image human annotator Taken from Isola et al. “Crisp Boundary Detection Using Pointwise Mutual Information”
Edges are Semantic • No mathematical definition of an edge, contour of boundary. • Classic problem in computer vision. • By definition they are semantic. • Early work focussed on oriented filters. • e.g. Canny edge detectors. • Developed by John F. Canny in 1986. “John Canny”
Today • Motivation. • What is an Edge? • Oriented Filters. • Hough Transform. • Advance Methods.
D.H. Hubel & T.N. Wiesel. Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex. The Journal of Physiology, 160(1):106, 1962.
D.H. Hubel & T.N. Wiesel. Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex. The Journal of Physiology, 160(1):106, 1962.
D.H. Hubel & T.N. Wiesel. Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex. The Journal of Physiology, 160(1):106, 1962.
D.H. Hubel & T.N. Wiesel. Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex. The Journal of Physiology, 160(1):106, 1962.
D.H. Hubel & T.N. Wiesel. Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex. The Journal of Physiology, 160(1):106, 1962.
D.H. Hubel & T.N. Wiesel. Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex. The Journal of Physiology, 160(1):106, 1962.
Olshausen & Field 1996
x 1
x 1 x 2
. . . x 1 x 2 x N − 1
. . . x 1 x 2 x N − 1 x N
. . . M × N . . . . . . X = . . . . x 1 x 2 x N − 1 x N . .
0.25 0.2 p ( x ) 0.15 0.1 0.05 0 -6 -4 -2 0 2 4 6 x n X 3.19 bits H ( x ) = − p ( x n ) · log[ p ( x n )] = n =1 Olshausen & Field 1996
0.8 0.7 0.6 p ( x ) 0.5 0.4 0.3 0.2 0.1 0 -6 -4 -2 0 2 4 6 x n X 1.41 bits H ( x ) = − p ( x n ) · log[ p ( x n )] = n =1 Olshausen & Field 1996
�� �� �� �� c) + = × ✏ X D Z Olshausen & Field 1996 Not Always Zero Always Zero H. Lee, A. Ng, et al. 2007
�� �� �� �� c) + = × ✏ X D Z Olshausen & Field 1996 Not Always Zero Always Zero H. Lee, A. Ng, et al. 2007
1D Filter ∗
1D Filter ∗
1D Filter ∗
2D Filter 1 , 0 , − 1 1 , 0 , − 1 ∗ 1 , 0 , − 1 (Prewitt)
2D Filter 1 , 0 , − 1 2 , 0 , − 2 ∗ 1 , 0 , − 1 (Sobel)
2D Filter
2D Filter + =
�� �� �� �� 2D Filter c)
99.6% sparse per patch
99.6% sparse per patch
+ . . . + ∗ + ∗ = d 1 d K ✏ z 1 z K x Not Always Zero Always Zero M. Zeiler, et al. 2010
�� �� �� �� �� �� �� �� + . . . + ∗ + ∗ = c) d 1 d K ✏ z 1 z K x Not Always Zero Always Zero M. Zeiler, et al. 2010
Edges Adapted from: Elder “Are Edges Incomplete?” IJCV 1999.
�� �� Naive Approach? �� �� c) ∗ How do we recover edges?
Canny Edge Detector Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince
Canny Edge Detector Compute horizontal and vertical gradient images h and v Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince
Oriented Filters • Seems inefficient to have to search all possible orientations, + = • Instead one can express all orientations as a linear combination of x- and y- gradient filters.
Canny Edge Detector Quantize to 4 directions Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince
Canny Edge Detector Non-maximal suppression Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince
Non-Max Suppression • Interesting, view of non-max suppression in terms of sparse coding. = × X D Z • Non-max suppression attempts to enforce that Z is sparse.
Canny Edge Detector Hysteresis Thresholding
Classic Edge Detector - Problems Texture Edge Filtering Response Simple Step Edge Filtering Response Appearance Edges Found Original Color Image by Linear Filtering (a) (b) Taken from: “Occlusion Boundaries: Low-Level Detection to High-Level Reasoning” - A. Stein (Ph.D. Thesis)
Today • Motivation. • What is an Edge? • Oriented Filters. • Hough Transform. • Advance Methods.
Hough Transform • A line is classically represented as - . y = m · x + c • Not good, in case of vertical lines (i.e. ). m = ∞ • Instead common to represent lines using , ( θ , ρ ) ρ y = − x tan θ + cos θ θ → angle from horizontal axis to perpendicular ρ → perpendicular distance between the origin and the line
Hough Transform x y Adapted from: Robotics, Vision and Control. Peter Corke.
Exhaustive Search θ ρ “Hough Transform Parameters”
Hough Transform ρ (pixels) y (pixels) x (pixels) θ (radians) ρ (pixels) y (pixels) θ (radians) x (pixels) Adapted from: Robotics, Vision and Control. Peter Corke.
Hough Transform • Elegant in principle - in practice it can work well or infuriatingly badly. • Performs poorly when the scene contains a lot of texture or edges are indistinct. • Lots of experimentation required to find strong edges AND thresholds within the Hough peak detector. Appearance Edges Found Original Color Image by Linear Filtering (a) (b)
State of the Art Sobel & Feldman Arbeláez et al. 1968 2011 (gPb) Isola et al. ez et al. Dollár & Zitnick Our method Human labelers 2013 (SE) 2014 Taken from Isola et al. “Crisp Boundary Detection Using Pointwise Mutual Information”
Things to try in iOS - GPUImage
More to read… • Prince et al. • Chapter 13, Sections 1-2. • Corke et al. • Chapter 13, Section 2. P. Isola et al. “ Crisp Boundary Detection Using • Pointwise Mutual Information ”, ECCV 2014.
Recommend
More recommend