Skip to content

Commit

Permalink
Merge pull request #247 from sbrunner/dev-images
Browse files Browse the repository at this point in the history
Add image to understand the deskewing
  • Loading branch information
sbrunner authored Aug 21, 2022
2 parents 9ad3445 + 55f61c8 commit 100495a
Show file tree
Hide file tree
Showing 43 changed files with 589 additions and 78 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user $(grep poetry ci/requirements.txt)
- run: poetry install
- run: poetry install --extras=debug_images
- name: Versions
run: |
poetry --version
Expand All @@ -58,7 +58,8 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: Test results
path: results/test-reports
path: results
if: always()

build:
name: Continuous integration
Expand Down Expand Up @@ -86,8 +87,8 @@ jobs:
- name: Checks
run: c2cciutils-checks

- run: poetry install
- run: poetry run prospector --output=pylint -X
- run: poetry install --extras=debug_images
- run: poetry run prospector --output=pylint --die-on-tool-error

- name: Init Git
run: |
Expand Down
2 changes: 2 additions & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ doc-warnings: True
pylint:
disable:
- too-many-arguments
- too-many-statements

pycodestyle:
disable:
Expand All @@ -18,6 +19,7 @@ pydocstyle:
- D102 # Missing docstring in public method
- D104 # Missing docstring in public package
- D212 # Multi-line docstring summary should start at the first line
- D202 # No blank lines allowed after function docstring

bandit:
run: true
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,17 @@ rotated = rotate(image, angle, (0, 0, 0))
cv2.imwrite('output.png', rotated)
```

# Debug images

If you get wrong skew angle you can generate debug images, that can help you to tune the skewing detection.

If you install deskew with `pip install deskew[debug_images]` you can get some debug images used for
the skew detection with the function `determine_skew_debug_images`.

To start the investigation you should first increase the `num_peaks` (default `20`) and use
the `determine_skew_debug_images` function.

Then you can try to tune the following arguments `num_peaks`, `angle_pm_90`, `min_angle`, `max_angle`,
`min_deviation` and eventually `sigma`.

Inspired by Alyn: https://github.com/kakul/Alyn
Loading

0 comments on commit 100495a

Please sign in to comment.