Using python, given a numpy array of point vertices and center of mass, how do I find the most upper left vertex (along the 45 degree axis), upper right, bottom left, and bottom right vertex?
Its easy to find the most Right or Highest, (its just the Max X coordinate, or Max Y)
In this example, (6,7) is not the most left as (4,10), or highest (10,5); however its most upper-left.
I want to be able to extend, and quickly sort what is second, or third closest to upper left.
Note: Sometimes the coordinates may not directly lie on the 45deg axis .
Currently using Python, with numpy and opencv.
Note: "Its easy to find the most Right or Highest, (its just the Max X coordinate, or Max Y) " If there is way to change the frame of reference, to a 45 degree axis angle, they can find most top left or top right correspondingly. Trying to find way to conduct this,
Update: Reviewing this example, want to extend it to bottom left and bottom right
https://stackoverflow.com/a/64659569/15435022
is bottom left as this?
bottom_left = sorted(keypoints_to_search, key=lambda p: (-p.pt[0]) - (p.pt[1]))[0]