Skip to content

Convert a photo to a pattern, i.e., Delaunay triangulation, Voronoi diagram, and halftoning.

Notifications You must be signed in to change notification settings

amingheibi/convert_photo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Convert a photo to a pattern

Delaunay, Voronoi and Halftone

This script converts a photo to a pattern by extracting pixels of edges. Hence, edge extractors are required. I've used two edge extractors, Laplace and Canny. The final output of the Laplace edge detector was more promising despite being much simpler. The script can produce Delaunay Triangulation, Voronoi Diagram, and Halftoning pattern.

Usage

You can use this code in console as follows:

python3 src/main.py [input_file] [output_file] [pattern: delaunay, voronoi, halftone] [edge_detector: laplace, canny]

For exmaple, the following code will use Laplace edge detector and produces Delaunay tringulation.

python3 src/main.py 'data/1.jpg' 'data/1_delaunay_laplace' delaunay laplace

Some Samples

Delaunay tringulation on Laplace output Delaunay tringulation on Canny output Voronoi diagram on Laplace output Voronoi diagram on Canny output Halftoning Delaunay tringulation on Laplace output Delaunay tringulation on Canny output Voronoi diagram on Laplace output Voronoi diagram on Canny output Halftoning

About

Convert a photo to a pattern, i.e., Delaunay triangulation, Voronoi diagram, and halftoning.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages