Generate mashes from an image

Hi,
I’m not sure if there’s something in the forum already, but I’m wondering if there is any example code for generating meshes from an image like http://www.flong.com/projects/zoo/.

I’ve checked already the tutorial in the oFBook.

Thank you community!

Hi, I can not recall of any OF example for doing such, yet there is this project which has its code written in processing. Porting it to OF could be a good exercise. once you have it you can pass the points to something like ofxVoronoi and you should get a similar result as the project you linked to.
Another option is asking @golan :slight_smile:

Thanks Roy! :slight_smile:

Hey I’ve goofed around with this a little bit in the past. @roymacdonald is right in that ofxVoronoi is a huge help. It will calculate a set of points for a Voronoi diagram, which has a mesh-like appearance like the link in the original post. The Voronoi points can then be used to create an ofMesh if needed. The Voronoi diagram itself is generated from a set of points, which can be obtained in a bunch of different ways. For instance, the points could be determined from a threshold value of brightness, or color, or a comparison of pixel values within a region, etc. Some of the functions in ofxCV are super helpful for this.

1 Like