You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+56-55Lines changed: 56 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,48 +11,48 @@
11
11
12
12
_Hough_ finds skew angles in scanned document pages, using the Hough transform.
13
13
14
-
It is oriented to batch processing, and can make use of multiple cores. (You'll
15
-
want this - analysis and image processing is very CPU intensive!)
14
+
It is oriented to batch processing, and can make use of multiple cores or an
15
+
optional CUDA backend. (It can be very compute intensive!)
16
16
17
17
# Installation and usage
18
18
19
19
## Installation
20
20
21
21
```
22
-
pip install -U pip
23
-
pip install hough
22
+
pipx install hough
24
23
```
25
24
26
-
The first line is required to update `pip` to a new enough version to be
27
-
compatible with `manylinux` wheel packaging, required for PyMuPDF.
25
+
Or, if you have a supported GPU and have [installed CUDA](https://developer.nvidia.com/cuda-toolkit) (currently 12.x supported):
28
26
29
-
Older versions of `pip` are fine, but you'll have to install MuPDF, its
30
-
headers, and a compiler first, so PyMuPDF can be compiled locally.
27
+
```
28
+
pipx install "hough[cuda]"
29
+
```
30
+
31
+
If you don't use `pipx`, other methods such as `pip` should work fine, just create a virtual environment first.
31
32
32
33
## Usage
33
34
34
35
To get started right away, here's some examples.
35
36
36
-
Generate angles (in CSV form) for a bunch of TIFF page images, one page per file:
37
+
Generate angles (in CSV form) for a bunch of TIFF images:
37
38
38
39
```
39
-
hough --csv in/*.tif
40
+
hough analyse in/*.tif
40
41
```
41
42
42
43
The same, but for a PDF file, and display a histogram at the end:
43
44
44
45
```
45
-
hough --histogram Able_Attach_Sep83.pdf
46
+
hough analyse --histogram Able_Attach_Sep83.pdf
46
47
```
47
48
48
-
The same, but show progress while running:
49
+
The same, but show more information while running:
49
50
50
51
```
51
-
hough -v --histogram Able_Attach_Sep83.pdf
52
+
hough --verbose --histogram Able_Attach_Sep83.pdf
52
53
```
53
54
54
-
55
-
The deskewing results are placed in the `results.csv` file. Example:
55
+
The deskewing results are placed in a `results.csv` file created under the `out/<timestamp>` directory, which is created at invocation time. Here's an example:
0 commit comments