Based on text detection, after achieving large-angle tilt rotation, I performed subject extraction and perspective transformation based on the text box area.
Example 1
First rotation:
Second rotation:
Subject extraction:
Perspective transformation:
Example 2
First rotation:
Second rotation:
Subject extraction:
Perspective transformation: