[iaffine] [Up] [iaresize] | Geometric Manipulations |
Implemented in Python.
f | Image. Gray-scale (uint8 or uint16) or binary image (logical). |
scale | Image. Gray-scale (uint8 or uint16) or binary image (logical).
[srow scol], scale in each dimension |
theta | Double. Rotation |
t | Image. Gray-scale (uint8 or uint16) or binary image (logical).
[trow tcol], translation in each dimension |
g | Image. Gray-scale (uint8 or uint16) or binary image (logical). |
>>> import Numeric
>>> f = iaread('lenina.pgm')
>>> g = iageorigid(f, [0.5,0.5], Numeric.pi/4, [0,64])
>>> iashow(g)
(256, 256) Min= 39 Max= 224 Mean=58.463 Std=13.73
g |
def iageorigid(f, scale, theta, t): from Numeric import cos, sin, matrixmultiply Ts = [[scale[1],0,0], [0,scale[0],0], [0,0,1]] Trot = [[cos(theta),-sin(theta),0], [sin(theta),cos(theta),0], [0,0,1]] Tx = [[1,0,t[1]], [0,1,t[0]], [0,0,1]] g = iaffine(f, matrixmultiply(matrixmultiply(Tx,Trot), Ts)) return g
iaffine | Affine transform. |
[iaffine] [Up] [iaresize] | |