Line image extractor
This is a tool and a library to be used for extracting line images. Built by Teklia and freely available as open-source under the MIT licence.
It supports different extraction methods:
- boundingRect - bounding rectangle of the line polygon
- polygon - exact polygon
- min_area_rect - minimum area rectangle containing the polygon
- deskew_polygon - deskew the polygon
- deskew_min_area_rect - deskew the minimum area rectangle
- skew_polygon - skew the polygon (rotate by some angle)
- skew_min_area_rect - skew the minimum area rectangle (rotate by some angle)
Install the library using stable version from Pypi:
pip install teklia-line-image-extractor
Install the library in development mode:
pip install -e .
Test extraction:
line-image-extractor -i tests/data/page_img.jpg -o out.jpg -p tests/data/line_polygon.json -e deskew_min_area_rect --color
How to use it?:
from pathlib import Path
import numpy as np
from line_image_extractor.extractor import extract, read_img, save_img
from line_image_extractor.image_utils import polygon_to_bbox
from line_image_extractor.image_utils import Extraction
page_img = read_img(Path("tests/data/page_img.jpg"))
polygon = np.asarray([[241, 1169], [2287, 1251], [2252, 1190], [244, 1091], [241, 1169]])
bbox = polygon_to_bbox(polygon)
extracted_img = extract(
page_img, polygon, bbox, Extraction.polygon
)
save_img("line_output.jpg", extracted_img)
Metadata
Release files for teklia-line-image-extractor 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| teklia_line_image_extractor-0.8.0.tar.gz | 10.0 kB | Without provenance | Details for teklia_line_image_extractor-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| teklia_line_image_extractor-0.8.0-py3-none-any.whl | Python 3 | none | any | Details for teklia_line_image_extractor-0.8.0-py3-none-any.whl |
Total release size: 19.0 kB
Release files / teklia_line_image_extractor-0.8.0.tar.gz
| Download URL | teklia_line_image_extractor-0.8.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e613108ad7cca041e6d79d20a84069c65dbd5c276178a69e4cc8ce03e7778862
|
|
BLAKE2b-256 checksum How to use checksums |
03eedbb8859cbc244561312aaa77202ec78508d8f900883d1a23988a71892b6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / teklia_line_image_extractor-0.8.0-py3-none-any.whl
| Download URL | teklia_line_image_extractor-0.8.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b05dbf02fb580728738e147ea4f48312485b0f6e1a3f09ba12cdb4712ef77509
|
|
BLAKE2b-256 checksum How to use checksums |
ab1f30ea80b895640dede5d5a01b65e2a9551d7dd02d8e3b53819951f210cf4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for teklia-line-image-extractor 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.