Skip to content

Commit 8be1c2a

Browse files
committed
Better docstring for text_direction
Explains all the algorithms impacted by the setting in blla.segment() and pageseg.segment().
1 parent ab0cd42 commit 8be1c2a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

kraken/blla.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ def segment(im: PIL.Image.Image,
260260
im: Input image. The mode can generally be anything but it is possible
261261
to supply a binarized-input-only model which requires accordingly
262262
treated images.
263-
text_direction: Passed-through value for serialization.serialize.
263+
text_direction: Determines principal text direction for heuristic
264+
reading order determination and fallback value for line
265+
orientation in case of low model confidence.
266+
Passed-through value for Segmentation container class.
264267
mask: A bi-level mask image of the same size as `im` where 0-valued
265268
regions are ignored for segmentation purposes. Disables column
266269
detection.

kraken/pageseg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,10 @@ def segment(im: PIL.Image.Image,
319319
320320
Args:
321321
im: A bi-level page of mode '1' or 'L'
322-
text_direction: Principal direction of the text
323-
(horizontal-lr/rl/vertical-lr/rl)
322+
text_direction: Determines principal text direction for heuristic
323+
reading order determination and value for line
324+
orientation. Passed-through value for Segmentation
325+
container class.
324326
scale: Scale of the image. Will be auto-determined if set to `None`.
325327
maxcolseps: Maximum number of whitespace column separators
326328
black_colseps: Whether column separators are assumed to be vertical

0 commit comments

Comments
 (0)