Function iadct

namespace:ia636
page:iadct

Synopse

Discrete Cossine Transform.

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

Examples

Example 1

1. from ia636 import iadct
2. from ia636 import iacircle
3. 
4. f = 255 * iacircle([256,256], 10, [129,129])
5. iashow(f)
6. F = iadct(f)
7. iashow(log(abs(F)+1))
Warning: downcasting image from int32 to uint16 (may lose precision)
Warning: downcasting image from double to uint16 (may lose precision)