CImage:Distance
The Distance method calculates the Distance in pixel coordinate units along a line formed by 2 image points. To measure a distance in world coordinates, use the DistanceWcs method.
nDistance = CImage:Distance( x1, y1, x2, y2) |
The Distance method returns a distance in pixel units. The DistanceWcs and DistanceWcsStr methods return distance measured in calibrated world coordinate units rather than pixel coordinates.
Assume an image is displayed and attached to a CImageView named V. The following script fragment measures the distance between two points (x1,y1) and (x2,y2) when the coordinates are in pixel units:
|
-- load the image from a |
|
-- point 1 |
|
-- point 2 |
|
-- make the measurement |
CImage, DistanceWcs, Image Coordinate System, Subpixel Coordinate Definition