GithubHelp home page GithubHelp logo

rdeits / concavehull.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lstagner/concavehull.jl

0.0 3.0 0.0 123 KB

Julia library for calculating concave hulls

License: Other

Julia 100.00%

concavehull.jl's Introduction

ConcaveHull

Build Status

This package computes the concave/convex hull of a set of points using a nearest neighbours algorithm[1].

[1] Moreira, Adriano, and Maribel Yasmina Santos. "Concave hull: A k-nearest neighbours approach for the computation of the region occupied by a set of points." (2007).

Usage

Pkg.add("ConcaveHull") # Add package
using ConcaveHull
using Plots

points = [[th, -sin(th)] .+ (0.4*rand(2) - 0.2) for th in linspace(0,2pi,5000)];
x = [p[1] for p in points];
y = [p[2] for p in points];

hull = concave_hull(points)
hull_area = area(hull)

scatter(x,y,ms=1,label="",axis=false,grid=false,markerstrokewidth=0.0)
plot!(hull)
annotate!(pi/2,0.5,"K = $(hull.k)")
annotate!(pi/2,0.25,"Area $(round(hull_area,3))")

Smoothness

The smoothness of the concave hull can be adjusted by increasing the number of neighbours used

hull = concave_hull(points,100) # Use 100 neighbours
hull_area = area(hull)

scatter(x,y,ms=1,label="",axis=false,grid=false,markerstrokewidth=0.0)
plot!(hull)
annotate!(pi/2,0.5,"K = $(hull.k)")
annotate!(pi/2,0.25,"Area $(round(hull_area,3))")

concavehull.jl's People

Contributors

crbinz avatar tkelman avatar

Watchers

 avatar  avatar  avatar

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.