Issue:
The original image is tilted at an angle. How can I obtain the correctly oriented image?
Solution:
To correctly rotate the document to the desired angle, follow these steps.
-
Process the original image. During the processing, several containers with different values are obtained. We need two specific containers: DocumentPosition (result_type 85) and OneCandidate (result_type 9).
-
Obtaining the rotation angle: In the ContainerList.List array, locate the DocumentPosition object where the Angle: -37.066749572753906 value is present.
-
The original image should be rotated by the specified angle. After the rotation, the image will have a similar position as shown in the screenshot. This is typically the first step in document rotation for processing and recognition purposes.

-
After recognition, we obtain the OneCandidate result where the RotationAngle: 90 value is present. The image needs to be rotated by this angle to achieve the correct orientation for the user.
-
To achieve the desired result, add both angle values and rotate the original image by the obtained angle. In this example: 90+(-37.066749572753906)=52.93325042724609.

Comments
Please sign in to leave a comment.