CStats:SetImage
The SetImage method assigns a CImage object to the CStats object. Statistics will be measured for this CImage.
CStats:SetImage( CImage ) |
|
Suppose a CImage named I exists. The following script fragment initializes CStats for computing statistics inside a rectangle on the image:
S = CStats:new() |
-- create a CStats object |
S:SetImage( I ) |
-- specify the CImage to be measured |
S:SetRect( R ) |
-- specify the CRect to be measured |
mean, sdev = S:MeanSdev() |
-- returns the mean and standard deviation |
S:delete() |
-- when done with S, remove it from memory |