HALCON Reference Manual 10.0.2
Table of Contents / Regions / Transformations ClassesClassesClasses | | | Operators

sort_regionsort_regionsort_regionSortRegionSortRegion (Operator)

Name

sort_regionsort_regionsort_regionSortRegionSortRegion — Sorting of regions with respect to their relative position.

Signature

sort_region(Regions : SortedRegions : SortMode, Order, RowOrCol : )

Herror sort_region(const Hobject Regions, Hobject* SortedRegions, const char* SortMode, const char* Order, const char* RowOrCol)

Herror T_sort_region(const Hobject Regions, Hobject* SortedRegions, const Htuple SortMode, const Htuple Order, const Htuple RowOrCol)

Herror sort_region(Hobject Regions, Hobject* SortedRegions, const HTuple& SortMode, const HTuple& Order, const HTuple& RowOrCol)

HRegionArray HRegionArray::SortRegion(const HTuple& SortMode, const HTuple& Order, const HTuple& RowOrCol) const

void HOperatorSetX.SortRegion(
[in] IHUntypedObjectX* Regions, [out] IHUntypedObjectX*SortedRegions, [in] VARIANT SortMode, [in] VARIANT Order, [in] VARIANT RowOrCol)

IHRegionX* HRegionX.SortRegion(
[in] BSTR SortMode, [in] BSTR Order, [in] BSTR RowOrCol)

static void HOperatorSet.SortRegion(HObject regions, out HObject sortedRegions, HTuple sortMode, HTuple order, HTuple rowOrCol)

HRegion HRegion.SortRegion(string sortMode, string order, string rowOrCol)

Description

The operator sort_regionsort_regionsort_regionSortRegionSortRegion sorts the regions with respect to their relative position. All sorting methods with the exception of 'character'"character""character""character""character" use one point of the region. With the help of the parameter RowOrColRowOrColRowOrColRowOrColrowOrCol = 'row'"row""row""row""row" these points will be sorted according to their row and then according to their column. By using 'column'"column""column""column""column", the column value will be used first. The following values are available for the parameter SortModeSortModeSortModeSortModesortMode:

'character'"character""character""character""character"

The regions will be treated like characters in a row and will be sorted according to their order in the line: If two regions overlap horizontally, they will be sorted with respect to their column values, otherwise they will be sorted with regard to their row values. To be able to sort a line correctly, all regions in the line must overlap each other vertically. Furthermore, the regions in adjacent rows must not overlap.

'first_point'"first_point""first_point""first_point""first_point"

The point with the lowest column value in the first row of the region.

'last_point'"last_point""last_point""last_point""last_point"

The point with the highest column value in the last row of the region.

'upper_left'"upper_left""upper_left""upper_left""upper_left"

Upper left corner of the surrounding rectangle.

'upper_right'"upper_right""upper_right""upper_right""upper_right"

Upper right corner of the surrounding rectangle.

'lower_left'"lower_left""lower_left""lower_left""lower_left"

Lower left corner of the surrounding rectangle.

'lower_right'"lower_right""lower_right""lower_right""lower_right"

Lower right corner of the surrounding rectangle.

The parameter OrderOrderOrderOrderorder determines whether the sorting order is increasing or decreasing: using 'true'"true""true""true""true" the order will be increasing, using 'false'"false""false""false""false" the order will be decreasing.

Parallelization

Parameters

RegionsRegionsRegionsRegionsregions (input_object)  region-array objectHRegionHRegionArrayHRegionXHobject

Regions to be sorted.

SortedRegionsSortedRegionsSortedRegionsSortedRegionssortedRegions (output_object)  region-array objectHRegionHRegionArrayHRegionXHobject *

Sorted regions.

SortModeSortModeSortModeSortModesortMode (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Kind of sorting.

Default value: 'first_point' "first_point" "first_point" "first_point" "first_point"

List of values: 'character'"character""character""character""character", 'first_point'"first_point""first_point""first_point""first_point", 'last_point'"last_point""last_point""last_point""last_point", 'upper_left'"upper_left""upper_left""upper_left""upper_left", 'lower_left'"lower_left""lower_left""lower_left""lower_left", 'upper_right'"upper_right""upper_right""upper_right""upper_right", 'lower_right'"lower_right""lower_right""lower_right""lower_right"

OrderOrderOrderOrderorder (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Increasing or decreasing sorting order.

Default value: 'true' "true" "true" "true" "true"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"

RowOrColRowOrColRowOrColRowOrColrowOrCol (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Sorting first with respect to row, then to column.

Default value: 'row' "row" "row" "row" "row"

List of values: 'row'"row""row""row""row", 'column'"column""column""column""column"

Result

If the parameters are correct, the operator sort_regionsort_regionsort_regionSortRegionSortRegion returns the value 2 (H_MSG_TRUE). Otherwise an exception will be raised.

Possible Successors

do_ocr_multido_ocr_multido_ocr_multiDoOcrMultiDoOcrMulti, do_ocr_singledo_ocr_singledo_ocr_singleDoOcrSingleDoOcrSingle

Module

Foundation


Table of Contents / Regions / Transformations ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH