| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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},
}The package is on PyPI, so just run following command and install the package.
> pip install pclinesAlternatively, you can download this repository and install manually.
import pclines as pclimage = 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]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 maximah = P.inverse(p) # (a,b,c) parameters of lines
X,Y = utils.line_segments_from_homogeneous(h, bbox) # Convert to line segments for plottingIf you have a suggestion for improvement, let us know by filling an issue. Or you can fork the project and submit a pull request.
| Back | FazBrowse Home | New Git URL |