CCentroid:Calc CCentroid:Y

CCentroid:X


The X method returns the centroid x position obtained by the Calc method.

Syntax

nX = CCentroid:X()

    nX is the centroid pixel coordinate for the x axis, measured in pixel coordinates.

Example

 

C = CCentroid:new()

-- create a new CCentroid object

C:Calc( 100, 200 )

-- calculate the centroid near pixel coordinate 100,200

Printf("X=%.3lf", C:X() )

-- result: X = 101.56

Related Topics

CCentroid, Y, Calc, Image Coordinate System, Subpixel Coordinate Definition