As of Imagemagick 7.0.10.7, there are new string formats for determining the minimum rotated bounding box vertices, width, height, area and angle of orientation for a region in an image. Furthermore, the minimum bounding box angle or its negative (unrotate angle) may be used to properly align the image with the coordinate axes, i.e. unrotate it.
See https://imagemagick.org/script/convex-hull.php#box