this post was submitted on 29 Nov 2023
1 points (100.0% liked)

Machine Learning

1 readers
1 users here now

Community Rules:

founded 1 year ago
MODERATORS
 

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

  1. 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/

  2. 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.

top 4 comments
sorted by: hot top controversial new old
[–] 0xcedbeef@alien.top 1 points 11 months ago
  1. Make a voronoi diagram
  2. Triangulate the voronoi cells.
  3. Make the triangles nice (do delaunay flips). I think it's ok if you break the voronoi cells
  4. 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

[–] Real_Revenue_4741@alien.top 1 points 11 months ago

Honestly, RL sounds like a decent approach here.

[–] bablador@alien.top 1 points 11 months ago

Simulated annealing

[–] currentscurrents@alien.top 1 points 11 months ago

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.