In answer to another question, Sushanth stated:
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)
I don't understand how to tell if the lowest point is the bottom-left or bottom-right point on the bases of the "first sub-list".
I need to create a generalized code that can tell them apart so that I can reliably apply warpAffine
transformation to a dataset of images (as shown here).