CStats:Median CStats:Max

CStats:Rank


The Rank method computes the rank percentile value inside a rectangular region of the image. The rectangle and image must have been previously initialized for the CStats object.

Syntax

nValue, Sdev = CStats:Rank( nPercentile )

    nPercentile is a number in the range 0 through 100.

    On success, returns the percentile value as a number.

    On success, the second returned argument, Sdev, is the standard deviation about nValue.

    On failure, returns 0, 0.

Example

Suppose a CImage named I and a CRect named R exist. The following script fragment returns the value for rank percentile 32.5 inside a rectangle on the image:

 

S = CStats:new()

-- create a CStats object

S:Init( I, R )

-- specify CImage and CRect to measure

nVal = S:Rank( 32.5 )

-- returns the value at the 32.5 percentile

Printf("rankval=%lg\n", nVal)

-- list the results

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats, CImage, CRect, Median