[iacircle] [Up] [iacos] | Image Creation |
Implemented in Python.
g | Image. Gray-scale (uint8 or uint16) or binary image (logical). |
Creates a gray scale image with dimensions given by s, with n increasing gray scale bands from left to right with values varying from the specified range.
>>> F = iaramp([5,7], 3, [4,10])
>>> print F
[[ 4 4 4 7 7 10 10] [ 4 4 4 7 7 10 10] [ 4 4 4 7 7 10 10] [ 4 4 4 7 7 10 10] [ 4 4 4 7 7 10 10]]
>>> F = iaramp([200,300], 10, [0,255])
>>> iashow(F)
(200, 300) Min= 0 Max= 255 Mean=127.200 Std=81.37
F |
def iaramp(s, n, range): from Numeric import arange rows, cols = s[0], s[1] x, y = iameshgrid(arange(cols), arange(rows)) g = x*n/cols * (range[1]-range[0]) / (n-1) + range[0] return g
iacircle | Create a binary circle image. |
[iacircle] [Up] [iacos] | |