Parameter Name | Type | Description |
Angel | Float | The rotation angle of the image (in degrees), with the horizontal direction of the text as 0°; clockwise is positive, and counterclockwise is negative. |
Polygon | Array of Coord | Coordinates of the text line, represented by the coordinates of its four vertices. Note: This field may return null, indicating that no valid value can be obtained. |
ItemPolygon | Pixel coordinates of the text line in the rotation-corrected image, represented as (top-left x, top-left y, width, height). |



{"TextDetections": [{"DetectedText": "Confetteria","Confidence": 99,"ItemPolygon": {"X": 473,"Y": 273,"Width": 112,"Height": 22},"Polygon": [{"X": 450,"Y": 211},{"X": 560,"Y": 223},{"X": 558,"Y": 244},{"X": 448,"Y": 232}],"AdvancedInfo": "{\\"Parag\\":{\\"ParagNo\\":1}}"},{"DetectedText": "Raffaello","Confidence": 99,"ItemPolygon": {"X": 396,"Y": 304,"Width": 282,"Height": 68},"Polygon": [{"X": 370,"Y": 233},{"X": 649,"Y": 265},{"X": 642,"Y": 331},{"X": 362,"Y": 299}],"AdvancedInfo": "{\\"Parag\\":{\\"ParagNo\\":2}}"},...],"Language": "zh","Angel": 6.5,"RequestId": "8f038ec7-062d-44b0-b2f9-e5736ced4f84"}
import cv2from PIL import Imageimport numpydef rotate_img(image,angle):img = Image.fromarray(cv2.cvtColor(image,cv2.COLOR_BGR2RGB))rotated = img.rotate(angle, expand = 1)rotated = cv2.cvtColor(numpy.asarray(rotated),cv2.COLOR_RGB2BGR)return rotatedimage = cv2.imread('./demo.jpg')angle = 6.4rotate_img = rotate_img(image, angle)img2 = rotate_img[:,:,::-1]

Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback