CCentroid Class


The CCentroid class encapsulates functionality for computing accurate centroid coordinates in an image. The centroid position is a refined coordinate based upon higher order moments of the pixel value distribution. This class provides methods for calculating the centroid position and for retrieving calculation results. The pixel coordinates may be converted to world coordinates using one of the CImage class methods such as XyToWcs.

Usage

Construction

Object = CCentroid:new()

Destruction

Object:delete()

Class Properties

These properties hold the data used by each instance of a CCentroid object.

Methods

Construction

new

Creates a new instance of a CCentroid object. Various constructors are available

delete

Deletes the instance of the CCentroid object.

Operations

Calc

Calculates the centroid position for the image near starting coordinate x,y.

X

Returns the computed x coordinate of the centroid position.

Y

Returns the computed y coordinate of the centroid position.

GetStartingPos

Returns the initial x,y coordinates passed to Calc.

Related Topics

Script Classes

Image Coordinate System

Subpixel Coordinate Definition