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

 

posted @ 2021-08-23 10:51  Doron419  阅读(1321)  评论(0编辑  收藏  举报