Name
distance_prdistance_prDistancePrdistance_prDistancePrDistancePr — Calculate the distance between a point and a region.
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
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.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
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.
Column coordinate of the point.
Minimum distance between the point and the region.
Maximum distance between the point and the region.
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)
endfor
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
hamming_distancehamming_distanceHammingDistancehamming_distanceHammingDistanceHammingDistance,
select_region_pointselect_region_pointSelectRegionPointselect_region_pointSelectRegionPointSelectRegionPoint,
test_region_pointtest_region_pointTestRegionPointtest_region_pointTestRegionPointTestRegionPoint,
smallest_rectangle2smallest_rectangle2SmallestRectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2
Foundation