Function iahwt

namespace:ia636
page:iahwt

Synopse

Haar Wavelet Transform.

  • F = iahwt(f)
    • F: Image.
    • f: Image.
01. from numpy import *
02. 
03. def iahwt(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(A, f)
12.     else:
13.         B = iahaarmatrix(n)
14.         F = dot(dot(A, f), transpose(B))
15.     return F

Examples

Example 1

1. from ia636 import iahwt
2. 
3. f = iaread('cameraman.pgm')
4. iashow(f)
5. F = iahwt(f)
6. iashow(log(abs(F)+1))
Warning: downcasting image from double to uint16 (may lose precision)

See Also: