How to tell if the lowest point in the output of BoxPoints(rect) is the bottom right or bottom left point of the bounding box?
Quoting from this answer:
The lowest point of the rectangle(does not matter left or right) will always be the first sub-list of the "box" ndarray. So in the example I have given, the first sub-list [169 144] represents the "bottom right of this rectangle". Now this point will be the reference point to decide what the next sub-list represents. Meaning, the next sub-list will always represent the point that you first get when you move in the clockwise direction. (as shown in the second image of the for loop)
Here are my two questions:
How to tell if the lowest point is the bottom-left
or bottom-right
point on the bases of the "first sub-list"?
How to create a generalized code that can tell them apart, so that the warpAffine
transformation can be reliably applied to a dataset of images, as shown here?