Image gradients and edges Tuesday, September 1 st 2015 Devi Parikh Virginia Tech Disclaimer: Many slides have been borrowed from Kristen Grauman, who may.

Slides:



Advertisements
Similar presentations
November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Advertisements

Lecture 2: Convolution and edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Spatial Filtering (Chapter 3)
Motion illusion, rotating snakes. Slide credit Fei Fei Li.
Computational Photography CSE 590 Tamara Berg Filtering & Pyramids.
Edges and Binary Images
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
Edge detection. Edge Detection in Images Finding the contour of objects in a scene.
Announcements Mailing list: –you should have received messages Project 1 out today (due in two weeks)
Lecture 2: Edge detection and resampling
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Lecture 2: Image filtering
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 10 – Edges and Pyramids 1.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
Spatial Filtering: Basics
Local invariant features Cordelia Schmid INRIA, Grenoble.
Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Image Processing Edge detection Filtering: Noise suppresion.
Lecture 3: Edge detection CS4670/5670: Computer Vision Kavita Bala From Sandlot ScienceSandlot Science.
CS 1699: Intro to Computer Vision Edges and Binary Images Prof. Adriana Kovashka University of Pittsburgh September 15, 2015.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection From Sandlot ScienceSandlot Science.
CS 1699: Intro to Computer Vision Matlab Tutorial Prof. Adriana Kovashka University of Pittsburgh September 3, 2015.
Linear Filters Monday, Jan 24 Prof. Kristen Grauman UT-Austin …
Linear Filters August 27 th 2015 Devi Parikh Virginia Tech 1 Slide credit: Devi Parikh Disclaimer: Many slides have been borrowed from Kristen Grauman,
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski, Ch 4.1.2, From Sandlot.
Image Filtering Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/02/10.
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
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
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.
Local features and image matching October 1 st 2015 Devi Parikh Virginia Tech Disclaimer: Many slides have been borrowed from Kristen Grauman, who may.
Local features: detection and description
CS 691B Computational Photography
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.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Instructor: Mircea Nicolescu Lecture 7
Lecture 8: Edges and Feature Detection
Grauman Today: Image Filters Smooth/Sharpen Images... Find edges... Find waldo…
Images and Filters CSEP 576 Ali Farhadi Many slides from Steve Seitz and Larry Zitnick.
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,
1 Edge Operators a kind of filtering that leads to useful features.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Winter in Kraków photographed by Marcin Ryczek
Miguel Tavares Coimbra
Edge Detection slides taken and adapted from public websites:
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.
Image gradients and edges April 11th, 2017
Dr. Chang Shu COMP 4900C Winter 2008
a kind of filtering that leads to useful features
a kind of filtering that leads to useful features
Motion illusion, rotating snakes
Lecture 2: Edge detection
Local features and image matching
Lecture 2: Edge detection
Winter in Kraków photographed by Marcin Ryczek
IT472 Digital Image Processing
IT472 Digital Image Processing
Presentation transcript:

Image gradients and edges Tuesday, September 1 st 2015 Devi Parikh Virginia Tech Disclaimer: Many slides have been borrowed from Kristen Grauman, who may have borrowed some of them from others. Any time a slide did not already have a credit on it, I have credited it to Kristen. So there is a chance some of these credits are inaccurate.

Announcements Questions? PS0 was due last night –5 late PS1 is out –Due September 16 th (Wednesday) 11:55 pm 2 Slide credit: Devi Parikh

Topics overview Features & filters –Filters Grouping & fitting Multiple views and motion Recognition Video processing 3 Slide credit: Kristen Grauman

Topics overview Features & filters –Filters –Gradients –Edges Grouping & fitting Multiple views and motion Recognition Video processing 4 Slide credit: Kristen Grauman

Last time Image formation Various models for image “noise” Linear filters and convolution useful for –Image smoothing, removing noise Box filter Gaussian filter Impact of scale / width of smoothing filter Separable filters more efficient Median filter: a non-linear filter, edge-preserving 5 Slide credit: Adapted by Devi Parikh from Kristen Grauman

f*g=? original image hfiltered Filter f = 1/9 x [ ] Review 6 Slide credit: Kristen Grauman

f*g=? Filter f = 1/9 x [ ] T original image hfiltered Review 7 Slide credit: Kristen Grauman

Review How do you sharpen an image? 8 Slide credit: Devi Parikh

Review Median filter f: Is f(a+b) = f(a)+f(b)? Example: a = [ ] b = [ ] Is f linear? 9 Slide credit: Devi Parikh

Recall: image filtering Compute a function of the local neighborhood at each pixel in the image –Function specified by a “filter” or mask saying how to combine values from neighbors. Uses of filtering: –Enhance an image (denoise, resize, etc) –Extract information (texture, edges, etc) –Detect patterns (template matching) 10 Slide credit: Kristen Grauman, Adapted from Derek Hoiem

Recall: image filtering Compute a function of the local neighborhood at each pixel in the image –Function specified by a “filter” or mask saying how to combine values from neighbors. Uses of filtering: –Enhance an image (denoise, resize, etc) –Extract information (texture, edges, etc) –Detect patterns (template matching) 11 Slide credit: Kristen Grauman, Adapted from Derek Hoiem

Edge detection Goal: map image from 2d array of pixels to a set of curves or line segments or contours. Why? Main idea: look for strong gradients, post-process Figure from J. Shotton et al., PAMI Slide credit: Kristen Grauman

What causes an edge? Depth discontinuity: object boundary Change in surface orientation: shape Cast shadows Reflectance change: appearance information, texture 13 Slide credit: Kristen Grauman

Edges/gradients and invariance 14 Slide credit: Kristen Grauman

Derivatives and edges image intensity function (along horizontal scanline) first derivative edges correspond to extrema of derivative An edge is a place of rapid change in the image intensity function. 15 Slide credit: Svetlana Lazebnik

Derivatives with convolution For 2D function, f(x,y), the partial derivative is: For discrete data, we can approximate using finite differences: To implement above as convolution, what would be the associated filter? 16 Slide credit: Kristen Grauman

Partial derivatives of an image Which shows changes with respect to x? or ? -1 1 (showing filters for correlation) 17 Slide credit: Kristen Grauman

Assorted finite difference filters >> My = fspecial(‘sobel’); >> outim = imfilter(double(im), My); >> imagesc(outim); >> colormap gray; 18 Slide credit: Kristen Grauman

Image gradient The gradient of an image: The gradient points in the direction of most rapid change in intensity The gradient direction (orientation of edge normal) is given by: The edge strength is given by the gradient magnitude 19 Slide credit: Steve Seitz

Effects of noise Consider a single row or column of the image Plotting intensity as a function of position gives a signal Where is the edge? 20 Slide credit: Steve Seitz

Where is the edge? Solution: smooth first Look for peaks in 21 Slide credit: Kristen Grauman

Derivative theorem of convolution Differentiation property of convolution. 22 Slide credit: Steve Seitz

Derivative of Gaussian filters 23 Slide credit: Kristen Grauman

Derivative of Gaussian filters x-direction y-direction 24 Slide credit: Svetlana Lazebnik

Derivative theorem of convolution 25 Slide credit: Steve Seitz

Laplacian of Gaussian Consider Laplacian of Gaussian operator Where is the edge?Zero-crossings of bottom graph 26 Slide credit: Steve Seitz

2D edge detection filters is the Laplacian operator: Laplacian of Gaussian Gaussianderivative of Gaussian 27 Slide credit: Steve Seitz

Smoothing with a Gaussian Recall: parameter σ is the “scale” / “width” / “spread” of the Gaussian kernel, and controls the amount of smoothing. … 28 Slide credit: Kristen Grauman

Effect of σ on derivatives The apparent structures differ depending on Gaussian’s scale parameter. Larger values: larger scale edges detected Smaller values: finer features detected σ = 1 pixel σ = 3 pixels 29 Slide credit: Kristen Grauman

So, what scale to choose? It depends what we’re looking for. 30 Slide credit: Kristen Grauman

Mask properties Smoothing –Values positive –Sum to 1  constant regions same as input –Amount of smoothing proportional to mask size –Remove “high-frequency” components; “low-pass” filter Derivatives –___________ signs used to get high response in regions of high contrast –Sum to ___  no response in constant regions –High absolute value at points of high contrast 31 Slide credit: Kristen Grauman

Seam carving: main idea [Shai & Avidan, SIGGRAPH 2007] 32 Slide credit: Kristen Grauman

Content-aware resizing Traditional resizing Seam carving: main idea [Shai & Avidan, SIGGRAPH 2007] 33 Slide credit: Kristen Grauman

Seam carving: main idea 34 Slide credit: Devi Parikh

Content-aware resizing Seam carving: main idea Intuition: Preserve the most “interesting” content  Prefer to remove pixels with low gradient energy To reduce or increase size in one dimension, remove irregularly shaped “seams”  Optimal solution via dynamic programming. 35 Slide credit: Kristen Grauman

Want to remove seams where they won’t be very noticeable: –Measure “energy” as gradient magnitude Choose seam based on minimum total energy path across image, subject to 8-connectedness. Seam carving: main idea 36 Slide credit: Kristen Grauman

37 Let a vertical seam s consist of h positions that form an 8-connected path. Let the cost of a seam be: Optimal seam minimizes this cost: Compute it efficiently with dynamic programming. Seam carving: algorithm s1s1 s2s2 s3s3 s4s4 s5s5 Slide credit: Kristen Grauman

How to identify the minimum cost seam? How many possible seams are there? First, consider a greedy approach: Energy matrix (gradient magnitude) 38 Slide credit: Adapted by Devi Parikh from Kristen Grauman

Seam carving: algorithm 39 Slide credit: Devi Parikh If I tell you the minimum cost over all seams starting at row 1 and ending at this point For every pixel in this row: M(i,j) What is the minimum cost over all seams starting at row 1 and ending here?

row i-1 Seam carving: algorithm Compute the cumulative minimum energy for all possible connected seams at each entry (i,j): Then, min value in last row of M indicates end of the minimal connected vertical seam. Backtrack up from there, selecting min of 3 above in M. j-1 j row i M matrix: cumulative min energy (for vertical seams) Energy matrix (gradient magnitude) j j+1 40 Slide credit: Kristen Grauman

Example Energy matrix (gradient magnitude) M matrix (for vertical seams) 41 Slide credit: Kristen Grauman

Example Energy matrix (gradient magnitude) M matrix (for vertical seams) 42 Slide credit: Kristen Grauman

Real image example Original Image Energy Map Blue = low energy Red = high energy 43 Slide credit: Kristen Grauman

Real image example 44 Slide credit: Kristen Grauman

Other notes on seam carving Analogous procedure for horizontal seams Can also insert seams to increase size of image in either dimension –Duplicate optimal seam, averaged with neighbors Other energy functions may be plugged in –E.g., color-based, interactive,… Can use combination of vertical and horizontal seams 45 Slide credit: Kristen Grauman

Results from Eunho Yang Example results from students at UT Austin 46 Slide credit: Kristen Grauman

Results from Suyog Jain 47 Slide credit: Kristen Grauman

Seam carving result Original image Results from Martin Becker Conventional resize 48 Slide credit: Kristen Grauman

Seam carving result Conventional resize Original image Results from Martin Becker 49 Slide credit: Kristen Grauman

Results from Jay Hennig Original image (599 by 799) Conventional resize (399 by 599) Seam carving (399 by 599) 50 Slide credit: Kristen Grauman

Results from Donghyuk Shin Removal of a marked object 51 Slide credit: Kristen Grauman

Removal of a marked object Results from Eunho Yang 52 Slide credit: Kristen Grauman

“Failure cases” with seam carving By Donghyuk Shin 53 Slide credit: Kristen Grauman

“Failure cases” with seam carving By Suyog Jain 54 Slide credit: Kristen Grauman

Topics overview Features & filters – Filters – Gradients – Edges Grouping & fitting Multiple views and motion Recognition Video processing 55 Slide credit: Kristen Grauman

Questions? See you Thursday!