TNorm
The TNorm function normalizes a table by scaling all its elements to make its total area or volume equal to 1.0. The table can be a Lua array or a class object of type CImage, CArray, or CMatrix.
table = TNorm( table )
CImage = TNorm( CImage )
CArray = TNorm( CArray )
CMatrix = TNorm( CMatrix )
where
table, CImage, CArray, or CMatrix contains the target data.
On success, the modified data object is returned, otherwise nil is returned.
The following script creates a Gaussian normal population of 10,000 numbers with the area under the curve normalized to 1.0.
|
-- create a table of 10,000 values and normalize it |
The next script normalizes a CImage.
|
-- attach the topmost image window |
|
-- make sure an image window is on top |
|
-- normalize the CImage |