CStats:delete CStats:SetImage

CStats:Init


The Init method assigns both a CImage object and a CRect object to the CStats object. Statistics will be measured for this CImage inside the rectangular region specified by the CRect.

Syntax

CStats:Init( CImage, CRect )

Example

Suppose the following objects exist and are initialized to valid data: a CImage named I, and a CRect named R. The following script fragment initializes the CStats for computing statistics inside a rectangle on the image:

 

S = CStats:new()

-- create a CStats object

S:Init( I, R )

-- specify CImage and CRect to measure

mean, sdev = S:MeanSdev()

-- returns the mean and standard deviation

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats, CImage, CRect