Computer Vision : CISC 4/689 Sobel Edge Detection: Gradient Approximation Horizontal diff.Vertical diff. -2 000 121 01 -202 01 Note anisotropy of edge.

Slides:



Advertisements
Similar presentations
Boundary Detection - Edges Boundaries of objects –Usually different materials/orientations, intensity changes.
Advertisements

Instructor: Mircea Nicolescu Lecture 6 CS 485 / 685 Computer Vision.
EDGE DETECTION.
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Edge and Corner Detection Reading: Chapter 8 (skip 8.1) Goal: Identify sudden changes (discontinuities) in an image This is where most shape information.
Edge Detection. Our goal is to extract a “line drawing” representation from an image Useful for recognition: edges contain shape information –invariance.
EE663 Image Processing Edge Detection 1
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Lecture 4 Edge Detection
Filtering and Edge Detection
Canny Edge Detector.
Example: Canny Edge Detection
Computer Vision - A Modern Approach
Canny Edge Detector1 1)Smooth image with a Gaussian optimizes the trade-off between noise filtering and edge localization 2)Compute the Gradient magnitude.
Feature extraction: Corners and blobs
Segmentation (Section 10.2)
Scale Invariant Feature Transform (SIFT)
Filters and Edges. Zebra convolved with Leopard.
EE663 Image Processing Edge Detection 3 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
2D Fourier Theory for Image Analysis Mani Thomas CISC 489/689.
Lecture 4: Edge Based Vision Dr Carole Twining Thursday 18th March 2:00pm – 2:50pm.
Announcements Since Thursday we’ve been discussing chapters 7 and 8. “matlab can be used off campus by logging into your wam account and bringing up an.
3-D Computer Vision CSc Feature Detection and Grouping.
Computer Vision P. Schrater Spring 2003
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Scale-Invariant Feature Transform (SIFT) Jinxiang Chai.
Computer Vision Spring ,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30 – 11:50am.
Discrete Images (Chapter 7) Fourier Transform on discrete and bounded domains. Given an image: 1.Zero boundary condition 2.Periodic boundary condition.
Edges. Edge detection schemes can be grouped in three classes: –Gradient operators: Robert, Sobel, Prewitt, and Laplacian (3x3 and 5x5 masks) –Surface.
Computer Vision : CISC 4/689 Gradients and edges Points of sharp change in an image are interesting: –change in reflectance –change in object –change in.
CSC508 What You Should Be Doing Code, code, code –Programming Gaussian Convolution Sobel Edge Operator.
CSCE 643 Computer Vision: Extractions of Image Features Jinxiang Chai.
Instructor: S. Narasimhan
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
October 7, 2014Computer Vision Lecture 9: Edge Detection II 1 Laplacian Filters Idea: Smooth the image, Smooth the image, compute the second derivative.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Computer Vision - A Modern Approach Set: Linear Filters Slides by D.A. Forsyth Gradients and edges Points of sharp change in an image are interesting:
Edges.
Feature extraction: Corners and blobs. Why extract features? Motivation: panorama stitching We have two images – how do we combine them?
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
CSE 6367 Computer Vision Image Operations and Filtering “You cannot teach a man anything, you can only help him find it within himself.” ― Galileo GalileiGalileo.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Course 5 Edge Detection. Image Features: local, meaningful, detectable parts of an image. edge corner texture … Edges: Edges points, or simply edges,
Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T Computer Vision Tahun: 2010.
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
Lecture 8: Edges and Feature Detection
September 26, 2013Computer Vision Lecture 8: Edge Detection II 1Gradient In the one-dimensional case, a step edge corresponds to a local peak in the first.
1 Edge Operators a kind of filtering that leads to useful features.
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
EDGE DETECTION Dr. Amnach Khawne. Basic concept An edge in an image is defined as a position where a significant change in gray-level values occur. An.
Edge Detection Images and slides from: James Hayes, Brown University, Computer Vision course Svetlana Lazebnik, University of North Carolina at Chapel.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Edge Detection CS 678 Spring 2018.
Jeremy Bolton, PhD Assistant Teaching Professor
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.
Review: Linear Systems
a kind of filtering that leads to useful features
The SIFT (Scale Invariant Feature Transform) Detector and Descriptor
a kind of filtering that leads to useful features
Lecture 2: Edge detection
Canny Edge Detector.
CS 565 Computer Vision Nazar Khan Lecture 9.
Canny Edge Detector Smooth image with a Gaussian
Presented by Xu Miao April 20, 2005
IT472 Digital Image Processing
IT472 Digital Image Processing
Presentation transcript:

Computer Vision : CISC 4/689 Sobel Edge Detection: Gradient Approximation Horizontal diff.Vertical diff Note anisotropy of edge finding

Computer Vision : CISC 4/689 Sobel These can then be combined together to find the absolute magnitude of the gradient at each point and the orientation of that gradient. The gradient magnitude is given by: an approximate magnitude is computed using: which is much faster to compute. The angle of orientation of the edge (relative to the pixel grid) giving rise to the spatial gradient is given by: In this case, orientation 0 is taken to mean that the direction of maximum contrast from black to white runs from left to right on the image, and other angles are measured anti-clockwise from this.

Computer Vision : CISC 4/689 Derivative of Gaussian

Computer Vision : CISC 4/689 Smoothing and Differentiation Issue: noise –smooth before differentiation –two convolutions: to smooth, then differentiate? –actually, no - we can use a derivative of Gaussian filter because differentiation is convolution, and convolution is associative

Computer Vision : CISC 4/689 The Laplacian of Gaussian Another way to detect an extremal first derivative is to look for a zero second derivative –the Laplacian Bad idea to apply a Laplacian without smoothing –smooth with Gaussian, apply Laplacian –this is the same as filtering with a Laplacian of Gaussian filter Now mark the zero points where there is a sufficiently large (first) derivative, and enough contrast

Computer Vision : CISC 4/689 Marr-Hildreth operator The Laplacian is linear and rotationally symmetric. Thus, we search for the zero crossings of the image that is first smoothed with a Gaussian mask and then the second derivative is calculated; or we can convolve the image with the Laplacian of the Gaussian, also known as the LoG operator; This defines the Marr-Hildreth operator. One can also get a shape similar to G'' by taking the difference of two Gaussians having different standard deviations. A ratio of standard deviations of 1:1.6 will give a close approximation to.This is known as the DoG operator (Difference of Gaussians), or the Mexican Hat Operator. Still sensitive to noise.

Computer Vision : CISC 4/689 Step edge detection: 2 nd -Derivative Operators Method: 2 nd derivative is 0 for 1 st -derivative extrema, so find “zero-crossings” –Laplacian Isotropic (finds edges regardless of orientation. Three commonly used discrete approximations to the Laplacian filter. (Note, we have defined the Laplacian using a negative peak because this is more common, however, it is equally valid to use the opposite sign convention.) Source:

Computer Vision : CISC 4/689 Laplacian of Gaussian Matlab: fspecial(‘log’,…) Below: Discrete approximation to LoG function with Gaussian 1.4

Computer Vision : CISC 4/689 Sobel vs. LoG Edge Detection: Matlab Automatic Thresholds SobelLoG

Computer Vision : CISC 4/689 There are three major issues: 1) The gradient magnitude at different scales is different; which should we choose? 2) The gradient magnitude is large along thick trail (for 3 rd fig); how do we identify the significant points? 3) How do we link the relevant points up into curves? = 1 = 2

Computer Vision : CISC 4/689 We wish to mark points along the curve where the magnitude is biggest. We can do this by looking for a maximum along a slice normal to the curve (non-maximum suppression). These points should form a curve. There are then two algorithmic issues: at which point is the maximum, and where is the next one?

Computer Vision : CISC 4/689 Non-maximum suppression At q, we have a maximum if the value is larger than those at both p and at r. Interpolate to get these values.

Computer Vision : CISC 4/689 Predicting the next edge point Assume the marked point is an edge point. Then we construct the tangent (along) to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s).

Computer Vision : CISC 4/689 Remaining issues Check that maximum value of gradient value is sufficiently large –drop-outs? use hysteresis use a high threshold to start edge curves and a low threshold to continue them.

Computer Vision : CISC 4/689

fine scale high Threshold (be strict in Accepting Edge points)

Computer Vision : CISC 4/689 coarse scale, high threshold

Computer Vision : CISC 4/689 coarse scale low threshold

Computer Vision : CISC 4/689 Canny Edge Detection Steps 1.Apply derivative of Gaussian (not Laplacian!) 2.Non-maximum suppression Thin multi-pixel wide “ridges” down to single pixel 3.Thresholding Low, high edge-strength thresholds Accept all edges over low threshold that are connected to edge over high threshold (in the stage of predicting next edge point) Matlab: edge(I, ‘canny’)

Computer Vision : CISC 4/689 Edge “Smearing” from Forsyth & Ponce Sobel filter example: Yields 2-pixel wide edge “band” We want to localize the edge to within 1 pixel Input Result

Computer Vision : CISC 4/689 Non-Maximum Suppression: Steps 1.Consider 9-pixel neighborhood around each edge candidate (i.e., already over a threshold) 2.Interpolate edge strengths E at neighborhood boundaries in negative & positive gradient directions from the center pixel 3.If the pixel under consideration is not greater than these two values (i.e. not a maximum), it is suppressed Interpolating the E value: E(r) = (1 ¡ a)E(x, y) + aE(x + 1, y) a1 ¡ a (x, y)(x + 1, y) r

Computer Vision : CISC 4/689 Example: Non-Maximum Suppression courtesy of G. Loy Original imageGradient magnitude Non-maxima suppressed

Computer Vision : CISC 4/689 Edge “Streaking” Can predict next pixel in edge orthogonal to gradient to make edge chain –Can also just use 8-connectedness to define chains Streaking: Gaps in edge chain due to edge strength dipping below threshold courtesy of G. Loy Original imageStrong edges gap

Computer Vision : CISC 4/689 Edge Hysteresis Hysteresis: A lag or momentum factor Idea: Maintain two thresholds k high and k low –Use k high to find strong edges to start edge chain –Use k low to find weak edges which continue edge chain Usual ratio of thresholds is roughly k high / k low = 2 or 3

Computer Vision : CISC 4/689 Example: Canny Edge Detection courtesy of G. Loy gap is gone Original image Strong edges only Strong + connected weak edges Weak edges

Computer Vision : CISC 4/689 Example: Canny Edge Detection (Matlab automatically set thresholds)

Computer Vision : CISC 4/689 Image Pyramids Observation: Fine-grained template matching expensive over a full image –Idea: Represent image at smaller scales, allowing efficient coarse- to-fine search Downsampling: Cut width, height in half at each iteration: from Forsyth & Ponce

Computer Vision : CISC 4/689 Gaussian Pyramid Let the base (the finest resolution) of an n -level Gaussian pyramid be defined as P 0 = I. Then the i th level is reduced from the level below it by: Upsampling S " (I) : Double size of image, interpolate missing pixels courtesy of Wolfram Gaussian pyramid

Computer Vision : CISC 4/689 Reconstruction

Example from: Computer Vision : CISC 4/689  decompose Reconstruct 

Computer Vision : CISC 4/689 Laplacian Pyramids The tip (the coarsest resolution) of an n -level Laplacian pyramid is the same as the Gaussian pyramid at that level: L n (I) = P n (I) The i th level is obtained from the level above according to L i (I) = P i (I) ¡ S " (P i+1 (I)) Synthesizing the original image: Get I back by summing upsampled Laplacian pyramid levels

Computer Vision : CISC 4/689 Laplacian Pyramid The differences of images at successive levels of the Gaussian pyramid define the Laplacian pyramid. To calculate a difference, the image at a higher level in the pyramid must be increased in size by a factor of four prior to subtraction. This computes the pyramid. The original image may be reconstructed from the Laplacian pyramid by reversing the previous steps. This interpolates and adds the images at successive levels of the pyramid beginning with the coarsest level. Laplacian is largely uncorrelated, and so may be represented pixel by pixel with many fewer bits than Gaussian. courtesy of Wolfram

Computer Vision : CISC 4/689 Splining Build Laplacian pyramids LA and LB for A & B images Build a Gaussian pyramid GR from selected region R Form a combined pyramid LS from LA and LB using nodes of GR as weights: LS(I,j) = GR(I,j)*LA(I,j)+(1-GR(I,j))*LB(I,j) Collapse the LS pyramid to get the final blended image

Computer Vision : CISC 4/689 Splining (Blending) Splining two images simply requires: 1) generating a Laplacian pyramid for each image, 2) generating a Gaussian pyramid for the bitmask indicating how the two images should be merged, 3) merging each Laplacian level of the two images using the bitmask from the corresponding Gaussian level, and 4) collapsing the resulting Laplacian pyramid. i.e. GS = Gaussian pyramid of bitmask LA = Laplacian pyramid of image "A" LB = Laplacian pyramid of image "B" therefore, "Lout = (GS)LA + (1-GS)LB"

Computer Vision : CISC 4/689 Example images from GTech Image-1 bit-mask image-2 Direct addition splining bad bit-mask choice

Computer Vision : CISC 4/689 Outline Corner detection RANSAC

Computer Vision : CISC 4/689 Matching with Invariant Features Darya Frolova, Denis Simakov The Weizmann Institute of Science March 2004

Computer Vision : CISC 4/689 Example: Build a Panorama M. Brown and D. G. Lowe. Recognising Panoramas. ICCV 2003

Computer Vision : CISC 4/689 How do we build panorama? We need to match (align) images

Computer Vision : CISC 4/689 Matching with Features Detect feature points in both images

Computer Vision : CISC 4/689 Matching with Features Detect feature points in both images Find corresponding pairs

Computer Vision : CISC 4/689 Matching with Features Detect feature points in both images Find corresponding pairs Use these pairs to align images

Computer Vision : CISC 4/689 Matching with Features Problem 1: –Detect the same point independently in both images no chance to match! We need a repeatable detector

Computer Vision : CISC 4/689 Matching with Features Problem 2: –For each point correctly recognize the corresponding one ? We need a reliable and distinctive descriptor

Computer Vision : CISC 4/689 More motivation… Feature points are used also for: –Image alignment (homography, fundamental matrix) –3D reconstruction –Motion tracking –Object recognition –Indexing and database retrieval –Robot navigation –… other