Sebastian Thrun CS223B Computer Vision, Winter 2005 1 Stanford CS223B Computer Vision, Winter 2005 Lecture 3 Filters and Features (with Matlab) Sebastian.

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.
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
Computer Vision Group Edge Detection Giacomo Boracchi 5/12/2007
Sebastian Thrun CS223B Computer Vision, Winter Stanford CS223B Computer Vision, Winter 2006 Lecture 3 More On Features Professor Sebastian Thrun.
Edge detection. Edge Detection in Images Finding the contour of objects in a scene.
Image processing. Image operations Operations on an image –Linear filtering –Non-linear filtering –Transformations –Noise removal –Segmentation.
EE663 Image Processing Edge Detection 2 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Computer Vision - A Modern Approach
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Lecture 3: Edge detection, continued
Segmentation (Section 10.2)
Filters and Edges. Zebra convolved with Leopard.
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.
3-D Computer Vision CSc Feature Detection and Grouping.
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.
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.
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Computer Vision : CISC 4/689 Sobel Edge Detection: Gradient Approximation Horizontal diff.Vertical diff Note anisotropy of edge.
Image Processing Edge detection Filtering: Noise suppresion.
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 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.
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.
Edges.
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout Edge Detection.
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.
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 5 CS 485 / 685 Computer Vision.
Lecture 8: Edges and Feature Detection
Digital Image Processing CSC331
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,
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
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.
Image Filtering Spatial filtering
Professor Sebastian Thrun CAs: Dan Maynes-Aminzade and Mitul Saha
Linear Filters and Edges Chapters 7 and 8
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.
Dr. Chang Shu COMP 4900C Winter 2008
a kind of filtering that leads to useful features
Sebastian Thrun, Stanford Rick Szeliski, Microsoft
Lecture 2: Edge detection
CSSE463: Image Recognition Day 6
CSSE463: Image Recognition Day 6
Lecture 2: Edge detection
Winter in Kraków photographed by Marcin Ryczek
IT472 Digital Image Processing
IT472 Digital Image Processing
Presentation transcript:

Sebastian Thrun CS223B Computer Vision, Winter Stanford CS223B Computer Vision, Winter 2005 Lecture 3 Filters and Features (with Matlab) Sebastian Thrun, Stanford Rick Szeliski, Microsoft Hendrik Dahlkamp, Stanford [with slides by D Forsyth, D. Lowe, M. Polleyfeys, C. Rasmussen, G. Loy, D. Jacobs, J. Rehg, A, Hanson, G. Bradski,…]

Sebastian Thrun CS223B Computer Vision, Winter Assignment 1 FAQ Compiling projects –cxcored.dll is the debug version of cxcore.dll, can be compiled from cxcore.dsp –Use template cvsample.dsp to get paths right Taking the images –Assignment change: out-of-focus images no longer needed –Don’t print a border around the chessboard

Sebastian Thrun CS223B Computer Vision, Winter Assignment 1 FAQ Corner finding –Supply correct parameters e.g. corner_count<>0 –Visualize corner ordering How to verify results –Backproject scene corners into image –Use common sense: etc

Sebastian Thrun CS223B Computer Vision, Winter Stanford CS223B Computer Vision, Winter 2005 Lecture 3 Filters and Features (with Matlab) Sebastian Thrun, Stanford Rick Szeliski, Microsoft Hendrik Dahlkamp, Stanford [with slides by D Forsyth, D. Lowe, M. Polleyfeys, C. Rasmussen, G. Loy, D. Jacobs, J. Rehg, A, Hanson, G. Bradski,…]

Sebastian Thrun CS223B Computer Vision, Winter Today’s Goals Features 101 Linear Filters and Edge Detection Canny Edge Detector

Sebastian Thrun CS223B Computer Vision, Winter Today’s Question What is a feature? What is an image filter? How can we find corners? How can we find edges?

Sebastian Thrun CS223B Computer Vision, Winter What is a Feature? Local, meaningful, detectable parts of the image

Sebastian Thrun CS223B Computer Vision, Winter Features in Computer Vision What is a feature? –Location of sudden change Why use features? –Information content high –Invariant to change of view point, illumination –Reduces computational burden

Sebastian Thrun CS223B Computer Vision, Winter (One Type of) Computer Vision Computer Vision Algorithm Feature 1 Feature 2 : Feature N Feature 1 Feature 2 : Feature N Image 2 Image 1

Sebastian Thrun CS223B Computer Vision, Winter Where Features Are Used Calibration Image Segmentation Correspondence in multiple images (stereo, structure from motion) Object detection, classification

Sebastian Thrun CS223B Computer Vision, Winter What Makes For Good Features? Invariance –View point (scale, orientation, translation) –Lighting condition –Object deformations –Partial occlusion Other Characteristics –Uniqueness –Sufficiently many –Tuned to the task

Sebastian Thrun CS223B Computer Vision, Winter Today’s Goals Features 101 Linear Filters and Edge Detection Canny Edge Detector

Sebastian Thrun CS223B Computer Vision, Winter Depth discontinuity Surface orientation discontinuity Reflectance discontinuity (i.e., change in surface material properties) Illumination discontinuity (e.g., shadow) Slide credit: Christopher Rasmussen What Causes an Edge?

Sebastian Thrun CS223B Computer Vision, Winter Quiz: How Can We Find Edges?

Sebastian Thrun CS223B Computer Vision, Winter Edge Finding 101 im = imread('bridge.jpg'); image(im); figure(2); bw = double(rgb2gray(im)); image(bw); gradkernel = [-1 1]; dx = abs(conv2(bw, gradkernel, 'same')); image(dx); colorbar; colormap gray [dx,dy] = gradient(bw); gradmag = sqrt(dx.^2 + dy.^2); image(gradmag); colorbar colormap(gray(255)) colormap(default) matlab

Sebastian Thrun CS223B Computer Vision, Winter Edge Finding 101 Example of a linear Filter

Sebastian Thrun CS223B Computer Vision, Winter What is Image Filtering? Modify the pixels in an image based on some function of a local neighborhood of the pixels Some function

Sebastian Thrun CS223B Computer Vision, Winter Linear Filtering Linear case is simplest and most useful –Replace each pixel with a linear combination of its neighbors. The prescription for the linear combination is called the convolution kernel kernel

Sebastian Thrun CS223B Computer Vision, Winter Linear Filter = Convolution g 22 + g 22 I(i,j) I(.) f (i,j) = I(.) g 12 + g 12 I(i-1,j) I(.) g 13 + g 13 I(i-1,j+1) + I(.) g 21 g 21 I(i,j-1) I(.) g 23 + g 23 I(i,j+1) + I(.) g 31 g 31 I(i+1,j-1) I(.) g 32 + g 32 I(i+1,j) I(.) g 33 + g 33 I(i+1,j+1) I(.) g 11 g 11 I(i-1,j-1)

Sebastian Thrun CS223B Computer Vision, Winter Linear Filter = Convolution

Sebastian Thrun CS223B Computer Vision, Winter Filtering Examples

Sebastian Thrun CS223B Computer Vision, Winter Filtering Examples

Sebastian Thrun CS223B Computer Vision, Winter Filtering Examples

Sebastian Thrun CS223B Computer Vision, Winter Image Smoothing With Gaussian figure(3); sigma = 3; width = 3 * sigma; support = -width : width; gauss2D = exp( - (support / sigma).^2 / 2); gauss2D = gauss2D / sum(gauss2D); smooth = conv2(conv2(bw, gauss2D, 'same'), gauss2D', 'same'); image(smooth); colormap(gray(255)); gauss3D = gauss2D ' * gauss2D; tic ; smooth = conv2(bw,gauss3D, ' same ' ); toc

Sebastian Thrun CS223B Computer Vision, Winter Slide credit: Marc Pollefeys Smoothing With Gaussian GaussianAveraging

Sebastian Thrun CS223B Computer Vision, Winter Smoothing Reduces Noise The effects of smoothing Each row shows smoothing with gaussians of different width; each column shows different realizations of an image of gaussian noise. Slide credit: Marc Pollefeys

Sebastian Thrun CS223B Computer Vision, Winter Example of Blurring ImageBlurred Image -=

Sebastian Thrun CS223B Computer Vision, Winter Edge Detection With Smoothed Images figure(4); [dx,dy] = gradient(smooth); gradmag = sqrt(dx.^2 + dy.^2); gmax = max(max(gradmag)); imshow(gradmag); colormap(gray(gmax));

Sebastian Thrun CS223B Computer Vision, Winter Scale Increased smoothing: Eliminates noise edges. Makes edges smoother and thicker. Removes fine detail.

Sebastian Thrun CS223B Computer Vision, Winter The Edge Normal

Sebastian Thrun CS223B Computer Vision, Winter Displaying the Edge Normal figure(5); hold on; image(smooth); colormap(gray(255)); [m,n] = size(gradmag); edges = (gradmag > 0.3 * gmax); inds = find(edges); [posx,posy] = meshgrid(1:n,1:m); posx2=posx(inds); posy2=posy(inds); gm2= gradmag(inds); sintheta = dx(inds)./ gm2; costheta = - dy(inds)./ gm2; quiver(posx2,posy2, gm2.* sintheta / 10, -gm2.* costheta / 10,0); hold off;

Sebastian Thrun CS223B Computer Vision, Winter Separable Kernels

Sebastian Thrun CS223B Computer Vision, Winter Combining Kernels / Convolutions

Sebastian Thrun CS223B Computer Vision, Winter Effect of Smoothing Radius 1 pixel3 pixels7 pixels

Sebastian Thrun CS223B Computer Vision, Winter Robert’s Cross Operator or | I(x, y) - I(x+1, y+1) | + | I(x, y+1) - I(x+1, y) | [ I(x, y) - I(x+1, y+1) ] 2 + [ I(x, y+1) - I(x+1, y) ] 2 S =

Sebastian Thrun CS223B Computer Vision, Winter Sobel Operator S1=S1=S 2 = Edge Magnitude = Edge Direction = S 1 + S tan -1 S1S1 S2S2

Sebastian Thrun CS223B Computer Vision, Winter The Sobel Kernel, Explained Sobel kernel is separable! Averaging done parallel to edge

Sebastian Thrun CS223B Computer Vision, Winter Sobel Edge Detector figure(6) edge(bw, 'sobel')

Sebastian Thrun CS223B Computer Vision, Winter Robinson Compass Masks

Sebastian Thrun CS223B Computer Vision, Winter Claim Your Own Kernel! Frei & Chen

Sebastian Thrun CS223B Computer Vision, Winter Comparison (by Allan Hanson) Analysis based on a step edge inclined at an angle q (relative to y- axis) through center of window. Robinson/Sobel: true edge contrast less than 1.6% different from that computed by the operator. Error in edge direction –Robinson/Sobel: less than 1.5 degrees error –Prewitt: less than 7.5 degrees error Summary –Typically, 3 x 3 gradient operators perform better than 2 x 2. –Prewitt2 and Sobel perform better than any of the other 3x3 gradient estimation operators. –In low signal to noise ratio situations, gradient estimation operators of size larger than 3 x 3 have improved performance. –In large masks, weighting by distance from the central pixel is beneficial.

Sebastian Thrun CS223B Computer Vision, Winter Today’s Goals Features 101 Linear Filters and Edge Detection Canny Edge Detector

Sebastian Thrun CS223B Computer Vision, Winter Canny Edge Detector figure(7) edge(bw, 'canny')

Sebastian Thrun CS223B Computer Vision, Winter Canny Edge Detection Steps: 1.Apply derivative of Gaussian 2.Non-maximum suppression Thin multi-pixel wide “ridges” down to single pixel width 3.Linking and thresholding Low, high edge-strength thresholds Accept all edges over low threshold that are connected to edge over high threshold

Sebastian Thrun CS223B Computer Vision, Winter Non-Maximum Supression Non-maximum suppression: Select the single maximum point across the width of an edge.

Sebastian Thrun CS223B Computer Vision, Winter Linking to the Next Edge Point Assume the marked point is an edge point. Take the normal to the gradient at that point and use this to predict continuation points (either r or s).

Sebastian Thrun CS223B Computer Vision, Winter 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 Typical ratio of thresholds is roughly k high / k low = 2

Sebastian Thrun CS223B Computer Vision, Winter Canny Edge Detection (Example) courtesy of G. Loy gap is gone Original image Strong edges only Strong + connected weak edges Weak edges

Sebastian Thrun CS223B Computer Vision, Winter Canny Edge Detection (Example) Using Matlab with default thresholds

Sebastian Thrun CS223B Computer Vision, Winter Application: Road Finding (add roadrunner video here)

Sebastian Thrun CS223B Computer Vision, Winter Corner Effects

Sebastian Thrun CS223B Computer Vision, Winter Today’s Goals Features 101 Linear Filters and Edge Detection Canny Edge Detector