Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use point set to shape mapping to improve polygon annotation widget #7

Open
ibayer opened this issue Aug 27, 2021 · 1 comment
Open
Labels
good first issue Good for newcomers

Comments

@ibayer
Copy link
Member

ibayer commented Aug 27, 2021

Motivation

The polygon annotation widget nbs/01d_polygon_canvas.ipynb #5 (not yet included in the public github release) supports only sequential polygon annotation. Adding additional boundary points after creating an initial polygon depends on the creation order of the boundary points which is not very intuitive and also slow to execute.

Defining the polygon by a set of points instead of a list would make adding and removing of points much simpler.

Alpha-Concave Hull

In computational geometry, an alpha shape, or α-shape, is a family of piecewise linear simple curves in the Euclidean plane associated with the shape of a finite set of points. They were first defined by Edelsbrunner, Kirkpatrick & Seidel (1983). The alpha-shape associated with a set of points is a generalization of the concept of the convex hull, i.e. every convex hull is an alpha-shape but not every alpha shape is a convex hull.
source: https://en.wikipedia.org/wiki/Alpha_shape

Alpha-Concave Hull [0] is one such algorithm that could be interested for us.

Suggested steps.

  • literature review to find simple algorithm to associate shape with set of points.
  • poc implementation of algorithm in 01d_polygon_canvas.ipynb
  • create minimal sequence diagram https://plantuml.com/sequence-diagram to specify expected user iteration for creating and deleting points
  • refactor current polygon annotation widget to support the new algorithm

[0] Alpha-Concave Hull, a Generalization of Convex Hull

Note: This is an internal issue till the polygon annotation widget #5 is released.

@ibayer
Copy link
Member Author

ibayer commented Sep 22, 2021

Concave hull algorithms with pseudo code

The k-NN approach seems simpler to implement.

@ibayer ibayer added the good first issue Good for newcomers label Sep 28, 2021
itepifanio added a commit to itepifanio/ipyannotator that referenced this issue Oct 7, 2021
…o delete the closest point to the mouse pressing delete. WIP profiling algorithm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant