segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldsegment_contour_attrib_xld (算子)
名称
segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldsegment_contour_attrib_xld — 分割局部属性满足给定条件的 XLD 轮廓部分。
签名
Herror segment_contour_attrib_xld(const Hobject Contour, Hobject* ContourPart, const char* Attribute, const char* Operation, double Min, double Max)
Herror T_segment_contour_attrib_xld(const Hobject Contour, Hobject* ContourPart, const Htuple Attribute, const Htuple Operation, const Htuple Min, const Htuple Max)
void SegmentContourAttribXld(const HObject& Contour, HObject* ContourPart, const HTuple& Attribute, const HTuple& Operation, const HTuple& Min, const HTuple& Max)
HXLDCont HXLDCont::SegmentContourAttribXld(const HTuple& Attribute, const HString& Operation, const HTuple& Min, const HTuple& Max) const
HXLDCont HXLDCont::SegmentContourAttribXld(const HString& Attribute, const HString& Operation, double Min, double Max) const
HXLDCont HXLDCont::SegmentContourAttribXld(const char* Attribute, const char* Operation, double Min, double Max) const
HXLDCont HXLDCont::SegmentContourAttribXld(const wchar_t* Attribute, const wchar_t* Operation, double Min, double Max) const
(
Windows only)
static void HOperatorSet.SegmentContourAttribXld(HObject contour, out HObject contourPart, HTuple attribute, HTuple operation, HTuple min, HTuple max)
HXLDCont HXLDCont.SegmentContourAttribXld(HTuple attribute, string operation, HTuple min, HTuple max)
HXLDCont HXLDCont.SegmentContourAttribXld(string attribute, string operation, double min, double max)
def segment_contour_attrib_xld(contour: HObject, attribute: MaybeSequence[str], operation: str, min: MaybeSequence[Union[int, float, str]], max: MaybeSequence[Union[int, float, str]]) -> HObject
描述
segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldSegmentContourAttribXldsegment_contour_attrib_xld segments the contour in
ContourContourContourContourcontourcontour into contour parts ContourPartContourPartContourPartContourPartcontourPartcontour_part. The segmentation
of the contour depends on the values of its attributes AttributeAttributeAttributeAttributeattributeattribute
(see the possible values for AttributeAttributeAttributeAttributeattributeattribute below).
The operator checks which attribute values lie within the given limits
(MinMinMinMinminmin, MaxMaxMaxMaxmaxmax) and returns the corresponding contour
segments with its attributes in ContourPartContourPartContourPartContourPartcontourPartcontour_part。
If OperationOperationOperationOperationoperationoperation is set to 'and'"and""and""and""and""and", each of the given attributes
must lie within the limits.
If OperationOperationOperationOperationoperationoperation is set to 'or'"or""or""or""or""or", at least one of
the attributes has to be within the limits. The attributes are processed
in the same order as they are given in AttributeAttributeAttributeAttributeattributeattribute.
If only one attribute is used, the value of OperationOperationOperationOperationoperationoperation is
ignored.
The parameters MinMinMinMinminmin and MaxMaxMaxMaxmaxmax can be set to
'min'"min""min""min""min""min" or 'max'"max""max""max""max""max" in order to leave bottom and top limit,
respectively, open.
Note that not all attributes are defined in all contours per default.
Which attributes
are defined for a contour depends on how the contour was
instantiated, and whether some operations have been previously performed on
it. For example, the attributes 'width_right'"width_right""width_right""width_right""width_right""width_right" and
'width_left'"width_left""width_left""width_left""width_left""width_left" are only
defined, if the contour was created with the operator lines_gausslines_gaussLinesGaussLinesGaussLinesGausslines_gauss。Likewise, the attribute 'distance'"distance""distance""distance""distance""distance" is only present if the distances
to some other contour was previously calculated with
distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXlddistance_contours_xld or apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXldapply_distance_transform_xld。
Condition:
Possible values for AttributeAttributeAttributeAttributeattributeattribute:
- 'edge_direction':
Edge direction
- 'angle':
Angle of the direction perpendicular to the contour
- 'response':
Magnitude of the second derivative
- 'width_right':
Line width to the right of the line
- 'width_left':
Line width to the left of the line
- 'contrast':
Contrast of the line point
- 'asymmetry':
Asymmetry of the line point
- 'distance':
Minimum pointwise distance to a reference contour
To find out which operators add the attributes above to contours and further
details about those attributes, see get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
ContourContourContourContourcontourcontour (输入对象) xld_cont(-array) → objectHXLDContHObjectHXLDContHobject
Contour to be segmented.
ContourPartContourPartContourPartContourPartcontourPartcontour_part (输出对象) xld_cont-array → objectHXLDContHObjectHXLDContHobject *
Segmented contour parts.
AttributeAttributeAttributeAttributeattributeattribute (输入控制) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Contour attributes to be checked.
默认值:
'distance'
"distance"
"distance"
"distance"
"distance"
"distance"
值列表:
'angle'"angle""angle""angle""angle""angle", 'asymmetry'"asymmetry""asymmetry""asymmetry""asymmetry""asymmetry", 'contrast'"contrast""contrast""contrast""contrast""contrast", 'distance'"distance""distance""distance""distance""distance", 'edge_direction'"edge_direction""edge_direction""edge_direction""edge_direction""edge_direction", 'response'"response""response""response""response""response", 'width_left'"width_left""width_left""width_left""width_left""width_left", 'width_right'"width_right""width_right""width_right""width_right""width_right"
OperationOperationOperationOperationoperationoperation (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Linkage type of the individual attributes.
默认值:
'and'
"and"
"and"
"and"
"and"
"and"
值列表:
'and'"and""and""and""and""and", 'or'"or""or""or""or""or"
MinMinMinMinminmin (输入控制) real(-array) → HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Lower limits of the attribute values.
默认值:
150.0
最小增量:
0.001
建议增量:
1.0
MaxMaxMaxMaxmaxmax (输入控制) real(-array) → HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Upper limits of the attribute values.
默认值:
99999.0
最小增量:
0.001
建议增量:
1.0
限制:
Max >= Min
示例(HDevelop)
read_image (Image, 'fabrik')
edges_sub_pix (Image, Edges, 'canny', 1, 20, 40)
* select 'vertical' edges:
segment_contour_attrib_xld (Edges, ContourPart, 'edge_direction', \
'and', rad(90-20), rad(90+20))
结果
算子 segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldSegmentContourAttribXldsegment_contour_attrib_xld 在输入不为空时返回值 2 ( H_MSG_TRUE )。The behavior in case of empty input
(no input objects available) is set via the operator
set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。
可能的前趋
lines_gausslines_gaussLinesGaussLinesGaussLinesGausslines_gauss,
edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix,
apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXldapply_distance_transform_xld,
distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXlddistance_contours_xld
可能的后继
fit_line_contour_xldfit_line_contour_xldFitLineContourXldFitLineContourXldFitLineContourXldfit_line_contour_xld,
fit_ellipse_contour_xldfit_ellipse_contour_xldFitEllipseContourXldFitEllipseContourXldFitEllipseContourXldfit_ellipse_contour_xld,
fit_circle_contour_xldfit_circle_contour_xldFitCircleContourXldFitCircleContourXldFitCircleContourXldfit_circle_contour_xld,
fit_rectangle2_contour_xldfit_rectangle2_contour_xldFitRectangle2ContourXldFitRectangle2ContourXldFitRectangle2ContourXldfit_rectangle2_contour_xld
另见
split_contours_xldsplit_contours_xldSplitContoursXldSplitContoursXldSplitContoursXldsplit_contours_xld,
get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldGetContourGlobalAttribXldget_contour_global_attrib_xld,
query_contour_attribs_xldquery_contour_attribs_xldQueryContourAttribsXldQueryContourAttribsXldQueryContourAttribsXldquery_contour_attribs_xld,
get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld
模块
基础