Halcon 基础算子:sort_contours_xld
sort_contours_xld(Contours : SortedContours : SortMode, Order, RowOrCol : )
功能:对xld进行排序
排序方式:
'upper_left':
The position is determined by the upper left corner of the surrounding rectangle.
'upper_right':
The position is determined by the upper right corner of the surrounding rectangle.
'lower_left':
The position is determined by the lower left corner of the surrounding rectangle.
'lower_right':
The position is determined by the lower right corner of the surrounding rectangle.
'character':
The position is determined by the upper left corner of the surrounding rectangle. In contrast to 'upper_left', the contours are also sorted according to the remaining coordinate, if they overlap in the direction of the coordinate which is specified by the parameter RowOrCol.
The parameter Order determines whether the sorting order is increasing or decreasing: using 'true' the order will be increasing, using 'false' the order will be decreasing.
简单注释一下:
以外接矩形的相应顶点(左上,右上,左下,右下)为排序点,true时升序,false降序
character可以理解为 等于多次的左上点排序,避免重叠时卡bug
作者:Doron419
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!