Home Blog Contact

ImageMesh: Image to 3-D Model Mapping

Andrew Garcia, Dec 2022

ImageMesh is a method in versions ≥ 2.0 from the voxelmap Python library which uses Convex hull in 3-D to wrap external points from a series of partitioned point clouds, and generates 3-D model .obj files from images. In three-dimensional space, the smallest collection of triangular polygons meeting the latter rule is drawn. This is akin to placing a fabric above a 3-D object; with this logic, a single convex hull operation will be unable to draw a structure with holes or bumps i.e. with 2-D local extrema.

image

The quick solution implemented here "cuts" the above donut image into several segments for which to place these convex hull sheets to do the triangulation.

image image image image image image

As a complement to ImageMesh, a Python visualization tool called MeshView was developed in tandem. This tool loads the latter generated .obj file to be visualized in a pygame window with OpenGL capabilities.

GPU memory space complexity:

The former voxel-per-pixel method renders a cube from every "n" input point. In computer graphics, a cube is composed of 12 triangles, and thus, the GPU space complexity is 𝒪 (n*12).

For this new Convex Hull method, the input points are used as vertices to triangles which make a polyhedron in 3-D space. As this method cuts the image into "s" sectors to increase resolution, the space complexity approximates to 𝒪 (n*sqrt(s)/3).

image