ClassesClassesClassesClasses | | | | Operators

distance_prdistance_prDistancePrdistance_prDistancePrDistancePr (Operator)


distance_prdistance_prDistancePrdistance_prDistancePrDistancePr — Calculate the distance between a point and a region.


distance_pr(Region : : Row, Column : DistanceMin, DistanceMax)

Herror distance_pr(const Hobject Region, double Row, double Column, double* DistanceMin, double* DistanceMax)

Herror T_distance_pr(const Hobject Region, const Htuple Row, const Htuple Column, Htuple* DistanceMin, Htuple* DistanceMax)

Herror distance_pr(Hobject Region, const HTuple& Row, const HTuple& Column, double* DistanceMin, double* DistanceMax)

Herror distance_pr(Hobject Region, const HTuple& Row, const HTuple& Column, HTuple* DistanceMin, HTuple* DistanceMax)

HTuple HRegion::DistancePr(const HTuple& Row, const HTuple& Column, HTuple* DistanceMax) const

void DistancePr(const HObject& Region, const HTuple& Row, const HTuple& Column, HTuple* DistanceMin, HTuple* DistanceMax)

void HRegion::DistancePr(const HTuple& Row, const HTuple& Column, HTuple* DistanceMin, HTuple* DistanceMax) const

void HRegion::DistancePr(double Row, double Column, double* DistanceMin, double* DistanceMax) const

void HOperatorSetX.DistancePr(
[in] IHUntypedObjectX* Region, [in] VARIANT Row, [in] VARIANT Column, [out] VARIANT* DistanceMin, [out] VARIANT* DistanceMax)

VARIANT HRegionX.DistancePr(
[in] VARIANT Row, [in] VARIANT Column, [out] VARIANT* DistanceMax)

static void HOperatorSet.DistancePr(HObject region, HTuple row, HTuple column, out HTuple distanceMin, out HTuple distanceMax)

void HRegion.DistancePr(HTuple row, HTuple column, out HTuple distanceMin, out HTuple distanceMax)

void HRegion.DistancePr(double row, double column, out double distanceMin, out double distanceMax)


The operator distance_prdistance_prDistancePrdistance_prDistancePrDistancePr calculates the distance between a point and one region. As input the coordinates of the points (RowRowRowRowRowrow,ColumnColumnColumnColumnColumncolumn) and one region are expected. If a point is inside of the region, its minimum distance is zero. The parameters DistanceMinDistanceMinDistanceMinDistanceMinDistanceMindistanceMin and DistanceMaxDistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMax return the result of the calculation.



RegionRegionRegionRegionRegionregion (input_object)  region objectHRegionHRegionHRegionHRegionXHobject

Input region.

RowRowRowRowRowrow (input_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the point.

ColumnColumnColumnColumnColumncolumn (input_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the point.

DistanceMinDistanceMinDistanceMinDistanceMinDistanceMindistanceMin (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Minimum distance between the point and the region.

DistanceMaxDistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMax (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum distance between the point and the region.

Example (HDevelop)

dev_close_window ()
read_image (Image, 'mreut')
dev_open_window (0, 0, 512, 512, 'white', WindowHandle)
dev_set_color ('black')
threshold (Image, Region, 180, 255)
connection (Region, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', \
              10000, 100000000)
Row1 := 255
Column1 := 255
dev_clear_window ()
dev_display (SelectedRegions)
dev_set_color ('red')
for i := 1 to 360 by 1
  Row2 := 255 + sin(rad(i)) * 200
  Column2 := 255 + cos(rad(i)) * 200
  disp_line (WindowHandle, Row1, Column1, Row2, Column2)
  distance_pr (SelectedRegions, Row2, Column2, \
               DistanceMin, DistanceMax)


distance_prdistance_prDistancePrdistance_prDistancePrDistancePr returns 2 (H_MSG_TRUE).


distance_pcdistance_pcDistancePcdistance_pcDistancePcDistancePc, distance_lrdistance_lrDistanceLrdistance_lrDistanceLrDistanceLr, distance_srdistance_srDistanceSrdistance_srDistanceSrDistanceSr, diameter_regiondiameter_regionDiameterRegiondiameter_regionDiameterRegionDiameterRegion

See also

hamming_distancehamming_distanceHammingDistancehamming_distanceHammingDistanceHammingDistance, select_region_pointselect_region_pointSelectRegionPointselect_region_pointSelectRegionPointSelectRegionPoint, test_region_pointtest_region_pointTestRegionPointtest_region_pointTestRegionPointTestRegionPoint, smallest_rectangle2smallest_rectangle2SmallestRectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2



ClassesClassesClassesClasses | | | | Operators