I donβt know if this works at all, but given your sample images, I would find the midpoint of the short edges of the bounding box and get two rectangles for the two halves of the big BBox.
Then I calculated the sum of the pixels of the mask in two separate half-waves, assuming that white is 1 and black is 0. Since the white area is more than half the rectangle where the βfrontβ of the turbine, choose the direction according to which of the two half-BBoxes has a higher amount
source share