Generating normal maps using both 'photometric stereo' and 'height map to normal map' methods
This Python code converts photometric stereo images like these:
to normal map textures like this:
You can use just hm2nm(img)
function to create a normal map from a single RGB image, or just ps2nm(imgU, imgD, imgR, imgL)
to create more realistic normal maps, or combine them together to create normal maps with much more detailed edges.
Also overlay blend mode is implemented to combine two normal maps.
I was able to code these Python functions thanks to Ryan Clark who wrote Normal Map Photography.