diff --git a/camelot/imgproc.py b/camelot/imgproc.py index 24abac3..b0a00ba 100644 --- a/camelot/imgproc.py +++ b/camelot/imgproc.py @@ -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. diff --git a/camelot/lattice.py b/camelot/lattice.py index 3a60a73..7ccd49a 100644 --- a/camelot/lattice.py +++ b/camelot/lattice.py @@ -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): diff --git a/camelot/ocr.py b/camelot/ocr.py index 4ce2791..dd862fe 100644 --- a/camelot/ocr.py +++ b/camelot/ocr.py @@ -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 diff --git a/tools/camelot b/tools/camelot index 54a6de1..8e5b236 100755 --- a/tools/camelot +++ b/tools/camelot @@ -79,7 +79,7 @@ options: -C, --constant See adaptive threshold doc. [default: -2] -s, --scale Scaling factor. Large scaling factor leads to smaller lines being detected. [default: 15] - -I, --iterations Number of iterations for dilation. [default: 2] + -I, --iterations Number of iterations for dilation. [default: 0] -i, --invert Invert pdf image to make sure that lines are in foreground. -T, --shift_text Specify where the text in a spanning cell @@ -124,7 +124,7 @@ options: -l, --lang Specify language to be used for OCR. [default: eng] -s, --scale Scaling factor. Large scaling factor leads to smaller lines being detected. [default: 15] - -I, --iterations Number of iterations for dilation. [default: 2] + -I, --iterations Number of iterations for dilation. [default: 0] -d, --debug Debug by visualizing pdf geometry. (contour,line,joint,table) Example: -d table """