Basic Algorithms for Digital Image Analysis: a course

Similar documents
Basic Algorithms for Digital Image Analysis: a course

Basic Algorithms for Digital Image Analysis: a course

Basic Algorithms for Digital Image Analysis: a course

Lecture 2 Image Processing and Filtering

What will we learn? Neighborhood processing. Convolution and correlation. Neighborhood processing. Chapter 10 Neighborhood Processing

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Computer Vision I - Filtering and Feature detection

Computer Vision I - Basics of Image Processing Part 1

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Dense 3D Reconstruction. Christiano Gava

Digital Image Processing. Prof. P. K. Biswas. Department of Electronic & Electrical Communication Engineering

Recall: Derivative of Gaussian Filter. Lecture 7: Correspondence Matching. Observe and Generalize. Observe and Generalize. Observe and Generalize

Depth. Common Classification Tasks. Example: AlexNet. Another Example: Inception. Another Example: Inception. Depth

Dense 3D Reconstruction. Christiano Gava

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

CSE 252B: Computer Vision II

Lecture 4: Spatial Domain Transformations

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

Correspondence and Stereopsis. Original notes by W. Correa. Figures from [Forsyth & Ponce] and [Trucco & Verri]

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

Basic relations between pixels (Chapter 2)

Image Restoration and Reconstruction

ME/CS 132: Introduction to Vision-based Robot Navigation! Low-level Image Processing" Larry Matthies"

Image processing and features

Digital Image Processing

Image Restoration and Reconstruction

Image Enhancement: To improve the quality of images

CoE4TN3 Medical Image Processing

Chapter 3: Intensity Transformations and Spatial Filtering

EE795: Computer Vision and Intelligent Systems

Interpolation is a basic tool used extensively in tasks such as zooming, shrinking, rotating, and geometric corrections.

Local features: detection and description. Local invariant features

x' = c 1 x + c 2 y + c 3 xy + c 4 y' = c 5 x + c 6 y + c 7 xy + c 8

CHAPTER 3 DISPARITY AND DEPTH MAP COMPUTATION

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

Filtering Images. Contents

Motivation. Gray Levels

Templates, Image Pyramids, and Filter Banks

Feature descriptors. Alain Pagani Prof. Didier Stricker. Computer Vision: Object and People Tracking

CS4733 Class Notes, Computer Vision

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

Lecture 4: Image Processing

Motivation. Intensity Levels

SUMMARY: DISTINCTIVE IMAGE FEATURES FROM SCALE- INVARIANT KEYPOINTS

Complex Sensors: Cameras, Visual Sensing. The Robotics Primer (Ch. 9) ECE 497: Introduction to Mobile Robotics -Visual Sensors

Lecture 3 - Intensity transformation

Range Imaging Through Triangulation. Range Imaging Through Triangulation. Range Imaging Through Triangulation. Range Imaging Through Triangulation

Hom o om o or o phi p c Processing

Corner Detection. GV12/3072 Image Processing.

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

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

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

Video Mosaics for Virtual Environments, R. Szeliski. Review by: Christopher Rasmussen

Stereo Wrap + Motion. Computer Vision I. CSE252A Lecture 17

PROCESS > SPATIAL FILTERS

2D Image Processing INFORMATIK. Kaiserlautern University. DFKI Deutsches Forschungszentrum für Künstliche Intelligenz

Babu Madhav Institute of Information Technology Years Integrated M.Sc.(IT)(Semester - 7)

Dietrich Paulus Joachim Hornegger. Pattern Recognition of Images and Speech in C++

Classification of image operations. Image enhancement (GW-Ch. 3) Point operations. Neighbourhood operation

Digital Image Procesing

Problems with template matching

2D Image Processing Feature Descriptors

Local Image preprocessing (cont d)

Last update: May 4, Vision. CMSC 421: Chapter 24. CMSC 421: Chapter 24 1

Local features: detection and description May 12 th, 2015

Image features. Image Features

Digital Image Processing. Image Enhancement - Filtering

EECS150 - Digital Design Lecture 14 FIFO 2 and SIFT. Recap and Outline

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

Vivekananda. Collegee of Engineering & Technology. Question and Answers on 10CS762 /10IS762 UNIT- 5 : IMAGE ENHANCEMENT.

Image restoration. Restoration: Enhancement:

CS 565 Computer Vision. Nazar Khan PUCIT Lectures 15 and 16: Optic Flow

Automatic Image Alignment (feature-based)

Bioimage Informatics. Lecture 8, Spring Bioimage Data Analysis (II): Point Feature Detection

Part 3: Image Processing

Image Processing. Filtering. Slide 1

Digital Image Processing

Why study Computer Vision?

Image Sampling and Quantisation

image filtration i Ole-Johan Skrede INF Digital Image Processing

Image Sampling & Quantisation

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

The SIFT (Scale Invariant Feature

SIFT - scale-invariant feature transform Konrad Schindler

Using temporal seeding to constrain the disparity search range in stereo matching

Feature Extraction and Image Processing, 2 nd Edition. Contents. Preface

Depth Sensors Kinect V2 A. Fornaser

Filtering Images in the Spatial Domain Chapter 3b G&W. Ross Whitaker (modified by Guido Gerig) School of Computing University of Utah

Computer Vision Course Lecture 04. Template Matching Image Pyramids. Ceyhun Burak Akgül, PhD cba-research.com. Spring 2015 Last updated 11/03/2015

Local Feature Detectors

Final Exam Study Guide

Digital Image Processing

Segmentation. (template) matching

Data Term. Michael Bleyer LVA Stereo Vision

EE795: Computer Vision and Intelligent Systems

Capturing, Modeling, Rendering 3D Structures

Lecture 6: Edge Detection

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

Comparative Analysis in Medical Imaging

Why is computer vision difficult?

Transcription:

Institute of Informatics Eötvös Loránd University Budapest, Hungary Basic Algorithms for Digital Image Analysis: a course Dmitrij Csetverikov with help of Attila Lerch, Judit Verestóy, Zoltán Megyesi, Zsolt Jankó http://visual.ipan.sztaki.hu

Lecture 5: Finding Patterns in Images Neighbourhood processing: A summary Adaptive neighbourhood selection Frequency domain: low-, high- and band-pass filters Matching and correspondence in computer vision Template matching Similarity and dissimilarity measures Interior matching versus contour matching Invariance Speed 2

Adaptive neighbourhood selection All filters considered up to now are non-adaptive (position-independent): Fixed neighbourhood selection procedure Fixed function that calculates output value Adaptivity: Using local context to improve performance of noise filters Goal: Avoid artefacts (undesirable effects) Averaging across edges by the mean filter Rounding of corners by the median filter Main cause of artefacts: Pixels belonging to different classes (distributions) are mixed by filter. 3

Basic idea: Try to separate object pixels from background pixels relevant greyvalues from noise How can we do this making the filter adaptive? Components of a noise filter: Neighborhood selection: Selecting relevant pixels in a vicinity of central pixel. Until now, we used all pixels of the window. Now, we are going to select certain pixels. Computation of the output value based on the selected relevant pixels Until now, we used fixed functions: mean, median, etc. This will not change. 4

Alternative ways of neighborhood selection in a n n window: Standard neighborhood: Use all n 2 pixels. k-nearest neighbors (knn): Select those k pixels that are closest in grey value to the central pixel. A possible value of k is k = n [ n 2] + (n 1) Example: For n = 3, k = 5 Sigma-nearest neighbors: select pixels i : I(i) I(c) < k σ ns Usually, k = 2. σ ns is the standard deviation of noise estimated in a flat (non-variyng) region of image. 5

Symmetric nearest neighbors: select i if I(i) I(c) < I(i s ) I(c) I(m): intensity of pixel m; c: central pixel; {i, i s }: symmetric pixels i c is Examples of symmetric pixel pairs in a window. Local context: intensity and geometry are taken into account. Useful in case of edges Selects pixels on the same side of an edge. Averaging across edge is avoided. 6

Original image Median filter 3 3 Median filter 5 5 Symmetr. box 5 5 Box filter 3 3 Box filter 5 5 Comparison of the median and the box filters for a greyscale image corrupted by the salt-and-pepper noise. The images are grey-scale normalised. 7

Frequency domain: low-, high- and band-pass filters u(m,n) Low-pass Spatial averaging High-pass - v LP(m,n) u(m,n) v u(m,n) LPF v (m,n) LPF + HP (m,n) h (m,n) + + h 1 2 Band-pass LPF (m,n) + BP - Block diagrams of low-, high- and band-pass filtering. Low-pass filter (LPF): Spatial averaging. High-pass filter: Weighted difference of the original image and an LPF. Band-pass filter: Weighted difference of two low-pass filters, LPF1 and LPF2. 8

E Low-pass E High-pass E Band-pass ω W W W ω ω 0 d 0 d 0 d Low-, high- and band-pass filtering: Typical shapes of filters in frequency domain E and spatial domain W. 9

Low-pass Fourier kernel E: Low frequencies (gradual variations) preserved or amplified, high frequencies (edges) suppressed. Spatial kernel W : Non-negative, monotonically decreasing with radius r = d. High-pass Fourier kernel E: High frequencies preserved or amplified, low frequencies suppressed. Spatial kernel W : Positive center (original image), negative wings (averaged image subtracted). Band-pass Fourier kernel E: A band of frequencies preserved or amplified, other frequencies suppressed. Spatial kernel W : Weighted difference of two low-pass filters. 10

Matching and correspondence in computer vision Image matching: Finding correspondences between two or more images. Basic tasks of computer vision related to matching: 1. Given images of a scene taken by different sensors, bring them into registration. This is called image registration. Typical example: Medical imaging Images obtained by sensors of different types are called modalities. 2. Given images of a scene taken at different times, find correspondences, displacements, or changes. This is motion analysis. Typical example: Motion tracking. 11

3. Given images of a scene taken from different positions, find correspondent points to obtain 3D information about the scene. This is stereopsis, or simply stereo. Matching provides disparity: the shift of a point between the two views By triangulation, disparity and baseline (distance between eyes) provide depth: the 3D distance to the point. Generalised stereo is called 3D scene reconstruction from multiple views. 4. Find places in an image or on a contour where it matches a given pattern. Template matching: Pattern specified by template. Feature detection: Feature specified by description. 5. Match two contours for object recognition, measurement, or positioning. This is contour matching. 12

Key issues of matching: Invariance under imaging transformations spatial photometric (intensity) Sensitivity to noise and distortions Considered in this course are: Tasks Task 4: Template matching and feature detection Task 5: Contour matching Transformations Spatial: 2D shift and rotation Photometric: Shift and scaling of intensity (linear) 13

Template matching Compare a subimage (template) w(r, c ) with an image f(r, c ) for all possible displacements (r, c). In other words: Match w(r, c ) against f(r + r, c + c ) for all (r, c). Measures of dissimilarity between image f and template w in position (r, c): D1 Sum of Square Differences (SSD): D(r, c) = (r,c ) W (r+r,c+c ) F { } 2 f(r + r, c + c ) w(r, c ) W : set of pixel positions in template w (template coordinates) F : set of pixel positions in image f (image coordinates) D(r, c) is not invariant under the following transformations 2D rotation Cannot find significantly rotated pattern Shift or scaling of intensity Cannot cope with any varying illumination 14

D2 Intensity shift-corrected SSD: δ(r, c) = (r,c ) W (r+r,c+c ) F {[ ] f(r + r, c + c ) f(r, c) [ ]} 2 w(r, c ) w f(r, c): Average value of image in region covered by template computed in each position (r, c) w: Average value of template computed only once δ(r, c) is a bit more sophisticated measure used to compensate for intensity shift due to uneven illumination. Handles changes in average level of signal Cannot handle changes in amplitude of signal 15

Measures of similarity between image f and template w in position (r, c): S1 Unnormalised cross-correlation (CC) of image f with template w: C un (r, c) = (r,c ) W (r+r,c+c ) F f(r + r, c + c ) w(r, c ) We have already studied the properties of cross-correlation and convolution. C un (r, c) is formally the same as filtering image f with mask w. Our knowledge of filters is applicable, including normalisation, separability, fast implementation, etc. C un (r, c) is not invariant under intensity shift and scaling. When w > 0 and f is large, C un (r, c) is large, independently from (dis)similarity between w and f. To compensate for this, a normalised version is used. 16

S2 Normalised cross-correlation (NCC), or correlation coefficient: C nr (r, c) = 1 ] [f(r + r, c + c ) f(r, c) Sf (r, c) S w [ ] w(r, c ) w where S f (r, c) = ] 2, [f(r + r, c + c ) f(r, c) Sw = [ ] 2 w(r, c ) w and for simplicity denotes (r,c ) W (r+r,c+c ) F S f (r, c) is computed in each position (r, c), S W is computed in only once. C nr (r, c) is invariant to any linear intensity transformation. If the average values are not subtracted, C nr (r, c) is only intensity scaleinvariant (scale-corrected). 17

S3 Modified normalised cross-correlation (MNCC): C mnr (r, c) = 1 [ ] f(r + r, c + c ) f(r, c) S f (r, c) + S w [ ] w(r, c ) w where as before S f (r, c) = ] 2, [f(r + r, c + c ) f(r, c) Sw = [ ] 2 w(r, c ) w C mnr is another normalisation: C nr is divided by Sf (r, c) S w C mnr is divided by S f (r, c) + S w C mnr is used instead of the standard C nr to avoid the numerically unstable division by a small number when S f (r, c) is small. (Small image variation.) Formally, C mnr is only shift-corrected. In practice, C mnr is reasonably insensitive to intensity scaling as well, since S w is constant and S f (r, c) + S w is roughly proportional to S f (r, c). 18

Template matching: Varying r and c, search for locations of high similarity C un (r, c), C nr (r, c), C mnr (r, c), or low dissimilarity D(r, c), δ(r, c). Left image Template, zoomed Right image NCC image NCC surface SDD image SDD surface Examples of matching in stereo pair. Pattern from left image is searched in right image. NCC is Normalised Cross-Correlation, SSD is Sum of Square Differences. 19