Filtering and Edge Detection

Slides:



Advertisements
Similar presentations
3-D Computer Vision CSc83020 / Ioannis Stamos  Revisit filtering (Gaussian and Median)  Introduction to edge detection 3-D Computater Vision CSc
Advertisements

Boundary Detection - Edges Boundaries of objects –Usually different materials/orientations, intensity changes.
Instructor: Mircea Nicolescu Lecture 6 CS 485 / 685 Computer Vision.
Sliding Window Filters and Edge Detection Longin Jan Latecki Computer Graphics and Image Processing CIS 601 – Fall 2004.
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.
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
Computer Vision Group Edge Detection Giacomo Boracchi 5/12/2007
Canny Edge Detector.
Edge detection. Edge Detection in Images Finding the contour of objects in a scene.
EE663 Image Processing Edge Detection 2 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Filtering and Edge Detection. Local Neighborhoods Hard to tell anything from a single pixelHard to tell anything from a single pixel – Example: you see.
Canny Edge Detector1 1)Smooth image with a Gaussian optimizes the trade-off between noise filtering and edge localization 2)Compute the Gradient magnitude.
Zoom Lenses – Varifocal
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.
Lecture 2: Image filtering
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.
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.
Neighborhood Operations
Computer Vision Spring ,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30 – 11:50am.
Computer Vision : CISC 4/689 Sobel Edge Detection: Gradient Approximation Horizontal diff.Vertical diff Note anisotropy of edge.
Edge Detection Edge detection Convert a 2D image into a set of curves Extracts salient features of the scene More compact than pixels.
Edges. Edge detection schemes can be grouped in three classes: –Gradient operators: Robert, Sobel, Prewitt, and Laplacian (3x3 and 5x5 masks) –Surface.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection From Sandlot ScienceSandlot Science.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski, Ch 4.1.2, From Sandlot.
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.
CSE 185 Introduction to Computer Vision Edges. Scale space Reading: Chapter 3 of S.
EE 4780 Edge Detection.
October 7, 2014Computer Vision Lecture 9: Edge Detection II 1 Laplacian Filters Idea: Smooth the image, Smooth the image, compute the second derivative.
Chapter 9: Image Segmentation
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.
Announcements Project 0 due tomorrow night. Edge Detection Today’s readings Cipolla and Gee (handout) –supplemental: Forsyth, chapter 9Forsyth For Friday.
EDGE DETECTION Instructor: Dr. Engr. Junaid Zafar.
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.
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Canny Edge Detection. 5 STEPS 5 STEPS Apply Gaussian filter to smooth the image in order to remove the noise Apply Gaussian filter to smooth the image.
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.
Sliding Window Filters Longin Jan Latecki October 9, 2002.
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.
Winter in Kraków photographed by Marcin Ryczek
Miguel Tavares Coimbra
Edge Detection slides taken and adapted from public websites:
Image Filtering Spatial filtering
Edge Detection CS 678 Spring 2018.
Edge Detection The purpose of Edge Detection is to find jumps in the brightness function (of an image) and mark them.
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
a kind of filtering that leads to useful features
Edge Detection Today’s reading
Lecture 2: Edge detection
Canny Edge Detector.
Edge Detection Today’s reading
CS 565 Computer Vision Nazar Khan Lecture 9.
Canny Edge Detector Smooth image with a Gaussian
Winter in Kraków photographed by Marcin Ryczek
IT472 Digital Image Processing
Presentation transcript:

Filtering and Edge Detection Szymon Rusinkiewicz

Convolution: how to derive discrete 2D convolution 1-dimensional 2-dimensional Discrete Where f(i,j) is any given image, g(i,j) is a mask, h(i,j) is an new image obtained.

Formalizing Edge Detection We want to look for strong step edges PROBLEM: We want to have edges one pixel wide: Solution: look for maxima in dI / dx It would be difficult to get with small kernel like Roberts. PROBLEM: Noise rejection: Solution: smooth (with a Gaussian) over a neighborhood  So we want to find edges as derivatives on smoothed image

Canny Operator executes four stages in sequence: Canny Edge Detector Canny Operator executes four stages in sequence: 1. Smooth with 2D Gaussian 2. Find derivative 3. Find maxima 4. Threshold

1 Step: Canny Edge Detector: smoothing First, smooth with a Gaussian of some width 

2 Step: Canny Edge Detector: derivative Next, find “derivative” What is derivative in 2D? Gradient: Derivative in 2D is a gradient vector of derivatives to x and to y

1st step Canny Edge Detector: Gaussian Useful fact #1: differentiation “commutes” with convolution Useful fact #2: Gaussian is separable Our goal is to combine the first two stages of the Canny operator

Canny Edge Detector: Combined two first stages of Canny Thus, combine first two stages of Canny:

Step 3: Canny Edge Detector: calculate Maxima Non-maximum suppression Eliminate all but local maxima in magnitude of gradient At each pixel look along direction of gradient: if either neighbor is bigger, set to zero In practice, quantize direction to horizontal, vertical, and two diagonals Result: “thinned edge image”

Step 4: Canny Edge Detector: Thresholding Final stage: thresholding Simplest: use a single threshold Better: use two thresholds Find chains of edge pixels, all greater than  low Each chain must contain at least one pixel greater than  high Helps eliminate dropouts in chains, without being too susceptible to noise “Thresholding with hysteresis”

Complete Example : Canny Edge Detection Derivative of gaussian is gaussian Example of Canny on ideal edge model Original image edge After smoothing with Gaussian (first stage) Gauss uniformized maximum After derivative 1. Smooth 2. Find derivative 3. Find maxima 4. Threshold First derivative

Examples of operation of Canny Edge Detection Operator This is a very high quality operator for edge detection

Canny Edge Detector: Smoothed Gradient Original: Lena Smoothed Gradient Magnitude

Canny Edge Detector: Final result Original: Lena Edges

Some details of derivation of Canny Masks

How to create masks for Gaussian Filter example? This explains how the kernel’s mask is created 1 (0.606)1 (1.65)2 (0.779-->1.3-->)1 0.606 0.779 1 -1 [i,j] Mask size= 3 Discrete Gaussian Filter 1 2 Based on Pascal’s triangle we can create now larger masks

How to create masks for Gaussian Filter example? 0 1 1 0 0 1 2 1 0 Pascal Triangle 0 1 3 3 1 0 0 1 4 6 4 1 0 Take the lower integer  3 = 2 Discrete Gaussian Filter 1 2 4 Based on Pascal’s triangle like approximation

Canny Edge Detector: Derivative of Gaussian First derivative of a Gaussian Nonmaxima suppression (ridge thinning) Double thresholding to detect and link edges Gaussian filtering S[i,j] = G[i,j; s] * I[i,j] P[i,j] = - S[i,j] + S[i,j+1] - S[i+1,j] + S[i+1,j+1] Q[i,j] = S[i,j] + S[i,j+1] - S[i+1,j] - S[i+1,j+1] -1 1 First derivative 1 1 -1 -1

Canny Edge Detector: Gaussian plus Edge direction Step 1: Gaussian Filter Step 2: Edge Detector Edge Modulus Edge Direction In every point we can calculate modulus and angle

Other Edge Detectors

Other Edge Detectors Can build simpler, faster edge detector by omitting some steps: No non-maximum suppression No hysteresis in thresholding Simpler filter

Second-Derivative-Based Edge Detectors To find local maxima in derivative, look for zeros in second derivative Analogue in 2D: Laplacian

LOG or Mexican Hat Operator Laplacian of Gaussian (LoG) Smoothing with a Gaussian filter Enhancement by second derivative edge detection Detection of zero crossings in second derivative in combination with large peak in first derivative Localization with sub-pixel resolution using linear interpolation

LOG = Laplacian of Gaussian As before, combine Laplacian with Gaussian smoothing: Laplacian of Gaussian (LOG)

LOG As before, combine Laplacian with Gaussian smoothing: Laplacian of Gaussian (LOG)

LoG-Operator h(x,y) = D2[g(x,y) * f(x,y)] = [D2g(x,y)] * f(x,y) 0 0 -1 0 0 0 -1 -2 -1 0 -1 -2 16 -2 -1 0 0 0 0 0 0 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 -1 -1 -1 -2 -3 -3 -3 -3 -3 -2 -1 -1 -1 0 0 0 0 -1 -1 -2 -3 -3 -3 -3 -3 -3 -3 -2 -1 -1 0 0 0 -1 -1 -2 -3 -3 -3 -2 -3 -2 -3 -3 -3 -2 -1 -1 0 0 -1 -2 -3 -3 -3 0 2 4 2 0 -3 -3 -3 -2 -1 0 -1 -1 -3 -3 -3 0 4 10 12 10 4 0 -3 -3 -3 -1 -1 -1 -1 -3 -3 -2 2 10 18 21 18 10 2 -2 -3 -3 -1 -1 -1 -1 -3 -3 -3 4 12 21 24 21 12 4 -3 -3 -3 -1 -1

Edge Detection: Laplacian Second Order Kernels non-directional results in closed curves (contours) example: Laplacian sum=0 4-4=0 8-8=0 Replace output pixel values with sign changes (zero crossings) 0 -1 0 -1 4 -1 -1 -1 -1 -1 8 -1

Edge Detection using Laplacian

Edge Detection using Laplacian Select a mask Image EdgeImage

Edge Detection using the LoG

Problems with Laplacian Edge Detectors How to use Local minimum vs. local maximum information The operator is Symmetric – it gives poor performance near corners of image Sensitive to noise along an edge Higher-order derivatives = greater noise sensitivity

Marr-Hildreth Operator Like Laplacian but no sum of second derivatives

Marr-Hildreth Algorithm Marr-Hildreth Operator

Marr-Hildreth Operator Marr-Hildreth Algorithm Marr-Hildreth Operator