There are two methods of calculating the angle of a blob, the Axis of Inertia method and the Minimum Rectangle method.
Axis of Inertia
When a blob is found using this method, its best fit ellipse is calculated. The angle of the blob is based on the angle of the ellipse's semi major axis. This method works well with most objects except objects have a rotational symmetry angle < 180 degrees like square shaped blobs. This method is not reliable for square blobs since the best fit ellipse of a square blob is a circle. The best fit ellipse is circular when the semi major and semi minor axis are the same length.
The image below shows two found blobs using the angle of inertia mode. Since the best fit ellipse is nearly circlular, then found angle seems random.
Minimum Rectangle
When a blob is found using this method, the smallest rectangle containing the blob is calculated. The angle of the blob is calculated based on the long side of the rectangle. This method is best for calculating the angle of a blob that is symmetrical at least two ways, like a square shaped blob. This could also apply to a rectangular box with a crushed corner.
The image below shows the same two blobs as the image above found using the minimum rectangle mode. Since the found blobs are nearly square, the minimum rectangle finds the angle closely matched to the square shape of the blob.
Note 1: The two methods of calculating the angle or other parameters of a found blob do not always yield the same result.
Note 2: The angle of a blob with either method is +/- 90 degrees.
Note 3: The location of the centroid of the blob is based on the ellipse. Its location will be the same for both methods.