Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.

Slides:



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

Lecture 2: Convolution and edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
The University of Ontario CS 4487/9587 Algorithms for Image Analysis Segmentation (2D) Acknowledgements: Alexei Efros, Steven Seitz.
Active Contours (SNAKES) Back to boundary detection –This time using perceptual grouping. This is non-parametric –We’re not looking for a contour of a.
Edge Detection CSE P 576 Larry Zitnick
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
Announcements Mailing list: –you should have received messages Project 1 out today (due in two weeks)
Edges and Scale Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski – From Sandlot ScienceSandlot.
Lecture 2: Edge detection and resampling
Snakes Goes from edges to boundaries. Edge is strong change in intensity. Boundary is boundary of an object. –Smooth (more or less) –Closed. –…
Image Segmentation Today’s Readings Intelligent Scissors, Mortensen et. al, SIGGRAPH 1995Intelligent Scissors From Sandlot ScienceSandlot Science.
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Lecture 3: Edge detection, continued
Lecture 2: Image filtering
Image Segmentation Today’s Readings Forsyth & Ponce, Chapter 14
Announcements Mailing list: –you should have received messages Office hours onlineonline –start next week.
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
The blue and green colors are actually the same.
Segmentation and Clustering Today’s Readings Forsyth & Ponce, Chapter 7 (plus lots of optional references in the slides) From Sandlot ScienceSandlot Science.
CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 10 – Edges and Pyramids 1.
Edge Detection.
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 WH 5409 T-R 10:30 – 11:50am.
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
The University of Ontario CS 433/653 Algorithms for Image Analysis Segmentation (2D) Acknowledgements: Alexei Efros, Steven Seitz.
Lecture 4: Image Resampling and Reconstruction CS4670: Computer Vision Kavita Bala.
Lecture 3: Edge detection CS4670/5670: Computer Vision Kavita Bala From Sandlot ScienceSandlot Science.
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
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.
CSE 185 Introduction to Computer Vision Edges. Scale space Reading: Chapter 3 of S.
EE 4780 Edge Detection.
Many slides from Steve Seitz and Larry Zitnick
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout Edge Detection.
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout Edge Detection:
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 15/16 – TP7 Spatial Filters Miguel Tavares Coimbra.
Announcements Project 0 due tomorrow night. Edge Detection Today’s readings Cipolla and Gee (handout) –supplemental: Forsyth, chapter 9Forsyth For Friday.
COMPUTER VISION D10K-7C02 CV05: Edge Detection Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
Lecture 8: Edges and Feature Detection
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
Finding Boundaries Computer Vision CS 143, Brown James Hays 09/28/11 Many slides from Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li,
Winter in Kraków photographed by Marcin Ryczek
Edge Detection Images and slides from: James Hayes, Brown University, Computer Vision course Svetlana Lazebnik, University of North Carolina at Chapel.
Miguel Tavares Coimbra
Edge Detection slides taken and adapted from public websites:
Announcements CS accounts Project 1 is out today
CS4670/5670: Image Scissors Noah Snavely Today’s Readings
Image gradients and edges
Edge Detection CS 678 Spring 2018.
Lecture 2: Edge detection
Jeremy Bolton, PhD Assistant Teaching Professor
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
Edge Detection Today’s reading
Announcements Reader is in the BOOK STORE (not Comm Bldg.)
Edge Detection CSE 455 Linda Shapiro.
Edge Detection Today’s reading
Lecture 2: Edge detection
Announcements Project 1 is out today
Edge Detection Today’s reading
Edge Detection Today’s readings Cipolla and Gee Watt,
Announcements Project 1 is out today help session at the end of class.
Lecture 2: Edge detection
Winter in Kraków photographed by Marcin Ryczek
IT472 Digital Image Processing
IT472 Digital Image Processing
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Presentation transcript:

Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science

Announcements Project 1 released, due Friday, September 7

Edge detection TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA Convert a 2D image into a set of curves – Extracts salient features of the scene – More compact than pixels

Origin of Edges Edges are caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity

Images as functions… Edges look like steep cliffs

Characterizing edges An edge is a place of rapid change in the image intensity function image intensity function (along horizontal scanline) first derivative edges correspond to extrema of derivative Source: L. Lazebnik

How can we differentiate a digital image F[x,y]? – Option 1: reconstruct a continuous image, f, then compute the derivative – Option 2: take discrete derivative (finite difference) 1 How would you implement this as a linear filter? Image derivatives 1 : : Source: S. Seitz

The gradient points in the direction of most rapid increase in intensity Image gradient The gradient of an image: The edge strength is given by the gradient magnitude: The gradient direction is given by: how does this relate to the direction of the edge? Source: Steve Seitz

Image gradient Source: L. Lazebnik

Effects of noise Where is the edge? Source: S. Seitz Noisy input image

Solution: smooth first f h f * h Source: S. Seitz To find edges, look for peaks in

Differentiation is convolution, and convolution is associative: This saves us one operation: Associative property of convolution f Source: S. Seitz

2D edge detection filters Gaussian derivative of Gaussian ( x )

Derivative of Gaussian filter x-direction y-direction

The Sobel operator Common approximation of derivative of Gaussian The standard defn. of the Sobel operator omits the 1/8 term –doesn’t make a difference for edge detection –the 1/8 term is needed to get the right gradient value

Sobel operator: example Source: Wikipedia

Example original image (Lena)

Finding edges gradient magnitude

thresholding Finding edges where is the edge?

Check if pixel is local maximum along gradient direction – requires interpolating pixels p and r Non-maximum supression

thresholding Finding edges

thinning (non-maximum suppression) Finding edges

Canny edge detector 1.Filter image with derivative of Gaussian 2.Find magnitude and orientation of gradient 3.Non-maximum suppression 4.Linking and thresholding (hysteresis): – Define two thresholds: low and high – Use the high threshold to start edge curves and the low threshold to continue them Source: D. Lowe, L. Fei-Fei MATLAB: edge(image,‘canny’)

Canny edge detector Still one of the most widely used edge detectors in computer vision Depends on several parameters: J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8: , 1986.A Computational Approach To Edge Detection : width of the Gaussian blur high threshold low threshold

Canny edge detector Canny with original The choice of depends on desired behavior –large detects “large-scale” edges –small detects fine edges Source: S. Seitz

Scale space (Witkin 83) Properties of scale space (w/ Gaussian smoothing) – edge position may shift with increasing scale (  ) – two edges may merge with increasing scale – an edge may not split into two with increasing scale larger Gaussian filtered signal first derivative peaks

Questions?

Image Scissors Today’s Readings – Intelligent Scissors, Mortensen et. al, SIGGRAPH 1995 Intelligent Scissors Aging Helen Mirren

Extracting objects How could this be done? – hard to do manually – hard to do automatically (“image segmentation”) – pretty easy to do semi-automatically

Intelligent Scissors (demo)

Intelligent Scissors Approach answers basic question – Q: how to find a path from seed to mouse that follows object boundary as closely as possible? – A: define a path that stays as close as possible to edges

Intelligent Scissors Basic Idea – Define edge score for each pixel edge pixels have low cost – Find lowest cost path from seed to mouse seed mouse Questions How to define costs? How to find the path?

Let’s look at this more closely Treat the image as a graph Graph node for every pixel p link between every adjacent pair of pixels, p,q cost c for each link Note: each link has a cost this is a little different than the figure before where each pixel had a cost p q c

good (low-cost) links follow the intensity edge –want intensity to change rapidly to the link c – |intensity of r – intensity of s| Defining the costs Want to hug image edges: how to define cost of a link? p q c r s

c can be computed using a cross-correlation filter – assume it is centered at p p q c r s Defining the costs

1 11 c can be computed using a cross-correlation filter assume it is centered at p A couple more modifications Scale the filter response by length of link c. Why? Make c positive –Set c = (max-|filter response|*length) –where max = maximum |filter response|*length over all pixels in the image p q c r s w

Dijkstra’s shortest path algorithm Algorithm 1.init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) ) link cost

Dijkstra’s shortest path algorithm if q’s cost changed, make q point back to p put q on the ACTIVE list (if not already there) Algorithm 1.init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) )

set r = node with minimum cost on the ACTIVE list 4.repeat Step 2 for p = r Dijkstra’s shortest path algorithm Algorithm 1.init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) ) if q’s cost changed, make q point back to p put q on the ACTIVE list (if not already there)

Dijkstra’s shortest path algorithm 3.set r = node with minimum cost on the ACTIVE list 4.repeat Step 2 for p = r Algorithm 1.init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) ) if q’s cost changed, make q point back to p put q on the ACTIVE list (if not already there)

Dijkstra’s shortest path algorithm Properties – It computes the minimum cost path from the seed to every node in the graph. This set of minimum paths is represented as a tree – Running time, with N pixels: O(N 2 ) time if you use an active list O(N log N) if you use an active priority queue (heap) takes fraction of a second for a typical (640x480) image – Once this tree is computed once, we can extract the optimal path from any point to the seed in O(N) time. it runs in real time as the mouse moves – What happens when the user specifies a new seed?

Example Result Peter Davis

Questions?