How can I determine whether the page with the text in the correct portrait orientation (not turned) without using text recognition?

There are no landmarks on which the page could be tracked (page numbers at the bottom, etc.), the text does not follow any particular formatting pattern.

  • And if not the text, then what else do you want to navigate? You can try to recognize the specific characters of the letter (by which it will be clear that the sheet is turned: Aa Her Cc TT for example). You can try to recognize the comma points and "row", and on the "row" and punctuation marks try to make such a conclusion. - nick_n_a pm
  • There are algorithms for recognition. Either in Google, or you can write a crutch yourself. The principle is approximately as follows: we draw lines vertically and horizontally across the page. For each line, we count how many pixels below it are black, and how many are white. In those that will go parallel to the rows, very contrast lines will be observed, where there is a lot of black in the other, and a lot of white in the other. In perpendicular, all lines will be approximately on average gray. Look for a ready-made algorithm. A lot of "but" - Serhii Dikobrazko

0