Member-only story

Generate a 3D Mesh from an Image with Python

Combine Deep Learning with 3D data processing to generate a mesh

Mattia Gatti
TDS Archive
6 min readOct 26, 2022

--

Photo by Alvaro Pinot on Unsplash

Generating a 3D mesh from a single 2D image seemed a very hard task some years ago. Nowadays, thanks to the advancement in Deep Learning, multiple monocular depth estimation models have been developed and they can provide a precise depth map from any image. Through this map, it’s possible to generate a mesh by performing surface reconstruction.

Introduction

Monocular depth estimation is the task of estimating the depth value (distance relative to the camera) of each pixel given a single RGB image. The output of a monocular depth estimation model is a depth map, which is basically a matrix, where each element corresponds to the predicted depth of the associated pixel in the input image.

A depth map. Image by the author.

Points in a depth map can be seen as a collection of points with 3-axis coordinates. As the map is a matrix, each element has x and y components (its column and row). Whereas the z component is its stored value, which is the predicted depth in the point (x, y). In the field of 3D data processing, a list of (x, y, z) points is…

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Mattia Gatti
Mattia Gatti

Written by Mattia Gatti

Currently doing research into AI Remote Sensing. Writing about Deep Learning and Geospatial Data Analysis.

Responses (7)