pclines package for Python
This package implements a PCLines transform for line detection in images.
@INPROCEEDINGS{dubska2011pclines,
author={M. {Dubská} and A. {Herout} and J. {Havel}},
booktitle={CVPR 2011},
title={PClines — Line detection using parallel coordinates},
year={2011},
}
Requrements
- Python 3.6+
- numpy
- numba
- scikit-image
Installation
The package is on PyPI, so just run following command and install the package.
> pip install pclines
Alternatively, you can download this repository and install manually.
Example
- Import package
import pclines as pcl
- Data and observations The observations are 2D weighted coordinates enclosed by a known bounding box. As an example we extract edge points from an image.
image = imread("doc/test.png", as_gray=True)
edges = sobel(image)
r,c = np.nonzero(edges > 0.5)
x = np.array([c,r],"i").T
weights = edges[r,c]
- Accumulation in PCLines space
h,w = image.shape[:2]
bbox=(0,0,w,h) # Bounding box of observations
d = 1024 # Accumulator resolution
P = PCLines(bbox, d) # Create new accumulator
P.insert(x, weights) # Insert observations
p, w = P.find_peaks(min_dist=10, prominence=1.3, t=0.1) # Find local maxima
- Detected lines
h = P.inverse(p) # (a,b,c) parameters of lines
X,Y = utils.line_segments_from_homogeneous(h, bbox) # Convert to line segments for plotting
Contribute
If you have a suggestion for improvement, let us know by filling an issue. Or you can fork the project and submit a pull request.
Metadata
Release files for pclines 1.0.2
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 |
|---|---|---|---|---|
| pclines-1.0.2.tar.gz | 5.1 kB | Without provenance | Details for pclines-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pclines-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for pclines-1.0.2-py3-none-any.whl |
Total release size: 11.8 kB
Release files / pclines-1.0.2.tar.gz
| Download URL | pclines-1.0.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f25339a3d682d7faccbfd4c63628b404deff525f1d93e2ed172c30bf3a322416
|
|
BLAKE2b-256 checksum How to use checksums |
e97c68eefaad7c605f716e85842a21b8c1e11c4260fefaf890f9ab72d64be28b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12
|
Release files / pclines-1.0.2-py3-none-any.whl
| Download URL | pclines-1.0.2-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c647dc9154e3f4ceac213e3cbf0d70659f7b4b5c3d8aae28b2d511fe7d49d165
|
|
BLAKE2b-256 checksum How to use checksums |
814a0e80359818b5974dfba3d5341d36a21c3857e5fb98d9df0ca378c68f4a81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12
|
Security for pclines 1.0.2
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.