1 Computer Science 631 Lecture 4: Wavelets Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

Slides:



Advertisements
Similar presentations
Multimedia Data Compression
Advertisements

Wavelets Fast Multiresolution Image Querying Jacobs et.al. SIGGRAPH95.
University of Ioannina - Department of Computer Science Wavelets and Multiresolution Processing (Background) Christophoros Nikou Digital.
Transforming images to images
Chap 4 Image Enhancement in the Frequency Domain.
School of Computing Science Simon Fraser University
6/9/2015Digital Image Processing1. 2 Example Histogram.
Computer Graphics Recitation 6. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
Lecture05 Transform Coding.
Computer Graphics Recitation 7. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
1 Computer Science 631 Lecture 2: Morphing Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
Immagini e filtri lineari. Image Filtering Modifying the pixels in an image based on some function of a local neighborhood of the pixels
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain.
Lifting Scheme.
Image Enhancement in the Frequency Domain Part I Image Enhancement in the Frequency Domain Part I Dr. Samir H. Abdul-Jauwad Electrical Engineering Department.
Wavelet Transform A very brief look.
CSCE 641 Computer Graphics: Fourier Transform Jinxiang Chai.
1 Computer Science 631 Lecture 3: Morphing, Sampling Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
2D Fourier Theory for Image Analysis Mani Thomas CISC 489/689.
Introduction to Wavelets
CPSC 641 Computer Graphics: Fourier Transform Jinxiang Chai.
Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project
Computational Photography: Fourier Transform Jinxiang Chai.
Fundamentals of Multimedia Chapter 8 Lossy Compression Algorithms (Wavelet) Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Multimedia Data The DCT and JPEG Image Compression Dr Mike Spann Electronic, Electrical and Computer.
Image Sampling Moire patterns -
The Frequency Domain Sinusoidal tidal waves Copy of Katsushika Hokusai The Great Wave off Kanagawa at
ENG4BF3 Medical Image Processing
CS448f: Image Processing For Photography and Vision Wavelets Continued.
Topic 7 - Fourier Transforms DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Computer Science 631 Lecture 7: Colorspace, local operations
Transforms. 5*sin (2  4t) Amplitude = 5 Frequency = 4 Hz seconds A sine wave.
Multimedia Data DCT Image Compression
Indiana University Purdue University Fort Wayne Hongli Luo
Image Processing Edge detection Filtering: Noise suppresion.
DCT.
Math 3360: Mathematical Imaging Prof. Ronald Lok Ming Lui Department of Mathematics, The Chinese University of Hong Kong Lecture 9: More about Discrete.
Wavelets and Multiresolution Processing (Wavelet Transforms)
Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2
Digital Image Processing Lecture 21: Lossy Compression Prof. Charlene Tsai.
Dr. Scott Umbaugh, SIUE Discrete Transforms.
1 CMPB 345: IMAGE PROCESSING DISCRETE TRANSFORM 2.
Fourier Transform.
Dr. Abdul Basit Siddiqui FUIEMS. QuizTime 30 min. How the coefficents of Laplacian Filter are generated. Show your complete work. Also discuss different.
By Dr. Rajeev Srivastava CSE, IIT(BHU)
Image hole-filling. Agenda Project 2: Will be up tomorrow Due in 2 weeks Fourier – finish up Hole-filling (texture synthesis) Image blending.
Digital Image Processing Part 3 Spatial Domain Processing.
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
Digital Image Processing Lecture 9: Filtering in Frequency Domain Prof. Charlene Tsai.
Chapter 13 Discrete Image Transforms
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM M ULTIMEDIA OF D ATA C OMPRESSION Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny.
Wavelets Chapter 7 Serkan ERGUN. 1.Introduction Wavelets are mathematical tools for hierarchically decomposing functions. Regardless of whether the function.
1. 2 What is Digital Image Processing? The term image refers to a two-dimensional light intensity function f(x,y), where x and y denote spatial(plane)
JPEG Compression What is JPEG? Motivation
Linear Filters and Edges Chapters 7 and 8
Linear Filters and Edges Chapters 7 and 8
Digital Image Processing Lecture 21: Lossy Compression
Wavelets : Introduction and Examples
Fourier Transform.
All about convolution.
Researchlab 4 Presentation
CSCE 643 Computer Vision: Thinking in Frequency
Introduction To Wavelets
Resampling.
Chapter 15: Wavelets (i) Fourier spectrum provides all the frequencies
Wavelet Analysis Objectives: To Review Fourier Transform and Analysis
Presentation transcript:

1 Computer Science 631 Lecture 4: Wavelets Ramin Zabih Computer Science Department CORNELL UNIVERSITY

2 Outline n Announcement: HW#1 exists! n One more try at Powerpoint formulas n Wavelet transformation via the Haar basis n 2D wavelets

3 Ray-based coordinates n Compute the position of the pixel X w.r.t. an oriented ray PQ Coordinates are A (along PQ) and B (perpendicular to PQ)

4 Changing units n The problem is that A and B are in units of pixels Need them in percentages of the length of PQ

5 General formula Note that X’ (as well as X) is a point, not a pixel

6 Fast bilinear interpolation n The value at the interior point (x,y) is n To compute this fast:

7 Frequency decomposition of an image n An image can be described in several ways So far, in terms of pixels (= spatial domain) The frequency decomposition is very useful Low-frequency components change slowly High-frequency components change rapidly n If the image has no (little) high-frequency components, then aliasing is not a problem

8 Why use the frequency domain? n By describing an image in terms of the frequency domain, many things become clear The image formation process itself removes really high-frequency components –What happens when we take a picture of a checkerboard where a pixel contains 100 squares? –Many image operations are naturally viewed in terms of their effects on various frequency components Local averaging removes high-frequency components –Image compression is best viewed in this way

9 Choice of basis n The canonical way to describe the frequency of an image is in terms of its Fourier transform This involves a number of issues that we don’t have time to cover in depth n Instead, we will use a Wavelet representation called the Haar basis Same basic idea, but easier and more intuitive For example, our basis vectors will be mostly 0 –By contrast, the Fourier basis is sine waves

10 Image representations n Consider a 1-D image (signal) with four elements: I = [ ] Spatial representation: I = 9*[ ]+7*[ ]+3*[ ]+5*[ ] The basis elements are 1-D (in this case) vectors, each with a single 1 –What are they called for an image?

11 Wavelets and DC components n Our basis vectors will have a scale, which intuitively means how many non-zero elements To begin with, we will subtract the average value of I, which is 6 in our example I - 6 = [ ] I = 6*[ ] + [ ] [ ] is our first (dull) new basis –No zeros, so coarsest possible scale The average value of an image is referred to as its DC component, others are AC components

12 Haar basis AC components n For wavelets, the basis functions are shifted and scaled versions of a single function Like Fourier basis, with sine/cosine The “generating function” for the Haar basis is [1 -1] –everywhere else it’s 0 This is a pretty simple way to describe a signal!

13 Computing detail coefficients n The average of two numbers is halfway between them Therefore, a pair [a b] can be represented as: avg*[1 1] + diff*[1 -1], where avg = (a + b)/2 and diff = a - avg = avg - b For the Haar basis, we will use this trick –For a pair of numbers, compute the average and difference

14 Multi-resolution averaging n Given a signal of size 2 n, we can average the pixels together at various scales Compute a pairwise average, to get size 2 n-1 Compute a pairwise average on that, too Eventually you get a single number n Example (n = 2) [ ] [8 4] [6] scaleaverage

15 Generating detail coefficients n Each time we compute the average, we can write down the difference too [9 7] -> [8 1], [3 5] -> [4 -1] We can reconstruct [8 4] from [6] and [2] [ ] [8 4] [6] scaleaverage [1 -1] [2] detail

16 Example Goal: represent the input (left) in terms of a DC term, plus scaled and shifted versions of the basis function (right)

17 One step of average and difference Add these to get our original input [ ]

18 Last step of average and difference Add these to get the previous average [ ]

19 Wavelet representation n There are several ways to do the representation For the Haar basis, we use a single DC component, and everything else is details 6*[ ]+2*[ ]+1*[ ] +-1*[ ] Note that you can build the averages at one level from the averages and differences on the next level down –We can reconstruct [8 4] from [6] and [2] [8 4] = 6*[1 1] + 2*[1 -1]

20 n Given an input signal, we can create the transformed signal by repeated averaging and differencing [ ] [ ] [ ] Computing the transform Algorithm: Turn each adjacent pair into an (avg,diff) pair Store all the avg’s in the left half of output Store all the diff’s in the right half Recurse on the left half of the output Stop when there is a single number left Inverting is a simple exercise...

21 Scaling the Haar basis vectors n The basis vectors for the Haar basis are shifted and scaled versions of [1 -1] n We’d like the basis to be orthonormal For any two elements u,v we want the inner product u t v to be 1 if u = v, otherwise 0 What is [1 -1] t [1 -1] ? Solution: multiple basis vectors by the appropriate constant

22 What about 2-D images n First issue is that images are not necessarily of size 2 n by 2 n What is the wavelet transform of [1 3 9]? n This issue arises in many places For example, if you want to smooth an image. Obvious solution is to replace each pixel by a local average –But what do you do at the borders?

23 Three obvious solutions n Pad the image with something Typically, pad with 0 For a local operation, discard the values that are within radius of the border –Just need to be sure the process doesn’t crash n “Make up” some other stuff around the image Question is what to make up Obvious answer is to use the image itself!

24 Standard tiling

25 Reverse tiling

26 Reverse tiling is in general better n Why? n The difference between the Fourier transform and the transform that JPEG compression uses is (to simplify) standard versus reverse tiling Discrete Fourier Transform = standard Discrete Cosine Transform = reverse

27 2-D wavelet transform n The standard decomposition first computes the 1D wavelet transform of each row The result is a row of the same length Order by decreasing importance (resolution) –DC coefficient first We treat the result as an image, then compute a 1D wavelet transform of each column Result is an image with a single DC coefficient –Rest are details (usually, details of details…)

28 Standard decomposition example

29 What are the 2-D basis functions? n Under the standard basis, examples are: Gray = 0

30 Non-standard 2D Haar basis