From cf58bf95cd13b1b0e07f553af7e802668f543cbd Mon Sep 17 00:00:00 2001 From: Narongdej Sarnsuwan Date: Fri, 19 Jul 2019 15:55:25 +0700 Subject: [PATCH] Make _segment return unscale point instead of scale --- .gitignore | 69 ++++++++++++++++++++++++++++++++++++++ .idea/camelot.iml | 11 ++++++ .idea/misc.xml | 4 +++ .idea/modules.xml | 8 +++++ .idea/vcs.xml | 6 ++++ README.md | 4 +++ camelot/__init__.py | 1 + camelot/parsers/lattice.py | 4 ++- 8 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 .idea/camelot.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index d0aea62..64df909 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,72 @@ htmlcov/ # vscode .vscode + +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser diff --git a/.idea/camelot.iml b/.idea/camelot.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/.idea/camelot.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a2e120d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..38222c7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 4ecb665..3dc2935 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +#BEWARE:: This is a customized camelot version!!! + +--- +

diff --git a/camelot/__init__.py b/camelot/__init__.py index bc4beb6..f0cf44f 100644 --- a/camelot/__init__.py +++ b/camelot/__init__.py @@ -6,6 +6,7 @@ from .__version__ import __version__ from .io import read_pdf from .plotting import PlotMethods +print("LOAD LOCAL CAMELOT") # set up logging logger = logging.getLogger("camelot") diff --git a/camelot/parsers/lattice.py b/camelot/parsers/lattice.py index e771bd9..a6ce12e 100644 --- a/camelot/parsers/lattice.py +++ b/camelot/parsers/lattice.py @@ -286,8 +286,10 @@ class Lattice(BaseParser): table_bbox = find_joints(areas, vertical_mask, horizontal_mask) self.table_bbox_unscaled = copy.deepcopy(table_bbox) + self.vertical_segments = vertical_segments + self.horizontal_segments = horizontal_segments - self.table_bbox, self.vertical_segments, self.horizontal_segments = scale_image( + self.table_bbox, _, _= scale_image( table_bbox, vertical_segments, horizontal_segments, pdf_scalers )