Generating height map from a single image of shadows using python

448 views Asked by At

i'm currently developing a web app with python based for generating a set of PBR texture. and stuck on the height map generation. i've been searching for this problem for a few weeks and still haven't find any answer yet. is there's any method to generate a height map from a single image, or it's just not possible.

for reference, this is how i want to achieve the result. i've tried to applying gaussian blur but it seems not just that simple.

left, original. right, height map generated by Materialize by bounding box:

original height map

1

There are 1 answers

2
AudioBubble On

To some extent, there is a technique known as "shape from shading" that can reconstruct a height field from reflected intensities, by assuming a Lambertian reflectance model.

But this is difficult and inaccurate, and can be deceived by the color of the rocks not being uniform and by cast shadows.


Short answer: don't even try.