Download presentation
Presentation is loading. Please wait.
1
Researchlab 4 Presentation
Fourier vs Wavelets Researchlab 4 Presentation Maurice Samulski June 27th, 2005
2
Contents Introduction Discrete Fourier Transform
Discrete Cosine Transform Wavelet Transform Comparison between DCT and WT Conclusions Thursday, November 22, 2018 Research Lab 4 presentation 2
3
Fourier analysis Joseph Fourier 1807
Represent functions by superposing sines and cosines with different frequencies and amplitudes s(t) = 3 sin (t) sin(4t) - 20 sin (200t) Fourier analysis is named after its inventor Joseph Fourier, who discovered that we can represent functions by superposing sines and cosines with different frequencies and amplitudes. For example, an arbritary signal can be described as …… where 3, 100 and 20 are the amplitudes and 1, 4, 200 are the periodic times Thursday, November 22, 2018 Research Lab 4 presentation 3
4
Fourier analysis 4 Thursday, November 22, 2018
Here are some basic signals which can be represented as a sum of sines. The more harmonics the better the signal will look like it’s original. Thursday, November 22, 2018 Research Lab 4 presentation 4
5
Discrete Fourier Transform (DFT)
DFT of image f(x,y) with size m x n To get a discrete Fourier transform of an image f(x,y) with size m x n, you feed it in this formula. We can see that F(u,v) is calculated for every pixel, and that it has to do the sum over the whole image, it’s therefore quite a complex computation. Thursday, November 22, 2018 Research Lab 4 presentation 5
6
Discrete Fourier Transform (DFT)
Inverse DFT of F(u,v) The basic idea behind this transform is that any signal can be seen as an infinite sum of a series of sinusoidal signals, where each sine can have a different amplitude and phase n practical terms, it means that you can feed in an arbitrary signal and get out data that represents the individual frequencies and their amplitudes that make up the original data. Thursday, November 22, 2018 Research Lab 4 presentation 6
7
Discrete Fourier Transform
Image f(x,y) is real Fourier transform F(u,v) is complex F(u,v) often represented as One of the things that should be noted is that the image function f(x,y) is real, but the fourier transform F(u,v) is complex x,y are image variables, location of the pixel But u,v are frequency variables In the literature F(u,v) is often represented as magnitude and phase rather than its real and imaginary parts. Basically, the magnitude tells how much of a certain frequency component is present and the phase tells where the frequency component is in the image. Thursday, November 22, 2018 Research Lab 4 presentation 7
8
Discrete Fourier Transform
To see how a FT looks like, we have to use a simple image. Because Fourier works with sine functions, the image is build up with sines. 8 to be exactly. The picture on the right is only the magnitude picture. If frequency where higher, then the points would be further away from the middle point Thursday, November 22, 2018 Research Lab 4 presentation 8
9
Discrete Fourier Transform
This is an example of an FT from a normal image (MAGNITUDE!). Because a real world image normally contains lots of low frequencies, there is a bright blob in the middle You can do some basic stuff to the transform and then transform it back to the original image. If you make a circle cut out, the image will be blurred. But with this transform you can also compress the image by letting away high frequencies which the eye can’t see and then transform it back. Thursday, November 22, 2018 Research Lab 4 presentation 9
10
Discrete Fourier Transform
This is an example of an FT from a normal image (MAGNITUDE!). Because a real world image normally contains lots of low frequencies, there is a bright blob in the middle You can do some basic stuff to the transform and then transform it back to the original image. If you make a circle cut out, the image will be blurred. But with this transform you can also compress the image by letting away high frequencies which the eye can’t see and then transform it back. Thursday, November 22, 2018 Research Lab 4 presentation 10
11
Discrete Cosine Transform (DCT)
Very similar to the discrete Fourier transform, but Uses only real numbers Decomposes a function into a series of even cosine components only Different ordering of coefficients Computationally cheaper than DFT and therefore very commonly used in image processing, eg JPEG and MPEG The basic idea behind this transform is that any signal can be seen as an infinite sum of a series of sinusoidal signals, where each sine can have a different amplitude and phase n practical terms, it means that you can feed in an arbitrary signal and get out data that represents the individual frequencies and their amplitudes that make up the original data. Thursday, November 22, 2018 Research Lab 4 presentation 11
12
(1) Divide image into 8x8 blocks
It first divides an image in 8x8 blocks Input image 8x8 block Thursday, November 22, 2018 Research Lab 4 presentation 12
13
(2a) 2-D DCT basis functions
Low High Low Low Here are the 64 basis functions which DCT uses. Horizontal axis is the horizontal frequency Vertical axis is the vertical frequency Each 8 x 8 block can be build up with these basis functions, and can be seen as a weighted sum of these basis functions. High High 8x8 block Low High Thursday, November 22, 2018 Research Lab 4 presentation 13
14
(2b) 2-D Transform Coding
DC coefficient (average color) + y00 y23 y01 y12 y10 The basis function in the upperleft corner, here left, is the DC coefficient of the block..which is the average color. Then the detail is expressed with the other basis functions with their coefficient. And if you have the information below, you can reconstruct the original block ... AC coefficients (details) Thursday, November 22, 2018 Research Lab 4 presentation 14
15
(3) Zig-zag ordering DCT blocks
Why? To group low frequency coefficients in top of vector. Maps 8 x 8 to a 1 x 64 vector. Then these DCT blocks coefficients are ordered zigzag, to group the low frequency coefficients in top of vector. Low frequencies are more important for the eye than high frequency blocks. Thursday, November 22, 2018 Research Lab 4 presentation 15
16
DCT compression Because human eye is most sensitive to low frequencies, less sensitive to high frequencies, we can truncate the coefficients which represent these high frequencies The lower quality setting, the more coefficients are truncated Lesser coefficients mean less detail of the block which leads to the famous blocking artifact Thursday, November 22, 2018 Research Lab 4 presentation 16
17
Wavelets The major advantage of using wavelets is that they can be used for analyzing functions at various scales It stores versions of an image at various resolutions, which is very similar how the human eye works. As you zoom in at smaller and smaller scales, you can find details that you did not see before. Looking to a forest from an airplane, it appears to be a solid green plane If you look to a forest from a car on the ground, this solid plane resolves into individual trees If you got out of the car, you can see branches and leaves Thursday, November 22, 2018 Research Lab 4 presentation 17
18
Haar wavelet example (1D)
Suppose we have a one-dimensional data set containing eight pixels: [ ] We can represent this image in the Haar basis by computing a wavelet transform, by averaging the pixels together pairwise: [ ] Clearly, some information has been lost in this averaging process, we need to store detail coefficients: [ ] To get a sense for how these wavelets work and give an impression on what is meant by resolution and scale, we give a simple example that is based on the simplest wavelet basis: the Haar wavelet. Suppose we have a one-dimensional data set containing eight pixels. For example, they could be the first row of an two-dimensional 8x8 pixel image: We can represent this image in the Haar basis by computing a wavelet transform. To do this, we first average the pixels together, pairwise to get a new, lower resolution image with four pixel values. Thursday, November 22, 2018 Research Lab 4 presentation 18
19
Haar wavelet example (1D)
The full decomposition will look like We will store this as follows: [ −1 1 −1 −2 1 ] No information has been gained or lost by this process To get a sense for how these wavelets work and give an impression on what is meant by resolution and scale, we give a simple example that is based on the simplest wavelet basis: the Haar wavelet. Suppose we have a one-dimensional data set containing eight pixels. For example, they could be the first row of an two-dimensional 8x8 pixel image: We can represent this image in the Haar basis by computing a wavelet transform. To do this, we first average the pixels together, pairwise to get a new, lower resolution image with four pixel values. Thursday, November 22, 2018 Research Lab 4 presentation 19
20
Haar wavelet example (1D)
The full decomposition will look like This transform will be stored as: [ −1 1 −1 −2 1 ] No information has been gained or lost by this process To get a sense for how these wavelets work and give an impression on what is meant by resolution and scale, we give a simple example that is based on the simplest wavelet basis: the Haar wavelet. Suppose we have a one-dimensional data set containing eight pixels. For example, they could be the first row of an two-dimensional 8x8 pixel image: We can represent this image in the Haar basis by computing a wavelet transform. To do this, we first average the pixels together, pairwise to get a new, lower resolution image with four pixel values. Thursday, November 22, 2018 Research Lab 4 presentation 20
21
Haar wavelet This may look wonderful and all, but what good is compression that takes eight values and compresses it to eight values? Pixel values are similar to their neighbors The image can be compressed by removing small coefficients from this transform The one-dimensional Haar Transform can be easily extended to two-dimensional Input matrix instead of an input vector apply the one-dimensional Haar transform on each row apply the one-dimensional Haar transform on each column You may think that a compression of eight values to other eight values may be useless, but the difference is that because neighbour pixels are very similar to eachother, the detail coefficients are close to zero and can be compressed better. …which only introduces some small errors in the reconstructed image Thursday, November 22, 2018 Research Lab 4 presentation 21
22
Other wavelets The Haar wavelet uses simple basis functions (discontinuous) for scaling and determining detail coefficients Not suitable for smooth functions You may think that a compression of eight values to other eight values may be useless, but the difference is that because neighbour pixels are very similar to eachother, the detail coefficients are close to zero and can be compressed better. …which only introduces some small errors in the reconstructed image Thursday, November 22, 2018 Research Lab 4 presentation 22
23
JPEG vs JPEG2000 Generally, there are two visible damages caused by image compression: Blocking artifacts: artificial horizontal and vertical borders between blocks Blur: loss of fine detail and the smearing of edges …which only introduces some small errors in the reconstructed image Thursday, November 22, 2018 Research Lab 4 presentation 23
24
Test: Image quality Test results are subjective
With ‘normal’ compression (2+ bits/pixel), quality advantage of JPEG2000 is negligible Real quality advantage will only become clear by using very high compression ratios (0.5 or less b/p) At 0.25 b/p, JPEG images begin to look like a mosaic while with JPEG2000 it gets a elegant blur across the image JPEG2000 image files tend to be 20 to 60% smaller than their JPEG counterparts for the same subjective image quality The test results are subjective because they are based on our human visual experience, however I think we can conclude the following: With normal compression (above 2 bits/pixel) the quality advantage of jpeg2000 is negligible. I can’t see the difference unless I zoom in 1000%. Real quality advantage will only become clear by using very high compression ratios (0.5 or less b/p) At a quarter bits per pixel, JPEG images begin to look like a mosaic while with JPEG2000 it gets a elegant blur across the image Thursday, November 22, 2018 Research Lab 4 presentation 24
25
Test: Image quality (Original)
Although the test results are subjective because they are based on our human visual experience we come to the conclusion that JPEG2000 provides a slightly better image quality than JPEG when the compressed rates are 1-2 bits per pixel. Lena Original (512x512x24b) Building Plan (small piece) Thursday, November 22, 2018 Research Lab 4 presentation 25
26
Results: Image quality (Lena)
Although the test results are subjective because they are based on our human visual experience we come to the conclusion that JPEG2000 provides a slightly better image quality than JPEG when the compressed rates are 1-2 bits per pixel. JPEG (0.2 b/p) JPEG2000 (0.2 b/p) Thursday, November 22, 2018 Research Lab 4 presentation 26
27
Results: Image quality (Building plan)
Although the test results are subjective because they are based on our human visual experience we come to the conclusion that JPEG2000 provides a slightly better image quality than JPEG when the compressed rates are 1-2 bits per pixel. JPEG (0.2 b/p) JPEG2000 (0.2 b/p) Thursday, November 22, 2018 Research Lab 4 presentation 27
28
Results: Performance Price to pay: considerable increase in computational complexity and memory usage For these quality improvements there’s a price to pay In the table below we compare both algorithms by recording the time needed to compress the selected images known for their difficulty. Thursday, November 22, 2018 Research Lab 4 presentation 28
29
Conclusions JPEG2000 works better with sharp spikes in images
Quality advantages are really visible when compressing with very high compression ratios Only to be used with very large datasets like fingerprints, MRI scans, building plans, etc. You can choose between different wavelet basis functions to get the optimal result for a specific application Blur isn’t experienced as bad as blocking artifacts Time needed to compress high resolution images takes a lot of time with JPEG2000 JPEG 2000 works better with sharp spikes in images, as can be seen in the building plan. Also fingerprints are compressed with more accuracy than JPEG. Possibly because JPEG2000 needs to process the whole file and JPEG works per block. Thursday, November 22, 2018 Research Lab 4 presentation 29
30
Questions? 30 Thursday, November 22, 2018 Research Lab 4 presentation
JPEG 2000 works better with sharp spikes in images, as can be seen in the building plan. Also fingerprints are compressed with more accuracy than JPEG. Possibly because JPEG2000 needs to process the whole file and JPEG works per block. Thursday, November 22, 2018 Research Lab 4 presentation 30
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.