| [uint16] [Up] [mmdrawv] | Image Creation |
Implemented in Python.
| f | Image Unsigned gray-scale (uint8 or uint16), signed (int32) or binary image. |
| WT | Double Positive integer ( width thickness). Default:
|
| HT | Double Positive integer ( height thickness). Default:
|
| DT | Double Positive integer ( depth thickness). Default:
|
| k1 | Double Non-negative integer.
Frame gray-level. Default:
|
| k2 | Double Non-negative integer.
Background gray level. Default:
|
| y | Image image of same type as
|
mmframe creates an image
y, with the same dimensions (W,H,D) and same pixel type of the image
f, such that the value of the pixels in the image frame is
k1 and the value of the other pixels is
k2. The thickness of the image frame is DT.
def mmframe(f, WT=1, HT=1, DT=0, k1=None, k2=None):
if k1 is None: k1 = mmlimits(f)[1]
if k2 is None: k2 = mmlimits(f)[0]
assert len(f.shape)<3,'Supports 2D only'
y = mmunion(mmintersec(f,mmlimits(f)[0]),k2)
y[:,0:WT] = k1
y[:,-WT:] = k1
y[0:HT,:] = k1
y[-HT:,:] = k1
return y
| [uint16] [Up] [mmdrawv] | |
| Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |