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

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

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

Prof. Feng Liu. Winter /10/2019

Motion illusion, rotating snakes

CSCI 1290: Comp Photo

Fourier analysis of images

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

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

Images and Filters. EE/CSE 576 Linda Shapiro

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

Image Filtering and Gaussian Pyramids

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

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

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

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

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

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

Last Lecture. photomatix.com

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?

Image Filtering. Median Filtering

Last Lecture. photomatix.com

Sampling and Reconstruction

Vision Review: Image Processing. Course web page:

Computer Vision, Lecture 3

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

Image filtering, image operations. Jana Kosecka

Numerical Derivatives See also T&V, Appendix A.2 Gradient = vector of partial derivatives of image I(x,y) = [di(x,y)/dx, di(x,y)/dy]

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

Image Processing for feature extraction

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

Thinking in Frequency

Sampling and Pyramids

Computer Vision Lecture 3

Templates and Image Pyramids

Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

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

More image filtering , , Computational Photography Fall 2017, Lecture 4

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

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

Templates and Image Pyramids

Digital Image Processing

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Image Enhancement II: Neighborhood Operations

Midterm is on Thursday!

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

Digital Image Processing

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

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

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

Lecture 2: Color, Filtering & Edges. Slides: S. Lazebnik, S. Seitz, W. Freeman, F. Durand, D. Forsyth, D. Lowe, B. Wandell, S.Palmer, K.

Computer Graphics Fundamentals

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

Filters. Materials from Prof. Klaus Mueller

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

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

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

Practical Image and Video Processing Using MATLAB

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

Digital Image Processing

Filip Malmberg 1TD396 fall 2018 Today s lecture

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

Midterm Examination CS 534: Computational Photography

Transforms and Frequency Filtering

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

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

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

Continued. Introduction to Computer Vision CSE 252a Lecture 11

Computer Vision for HCI. Noise Removal. Noise in Images

Image Interpolation. Image Processing

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

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Digital Image Processing. Lecture 5 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009

Performance Evaluation of Edge Detection Techniques for Square Pixel and Hexagon Pixel images

Image Enhancement using Histogram Equalization and Spatial Filtering

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

Study guide for Graduate Computer Vision

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

Tonemapping and bilateral filtering

ELEC Dr Reji Mathew Electrical Engineering UNSW

Sharpening Spatial Filters ( high pass)

Overview. Neighborhood Filters. Dithering

CAP 5415 Computer Vision. Marshall Tappen Fall Lecture 1

Image Enhancement in the Spatial Domain Low and High Pass Filtering

DIGITAL IMAGE PROCESSING (COM-3371) Week 2 - January 14, 2002

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

Sampling and Reconstruction

EEL 6562 Image Processing and Computer Vision Box Filter and Laplacian Filter Implementation

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

ELEC Dr Reji Mathew Electrical Engineering UNSW

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

Image restoration and color image processing

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

Filtering in the spatial domain (Spatial Filtering)

Lecture 3: Linear Filters

CoE4TN4 Image Processing. Chapter 4 Filtering in the Frequency Domain

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

CIS581: Computer Vision and Computational Photography Homework: Cameras and Convolution Due: Sept. 14, 2017 at 3:00 pm

Digital Image Processing. Lecture # 8 Color Processing

Frequency Domain Enhancement

Sampling and Reconstruction

Transcription:

Matlab (see Homework : Intro to Matlab) Starting Matlab from Unix: matlab & OR matlab nodisplay Image representations in Matlab: Unsigned 8bit values (when first read) Values in range [, 255], = black, 255 = white Double precision floating point By convention, values in range [.,.];. = black;. = white Colour images have 3 values at each pixel: RGB [...] = black; [...] = white; [...] = red Sometimes accessed through a colour map (lookup table) Linear Filters (Reading: 7., 7.5-7.7) Linear filtering: Form a new image whose pixels are a weighted sum of the original pixel values, using the same set of weights at each point 9 I 9 2 9 9 9 9 99 9 9 Correlation /9 F /9.(x + x + x + 9x + x + x + x + 9x + x) = /9.( 9) = O Slide credit: Christopher Rasmussen Same as correlation, but with kernel reversed Represent the linear weights as an image, F F is called the kernel Center origin of the kernel F at each pixel location Multiply weights by corresponding pixels Set resulting value for each pixel Convolution Image, R, resulting from convolution of F with image H, where u,v range over kernel pixels (in D): R ij = u,v H i u,j v F uv Warning: the textbook mixes up H and F Correlation compared to Convolution (warm-up slide)?

(warm-up slide)? Filtered (no change)? Shifted left By pixel Blur (with a box filter) 2 -? (Note that filter sums to ) 2

2 - Sharpening filter - Accentuates differences with local average - Also known as Laplacian Average filter (box filter) Example: Smoothing with a box filter Mask with positive entries, that sum to. Replaces each pixel with an average of its neighborhood. If all weights are equal, it is called a box filter. Smoothing with a Gaussian Gaussian Kernel Smoothing with a box 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 box filter would give a little square. A Gaussian gives a good model of a fuzzy blob It closely models many physical processes (the sum of many small effects) Idea: Weight contributions of neighboring pixels by nearness.3.3.22.3.3.3.59.97.59.3.22.97.59.97.22.3.59.97.59.3.3.3.22.3.3 5 x 5, σ = Constant factor at front makes volume sum to (can be ignored, as we should re-normalize weights to sum to in any case). Slide credit: Christopher Rasmussen 3

Smoothing with a Gaussian Smoothing reduces pixel noise: Each row shows smoothing with Gaussians of different width; each column shows different amounts of Gaussian noise. Efficient Implementation Separability of the Gaussian filter Both the BO filter and the Gaussian filter are separable into two D convolutions: First convolve each row with a D filter Then convolve each column with a D filter. (or vice-versa) Differentiation and convolution Vertical gradients from finite differences Recall, for 2D function, f(x,y): f x = lim f( x + ε, y) f( x,y) ε ε ε This is linear and shift invariant, so must be the result of a convolution. We could approximate this as f x f ( x n+,y) f x n, y x (which is obviously a convolution) - ( ) 4

Filters are templates Normalized correlation Applying a filter at some point can be seen as taking a dotproduct between the image and some vector Filtering the image is a set of dot products Insight filters look like the effects they are intended to find filters find effects they look like Think of filters as a dot product of the filter vector with the image region Now measure the angle between the vectors a b = a b cosθ Angle (similarity) between vectors can be measured by normalizing length of each vector to. Normalized correlation: divide each correlation by square root of sum of squared values (length) Application: Vision system for TV remote control - uses template matching We need scaled representations Figure from Computer Vision for Interactive Computer Graphics, W.Freeman et al, IEEE Computer Graphics and Applications, 998 copyright 998, IEEE Find template matches at all scales e.g., when finding hands or faces, we don t know what size they will be in a particular image Template size is constant, but image size changes Efficient search for correspondence look at coarse scales, then refine with finer scales much less cost, but may miss best match Examining all levels of detail Find edges with different amounts of blur Find textures with different spatial frequencies (levels of detail) Aliasing We can t shrink an image by taking every second pixel If we do, characteristic errors appear Examples shown in next few slides Typically, small phenomena look bigger; fast phenomena can look slower Common examples Checkerboard patterns misrepresented in video games Striped shirts look funny on colour television Wagon wheels rolling the wrong way in movies Resample the checkerboard by taking one sample at each circle. In the case of the top left board, new representation is reasonable. Top right also yields a reasonable representation. Bottom left is all black (dubious) and bottom right has checks that are too big. 5

Resampling with prior smoothing The Gaussian pyramid Create each level from previous one: smooth and sample Smooth with Gaussians, in part because a Gaussian*Gaussian = another Gaussian G(x) * G(y) = G(sqrt(x 2 + y 2 )) Gaussians are low pass filters, so the representation is redundant once smoothing has been performed There is no need to store smoothed images at the full original resolution Summary of Linear Filters All the extra levels add very little overhead for memory or computation! Linear filtering: Form a new image whose pixels are a weighted sum of original pixel values Properties Output is a shift-invariant function of the input (same at each image location) Examples: Smoothing with a box filter Smoothing with a Gaussian Finding a derivative Searching for a template Pyramid representations Important for describing and searching an image at all scales 6