I have a Region that can have any shape. (sample below) I would need to find the ROW coordinates of the two points pointed with an arrow. (the most left and most right pixel coordinates of the region.) I've managed to get the Col coordinates with smallest_rectangle1, but cannot find a way to extract the Row coordinates of given points.
How can this be done?
here the code you can use
* get the points of the region contour
get_region_contour (Region, Rows, Columns)
* sort the Columns
tuple_sort_index ( Columns, Indices)
* Left point
LeftIndex := Indices[0]
LeftRow := Rows[LeftIndex]
LeftColumn := Columns[LeftIndex]
* Right point
RightIndex := Indices[|Indices|-1]
RightRow := Rows[RightIndex]
RightColumn := Columns[RightIndex]