Commit 4d72c196 authored by Marián Skrip's avatar Marián Skrip

Set language for detecting orientation to `osd`

This fixes segfaults when running C-API Tesseract 4 with psm as
osd only with other than `osd` language.
parent 5abd0a56
......@@ -42,7 +42,11 @@ def can_detect_orientation():
def detect_orientation(image, lang=None):
handle = tesseract_raw.init(lang=lang)
# C-API with Tesseract 4 segfaults if running OSD_ONLY
# psm mode with other than osd language
# lang argument left purely for compatibility reasons
# tested on 4.0.0-rc2
handle = tesseract_raw.init(lang='osd')
handle, tesseract_raw.PageSegMode.OSD_ONLY
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment