How do I implement the CDF wavelet inverse? I understand and have implemented a 2D discrete wavelet transform that uses a Haar wavelet to process images.

Now I would like to implement a 2D Cohen-Daubechies-Feauveau wavelet transform, but I am uncertain about how to do the inverse transform.

The Haar transform uses a 2x2 kernel, so I have 4 coefficients for each 2x2 block of pixels, and it's obvious to me how to reverse transform to reconstruct my pixels.

The CDF wavelet uses odd tap filters, so at each image location (i,j), I have 4 coefficients.  It seems, therefore, that there is no need to downsample -- I can simply get 4 coefficient images, where each is the same size as the original image, and then run the reverse transform on those four images to reconstruct the original.  Is that correct?

This is the method I tried, but it does not restore the image -- it just gives me garbage.

If A is the low pass filter and B is the high pass filter, x is the image, and x(A,B) means apply filter A to x horizontally and B to x vertically:


x1 = x(A,A)
x2 = x(A,B)
x3 = x(B,A)
x4 = x(B,B)
y1 = x1(B,B)
y2 = x2(B,A)
y3 = x3(A,B)
y4 = x4(A,A)


Sum y1, y2, y3, y4 to get original image, x.

Does this method look correct?

I am certain that I am doing the forward transform correctly, but I am unsure about the reverse transform.  I have read the Wikipedia article on Fast Wavelet Transform, and I believe that I am implementing what this page states (without the downsampling).
To the contrary, the odd tap filters allow you to keep everything perfectly symmetric. If you make the filter centered at $0$, then the application of the filter at position $i$ requires a symmetric range of coefficients around $i$.

All 2-channel wavelets will produce a quad-tree decomposition of a 2D image, regardless of tap length. The only complication of longer, non-trivial wavelet filter banks is the treatment of the boundaries. Here one has an advantage in using symmetric filters. (Symmetric and orthogonal wavelet filters exist for 3-channel, 4-channel wavelets and so on. See articles by Heller, Belogay/Wang, Turcajeva.)

If you continue the image by mirroring at the boundaries, the transformed image will also have odd or even symmetry at the boundaries so that the size of the transformed image can be kept equal to the size of the original image.

In the reconstruction process, you have to reconstruct those mirrored coefficients in the bands and then apply the centered filters to obtain the original image back.