Lecture 2 Image Processing and Filtering

Similar documents
CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Digital Image Processing

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

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

Lecture 4: Spatial Domain Transformations

Lecture 1 Introduction & Fundamentals

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

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

Digital Image Processing COSC 6380/4393

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

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

UNIT-2 IMAGE REPRESENTATION IMAGE REPRESENTATION IMAGE SENSORS IMAGE SENSORS- FLEX CIRCUIT ASSEMBLY

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

Image and Multidimensional Signal Processing

CoE4TN3 Medical Image Processing

Computer Vision I - Basics of Image Processing Part 1

Digital Image Fundamentals. Prof. George Wolberg Dept. of Computer Science City College of New York

An Introduc+on to Mathema+cal Image Processing IAS, Park City Mathema2cs Ins2tute, Utah Undergraduate Summer School 2010

EE795: Computer Vision and Intelligent Systems

EE795: Computer Vision and Intelligent Systems

Chapter 3: Intensity Transformations and Spatial Filtering

Broad field that includes low-level operations as well as complex high-level algorithms

Filters and Pyramids. CSC320: Introduction to Visual Computing Michael Guerzhoy. Many slides from Steve Marschner, Alexei Efros

Why is computer vision difficult?

Sampling and Reconstruction

Basic Algorithms for Digital Image Analysis: a course

IMAGING. Images are stored by capturing the binary data using some electronic devices (SENSORS)

Relationship between Fourier Space and Image Space. Academic Resource Center

CS4733 Class Notes, Computer Vision

Sampling and Reconstruction. Most slides from Steve Marschner

Lecture 4: Image Processing

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

Lecture 6: Edge Detection

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

Noise Model. Important Noise Probability Density Functions (Cont.) Important Noise Probability Density Functions

Image Enhancement: To improve the quality of images

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

Announcements. Image Matching! Source & Destination Images. Image Transformation 2/ 3/ 16. Compare a big image to a small image

SYDE 575: Introduction to Image Processing

Chapter 2 - Fundamentals. Comunicação Visual Interactiva

Edge Detection. Today s reading. Cipolla & Gee on edge detection (available online) From Sandlot Science

Basic relations between pixels (Chapter 2)

Chapter - 2 : IMAGE ENHANCEMENT

EC-433 Digital Image Processing

Computer Vision I - Filtering and Feature detection

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

Introduction to Digital Image Processing

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Warping. 12 May 2015

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

ECG782: Multidimensional Digital Signal Processing

CPSC 425: Computer Vision

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

ECG782: Multidimensional Digital Signal Processing

Image Processing Lecture 10

Computer Vision and Graphics (ee2031) Digital Image Processing I

Islamic University of Gaza Faculty of Engineering Computer Engineering Department

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

Digital Image Fundamentals

Image Enhancement in Spatial Domain (Chapter 3)

CS4670: Computer Vision

Image Acquisition + Histograms

Anno accademico 2006/2007. Davide Migliore

Filtering Images. Contents

Filtering in frequency domain

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

Correction and Calibration 2. Preprocessing

JNTUWORLD. 4. Prove that the average value of laplacian of the equation 2 h = ((r2 σ 2 )/σ 4 ))exp( r 2 /2σ 2 ) is zero. [16]

Edge Detection. CS664 Computer Vision. 3. Edges. Several Causes of Edges. Detecting Edges. Finite Differences. The Gradient

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

Digital Image Processing

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

Digital Image Processing

Filtering and Enhancing Images

Motion. 1 Introduction. 2 Optical Flow. Sohaib A Khan. 2.1 Brightness Constancy Equation

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

Image Processing. Filtering. Slide 1

Unit - I Computer vision Fundamentals

Introduction to Digital Image Processing

ENG 7854 / 9804 Industrial Machine Vision. Midterm Exam March 1, 2010.

Lecture 3 - Intensity transformation

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

Digital Image Processing. Image Enhancement - Filtering

2D Image Processing Feature Descriptors

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

ECE 176 Digital Image Processing Handout #14 Pamela Cosman 4/29/05 TEXTURE ANALYSIS

Image restoration. Restoration: Enhancement:

Mosaics. Today s Readings

Review for Exam I, EE552 2/2009

Outline 7/2/201011/6/

Hybrid filters for medical image reconstruction

Capturing, Modeling, Rendering 3D Structures

A Vision System for Automatic State Determination of Grid Based Board Games

N-Views (1) Homographies and Projection

Image warping , , Computational Photography Fall 2017, Lecture 10

Digital image processing

Lecture Image Enhancement and Spatial Filtering

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

EEM 463 Introduction to Image Processing. Week 3: Intensity Transformations

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

Transcription:

Lecture 2 Image Processing and Filtering UW CSE vision faculty

What s on our plate today? Image formation Image sampling and quantization Image interpolation Domain transformations Affine image transformations Range (intensity) transformations Noise reduction through spatial filtering Filtering as cross-correlation Convolution Nonlinear (median) filtering

Image Formation: Basics i(x,y) r(x,y) f(x,y) (from Gonzalez & Woods, 2008)

Image Formation: Basics Image f(x,y) is characterized by 2 components 1. Illumination i(x,y) = Amount of source illumination incident on scene 2. Reflectance r(x,y) = Amount of illumination reflected by objects in the scene f ( x, y) = i( x, y) r( x, y) where 0 < i( x, y) < and 0 < r( x, y) < 1 r(x,y) depends on object properties r = 0 means total absorption and 1 means total reflectance

Image Formation: Basics f ( x, y) = i( x, y) r( x, y) where 0 < i( x, y) < and 0 < r( x, y) < 1 Typical values of i(x,y): Sun on a clear day: 90,000 lm/m 2 Cloudy day: 10,000 lm/m 2 Inside an office: 1000 lm/m 2 Typical values of r(x,y) Black velvet: 0.01, Stainless steel: 0.65, Snow: 0.93 Typical limits of f(x,y) in an office environment 10 < f(x,y) < 1000 Shifted to gray scale [0, L-1]; 0 = black, L-1 = 255 = white r=1

Sampling and Quantization Process (from Gonzalez & Woods, 2008)

Example of a Quantized 2D Image Continuous image projected onto sensor array Result of sampling and quantization (from Gonzalez & Woods, 2008)

Suppose we want to zoom an image Original image Need to fill in values for new pixels Zoomed image

Interpolation Original Zoomed Nearest Neighbor Interpolation **** **** ******** **** **** Need to fill in missing values * For each new pixel, copy nearest value

Neared Neighbor Interpolation Original image Can we do better? Zoomed image

Other image interpolation techniques Bilinear interpolation: Compute pixel value v(x,y) as: v ( x, y) = ax + by + cxy + a, b, c, d determined from four nearest neighbors of (x,y) Bicubic interpolation: (Used in most commercial image editing programs, e.g., Photoshop) v( x, y) = 3 i= 0 j= 0 a a ij determined from 16 nearest neighbors of (x,y) 3 ij See also http://en.wikipedia.org/wiki/bilinear_interpolation x i y j d (from http://www.cambridgeincolour.com/tutorials/image-interpolation.htm)

Comparison of Interpolation Techniques Nearest Neighbor Bilinear Bicubic

Recall from Last Time Domain transformation: (What is an example?) Translation Rotation How are these done?

Geometric spatial transformations of images Two steps: 1. Spatial transformation of coordinates (x,y) 2. Interpolation of intensity value at new coordinates We already know how to do (2), so focus on (1) Example: What does the transformation (x,y) = T((v,w)) = (v/2,w/2) do? [Shrinks original image in half in both directions]

Affine Spatial Transformations Most commonly used set of transformations General form: [ x y 1] = [ v w 1] T = [ v w 1] [x y 1] are called homogenous coordinates Can translate, rotate, scale, or shear based on values t ij Multiple transformations can be concatenated by multiplying them to form new matrix T t t t 11 21 31 t t t 12 22 32 0 0 1

Example: Translation [ x y 1] = [ v w 1] T = [ v w 1] t t t 11 21 31 t t t 12 22 32 0 0 1 What does T look like for translation? x = v + t x y = w + t y

Affine Transformations Transformation Affine Matrix T Coordinate Equations Example

Affine Transformations (cont.) Transformation Affine Matrix T Coordinate Equations Example

Example of Affine Transformation Image rotated 21 degrees Nearest Neighbor Bilinear Bicubic (from Gonzalez & Woods, 2008)

Recall from last time Range transformation: (What is an example?) Noise filtering

Image processing for noise reduction Common types of noise: Salt and pepper noise: contains random occurrences of black and white pixels Impulse noise: contains random occurrences of white pixels Gaussian noise: variations in intensity drawn from a Gaussian normal distribution Original Impulse noise Salt and pepper noise Gaussian noise

How do we reduce the effects of noise? 0 0 0 90 0 90 90 90 0 0 0 0 9 0

How do we reduce the effects of noise? 0 0 0 90 0 90 90 90 0 0 0 0 9 0 80

How do we reduce the effects of noise? 0 0 0 90 0 90 90 90 0 0 0 0 9 0 10 80 Idea: Compute mean value for each pixel from neighbors

Mean filtering 0 0 0 90 0 90 90 90 0 0 0 0 9 0 0 10 20 30 30 30 20 10 0 20 40 60 60 60 40 20 0 30 60 90 90 90 60 30 0 30 50 80 80 90 60 30 0 30 50 80 80 90 60 30 0 20 30 50 50 60 40 20 10 20 30 30 30 30 20 10 10 10 10 0 0 0 0 0

Filtering as cross-correlation If the averaging window is (2k+1)x(2k+1): In our example in previous slide, k = 1 for a 3x3 averaging window

Filtering as cross-correlation Can generalize this by allowing different weights for different neighboring pixels: This is called cross-correlation, denoted by: H is called the filter, kernel, or mask. Note: During implementation, we avoid the negative filter indices by using H[u+k,v+k] instead of H[u,v]

Kernel for mean filtering What is the kernel for a 3x3 mean filter? 0 0 0 90 0 90 90 90 0 0 0 0 9 0

Kernel for mean filtering What is the kernel for a 3x3 mean filter? 0 0 0 90 0 90 90 90 0 0 0 0 9 0 1/9 1 1 1 1 1 1 1 1 1

Example of mean filtering Input image Filtered Images Salt and pepper noise 3 x 3 5 x 5 7 x 7 Kernel size

Gaussian Filtering A Gaussian kernel gives less weight to pixels further from the center of the window 0 0 0 90 0 90 90 90 0 0 0 0 9 0 1 2 1 2 4 2 1 2 1 Kernel approximates Gaussian function: What happens if you increase σ?

Mean versus Gaussian filtering Input Image Mean filtered Gaussian filtered

Filtering an impulse Impulse signal 0 0 0 1 0 0 0 Kernel a b c d e f g h i Output =?

Filtering an impulse Impulse signal 0 0 0 1 0 0 0 Filter Kernel a b c d e f g h i Output is equal to filter kernel flipped horizontally & vertically 0 0 i h g 0 0 0 0 f e d 0 0 0 0 c b a 0 0

What if we want to get an output that looks exactly like the filter kernel?

Flipping kernels Impulse signal Filter Kernel Flipped Kernel a b c d e f g h i 0 0 0 1 0 0 0 Output is equal to filter kernel! i h g f e d c b a 0 0 a b c 0 0 0 0 d e f 0 0 0 0 g h i 0 0

Convolution A convolution is a cross-correlation where the filter is flipped both horizontally and vertically before being applied to the image: Written as: Compare with cross-correlation: If H is a Gaussian or mean kernel, how does convolution differ from cross-correlation?

Why convolution? Convolution is associative (cross-corr. is not): F * (G * I) = (F * G) * I Important for efficiency: To apply two filters F and G sequentially to incoming images I, pre-compute (F * G) and perform only 1 convolution (with precomputed filter) Convolution also allows effects of filtering to be analyzed using Fourier analysis (will touch on this later)

Cross-correlation and template matching Cross-correlation is useful for template matching (locating a given pattern in an image) a b c d e f g h i Image Template (pattern) a b c d e f g h i Highest value yields location of pattern in image

Nonlinear filters: Median filter A Median Filter replaces the value of a pixel by the median of intensity values of neighbors Recall: m is the median of a set of values iff half the values in the set are <= m and half are >= m. Median filtering of image I: For each location (x,y), sort intensity values in its neighborhood, determine median intensity value, and assign that value to I(x,y) Is a median filter better than a mean filter? Is median filtering a convolution?

Comparison of filters (salt-and-pepper noise)

Comparison of filters (Gaussian noise)

Next Time: Edge detection Things to do: Read Chap. 5: Secs. 5.6-5.8, 5.11 and online article by Cipolla & Gee on edge detection Mailing list: cse455@cs.washington.edu Did you receive the first message? Otherwise, sign up Prepare for C/C++ programming Visit Vision and Graphics Lab (Sieg 327) Your ID card should open Sieg 327 Check to make sure ASAP Have a good weekend!