Function iaihwt

Synopse

Inverse Haar Wavelet Transform.

  • F = iaihwt(f)
    • F: Image.
    • f: Image.
01. from numpy import *
02. 
03. def iaihwt(f):
04.     from iahaarmatrix import iahaarmatrix
05. 
06.     f = asarray(f).astype(float64)
07.     if len(f.shape) == 1: f = f[:,newaxis]
08.     (m, n) = f.shape
09.     A = iahaarmatrix(m)
10.     if (n == 1):
11.         F = dot(transpose(A), f)
12.     else:
13.         B = iahaarmatrix(n)
14.         F = dot(dot(transpose(A), f), B)
15.     return F

Examples

Example 1

1. from ia636 import iahwt, iaihwt, ianormalize
2. 
3. f = adreadgray('cameraman.pgm')
4. adshow(f)
5. F = iahwt(f)
6. g = iaihwt(F)
7. adshow(ianormalize(F))
8. print sum(sum(abs(f.astype(float)-g.astype(float))))
2.68465338849e-09