CS534 Introduction to Computer Vision. Linear Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Similar documents
Matlab (see Homework 1: Intro to Matlab) Linear Filters (Reading: 7.1, ) Correlation. Convolution. Linear Filtering (warm-up slide) R ij

Digital Image Processing

Digital Imaging and Multimedia Point Operations in Digital Images. Ahmed Elgammal Dept. of Computer Science Rutgers University

Image Processing for feature extraction

CoE4TN4 Image Processing. Chapter 3: Intensity Transformation and Spatial Filtering

Prof. Feng Liu. Winter /10/2019

Image filtering, image operations. Jana Kosecka

Image Filtering. Median Filtering

Image features: Histograms, Aliasing, Filters, Orientation and HOG. D.A. Forsyth

Motivation: Image denoising. How can we reduce noise in a photograph?

Image Processing COS 426

Images and Filters. EE/CSE 576 Linda Shapiro

>>> from numpy import random as r >>> I = r.rand(256,256);

Motivation: Image denoising. How can we reduce noise in a photograph?

Computer Vision, Lecture 3

Image Enhancement. DD2423 Image Analysis and Computer Vision. Computational Vision and Active Perception School of Computer Science and Communication

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

Vision Review: Image Processing. Course web page:

Color Space 1: RGB Color Space. Color Space 2: HSV. RGB Cube Easy for devices But not perceptual Where do the grays live? Where is hue and saturation?

>>> from numpy import random as r >>> I = r.rand(256,256);

Announcements. Image Processing. What s an image? Images as functions. Image processing. What s a digital image?

Image Filtering in Spatial domain. Computer Vision Jia-Bin Huang, Virginia Tech

CS 4501: Introduction to Computer Vision. Filtering and Edge Detection

Table of contents. Vision industrielle 2002/2003. Local and semi-local smoothing. Linear noise filtering: example. Convolution: introduction

Image analysis. CS/CME/BIOPHYS/BMI 279 Fall 2015 Ron Dror

Image analysis. CS/CME/BioE/Biophys/BMI 279 Oct. 31 and Nov. 2, 2017 Ron Dror

Filtering in the spatial domain (Spatial Filtering)

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Image analysis. CS/CME/BioE/Biophys/BMI 279 Oct. 31 and Nov. 2, 2017 Ron Dror

Image Filtering and Gaussian Pyramids

CS6670: Computer Vision Noah Snavely. Administrivia. Administrivia. Reading. Last time: Convolution. Last time: Cross correlation 9/8/2009

Computer Graphics Fundamentals

Image Processing. Adam Finkelstein Princeton University COS 426, Spring 2019

Digital Image Processing

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

Practical Image and Video Processing Using MATLAB

Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Image Enhancement in spatial domain. Digital Image Processing GW Chapter 3 from Section (pag 110) Part 2: Filtering in spatial domain

Digital Image Processing

Motion illusion, rotating snakes

Non Linear Image Enhancement

Overview. Neighborhood Filters. Dithering

Image processing for gesture recognition: from theory to practice. Michela Goffredo University Roma TRE

02/02/10. Image Filtering. Computer Vision CS 543 / ECE 549 University of Illinois. Derek Hoiem

A Spatial Mean and Median Filter For Noise Removal in Digital Images

Image Filtering. Reading Today s Lecture. Reading for Next Time. What would be the result? Some Questions from Last Lecture

Filip Malmberg 1TD396 fall 2018 Today s lecture

CSCI 1290: Comp Photo

קורס גרפיקה ממוחשבת 2008 סמסטר ב' Image Processing 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור

Midterm Examination CS 534: Computational Photography

Image preprocessing in spatial domain

CAP 5415 Computer Vision. Marshall Tappen Fall Lecture 1

ECC419 IMAGE PROCESSING

Computer Vision. Howie Choset Introduction to Robotics

Frequency Domain Enhancement

Sampling and Reconstruction

On the evaluation of edge preserving smoothing filter

An Efficient Color Image Segmentation using Edge Detection and Thresholding Methods

30 lesions. 30 lesions. false positive fraction

Preparing Remote Sensing Data for Natural Resources Mapping (image enhancement, rectifications )

Image Processing. What is an image? קורס גרפיקה ממוחשבת 2008 סמסטר ב' Converting to digital form. Sampling and Reconstruction.

Image Enhancement using Histogram Equalization and Spatial Filtering

8.2 IMAGE PROCESSING VERSUS IMAGE ANALYSIS Image processing: The collection of routines and

Part I Feature Extraction (1) Image Enhancement. CSc I6716 Spring Local, meaningful, detectable parts of the image.

Continued. Introduction to Computer Vision CSE 252a Lecture 11

Digital Image Fundamentals and Image Enhancement in the Spatial Domain

Chapter 3. Study and Analysis of Different Noise Reduction Filters

Solution Q.1 What is a digital Image? Difference between Image Processing

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

Introduction. Computer Vision. CSc I6716 Fall Part I. Image Enhancement. Zhigang Zhu, City College of New York

Digital Image Processing. Lecture # 3 Image Enhancement

Convolutional Networks Overview

1.Discuss the frequency domain techniques of image enhancement in detail.

Spatial Domain Processing and Image Enhancement

DIGITAL IMAGE DE-NOISING FILTERS A COMPREHENSIVE STUDY

Midterm is on Thursday!

TDI2131 Digital Image Processing

Templates and Image Pyramids

Exercise questions for Machine vision

High Dynamic Range Imaging

Head, IICT, Indus University, India

Image Enhancement in the Spatial Domain

Sensors and Sensing Cameras and Camera Calibration

Image De-Noising Using a Fast Non-Local Averaging Algorithm

Computer Vision. Intensity transformations

Digital Image Processing. Digital Image Fundamentals II 12 th June, 2017

Image Processing Computer Graphics I Lecture 20. Display Color Models Filters Dithering Image Compression

Multimedia Systems Giorgio Leonardi A.A Lectures 14-16: Raster images processing and filters

Study guide for Graduate Computer Vision

Image Processing by Bilateral Filtering Method

On spatial resolution

Image Processing. 2. Point Processes. Computer Engineering, Sejong University Dongil Han. Spatial domain processing

CPSC 340: Machine Learning and Data Mining. Convolutional Neural Networks Fall 2018

CS 445 HW#2 Solutions

Filters. Materials from Prof. Klaus Mueller

EE482: Digital Signal Processing Applications

Robert Collins CSE486, Penn State. Lecture 3: Linear Operators

Image Denoising with Linear and Non-Linear Filters: A REVIEW

Circular averaging filter (pillbox) Approximates the two-dimensional Laplacian operator. Laplacian of Gaussian filter

Transcription:

CS534 Introduction to Computer Vision Linear Filters Ahmed Elgammal Dept. of Computer Science Rutgers University Outlines What are Filters Linear Filters Convolution operation Properties of Linear Filters Application of filters Nonlinear Filter Normalized Correlation and finding patterns in images Sources: Forsyth and Ponce Computer Vision a Modern approach Chapter 4 Burger and Burge Digital Image Processing Chapter 6 A.Elgammal, Rutgers 1

Digital image Assume we use a gray-level image Digital image: a two-dimensional light intensity function f (x,y) where x and y denote spatial coordinates, the value of f at any point is proportional to the brightness (gray level) of the image at that point. A digital image: is discretized in the spatial domain Is discretized in the brightness domain. f(x,y) What operations can we perform on pixels? Point operations Filters A.Elgammal, Rutgers 2

Point Operations Point Operations perform a mapping of the pixel values without changing the size, geometry, or local structure of the image Each new pixel value I (u,v) depends on the previous value I(u,v) at the same position and on a mapping function f(.) The function f(.) is independent of the coordinates Such operation is called homogeneous point operations Example of homogeneous point operations: Modifying image brightness or contrast Applying arbitrary intensity transformation (curves) Quantizing (posterizing) images Global thresholding Gamma correction Color transformations A.Elgammal, Rutgers 3

What is a Filter Point operations are limited (why) They cannot accomplish tasks like sharpening or smoothing, We need a function that involves the intensities (color) in the neighborhood of each pixel Smoothing an image by averaging Replace each pixel by the average of its neighboring pixels Assume a 3x3 neighborhood: A.Elgammal, Rutgers 4

In general a filter applies a function over the values of a small neighborhood of pixels to compute the result The size of the filter = the size of the neighborhood: 3x3, 5x5, 7x7,, 21x21,.. The shape of the filter region is not necessarily square, can be a rectangle, a circle Filters can be linear of nonlinear A.Elgammal, Rutgers 5

Linear Filters: convolution Averaging filter A.Elgammal, Rutgers 6

Mathematical Properties of Linear Convolution For any 2D discrete signal, convolution is defined as: Properties Commutativity Linearity (notice) Associativity A.Elgammal, Rutgers 7

Properties Separability Types of Linear Filters A.Elgammal, Rutgers 8

Smoothing by Averaging vs. Gaussian Flat kernel: all weights equal 1/N Smoothing with a Gaussian Smoothing with an average actually doesn t compare at all well with a defocussed lens Most obvious difference is that a single point of light viewed in a defocussed lens looks like a fuzzy blob; but the averaging process would give a little square. A Gaussian gives a good model of a fuzzy blob A.Elgammal, Rutgers 9

An Isotropic Gaussian The picture shows a smoothing kernel proportional to (which is a reasonable model of a circularly symmetric fuzzy blob) Smoothing with a Gaussian A.Elgammal, Rutgers 10

Gaussian smoothing Advantages of Gaussian filtering rotationally symmetric (for large filters) filter weights decrease monotonically from central peak, giving most weight to central pixels Simple and intuitive relationship between size of σ and the smoothing. The Gaussian is separable: Advantage of seperability First convolve the image with a one dimensional horizontal filter Then convolve the result of the first convolution with a one dimensional vertical filter For a kxk Gaussian filter, 2D convolution requires k 2 operations per pixel But using the separable filters, we reduce this to 2k operations per pixel. A.Elgammal, Rutgers 11

Separability 1 2 1 1 2 1 2 3 3 3 5 5 4 4 6 11 18 18 11 18 18 65 1 x 1 2 1 1 2 1 2 3 3 =2 + 6 + 3 = 11 2 = 2 4 2 3 5 5 = 6 + 20 + 10 = 36 1 1 2 1 4 4 6 = 4 + 8 + 6 = 18 65 Advantages of Gaussians Convolution of a Gaussian with itself is another Gaussian so we can first smooth an image with a small Gaussian then, we convolve that smoothed image with another small Gaussian and the result is equivalent to smoother the original image with a larger Gaussian. If we smooth an image with a Gaussian having sd σ twice, then we get the same result as smoothing the image with a Gaussian having standard deviation (2σ) 1/2 A.Elgammal, Rutgers 12

Noise Simplest noise model independent stationary additive Gaussian noise the noise value at each pixel is given by an independent draw from the same normal probability distribution Issues this model allows noise values that could be greater than maximum camera output or less than zero for small standard deviations, this isn t too much of a problem - it s a fairly good model independence may not be justified (e.g. damage to lens) may not be stationary (e.g. thermal gradients in the ccd) sigma=1 A.Elgammal, Rutgers 13

sigma=16 The response of a linear filter to noise Assume stationary independent additive Gaussian noise with zero mean (non-zero mean is easily dealt with) Mean: output is a weighted sum of inputs so we want mean of a weighted sum of zero mean normal random variables must be zero Variance: recall variance of a sum of random variables is sum of their variances variance of constant times random variable is constant^2 times variance then if σ 2 is noise variance and kernel is K, variance of response is K u,v A.Elgammal, Rutgers 14

The response of a linear filter to noise This can magnify or reduce the variance of the noise based on If This reduces noise variance (assume positive coefficients) A.Elgammal, Rutgers 15

Linear Filters: convolution Convolution as a Dot Product Applying a filter at some point can be seen as taking a dot-product between the image and some vector Convoluting an image with a filter is equivalent to taking the dot product of the filter with each image window. Window weights Window weights Original image Filtered image A.Elgammal, Rutgers 16

filters and finding patterns Largest value when the vector representing the image is parallel to the vector representing the filter Filter responds most strongly at image windows that looks like the filter. Filter responds stronger to brighter regions! (drawback) Insight: filters look like the effects they are intended to find filters find effects they look like weights Window Ex: Derivative of Gaussian used in edge detection looks like edges Normalized Correlation Convolution with a filter can be used to find templates in the image. Normalized correlation output is filter output, divided by root sum of squares of values over which filter lies Consider template (filter) M and image window N: Template Window Original image Filtered image (Normalized Correlation Result) A.Elgammal, Rutgers 17

Normalized Correlation This correlation measure takes on values in the range [0,1] it is 1 if and only if N = cm for some constant c so N can be uniformly brighter or darker than the template, M, and the correlation will still be high. The first term in the denominator, ΣΣM 2 depends only on the template, and can be ignored The second term in the denominator, ΣΣN 2 can be eliminated if we first normalize the grey levels of N so that their total value is the same as that of M - just scale each pixel in N by ΣΣ M/ ΣΣ N Positive responses Zero mean image, -1:1 scale Zero mean image, -max:max scale A.Elgammal, Rutgers 18

Positive responses Zero mean image, -1:1 scale Zero mean image, -max:max scale Figure from Computer Vision for Interactive Computer Graphics, W.Freeman et al, IEEE Computer Graphics and Applications, 1998 copyright 1998, IEEE A.Elgammal, Rutgers 19

Example of a biologically motivated recognition system A convolutional neural network, LeNet; the layers filter, subsample, filter, subsample, and finally classify based on outputs of this process. Figure from Gradient-Based Learning Applied to Document Recognition, Y. Lecun et al Proc. IEEE, 1998 copyright 1998, IEEE Nonlinear Filters Linear filters have a disadvantage when used for smoothing or removing noise: all image structures are blurred, the quality of the image is reduced. Examples of nonlinear filters: Minimum and Maximum filters A.Elgammal, Rutgers 20

Median Filter Much better in removing noise and keeping the structures A.Elgammal, Rutgers 21

Weighted median filter A.Elgammal, Rutgers 22