Change default value for iterations
parent
4b3e7fb6f6
commit
d28e4b8c1e
|
|
@ -47,7 +47,7 @@ def adaptive_threshold(imagename, invert=False, blocksize=15, c=-2):
|
|||
return img, threshold
|
||||
|
||||
|
||||
def find_lines(threshold, direction='horizontal', scale=15, iterations=2):
|
||||
def find_lines(threshold, direction='horizontal', scale=15, iterations=0):
|
||||
"""Finds horizontal and vertical lines by applying morphological
|
||||
transformations on an image.
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class Lattice:
|
|||
|
||||
iterations : int
|
||||
Number of iterations for dilation.
|
||||
(optional, default: 2)
|
||||
(optional, default: 0)
|
||||
|
||||
invert : bool
|
||||
Whether or not to invert the image. Useful when pdfs have
|
||||
|
|
@ -192,7 +192,7 @@ class Lattice:
|
|||
(optional, default: None)
|
||||
"""
|
||||
def __init__(self, table_area=None, fill=None, mtol=[2], jtol=[2],
|
||||
blocksize=15, threshold_constant=-2, scale=15, iterations=2,
|
||||
blocksize=15, threshold_constant=-2, scale=15, iterations=0,
|
||||
invert=False, margins=(1.0, 0.5, 0.1), split_text=False,
|
||||
flag_size=True, shift_text=['l', 't'], debug=None):
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class OCRLattice:
|
|||
|
||||
iterations : int
|
||||
Number of iterations for dilation.
|
||||
(optional, default: 2)
|
||||
(optional, default: 0)
|
||||
|
||||
debug : string
|
||||
{'contour', 'line', 'joint', 'table'}
|
||||
|
|
@ -61,7 +61,7 @@ class OCRLattice:
|
|||
(optional, default: None)
|
||||
"""
|
||||
def __init__(self, table_area=None, mtol=[2], blocksize=15, threshold_constant=-2,
|
||||
dpi=300, lang="eng", scale=15, iterations=2, debug=None):
|
||||
dpi=300, lang="eng", scale=15, iterations=0, debug=None):
|
||||
|
||||
self.method = 'ocrl'
|
||||
self.table_area = table_area
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ options:
|
|||
-C, --constant <constant> See adaptive threshold doc. [default: -2]
|
||||
-s, --scale <scale> Scaling factor. Large scaling factor leads to
|
||||
smaller lines being detected. [default: 15]
|
||||
-I, --iterations <iterations> Number of iterations for dilation. [default: 2]
|
||||
-I, --iterations <iterations> Number of iterations for dilation. [default: 0]
|
||||
-i, --invert Invert pdf image to make sure that lines are
|
||||
in foreground.
|
||||
-T, --shift_text <shift_text> Specify where the text in a spanning cell
|
||||
|
|
@ -124,7 +124,7 @@ options:
|
|||
-l, --lang <lang> Specify language to be used for OCR. [default: eng]
|
||||
-s, --scale <scale> Scaling factor. Large scaling factor leads to
|
||||
smaller lines being detected. [default: 15]
|
||||
-I, --iterations <iterations> Number of iterations for dilation. [default: 2]
|
||||
-I, --iterations <iterations> Number of iterations for dilation. [default: 0]
|
||||
-d, --debug <debug> Debug by visualizing pdf geometry.
|
||||
(contour,line,joint,table) Example: -d table
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue