distance_srdistance_srDistanceSrDistanceSrdistance_sr (算子名称)
名称
distance_srdistance_srDistanceSrDistanceSrdistance_sr — Calculate the distance between a line segment and one region.
参数签名
Herror distance_sr(const Hobject 区域, double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax)
Herror T_distance_sr(const Hobject 区域, const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2, Htuple* DistanceMin, Htuple* DistanceMax)
void DistanceSr(const HObject& 区域, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax)
void HRegion::DistanceSr(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax) const
void HRegion::DistanceSr(double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax) const
static void HOperatorSet.DistanceSr(HObject 区域, HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distanceMin, out HTuple distanceMax)
void HRegion.DistanceSr(HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distanceMin, out HTuple distanceMax)
void HRegion.DistanceSr(double row1, double column1, double row2, double column2, out double distanceMin, out double distanceMax)
def distance_sr(区域: HObject, row_1: MaybeSequence[Union[float, int]], column_1: MaybeSequence[Union[float, int]], row_2: MaybeSequence[Union[float, int]], column_2: MaybeSequence[Union[float, int]]) -> Tuple[Sequence[float], Sequence[float]]
def distance_sr_s(区域: HObject, row_1: MaybeSequence[Union[float, int]], column_1: MaybeSequence[Union[float, int]], row_2: MaybeSequence[Union[float, int]], column_2: MaybeSequence[Union[float, int]]) -> Tuple[float, float]
描述
该算子 distance_srdistance_srDistanceSrDistanceSrDistanceSrdistance_sr calculates the distance between
a line segment and one region.
Row1Row1Row1Row1row1row_1, Column1Column1Column1Column1column1column_1, Row2Row2Row2Row2row2row_2, Column2Column2Column2Column2column2column_2
are the start and end coordinates of a line segment.
The parameters DistanceMinDistanceMinDistanceMinDistanceMindistanceMindistance_min and DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMaxdistance_max
contain the resulting distances.
注意
To enhance distance_srdistance_srDistanceSrDistanceSrDistanceSrdistance_sr,
holes are ignored.
运行信息
- 多线程类型:可重入(与非独占操作符并行运行)。
- 多线程作用域:全局(可以从任何线程调用)。
- 未经并行化处理。
参数表
区域区域区域区域区域区域 (input_object) region → objectHRegionHObjectHRegionHobject
Input region.
Row1Row1Row1Row1row1row_1 (input_control) point.y(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the first point of the line segment.
Column1Column1Column1Column1column1column_1 (input_control) point.x(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the first point of the line segment.
Row2Row2Row2Row2row2row_2 (input_control) point.y(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the second point of the line segment.
Column2Column2Column2Column2column2column_2 (input_control) point.x(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the second point of the line segment.
DistanceMinDistanceMinDistanceMinDistanceMindistanceMindistance_min (output_control) real(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Minimum distance between the line segment and
the region.
DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMaxdistance_max (output_control) real(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Maximum distance between the line segment and
the region.
例程 (HDevelop)
gen_circle (Circle, 200, 200, 100.5)
Column1 := 300
Column2 := 400
for Row := 50 to 350 by 50
gen_contour_polygon_xld (Line, [Row,Row], [Column1,Column2])
distance_sr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor
例程 (C)
threshold(Image, &Region, 0.0, 120.0);
distance_sr(Region,row1,column1,row2,column2
&distance_min, &distance_max);
例程 (HDevelop)
gen_circle (Circle, 200, 200, 100.5)
Column1 := 300
Column2 := 400
for Row := 50 to 350 by 50
gen_contour_polygon_xld (Line, [Row,Row], [Column1,Column2])
distance_sr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor
例程 (HDevelop)
gen_circle (Circle, 200, 200, 100.5)
Column1 := 300
Column2 := 400
for Row := 50 to 350 by 50
gen_contour_polygon_xld (Line, [Row,Row], [Column1,Column2])
distance_sr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor
例程 (HDevelop)
gen_circle (Circle, 200, 200, 100.5)
Column1 := 300
Column2 := 400
for Row := 50 to 350 by 50
gen_contour_polygon_xld (Line, [Row,Row], [Column1,Column2])
distance_sr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor
结果
distance_srdistance_srDistanceSrDistanceSrDistanceSrdistance_sr returns 2 (
H_MSG_TRUE)
.
可替代算子
distance_scdistance_scDistanceScDistanceScDistanceScdistance_sc,
distance_lrdistance_lrDistanceLrDistanceLrDistanceLrdistance_lr,
distance_prdistance_prDistancePrDistancePrDistancePrdistance_pr,
diameter_regiondiameter_regionDiameterRegionDiameterRegionDiameterRegiondiameter_region
参考其它
hamming_distancehamming_distanceHammingDistanceHammingDistanceHammingDistancehamming_distance,
select_region_pointselect_region_pointSelectRegionPointSelectRegionPointSelectRegionPointselect_region_point,
test_region_pointtest_region_pointTestRegionPointTestRegionPointTestRegionPointtest_region_point,
smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2
模块
Foundation