Professor Sebastian Thrun CAs: Dan Maynes-Aminzade and Mitul Saha

Slides:



Advertisements
Similar presentations
Foundations of Physics
Advertisements

Sliding Window Filters and Edge Detection Longin Jan Latecki Computer Graphics and Image Processing CIS 601 – Fall 2004.
Chapter 31 Images.
Light: Geometric Optics
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 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
Advanced Computer Vision Cameras, Lenses and Sensors.
Cameras (Reading: Chapter 1) Goal: understand how images are formed Camera obscura dates from 15 th century Basic abstraction is the pinhole camera Perspective.
Midterm Review CS485/685 Computer Vision Prof. Bebis.
Edge detection. Edge Detection in Images Finding the contour of objects in a scene.
Image Formation and Optics
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
MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute.
Sebastian Thrun CS223B Computer Vision, Winter Stanford CS223B Computer Vision, Winter 2005 Lecture 3 Filters and Features (with Matlab) Sebastian.
Segmentation (Section 10.2)
Sebastian Thrun & Jana Kosecka CS223B Computer Vision, Winter 2007 Stanford CS223B Computer Vision, Winter 2006 Lecture 2: Lenses and Vision Software.
Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Stanford CS223B Computer Vision, Winter 2007 Lecture 4 Camera Calibration Professors.
1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski CORNEA AQUEOUS HUMOR.
Lecture 2: Image filtering
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
Image Formation III Chapter 1 (Forsyth&Ponce) Cameras “Lenses”
Chapter 23 Mirrors and Lenses.
MSU CSE 803 Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute some result.
Linear Filtering About modifying pixels based on neighborhood. Local methods simplest. Linear means linear combination of neighbors. Linear methods simplest.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Imaging Science FundamentalsChester F. Carlson Center for Imaging Science Mirrors and Lenses.
Chapter 17 Optics 17.1 Reflection and Refraction
Basic Principles of Imaging and Photometry Lecture #2 Thanks to Shree Nayar, Ravi Ramamoorthi, Pat Hanrahan.
Sebastian Thrun CS223B Computer Vision, Winter Stanford CS223B Computer Vision, Winter 2006 Lecture 4 Camera Calibration Professor Sebastian Thrun.
Cameras Course web page: vision.cis.udel.edu/cv March 22, 2003  Lecture 16.
Neighborhood Operations
Sebastian Thrun CS223B Computer Vision, Winter Stanford CS223B Computer Vision, Winter 2005 Lecture 2 Lenses and Camera Calibration Sebastian Thrun,
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Physics 203/204 4: Geometric Optics Images formed by refraction Lens Makers Equation Thin lenses Combination of thin lenses Aberration Optical Instruments.
1Ellen L. Walker 3D Vision Why? The world is 3D Not all useful information is readily available in 2D Why so hard? “Inverse problem”: one image = many.
Cameras, lenses, and sensors 6.801/6.866 Profs. Bill Freeman and Trevor Darrell Sept. 10, 2002 Reading: Chapter 1, Forsyth & Ponce Optional: Section 2.1,
Image Formation III Chapter 1 (Forsyth&Ponce) Cameras “Lenses” Guido Gerig CS-GY 6643, Spring 2016 (slides modified from Marc Pollefeys, UNC Chapel Hill/
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
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Digital Image Processing CSC331
Sliding Window Filters Longin Jan Latecki October 9, 2002.
Spherical Aberration. Rays emanating from an object point that are incident on a spherical mirror or lens at different distances from the optical axis,
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
Miguel Tavares Coimbra
Acquisition of Images.
Linear Filters and Edges Chapters 7 and 8
CSE 185 Introduction to Computer Vision
Announcements Final is Thursday, March 20, 10:30-12:20pm
Edge Detection CS 678 Spring 2018.
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
Professor Sebastian Thrun CAs: Dan Maynes-Aminzade and Mitul Saha
17.2 Mirrors, Lenses, and Images
a kind of filtering that leads to useful features
Sebastian Thrun, Stanford Rick Szeliski, Microsoft
a kind of filtering that leads to useful features
Filtering Things to take away from this lecture An image as a function
Mirrors, Plane and Spherical Spherical Refracting Surfaces
Linear Operations Using Masks
Filtering An image as a function Digital vs. continuous images
IT472 Digital Image Processing
Presentation transcript:

Professor Sebastian Thrun CAs: Dan Maynes-Aminzade and Mitul Saha Stanford CS223B Computer Vision, Winter 2006 Lecture 2 Lenses, Filters, Features Professor Sebastian Thrun CAs: Dan Maynes-Aminzade and Mitul Saha [with slides by D Forsyth, D. Lowe, M. Polleyfeys, C. Rasmussen, G. Loy, D. Jacobs, J. Rehg, A, Hanson, G. Bradski,…]

Today’s Goals Thin Lens Aberrations Features 101 Linear Filters and Edge Detection

Pinhole Camera (last Wednesday) “shards of diamond” – those little pieces of beautiful truth scattered about. -- Brunelleschi, XVth Century Marc Pollefeys comp256, Lect 2

Snell’s Law Snell’s law n1 sin a1 = n2 sin a2

Thin Lens: Definition f optical axis focus Spherical lense surface: Parallel rays are refracted to single point

Thin Lens: Projection f z optical axis Image plane Spherical lense surface: Parallel rays are refracted to single point

Thin Lens: Projection f f z optical axis Image plane Spherical lense surface: Parallel rays are refracted to single point

Thin Lens: Properties Any ray entering a thin lens parallel to the optical axis must go through the focus on other side Any ray entering through the focus on one side will be parallel to the optical axis on the other side

Thin Lens: Model Q P O Fr Fl p R Z f f z

Transformation

A Transformation

The Thin Lens Law Q P O Fr Fl p R Z f f z

The Thin Lens Law

Limits of the Thin Lens Model 3 assumptions : all rays from a point are focused onto 1 image point Remember thin lens small angle assumption 2. all image points in a single plane 3. magnification is constant Deviations from this ideal are aberrations

Today’s Goals Thin Lens Aberrations Features 101 Linear Filters and Edge Detection

Aberrations 2 types : geometrical : geometry of the lense, small for paraxial rays chromatic : refractive index function of wavelength Marc Pollefeys

Geometrical Aberrations spherical aberration astigmatism distortion coma aberrations are reduced by combining lenses

Astigmatism Different focal length for inclined rays Marc Pollefeys

Astigmatism Different focal length for inclined rays Marc Pollefeys

Spherical Aberration rays parallel to the axis do not converge outer portions of the lens yield smaller focal lenghts

Can be corrected! (if parameters are know) Distortion magnification/focal length different for different angles of inclination pincushion (tele-photo) barrel (wide-angle) Can be corrected! (if parameters are know) Marc Pollefeys

Coma point off the axis depicted as comet shaped blob Marc Pollefeys

Chromatic Aberration rays of different wavelengths focused in different planes cannot be removed completely Marc Pollefeys

Vignetting Effect: Darkens pixels near the image boundary

CCD vs. CMOS Mature technology Specific technology Recent technology High production cost High power consumption Higher fill rate Blooming Sequential readout Recent technology Standard IC technology Cheap Low power Less sensitive Per pixel amplification Random pixel access Smart pixels On chip integration with other components Marc Pollefeys

Today’s Goals Thin Lens Aberrations Features 101 Linear Filters and Edge Detection

Today’s Question What is a feature? What is an image filter? How can we find corners? How can we find edges? (How can we find cars in images?)

What is a Feature? Local, meaningful, detectable parts of the image

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

(One Type of) Computer Vision Feature 1 Feature 2 : Feature N Image 2 Image 1 Feature 1 Feature 2 : Feature N Computer Vision Algorithm

Where Features Are Used Calibration Image Segmentation Correspondence in multiple images (stereo, structure from motion) Object detection, classification

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

Today’s Goals Features 101 Linear Filters and Edge Detection Canny Edge Detector

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

Quiz: How Can We Find Edges?

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); matlab colorbar colormap(gray(255)) colormap(default)

Edge Finding 101 Example of a linear Filter

Today’s Goals Thin Lens Aberrations Features 101 Linear Filters and Edge Detection

What is Image Filtering? Modify the pixels in an image based on some function of a local neighborhood of the pixels 10 5 3 4 1 7 7 Some function

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. 10 5 3 4 1 7 0.5 1.0 7 kernel

Linear Filter = Convolution g11 g11 I(i-1,j-1) I(.) g12 + g12 I(i-1,j) I(.) g13 + g13 I(i-1,j+1) + I(.) g21 g21 I(i,j-1) g22 + g22 I(i,j) I(.) I(.) g23 + g23 I(i,j+1) + I(.) g31 g31 I(i+1,j-1) I(.) g32 + g32 I(i+1,j) I(.) g33 + g33 I(i+1,j+1) f (i,j) =

Linear Filter = Convolution

Filtering Examples

Filtering Examples

Filtering Examples

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

Smoothing With Gaussian Averaging Gaussian Slide credit: Marc Pollefeys

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

Example of Blurring Image Blurred Image - =

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));

Scale Increased smoothing: Eliminates noise edges. Makes edges smoother and thicker. Removes fine detail.

The Edge Normal

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;

Separable Kernels

Combining Kernels / Convolutions 0.0030 0.0133 0.0219 0.0133 0.0030 0.0133 0.0596 0.0983 0.0596 0.0133 0.0219 0.0983 0.1621 0.0983 0.0219

Effect of Smoothing Radius 1 pixel 3 pixels 7 pixels

Robert’s Cross Operator 1 0 0 -1 0 1 -1 0 + S = [ I(x, y) - I(x+1, y+1) ]2 + [ I(x, y+1) - I(x+1, y) ]2 or S = | I(x, y) - I(x+1, y+1) | + | I(x, y+1) - I(x+1, y) |

Sobel Operator -1 -2 -1 0 0 0 1 2 1 -1 0 1 -2 0 2 S1= S2 = -1 -2 -1 0 0 0 1 2 1 -1 0 1 -2 0 2 S1= S2 = Edge Magnitude = Edge Direction = S1 + S1 2 tan-1 S1 S2

The Sobel Kernel, Explained Sobel kernel is separable! Averaging done parallel to edge

Sobel Edge Detector figure(6) edge(bw, 'sobel')

Robinson Compass Masks -1 0 1 -2 0 2 0 1 2 -1 0 1 -2 -1 0 1 2 1 0 0 0 -1 -2 -1 2 1 0 1 0 -1 0 -1 -2 2 0 -2 1 1 -1 -1 0 -1

Claim Your Own Kernel! Frei & Chen

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.