Increased accuracy of orientation measurement by using minarearect2 (box) function