Main Page | Report this Page
 
   
Science Forum Index  »  Compression Forum  »  Understanding wavelet implementation
Page 1 of 1    
Author Message
J
Posted: Tue Apr 22, 2008 12:42 am
Guest
I need to implement the simple integer 5/3 wavelet, but need a little help
with code.

My understanding till now is that a 5/3 wavelet basically boils down to
following operations,

For even pixels, perform a prediction using a predictor based on average of
left and right pixels. For odd pixels, add half of average of errors at left
and right pixels. And then performing same operations in vertical direction.

Is this correct?

All the wavelet implementations I have found implement some kind of
generalised wavelet calculation method which makes it hard (for me) to
figure out how these operations are performed.

I am looking for clues which can either help me understand the available
wavelet code, or get me started on writing my own code.

How can both the horizontal and vertical transforms be implemented in a
single pass, without 'looking ahead'? Is this even possible (or required)?
While decompression we will only get decompressed pixels in raster-scan
order, so how will looking ahead work then?

I only want to perform 1-level transform, but can multiple level transforms
be done in a single pass?

J
Thomas Richter
Posted: Tue Apr 22, 2008 2:10 am
Guest
J schrieb:
Quote:
I need to implement the simple integer 5/3 wavelet, but need a little help
with code.

My understanding till now is that a 5/3 wavelet basically boils down to
following operations,

For even pixels, perform a prediction using a predictor based on average of
left and right pixels. For odd pixels, add half of average of errors at left
and right pixels. And then performing same operations in vertical direction.

Is this correct?

Yes.

Quote:
All the wavelet implementations I have found implement some kind of
generalised wavelet calculation method which makes it hard (for me) to
figure out how these operations are performed.

The above implementation is the "lifting" implementation of a wavelet.
You can also run a "convolution" implementation which computes the
output directly by convoluting the input with the wavelet filter. Both
methods are equivalent, the lifting method has, however, a higher
performance.

Quote:
I am looking for clues which can either help me understand the available
wavelet code, or get me started on writing my own code.

Get Sweldens paper "Building your own wavelets at home", for example
from here:

http://www.math.tu-berlin.de/~thor/imco/

Quote:
How can both the horizontal and vertical transforms be implemented in a
single pass, without 'looking ahead'? Is this even possible (or required)?

Well, depends on what you call "a single pass". One can build an
"incremental" wavelet computation that requires only a minimal amount of
samples buffered. That's found for example in Taubman's book ("JPEG2000
w. CD-ROM: Image Compression Fundamentals, Standards and Practice
(Kluwer International Series in Engineering & Computer Science)").

Quote:
While decompression we will only get decompressed pixels in raster-scan
order, so how will looking ahead work then?

By buffering enough samples. The idea is pretty simple: Obviously one
needs the neighbouring pixels for a single lifting step, thus you need
to have those pixels buffered to perform the step. Which means that for
each lifting step, the output has to be deferred by one sample: The
current, the next and the previous sample must be available to update
the current sample.

Quote:
I only want to perform 1-level transform, but can multiple level transforms
be done in a single pass?

In principle, yes. The relation between the output of a n-level
transform and its input is of course given by a convolution filter plus
suitable downsampling, so it can be done in principle. However, the
filters you get this way are pretty long, and a direct n-step
implementation is slower than lifting for n times.

Greetings,
Thomas
J
Posted: Wed Apr 23, 2008 3:08 pm
Guest
"Thomas Richter" <thor@math.tu-berlin.de> wrote in message
news:fuk328$1cr$1@infosun2.rus.uni-stuttgart.de...
Quote:
J schrieb:
I need to implement the simple integer 5/3 wavelet, but need a little
help
with code.

My understanding till now is that a 5/3 wavelet basically boils down to
following operations,

For even pixels, perform a prediction using a predictor based on average
of
left and right pixels. For odd pixels, add half of average of errors at
left
and right pixels. And then performing same operations in vertical
direction.

Is this correct?

Yes.

All the wavelet implementations I have found implement some kind of
generalised wavelet calculation method which makes it hard (for me) to
figure out how these operations are performed.

The above implementation is the "lifting" implementation of a wavelet.
You can also run a "convolution" implementation which computes the
output directly by convoluting the input with the wavelet filter. Both
methods are equivalent, the lifting method has, however, a higher
performance.

I am looking for clues which can either help me understand the available
wavelet code, or get me started on writing my own code.

Get Sweldens paper "Building your own wavelets at home", for example
from here:

http://www.math.tu-berlin.de/~thor/imco/

How can both the horizontal and vertical transforms be implemented in a
single pass, without 'looking ahead'? Is this even possible (or
required)?

Well, depends on what you call "a single pass". One can build an
"incremental" wavelet computation that requires only a minimal amount of
samples buffered. That's found for example in Taubman's book ("JPEG2000
w. CD-ROM: Image Compression Fundamentals, Standards and Practice
(Kluwer International Series in Engineering & Computer Science)").

While decompression we will only get decompressed pixels in raster-scan
order, so how will looking ahead work then?

By buffering enough samples. The idea is pretty simple: Obviously one
needs the neighbouring pixels for a single lifting step, thus you need
to have those pixels buffered to perform the step. Which means that for
each lifting step, the output has to be deferred by one sample: The
current, the next and the previous sample must be available to update
the current sample.

I only want to perform 1-level transform, but can multiple level
transforms
be done in a single pass?

In principle, yes. The relation between the output of a n-level
transform and its input is of course given by a convolution filter plus
suitable downsampling, so it can be done in principle. However, the
filters you get this way are pretty long, and a direct n-step
implementation is slower than lifting for n times.

Greetings,
Thomas

Thank you,

J
J
Posted: Sat Apr 26, 2008 2:23 pm
Guest
"Thomas Richter" <thor@math.tu-berlin.de> wrote in message
news:fuk328$1cr$1@infosun2.rus.uni-stuttgart.de...
Quote:
J schrieb:
I need to implement the simple integer 5/3 wavelet, but need a little
help
with code.

My understanding till now is that a 5/3 wavelet basically boils down to
following operations,

For even pixels, perform a prediction using a predictor based on average
of
left and right pixels. For odd pixels, add half of average of errors at
left
and right pixels. And then performing same operations in vertical
direction.

Is this correct?

Yes.

How does this help in removing noise?

J
Thomas Richter
Posted: Mon Apr 28, 2008 10:15 am
Guest
J wrote:

Quote:
My understanding till now is that a 5/3 wavelet basically boils down to
following operations,

For even pixels, perform a prediction using a predictor based on average
of
left and right pixels. For odd pixels, add half of average of errors at
left
and right pixels. And then performing same operations in vertical
direction.

Is this correct?
Yes.

How does this help in removing noise?

It doesn't. The wavelet transformation is a lossless (i.e. invertible)
transformation, you get the original back from the wavelet coefficients.

*Quantizing* the coefficients and then reconstructing might suppress
noise because it suppresses higher frequencies in the image that are
often typical for additive noise.

So long,
Thomas
Marco Al
Posted: Mon Apr 28, 2008 10:51 am
Guest
Thomas Richter wrote:

Quote:
*Quantizing* the coefficients and then reconstructing might suppress
noise because it suppresses higher frequencies in the image that are
often typical for additive noise.

Or it might just add quantization noise.

Shrinking (a.k.a. coring, a.k.a. thresholding) the coefficients works a
lot better for denoising (I assume you know you now that, but I thought
I'd mention it for the benefit of the OP).

Marco
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Thu Jan 08, 2009 8:35 am