[iaramp] [Up] [iagaussian] | Image Creation |
Implemented in Python.
f | Image. Gray-scale (uint8 or uint16) or binary image (logical). |
Generate a cosenosoid image of size s with amplitude 1, period T, phase phi and wave direction of theta. The output image is a double array.
>>> import Numeric
>>> f = iacos([128,256], 100, Numeric.pi/4, 0)
>>> iashow(ianormalize(f, [0,255]))
(128, 256) Min= 0.0 Max= 255.0 Mean=128.267 Std=90.04
ianormalize(f, [0,255]) |
def iacos(s, t, theta, phi): from Numeric import cos, sin, pi cols, rows = s[1], s[0] x, y = iameshgrid(range(cols),range(rows)) freq = 1./t fcols = freq * cos(theta) frows = freq * sin(theta) f = cos(2*pi*(fcols*x + frows*y) + phi) return f
[iaramp] [Up] [iagaussian] | |