• Stars
    star
    255
  • Rank 159,384 (Top 4 %)
  • Language
    Python
  • License
    ISC License
  • Created almost 9 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

My own implementation of a Delaunay triangulation and Voronoi partition in Python applied to images.

[Deprecated]

This tool for image manipulation with Voronoi/Delaunay is deprecated and was rewritten.

Visit the successor project: github.com/MauriceGit/Voronoi_Image_Manipulation

Please use the new tool for the following reasons:

  • More functionality
  • A lot more user friendly
  • Real-time with an actual GUI
  • A lot faster (a LOT. We are talking speed improvement of factor >100)
  • A lot more robust
  • Actual O(n log(n)) performance

Visit the successor project: github.com/MauriceGit/Voronoi_Image_Manipulation

Delaunay Triangulation and Voronoi Regions in images

This project consists of several parts which are joined together.

Image of an end result: Voronoi-diagrams of a sunset

  • Triangulation

    I always wanted to properly implement a Delaunay triangulation. So here it is. It runs in Omega(n logn). As soon as I change the data structure, also in O(n logn). Anyway. You provide a list of points (tuples with x,y-coordinates!) and get back a list of triangles (also tuples with three points per triangle!). In the new version it also transforms the triangles into Voronoi regions (polygons --> list of list of points).

    Example image of 100 random points triangulated: Image of a triangulation of 100 points

  • Image-Triangulation:

    This is the actual application of the Delaunay triangulation. You can specify a .jpg-Image and the program will perform some gauss-filtering and edge detection. Based on the contrast difference of the image there is a propability that a point is set on that spot (per pixel). With that there will be more points generated in areas with high contrast differences than in areas with equal colors and contrasts. These points will then be triangulated. After that each triangle will get colored with the approximate mean color of the pixels inside the triangle. Approximate because only the Vertices and the center of the triangle will be considered. These colored triangles will then be rendered into an new jpg-image.

    Example image with about 4000 different points triangulated and colored according to the original picture: Image of a triangulation of a photo of a sunset

    Example image when the points are equally distributed and not extracted from the picture: Image of a triangulation of a photo of some fireworks

  • Voronoi-Diagrams:

    The Delaunay triangulation is taken and transformed in O(n) into Voronoi regions. These regions will then be rendered into an image just like the triangles before. The color is determined by the average color of each corner and the center of the polygon.

    Example image directly converted from triangles to Voronoi regions: Image of Voronoi regions

    Now with equally distributed point selection (looking a bit better with Voronoi regions in my opionion): Image of equally distributed Voronoi regions

  • Point-Distribution:

    There are different options for determining points in the image for triangulation. Points can be determined from edge-detection and are more common in parts of the image where bigger color-differences occure. Otherwise points can be distributed equally over the image space. The choice has a quite big influence on the outcome-image. For the Delaunay triangulation I prefer more points in edging areas. For Voronoi regions it looks more pleasant if the regions are more equally distributed. Anyway the results are stunning (in my opinion) :).

    Result of a triangulation with point-extraction from edges and constrast: Image with triangles from edges

    The next image shows the exact same extracted triangles with random colors and not colored from the photo: Triangles with random colors

More Repositories

1

Partikel_accelleration_on_GPU

Particle accelleration with OpenGL 4.3, using the compute shader to calculate particle movement on graphics hardware.
C
253
star
2

skiplist

A Go library for an efficient implementation of a skip list: https://godoc.org/github.com/MauriceGit/skiplist
Go
252
star
3

compiler

Compiler for a small language into x86-64 Assembly
Go
243
star
4

Simple_GLSL_Shader_Example

A very simple example of how shaders in OpenGL can be used, to color Objects or map a texture on some triangles.
C
239
star
5

Voronoi_Image_Manipulation

A system independent tool for interactive image manipulation with Voronoi and Delaunay data structures.
Go
227
star
6

Water_Simulation

Water-Simulation with real time specular reflection on the waters surface. The reflection is implemented in GLSL and runs on the GPU and in screen space. The water itself is implemented using a pressure based approach for the surface calculation.
C
149
star
7

XBox_Controller_Linux_Interface

An interface that interacts with an XBox One controller via the usb stream. With simple methods for object or camera control (i.e. for OpenGL contexts).
C
132
star
8

Cloth_Simulation

Cloth-Visualization via particle-simulation.
C
83
star
9

Advanced_Algorithms

Quick implementations of some advanced algorithms for searching, sorting and trees
Python
77
star
10

Screen_Space_Ambient_Occlusion

Giving a scene a depth-dependent shading, completely irregarding the scene complexity, in screen-space.
C
47
star
11

Quaternion_Library

A small library that capsulates most commonly used operations on Quaternions. Also a small sample implementation, that rotates an object around an axis, using Quaternions.
C
40
star
12

Energy-Dome_Terrain

A visually appealing terrain visualization from real-world data with some extras, such as an animated energy dome, LOD tessellation and multisampling
Go
29
star
13

advsearch

A Go library for advanced searching in sorted data structures
Go
22
star
14

Repeat_History

A small but useful command for a linux shell. It makes the bash history more easily accessible than cmd+r.
Shell
19
star
15

Marching_Cubes_on_GPU

A marching cube algorithm, that is executed in parallel on the GPU, using compute shaders. This will later enable a highly parallel creation of advanced landscape/terrain structures in potentially real-time (next project).
Go
9
star
16

tree23

An implementation of a balanced 2,3-tree that allows accessing next/previous elements in O(1) at all times.
Go
8
star
17

Vector_Library

Small vector library in C, containing all basic vector operations.
C
4
star
18

2D_Bin_Packing

several parallel solutions for a 2D bin packing problem for a programming contest.
Python
2
star
19

Variance_Shadow_Maps

Small example of a project, that uses variance shadow maps with hardware Multisampling.
Go
2
star
20

Voronoi_DivideAndConquer

A Go implementation of a voronoi tessellation with the divide and conquer algorithm. It is still work in progress and not yet working properly!
Go
2
star
21

mtVector

A short vector library with all necessary operations for a Delaunay triangulation, including optimized matrix multiplication
Go
1
star
22

game

JavaScript
1
star
23

Agar_Clone_Joystick_Client

A C++ client for our programming challenge (2016) supporting an X-BOX-Controller.
C++
1
star
24

FastDelaunayImages

Go
1
star
25

AdventOfCode

My solutions for the advent of code puzzles (AOC)
Python
1
star
26

Artificial_Neural_Network_Character_Classification

Implementation of an artificial neural network with backpropagation for classification of characters.
Python
1
star
27

Bachelor_Thesis_Arimaa

Implementation of the practical part of my bachelor thesis for the FH-Wedel. The thesis has been awarded with the "Wedeler Hochschulpreis" for innovation. The code implements an artificial intelligence which plays the game of Arimaa.
Java
1
star