Images to triangles
Say you have an image, which is the input … You now need to output a set of n triangles that will most closely replicate it, where n is fixed. How will you go about this problem today
-
Genetic Algos have kind of tackled this problem, but takes forever or converges easily to some picture … I tried running some preliminary things here on Neat playground here … https://jerryjohnthomas.github.io/30pieces/
-
Each triangle is something takes space and color … So try to group pixels of same color as triangle … Like a knn thing
I think we could maybe do a much better job without cnns, adding a simplifying assumption say the image indeed is made of n triangles and exact replication is possible. Is there anything else you would try.
- Make a voronoi diagram
- Triangulate the voronoi cells.
- Make the triangles nice (do delaunay flips). I think it’s ok if you break the voronoi cells
- Color
No ML needed.
The way you sample at (1) will affect your result, you probably don’t want to sample where there’s edges in the image
Honestly, RL sounds like a decent approach here.
Simulated annealing
I have done something similar using gradient descent and this differentiable vector graphics library. It converges much faster than genetic algorithms.
A good initialization, like the other commenter’s voronoi idea, would speed it up considerably.