{"id":23605815,"url":"https://github.com/romanjuranek/pclines-python","last_synced_at":"2025-05-09T01:06:44.261Z","repository":{"id":49827162,"uuid":"284230135","full_name":"RomanJuranek/pclines-python","owner":"RomanJuranek","description":"PCLines for Python","archived":false,"fork":false,"pushed_at":"2020-09-03T14:23:38.000Z","size":504,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T01:06:36.597Z","etag":null,"topics":["hough-transform","line-detection","pclines","pclines-python","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RomanJuranek.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-01T09:35:21.000Z","updated_at":"2024-12-16T04:06:51.000Z","dependencies_parsed_at":"2022-08-25T16:51:53.164Z","dependency_job_id":null,"html_url":"https://github.com/RomanJuranek/pclines-python","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanJuranek%2Fpclines-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanJuranek%2Fpclines-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanJuranek%2Fpclines-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanJuranek%2Fpclines-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RomanJuranek","download_url":"https://codeload.github.com/RomanJuranek/pclines-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171254,"owners_count":21865292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hough-transform","line-detection","pclines","pclines-python","python"],"created_at":"2024-12-27T13:13:22.265Z","updated_at":"2025-05-09T01:06:44.227Z","avatar_url":"https://github.com/RomanJuranek.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `pclines` package for Python\n\n![pclines](doc/pclines.svg)\n\nThis package implements a PCLines transform for line detection in images.\n\n```bibtex\n@INPROCEEDINGS{dubska2011pclines,\n    author={M. {Dubská} and A. {Herout} and J. {Havel}},\n    booktitle={CVPR 2011},\n    title={PClines — Line detection using parallel coordinates},\n    year={2011},\n}\n```\n\n# Requrements\n\n* Python 3.6+\n* numpy\n* numba\n* scikit-image\n\n# Installation\n\nThe package is on [PyPI](https://pypi.org/project/pclines/), so just run following command and install the package.\n\n```shell\n\u003e pip install pclines\n```\n\nAlternatively, you can download this repository and install manually.\n\n\n# Example\n\n1. Import package\n\n```python\nimport pclines as pcl\n```\n\n2. Data and observations\nThe observations are 2D weighted coordinates enclosed by a known bounding box. As an example we extract edge points from an image.\n\n```python\nimage = imread(\"doc/test.png\", as_gray=True)\nedges = sobel(image)\nr,c = np.nonzero(edges \u003e 0.5)\nx = np.array([c,r],\"i\").T\nweights = edges[r,c]\n```\n![](doc/image.png) ![](doc/edges.png)\n\n3. Accumulation in PCLines space\n\n```python\nh,w = image.shape[:2]\nbbox=(0,0,w,h)  #  Bounding box of observations\nd = 1024  # Accumulator resolution\nP = PCLines(bbox, d) # Create new accumulator\nP.insert(x, weights) # Insert observations\np, w = P.find_peaks(min_dist=10, prominence=1.3, t=0.1) # Find local maxima\n```\n\n![](doc/accumulator.png)\n\n4. Detected lines\n\n```python\nh = P.inverse(p)  # (a,b,c) parameters of lines\nX,Y = utils.line_segments_from_homogeneous(h, bbox)  # Convert to line segments for plotting\n```\n\n![](doc/lines.png)\n\n\n# Contribute\n\nIf you have a suggestion for improvement, let us know by filling an issue. Or you can fork the project and submit a pull request.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromanjuranek%2Fpclines-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromanjuranek%2Fpclines-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromanjuranek%2Fpclines-python/lists"}