Skip to content

Commit 39193d0

Browse files
Merge pull request #5 from ahonnecke/add-pre-commit-hooks
Add pre commit hooks
2 parents 66b3701 + 60897c1 commit 39193d0

5 files changed

Lines changed: 82 additions & 21 deletions

File tree

.pre-commit-config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.2.0
4+
hooks:
5+
- id: check-ast
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: mixed-line-ending
9+
- id: check-symlinks
10+
- id: check-added-large-files
11+
- id: check-json
12+
- id: check-symlinks
13+
- id: check-added-large-files
14+
- repo: https://github.com/pre-commit/mirrors-prettier
15+
rev: "v2.6.2"
16+
hooks:
17+
- id: prettier
18+
- repo: https://github.com/psf/black
19+
rev: 22.3.0
20+
hooks:
21+
- id: black
22+
- repo: https://github.com/igorshubovych/markdownlint-cli
23+
rev: v0.31.1
24+
hooks:
25+
- id: markdownlint
26+
- repo: https://gitlab.com/pycqa/flake8
27+
rev: 3.9.2
28+
hooks:
29+
- id: flake8
30+
- repo: https://github.com/detailyang/pre-commit-shell
31+
rev: 1.0.5
32+
hooks:
33+
- id: shell-lint
34+
args: [--format=json]
35+
- repo: https://github.com/timothycrosley/isort
36+
rev: 5.10.1
37+
hooks:
38+
- id: isort

README.md

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
# stitching
22

3-
A Python package for fast and robust Image Stitching. A modularized and continuing work based on opencv's [stitching module](https://github.com/opencv/opencv/tree/4.x/modules/stitching) and the [stitching_detailed.py](https://github.com/opencv/opencv/blob/4.x/samples/python/stitching_detailed.py) python command line tool.
3+
A Python package for fast and robust Image Stitching. A modularized
4+
and continuing work based on opencv's [stitching
5+
module](https://github.com/opencv/opencv/tree/4.x/modules/stitching)
6+
and the
7+
[stitching_detailed.py](https://github.com/opencv/opencv/blob/4.x/samples/python/stitching_detailed.py)
8+
python command line tool.
49

5-
![inputs](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/inputs.png?raw=true)
10+
![inputs](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/inputs.png?raw=true)
611

7-
![result](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/panorama.png?raw=true)
12+
![result](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/panorama.png?raw=true)
813

914
## Installation
1015

11-
Use pip to install stitching from [PyPI](https://pypi.org/project/stitching/).
16+
Use pip to install stitching from
17+
[PyPI](https://pypi.org/project/stitching/).
1218

1319
```bash
1420
pip install stitching
@@ -24,32 +30,41 @@ panorama = stitcher.stitch(["img1.jpg", "img2.jpg", "img3.jpg"])
2430

2531
```
2632

27-
or using the [command line tool](https://github.com/lukasalexanderweber/stitching/blob/main/stitching_tool.py)
33+
or using the [command line
34+
tool](https://github.com/lukasalexanderweber/stitching/blob/main/stitching_tool.py)
2835

29-
30-
```
36+
```bash
3137
python stitching_tool.py -h
3238
python stitching_tool.py img1.jpg img2.jpg img3.jpg
3339
```
3440

3541
## Tutorial
3642

37-
This package provides utility functions to deeply analyse what's happening behind the stitching. A tutorial was created as [Jupyter Notebook](https://github.com/lukasalexanderweber/stitching_tutorial). The preview is [here](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/Stitching%20Tutorial.md).
43+
This package provides utility functions to deeply analyse what's
44+
happening behind the stitching. A tutorial was created as [Jupyter
45+
Notebook](https://github.com/lukasalexanderweber/stitching_tutorial). The
46+
preview is
47+
[here](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/Stitching%20Tutorial.md).
3848

39-
You can e.g. visualize the RANSAC matches between the images or the seam lines where the images are blended:
49+
You can e.g. visualize the RANSAC matches between the images or the
50+
seam lines where the images are blended:
4051

41-
![matches1](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/matches1.png?raw=true)
42-
![matches2](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/matches2.png?raw=true)
43-
![seams1](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/seams1.png?raw=true)
44-
![seams2](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/seams2.png?raw=true)
52+
![matches1](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/matches1.png?raw=true)
53+
![matches2](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/matches2.png?raw=true)
54+
![seams1](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/seams1.png?raw=true)
55+
![seams2](https://github.com/lukasalexanderweber/stitching_tutorial/blob/master/docs/static_files/seams2.png?raw=true)
4556

4657
## Literature
4758

48-
This package was developed and used for our paper 'Automatic stitching of fragmented construction plans of hydraulic structures' https://doi.org/10.1002/bate.202200010
59+
This package was developed and used for our paper [Automatic stitching
60+
of fragmented construction plans of hydraulic
61+
structures](https://doi.org/10.1002/bate.202200010 "Automatic
62+
stitching of fragmented construction plans of hydraulic structures")
4963

5064
## Contributing
5165

52-
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
66+
Pull requests are welcome. For major changes, please open an issue
67+
first to discuss what you would like to change.
5368

5469
Please make sure to update tests as appropriate.
5570

@@ -65,7 +80,15 @@ Build with
6580
python -m build
6681
```
6782

68-
## License
83+
Please make sure to lint all pull requests.
84+
85+
Lint the changed files
6986

70-
[Apache License 2.0](https://github.com/lukasalexanderweber/lir/blob/main/LICENSE)
87+
```bash
88+
pre-commit install && pre-commit run
89+
```
90+
91+
## License
7192

93+
[Apache License
94+
2.0](https://github.com/lukasalexanderweber/lir/blob/main/LICENSE)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
22
requires = ["setuptools>=42"]
3-
build-backend = "setuptools.build_meta"
3+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = stitching
33
version = attr: stitching.__version__
4-
description = A Python package for fast and robust Image Stitching
4+
description = A Python package for fast and robust Image Stitching
55
long_description = file: README.md
66
long_description_content_type = text/markdown
77
author = Lukas Weber
@@ -25,4 +25,4 @@ zip_safe = False
2525

2626
[options.packages.find]
2727
include = stitching
28-
exclude = tests
28+
exclude = tests

tests/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
!test_composition.py
1111
!test_performance.py
1212
!stitching_detailed.py
13-
!testdata/SAMPLE_IMAGES_TO_DOWNLOAD.txt
13+
!testdata/SAMPLE_IMAGES_TO_DOWNLOAD.txt

0 commit comments

Comments
 (0)