Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Image-triangulation (delaunay and voronoi)
2 points by EllipticCurve on Dec 29, 2015 | hide | past | favorite | 4 comments
Hey guys,

it's my first post here, but I've been reading for a couple of months.

And right now I am ready to share some stuff I made. Please feel free to ask, criticize or suggest alternatives :)

https://github.com/MauriceGit/Delaunay_Triangulation

A couple of months ago someone here (don't have the link anymore) inspired me to finally sit down and implement a delaunay-triangulation and voronoi from scratch.

What the python-script does is:

- take an image, extract points dependent on the contrast and color difference of the image (more points on edges or in contrast-rich parts).

- triangulate the points with a delaunay-triangulation (from scratch).

- transform the delaunay-triangles into voronoi-regions.

- render the triangles and voronoi-regions into new images with the average color for each polygon (from the original image).

The delaunay-triangulation runs in Omega(n logn) but I'm not 100% sure if also in O(n logn). The transformation into voronoi-regions runs in O(n).

Please tell me what you think :) Best regards Maurice




The whole thing gets started with a simple python call to "drawTriangles.py" (Have to rename it later...).

The only thing to do is now to specify the filename in main().

After that you should be good to go. I will work on that later, to make it more user-friendly :)


Posts without URLs get penalized, so you'd be better off posting this with a link, then adding your text as a first comment in the new thread. Good luck!


thanks! I did that. New thread is found here: https://news.ycombinator.com/item?id=10811325





Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: