Skip to main content

pclines package for Python

pclines

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

  1. Import package
import pclines as pcl
  1. 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]

  1. 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

  1. 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.

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)

Source distribution for pclines 1.0.2
File Size Uploaded
pclines-1.0.2.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pclines 1.0.2
File Interpreter ABI Platform
pclines-1.0.2-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page