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

Similar documents
Image Scaling. This image is too big to fit on the screen. How can we reduce it? How to generate a halfsized

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

Image Sampling. Moire patterns. - Source: F. Durand

Image Pyramids. Sanja Fidler CSC420: Intro to Image Understanding 1 / 35

Sampling and Pyramids

Image Interpolation. Image Processing

Image Filtering and Gaussian Pyramids

Sampling and Reconstruction

ECE 484 Digital Image Processing Lec 09 - Image Resampling

Images and Filters. EE/CSE 576 Linda Shapiro

Overview. Neighborhood Filters. Dithering

Last Lecture. photomatix.com

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

Last Lecture. photomatix.com

Filters. Materials from Prof. Klaus Mueller

CSC 320 H1S CSC320 Exam Study Guide (Last updated: April 2, 2015) Winter 2015

Vision Review: Image Processing. Course web page:

Midterm is on Thursday!

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

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

CSCI 1290: Comp Photo

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

Filtering in the spatial domain (Spatial Filtering)

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

06: Thinking in Frequencies. CS 5840: Computer Vision Instructor: Jonathan Ventura

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

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

Digital Image Processing

Image Filtering. Median Filtering

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

Sampling and reconstruction

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

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

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

Image Forgery. Forgery Detection Using Wavelets

Image Processing for feature extraction

Digital images. Digital Image Processing Fundamentals. Digital images. Varieties of digital images. Dr. Edmund Lam. ELEC4245: Digital Image Processing

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

EE482: Digital Signal Processing Applications

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

Image acquisition. Midterm Review. Digitization, line of image. Digitization, whole image. Geometric transformations. Interpolation 10/26/2016

Aliasing and Antialiasing. What is Aliasing? What is Aliasing? What is Aliasing?

Image Enhancement using Histogram Equalization and Spatial Filtering

Midterm Review. Image Processing CSE 166 Lecture 10

Sampling and reconstruction

Sampling and pixels. CS 178, Spring Marc Levoy Computer Science Department Stanford University. Begun 4/23, finished 4/25.

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

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

Prof. Feng Liu. Winter /10/2019

Thinking in Frequency

Templates and Image Pyramids

PRACTICAL IMAGE AND VIDEO PROCESSING USING MATLAB

CS4495/6495 Introduction to Computer Vision. 2C-L3 Aliasing

Next Classes. Spatial frequency Fourier transform and frequency domain. Reminder: Textbook. Frequency view of filtering Hybrid images Sampling

Practical Image and Video Processing Using MATLAB

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Prof. Feng Liu. Fall /04/2018

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

Sampling and reconstruction. CS 4620 Lecture 13

Sampling and Reconstruction

Digital Image Processing

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

ECE 484 Digital Image Processing Lec 10 - Image Restoration I

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

ECC419 IMAGE PROCESSING

Digital Image Processing 3/e

Image filtering, image operations. Jana Kosecka

Midterm Examination CS 534: Computational Photography

CS 445 HW#2 Solutions

Motion illusion, rotating snakes

Image preprocessing in spatial domain

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

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

Fourier analysis of images

SAMPLING THEORY. Representing continuous signals with discrete numbers

Image restoration and color image processing

Image Processing (EA C443)

Image Denoising Using Statistical and Non Statistical Method

Image Processing. Image Processing. What is an Image? Image Resolution. Overview. Sources of Error. Filtering Blur Detect edges

Image and Video Processing

Templates and Image Pyramids

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

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

A Novel Method for Enhancing Satellite & Land Survey Images Using Color Filter Array Interpolation Technique (CFA)

Efficient Construction of SIFT Multi-Scale Image Pyramids for Embedded Robot Vision

Thinking in Frequency

Convolution Pyramids. Zeev Farbman, Raanan Fattal and Dani Lischinski SIGGRAPH Asia Conference (2011) Julian Steil. Prof. Dr.

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

Sampling and Reconstruction

Computer Graphics (Fall 2011) Outline. CS 184 Guest Lecture: Sampling and Reconstruction Ravi Ramamoorthi

Filters. Motivating Example. Tracking a fly, oh my! Moving Weighted Average Filter. General Picture

Image Enhancement in the Spatial Domain

Computer Vision, Lecture 3

Antialiasing & Compositing

Digital Image Processing

CSE 564: Scientific Visualization

Orthonormal bases and tilings of the time-frequency plane for music processing Juan M. Vuletich *

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

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

Transcription:

Image Processing Images by Pawan Sinha Today s readings Forsyth & Ponce, chapters 8.-8. http://www.cs.washington.edu/education/courses/49cv/wi/readings/book-7-revised-a-indx.pdf For Monday Watt,.3-.4 (handout) Cipolla and Gee (handout) supplemental: Forsyth, chapter 9 Announcements HW due now Project is out today. Li will give a help-session in the last minutes of class. If you don t have a CSE account turn in your account forms right after class! If you want to add go ahead and register in EE4B, SLN 859 If you don t have access to 8 talk to me after class today All announcements are posted via the class webpage You may also use the mailing list (cse49cv@cs) for questions What s an image? Images as functions We can think of an image as a function, f, from R to R: gives the intensity of a channel at position typically only defined over a rectangle, with a finite range A color image is just three functions pasted together We can write this as a vector-valued function: f(x,y) y x f(x,y) y x scanalyze demo What s a digital image? We usually operate on digital (discrete) images: Sample the space on a regular grid Quantize each sample (round to nearest integer) If our samples are d apart, we can write this as: Digital images (or just images ) are typically stored in a matrix Different coordinate systems (x,y) vs. (i=row,j=column) Helpful to use macros to convert when coding things up 6 79 3 9 5 4 9 6 78 34 Image processing An image processing operation defines a new image g in terms of an existing image f. We can transform either the domain or the range of f Range transformation Changes the color of the image Examples: contrast adjustment, RGB to grayscale Domain transformation 58 97 46 46 48 76 35 5 88 9 68 49 9 6 37 77 89 44 47 87 6 8 55 5 66 3 6 3 66 63 7 7 99 3 Changes the shape of the image Example: image warping (http://www.colonize.com/warp/) scanalyze demo

Noise Original Impulse Salt and pepper Gaussian Common types of : Salt and pepper : random black and white pixels Impulse : random white pixels Gaussian : variations in intensity drawn from a Gaussian (normal) distribution Reducing Noise 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 Filtering look at the neighborhood N around each pixel replace each pixel with new value as a function of pixels in N The behavior of a filter depends on N and f Mean filtering Mean filtering 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 3 3 3 4 6 6 6 4 3 6 9 9 9 6 3 3 5 8 8 9 6 3 3 5 8 8 9 6 3 3 5 5 6 4 3 3 3 3 Replace each pixel with an average of the pixels in the k k box around it 3 3 case: Replace each pixel with an average of the pixels in the k k box around it 3 3 case: What about border pixels? Effect of filter size Gaussian Salt and pepper 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 3 3 3 4 6 6 6 4 3 6 9 9 9 6 3 3 5 8 8 9 6 3 3 5 8 8 9 6 3 3 5 5 6 4 3 3 3 3 What happens if we use a larger mean filter? 5 5? 7 7? 3x3 5x5 Some options don t evaluate image gets smaller each time a filter is applied pad the image with more rows and columns on the top, bottom, left, and right option : copy the border pixels: add [ ] to F in above case option : reflect the image about the border: add [ 9 ] to F in above case 7x7

Weighted average filtering Gaussian filter 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 4 Replace each pixel with a weighted average of the pixels in the k k box 3 3 case: Show filter demo This filter H is a good approximation to Properties of Gaussian more weight to the center good model of blurring in optical systems σ corresponds to width of the Gaussian more later... Comparison of mean vs. gaussian filter Linear shift-invariant filters What happens when a filter is applied to an impulse? a d g b e h c f i helps explain why mean filters can give blocky results Cross correlation For a k k filter, the equation becomes (assume k is odd): If we choose the origin of h, F, and G to be the center, we can simplify: This filtering operation is known as a cross-correlation, written For continuous images, cross-correlation is defined as: Linear shift-invariant filters Both cross-correlation and convolution filters have the following properties linear: how about scale? Is the following true? shift-invariant: same operation applied for every x,y in f Any filter with these properties (LSI) may be written as a cross-correlation Is this also true for convolution? Similar to convolution: Convolution has nice properties in the Fourier Domain we won t cover this, but see Forsyth Chap. 8.3 for a nice discussion Convolution flips the filter horizontally and vertically before applying it how does convolution with a Gaussian filter differ from cross-correlation? 3

Symmetry in Convolutions Convolutions have a symmetry property: Median filter A median filter operates over a k k window by returning the median pixel value in that window Try it out: What advantage might a median filter have over a mean filter? a d g b e h c f i Can a median filter be implemented by a cross-correlation? a d g b e h c f i Mean Gaussian Median Mean Gaussian Median 3x3 3x3 Filtering an image corrupted by salt and pepper 5x5 Filtering an image corrupted by Gaussian 5x5 7x7 7x7 Image Scaling Image sub-sampling This image is too big to fit on the screen. How can we reduce it? How to generate a halfsized version? /4 /8 Throw away every other row and column to create a / size image Why does this look so crufty? Called nearest-neighbor sampling 4

Even worse for synthetic images Sampling and the Nyquist rate Aliasing can arise when you sample a continuous signal or image Demo applet http://www.cs.brown.edu/exploratory/research/applets/repository/nyquist/nyquist.html occurs when your sampling rate is not high enough to capture the amount of detail in your image formally, the image contains structure at different scales called frequencies in the Fourier domain the sampling rate must be high enough to capture the highest frequency in the image To avoid aliasing: sampling rate > * max frequency in the image i.e., need more than two samples per period This minimum sampling rate is called the Nyquist rate Subsampling with Gaussian pre-filtering Some times we want many resolutions G /8 G /4 Gaussian / Solution: filter the image, then subsample Filter size should double for each ½ size reduction. Why? How can we speed this up? Known as a Gaussian Pyramid [Burt and Adelson, 983] In computer graphics, a mip map [Williams, 983] A precursor to wavelet transform Gaussian Pyramids have all sorts of applications in computer vision We ll talk about these later in the course Gaussian pyramid construction Image resampling So far, we considered only power-of-two subsampling What about arbitrary scale reduction? How can we increase the size of the image? filter mask Repeat Filter Subsample Until minimum resolution reached can specify desired number of levels (e.g., 3-level pyramid) 3 4 5 Recall how a digital image is formed d = in this example It is a discrete point-sampling of a continuous function If we could somehow reconstruct the original function, any new image could be generated, at any resolution and scale The whole pyramid is only 4/3 the size of the original image! 5

Image resampling So far, we considered only power-of-two subsampling What about arbitrary scale reduction? How can we increase the size of the image? Image resampling So what to do if we don t know Answer: guess an approximation Can be done in a principled way: filtering 3 4 5 Recall how a digital image is formed d = in this example It is a discrete point-sampling of a continuous function If we could somehow reconstruct the original function, any new image could be generated, at any resolution and scale d = in this example.5 3 4 5 Image reconstruction Convert to a continuous function Reconstruct by cross-correlation: Image resampling Subsampling with bilinear pre-filtering What does the D version of this hat function look like? performs linear interpolation performs bilinear interpolation Better filters give better resampled images Bicubic is common choice fit 3 rd degree polynomial surface to pixels in neighborhood can also be implemented by a convolution or cross-correlation BL /4 BL /8 Bilinear / Things to take away from this lecture Things to take away from this lecture An image as a function Digital vs. continuous images Image transformation: range vs. domain Types of LSI filters cross-correlation and convolution properties of LSI filters mean, Gaussian, bilinear filters Median filtering Image scaling Image resampling Aliasing Gaussian pyramids 6