Git Product home page Git Product logo

pclines-python's Introduction

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.

pclines-python's People

Contributors

romanjuranek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pclines-python's Issues

Examples

Few example cases

  • basic line detection
  • custom detection with user defined edges

As notebooks and also in radme so it appears on main page

Documentation

  • Basic doc of the interface
  • Quick start
  • Install guide - local and pypi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.