Computer Vision I - Filtering and Feature detection

Similar documents
Computer Vision I - Basics of Image Processing Part 2

Computer Vision I - Basics of Image Processing Part 1

Computer Vision I - Algorithms and Applications: Basics of Image Processing

Obtaining Feature Correspondences

Feature Based Registration - Image Alignment

Prof. Feng Liu. Spring /26/2017

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Motion Estimation and Optical Flow Tracking

CS4733 Class Notes, Computer Vision

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

Local Image Features

Peripheral drift illusion

Outline 7/2/201011/6/

Image processing and features

CS5670: Computer Vision

Computer Vision for HCI. Topics of This Lecture

Edge and corner detection

Feature Tracking and Optical Flow

EE795: Computer Vision and Intelligent Systems

Image Processing. Filtering. Slide 1

Computer Vision I. Dense Stereo Correspondences. Anita Sellent 1/15/16

BSB663 Image Processing Pinar Duygulu. Slides are adapted from Selim Aksoy

Local invariant features

Filtering Images. Contents

Local Image Features

Local Feature Detectors

Corner Detection. GV12/3072 Image Processing.

Augmented Reality VU. Computer Vision 3D Registration (2) Prof. Vincent Lepetit

Local features: detection and description. Local invariant features

Perception. Autonomous Mobile Robots. Sensors Vision Uncertainties, Line extraction from laser scans. Autonomous Systems Lab. Zürich.

Announcements. Edge Detection. An Isotropic Gaussian. Filters are templates. Assignment 2 on tracking due this Friday Midterm: Tuesday, May 3.

Edge Detection (with a sidelight introduction to linear, associative operators). Images

Feature Matching and Robust Fitting

SUMMARY: DISTINCTIVE IMAGE FEATURES FROM SCALE- INVARIANT KEYPOINTS

Image matching. Announcements. Harder case. Even harder case. Project 1 Out today Help session at the end of class. by Diva Sian.

SIFT: SCALE INVARIANT FEATURE TRANSFORM SURF: SPEEDED UP ROBUST FEATURES BASHAR ALSADIK EOS DEPT. TOPMAP M13 3D GEOINFORMATION FROM IMAGES 2014

Local Image preprocessing (cont d)

Lecture 4: Spatial Domain Transformations

Announcements. Edges. Last Lecture. Gradients: Numerical Derivatives f(x) Edge Detection, Lines. Intro Computer Vision. CSE 152 Lecture 10

Dense Image-based Motion Estimation Algorithms & Optical Flow

School of Computing University of Utah

Lecture 10 Detectors and descriptors

Filtering and Enhancing Images

Automatic Image Alignment (feature-based)

EECS 556 Image Processing W 09. Image enhancement. Smoothing and noise removal Sharpening filters

CS 4495 Computer Vision Motion and Optic Flow

Wikipedia - Mysid

Anno accademico 2006/2007. Davide Migliore

CS 4495 Computer Vision A. Bobick. CS 4495 Computer Vision. Features 2 SIFT descriptor. Aaron Bobick School of Interactive Computing

Midterm Wed. Local features: detection and description. Today. Last time. Local features: main components. Goal: interest operator repeatability

Filtering and Edge Detection. Computer Vision I. CSE252A Lecture 10. Announcement

Edge and local feature detection - 2. Importance of edge detection in computer vision

Local features: detection and description May 12 th, 2015

Chapter 3 Image Registration. Chapter 3 Image Registration

Motion illusion, rotating snakes

EECS 556 Image Processing W 09

Computer Vision I. Announcement. Corners. Edges. Numerical Derivatives f(x) Edge and Corner Detection. CSE252A Lecture 11

Automatic Image Alignment

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Feature Tracking and Optical Flow

Multi-stable Perception. Necker Cube

Automatic Image Alignment (direct) with a lot of slides stolen from Steve Seitz and Rick Szeliski

Harder case. Image matching. Even harder case. Harder still? by Diva Sian. by swashford

Optical flow and tracking

Feature Detection and Matching

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

Automatic Image Alignment

Building a Panorama. Matching features. Matching with Features. How do we build a panorama? Computational Photography, 6.882

Chapter 3: Intensity Transformations and Spatial Filtering

Local Features: Detection, Description & Matching

Image features. Image Features

Image Features. Work on project 1. All is Vanity, by C. Allan Gilbert,

Other Linear Filters CS 211A

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Segmentation and Grouping

Local features and image matching. Prof. Xin Yang HUST

Edge detection. Goal: Identify sudden. an image. Ideal: artist s line drawing. object-level knowledge)

Digital Image Processing (CS/ECE 545) Lecture 5: Edge Detection (Part 2) & Corner Detection

Introduction. Introduction. Related Research. SIFT method. SIFT method. Distinctive Image Features from Scale-Invariant. Scale.

Motion Estimation. There are three main types (or applications) of motion estimation:

The SIFT (Scale Invariant Feature

A NEW FEATURE BASED IMAGE REGISTRATION ALGORITHM INTRODUCTION

Feature Detection. Raul Queiroz Feitosa. 3/30/2017 Feature Detection 1

Lecture: RANSAC and feature detectors

CS 556: Computer Vision. Lecture 3

Image Analysis - Lecture 5

Image Processing. Image Features

Scale Invariant Feature Transform

Lecture 7: Most Common Edge Detectors

3D from Photographs: Automatic Matching of Images. Dr Francesco Banterle

Lecture 2 Image Processing and Filtering

521466S Machine Vision Assignment #3 Image Features

SIFT - scale-invariant feature transform Konrad Schindler

Object Recognition with Invariant Features

Robert Collins CSE598G. Intro to Template Matching and the Lucas-Kanade Method

Feature Detectors and Descriptors: Corners, Lines, etc.

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

CS4670: Computer Vision

Evaluation and comparison of interest points/regions

Transcription:

Computer Vision I - Filtering and Feature detection Carsten Rother 30/10/2015 Computer Vision I: Basics of Image Processing

Roadmap: Basics of Digital Image Processing Computer Vision I: Basics of Image Processing 30/10/2015 2 What is an Image? Point operators (ch. 3.1) Filtering: (ch. 3.2, ch 3.3, ch. 3.4) Linear filtering Non-linear filtering Edges detection (ch. 4.2) Interest Point detection (ch. 4.1.1)

Reminder: Convolution Computer Vision I: Basics of Image Processing 30/10/2015 3 Replace each pixel by a linear combination of its neighbours and itself 2D convolution (discrete) g = f h Centred at 0,0 f x, y h x, y g x, y g x, y = k,l f x k, y l h k, l the image f is implicitly mirrored

Reminder: Application: Noise removal Computer Vision I: Basics of Image Processing 30/10/2015 4 Noise is what we are not interested in: Sensor noise (Gaussian, shot noise), quantisation artefacts, light fluctuation, etc. Typical assumption is that the noise is not correlated between pixels Basic Idea: neighbouring pixel contain information about intensity

Reminder: Gaussian (Smoothing) Filters Computer Vision I: Basics of Image Processing 30/10/2015 5 Nearby pixels are weighted more than distant pixels Isotropic Gaussian (rotational symmetric)

The box filter does noise removal Computer Vision I: Basics of Image Processing 30/10/2015 6 Box filter takes the mean in a neighbourhood Image Noise Pixel-independent Gaussian noise added Filtered Image

Derivation of the Box Filter Computer Vision I: Basics of Image Processing 30/10/2015 7 y r is true gray value (color) x r observed gray value (color) Noise model: Gaussian noise p x r y r ) = N x r ; y r, σ ~ exp[ x r y r 2 2σ 2 ] y r x r

Computer Vision I: Basics of Image Processing 30/10/2015 8 Derivation of Box Filter Further assumption: independent noise p x y) ~ exp[ x r y r 2 2σ 2 ] r Find the most likely solution for the true signal y Maximum-Likelihood principle (probability maximization): posterior likelihood y = argmax y p y x) = argmax y p x y p y p(x) p(x) is a constant (drop it), assume (for now) uniform prior p(y). We get: p y x) = p x y exp[ x r y r 2 2σ 2 ] r the solution is trivial: y r = x r for all r Comments: 1) ~ means equal up to scale (i.e. 5x ~ x) 2) a 2 = a 2 2 = a 2 (i.e. squared L2 norm) 3) a is norm of a (i.e. L1 norm) prior additional assumptions about the signal y are necessary!!!

Derivation of Box Filter Computer Vision I: Basics of Image Processing 30/10/2015 9 Assumption: not uniform prior p y but in a small vicinity the true signal is nearly constant Maximum-a-posteriori: For one pixel r : p y x) exp[ x r y r 2 2σ 2 ] r y r = argmax yr exp[ x r y r 2 2σ 2 ] Only one y r in a window W(r) take neg. logarithm: y r = argmin yr x r y r 2 2σ 2 Note, Log-function is monotonically increasing hence minimum does not change, i.e. x 1 < x 2 then log x 1 < log x 2

Derivation of Box Filter Computer Vision I: Basics of Image Processing 30/10/2015 10 Let us minimize: y r = argmin yr x r y r 2 factor 1/2σ 2 is irrelevant Take derivative and set to 0: F y r = x r y r 2 W means number of pixel in window W F y r = 2 r x r y r = 2 (! x r W y r ) = 0 r y r (the average) Box filter is optimal under pixel-independent, Gaussian Noise assumption and assuming that the signal is constant in a window.

Roadmap: Basics of Digital Image Processing Computer Vision I: Basics of Image Processing 30/10/2015 11 What is an Image? Point operators (ch. 3.1) Filtering: (ch. 3.2, ch 3.3, ch. 3.4) Linear filtering Non-linear filtering Edges detection (ch. 4.2) Interest Point detection (ch. 4.1.1)

Non-linear filters Computer Vision I: Basics of Image Processing 30/10/2015 12 There are many different non-linear filters. (see Image Processing in SS16) We only look at the Median filter, Bilateral filter and Joint Bilateral Filter

Shot noise (Salt and Pepper Noise) Computer Vision I: Basics of Image Processing 30/10/2015 13 Gaussian filtered Original + shot noise (a random number of independent pixels have a random value) Median filtered

Another example Computer Vision I: Basics of Image Processing 30/10/2015 14 Original Noisy Mean Median

Median Filter Computer Vision I: Basics of Image Processing 30/10/2015 15 Replace each pixel with the median in a neighbourhood: 5 6 5 5 6 5 4 20 5 4 5 5 4 6 5 4 6 5 median Median filter: order the values and take the middle one No strong smoothing effect since values are not averaged Very good to remove outliers (shot noise) Used a lot for post processing of outputs (e.g. optical flow)

Median Filter: Derivation Computer Vision I: Basics of Image Processing 30/10/2015 16 Reminder, for Gaussian noise we did solve the following Maximum Likelihood Estimation Problem: y r = argmax yr exp[ x r y r 2 p y x) 2σ 2 ] = argmin yr x r y r 2 = 1/ W x r median mean Mean and median are quite Different For Median we solve the following problem: y r = argmax yr exp[ x (see next slide) r y r 2σ 2 ] = argmin yr x r y r = Median (W r ) This is a different noise distribution than Gaussian.

Median Filter Derivation Computer Vision I: Basics of Image Processing 30/10/2015 17 function: minimize the following: F y r = x r y r Problem: not differentiable, good news: it is convex Optimal solution is the median of all values

Bilateral Filter Computer Vision I: Basics of Image Processing 30/10/2015 18 More sharp Original + Gaussian noise Gaussian filtered Bilateral filtered Edge over-smoothed Edge not over-smoothed

Bilateral Filter in Pictures Computer Vision I: Basics of Image Processing 30/10/2015 19 Gaussian Filter weights Output (sketched) Centre pixel Noisy input Bilateral Filter weights Output

Bilateral Filter in equations Computer Vision I: Basics of Image Processing 30/10/2015 20 Filters looks at: a) distance to surrounding pixels (as Gaussian) b) Intensity of surrounding pixels Linear combination Same as Gaussian filter Consider intensity Problem: computation is slow O Nw ; approximations can be done in O(N) Comment: Guided filter is similar and can be computed exactly in O(N) See a tutorial on: http://people.csail.mit.edu/sparis/bf_course/

Application: Bilateral Filter Computer Vision I: Basics of Image Processing 30/10/2015 21 Cartoonization HDR compression (Tone mapping)

Joint Bilateral Filter Computer Vision I: Basics of Image Processing 30/10/2015 22 ~ ~ Same as Gaussian Consider intensity f is the input image which is processed ~ f is a guidance image where we look for pixel similarity

Application: Combine Flash and No-Flash Computer Vision I: Basics of Image Processing 30/10/2015 23 input image f ~ Guidance image f Joint Bilateral Filter ~ ~ We don t care about absolute colors [Petschnigg et al. Siggraph 04]

Reminder: Model versus Algorithm Computer Vision I: Introduction 30/10/2015 24 Example: Interactive Image Segmentation Goal z = R, G, B n x = 0,1 n Given z; derive binary x: Model: Energy function E x = i θ i x i + i,j θ ij (x i, x j ) Algorithm to minimization: x = argmin x E(x)

Filtering for Binary Segmentation Computer Vision I: Introduction 30/10/2015 25 New query image z i θ i (x i = 0) θ i (x i = 1) Dark means likely background Dark means likely foreground Optimum with unary terms only

Filtering for Binary Segmentation Computer Vision I: Basics of Image Processing 30/10/2015 26 Ratio Image θ i x i =1 θ i (x i =0) is the Input Image f Filtered Ratio Image ~ Guidance Input Image f (also shown user brush strokes) Results are very similar: This is an alternative to energy minimization This can also be done for stereo, etc. Cost Volume filtering (Winner takes all Result) Energy minimization [C. Rhemann, A. Hosni, M. Bleyer, C. Rother, and M. Gelautz, Fast Cost- Volume Filtering for Visual Correspondence and Beyond, CVPR 11]

Roadmap: Basics of Digital Image Processing Computer Vision I: Basics of Image Processing 30/10/2015 27 What is an Image? Point operators (ch. 3.1) Filtering: (ch. 3.2, ch 3.3, ch. 3.4) Linear filtering Non-linear filtering Edges detection (ch. 4.2) Interest Point detection (ch. 4.1.1)

Idealized edge types Computer Vision I: Basics of Image Processing 30/10/2015 28 We focus on this

What are edges? Computer Vision I: Basics of Image Processing 30/10/2015 29 Corresponds to fast changes in the image The magnitude of the derivative is large Image of 2 step edges Image of 2 ramp edges Slice through the image Slice through the image

What are fast changes in the image? Computer Vision I: Basics of Image Processing 30/10/2015 30 Texture or many edges? Scanline 250 Image Edges defined after smoothing Scanline 250 smoothed with Gausian

Edges and Derivatives Computer Vision I: Basics of Image Processing 30/10/2015 31 We will look at this mainly

Edge filters in 1D Computer Vision I: Basics of Image Processing 30/10/2015 32 We can implement this as a linear filter: Forward differences: 1/2-1 1 Central differences: 1/2-1 0 1

Reminder: Seperable Filters Computer Vision I: Basics of Image Processing 30/10/2015 33 1 4 1 2 1 This is the centralized difference-operator

Edge Filter in 1D: Example Computer Vision I: Basics of Image Processing 30/10/2015 34 Based on 1st derivative Smooth with Gaussian to filter out noise Calculate derivative Find its optima

Edge Filtering in 1D Computer Vision I: Basics of Image Processing 30/10/2015 35 Simplification: (saves one operation) Derivative of Gaussian

Edge Filtering in 2D Computer Vision I: Basics of Image Processing 30/10/2015 36

Edge Filter in 2D: Example Computer Vision I: Basics of Image Processing 30/10/2015 37 y x

Edge Filter in 2D Computer Vision I: Basics of Image Processing 30/10/2015 38 x-derivatives with different Gaussian smoothing

What is a gradient Computer Vision I: Basics of Image Processing 30/10/2015 39

What is a gradient Computer Vision I: Basics of Image Processing 30/10/2015 40

What is a gradient Computer Vision I: Basics of Image Processing 30/10/2015 41

What is a Gradient Computer Vision I: Basics of Image Processing 30/10/2015 42

Example Gradient magnitude image Computer Vision I: Basics of Image Processing 30/10/2015 43 First smoothed with Gaussian First smoothed with broad Gaussian In Image Processing Lecture we look at how to get edge chains?

Half-way Slide Computer Vision I: Basics of Image Processing 30/10/2015 44 3 minutes break

Roadmap: Basics of Digital Image Processing Computer Vision I: Basics of Image Processing 30/10/2015 45 What is an Image? Point operators (ch. 3.1) Filtering: (ch. 3.2, ch 3.3, ch. 3.4) Linear filtering Non-linear filtering Edges detection (ch. 4.2) Interest Point detection (ch. 4.1.1)

What region should we try to match? Computer Vision I: Basics of Image Processing 30/10/2015 46 We want to find a few regions where this image pair matches (applications later) Look for a region that is unique, i.e. not ambiguous

Goal: Interest Point Detection Computer Vision I: Basics of Image Processing 30/10/2015 47 Goal: predict a few interest points in order to remove redundant data efficiently Should be invariant against: a. Geometric transformation scaling, rotation, translation, affine transformation, projective transformation etc. b. Color transformation additive (lightning change), multiplicative (contrast), linear (both), monotone etc.; c. Discretization (e.g. spatial resolution, focus);

Points versus Lines Computer Vision I: Basics of Image Processing 30/10/2015 48 Apeture problem Lines are not as good as points?

Harris Corner Detector Basic Idea Computer Vision I: Basics of Image Processing 30/10/2015 49 Local measure of feature uniqueness: Shifting the window in any direction: How does it change? [Szeliski and Seitz]

Harris Corner Detector Computer Vision I: Basics of Image Processing 30/10/2015 50 How similar is a local window with its neighbor? Auto-correlation function: Δy W (x, y) Δx is a small window around is a convolution kernel and used to decrease the influence of pixels far from, e.g. with Gaussian For simplicity we use for now = 1.

Harris Corner Detector Computer Vision I: Basics of Image Processing 30/10/2015 51 One is interested in properties of at each position We could evaluate for all discrete shifts = +/-1. But we would like to do smaller shifts and have a fast method. Let us look at a linear approximation of Taylor expansion around, i.e. the + ε(δx, Δy) Gradient at (u, v)

Reminder: Taylor Expansion Computer Vision I: Basics of Image Processing 30/10/2015 52 A function f(x) is approximated by: f x ~ n f n a n! x a n The approximation is most accurate at point a

Harris Corner Detector Computer Vision I: Basics of Image Processing 30/10/2015 53 Put it together: with Q is call the Structure Tensor We compute this at any image location (x, y)

Harris Corner Detector Computer Vision I: Basics of Image Processing 30/10/2015 54 The auto-correlation function Function c is (after approximation) a quadratic function in Isolines are ellipses ( is symmetric and positive definite) Eigenvector x 1 with (larger) Eigenvalue λ 1 is the direction of fastest change in function c Eigenvector x 2 with (smaller) Eigenvalue λ 2 is direction of slowest change in function c and x 2 Δx Δy x 1 Function c Note c = 0 for Δx = Δy = 0

Computer Vision I: Basics of Image Processing 30/10/2015 55 Harris Corner Detector Some examples isolines for : (a) Flat (b) Edges (c) Corners a. Homogenous regions: both -s are small b. Edges: one is small the other one is large c. Corners: both -s are large (this is what we are looking for!)

Harris Corner Detector Computer Vision I: Basics of Image Processing 30/10/2015 56 Image λ 1 (larger eigenvalue) λ 2 (smaller eigenvalue) Zoom in

Computer Vision I: Basics of Image Processing 30/10/2015 57 Harris Corner Detector Cornerness is a characteristic of Proposition by Harris: Downweights edges where λ 1 λ 2 Harris Value Smallest eigenvalue

Harris Corners - Example Computer Vision I: Basics of Image Processing 30/10/2015 58

H-score (red- high, blue - low) Computer Vision I: Basics of Image Processing 30/10/2015 59

Threshold (H-score > value) Computer Vision I: Basics of Image Processing 30/10/2015 60

Non-maximum suppression Computer Vision I: Basics of Image Processing 30/10/2015 61 (all points are set to 0 for which a higher H-score in a window-neighborhood exists)

Harris Corners in Red Computer Vision: Algorithms and Applications -- 30/10/2015 62

Other examples Computer Vision I: Basics of Image Processing 30/10/2015 63

Maximally stable extremal regions Computer Vision I: Basics of Image Processing 30/10/2015 64 Invariant to affine transformation of gray-values Both small and large structures are detected

Literature Computer Vision I: Basics of Image Processing 30/10/2015 65 There is a large body of literature on detectors and descriptors (later lecture) A comparison paper (e.g. what is the most robust corner detectors): K. Mikolajczyk, T. Tuytelaars, C. Schmid, A. Zisserman, J. Matas, F. Schaffalitzky, T. Kadir: A Comparison of Affine Region Detectors (IJCV 2006)