Mapping a color image as a texture onto a surface - not a question

After a long thread on texture mapping, and a partial solution (only for grayscale images), suggested along the last years,
here is the workaround for color images, with surprisingly good results

The regular triangulation involved in meshing a surface looks like this :wink:


z_data is an array of shape (image_rows, image_columns). Hence we have an intensity value for each point in the meshgrid

np.meshgrid(np.linspace(a, b, image_columns), np.linspace(c,d, image_rows))

defined on the rectangular region mapped to the surface.
But the number of cells (faces) resulted from the regular triangulation is different from that in z_data.flatten(). That’s why I defined a rule that assigns to each cell a z_data value, like in the above image.


Hey @empet this image is amazing :star_struck::

Congratulations !!!


Thank you! :slight_smile:
This one illustrates that the method of mapping preserves the details, too:


Can’t wait to see what applications people come up with for this. Definitely has some cartographic potential to help with the age old problem of flattening the earth (maybe variations between a full globe and a flat rectangle).

1 Like

@kmhurchla A google search reveals a lot of applications in computer vision, image segmentation and classification, and more. To present the results of such a study with Plotty, it’s important to have a method to map texture on surfaces.

1 Like