Some results from this input image
Here is what the segmented regions look like
So far, only the diffuse lighting is rendered on the pebbles. Here are some different results, each with slightly different settings. The input image is 400px by 400px. The x and y positions of the light are in the middle of the image, and the light is getting further away from the image in each picture. There are 200 segments in this image. Processing time was around 10 mins.
Dist between pixels; 1 unit
Light’s height; 1000 units
Dist between pixels; 5 unit
Light’s height; 5000 units
Dist between pixels; 10 unit
Light’s height; 10000 units
Dist between pixels; 15 unit
Light’s height; 15000 units
Dist between pixels; 20 unit
Light’s height; 20000 units
As you can see, there is a lot of clipping in the final images, and the boundaries of the regions do not have a proper gradient.
This final image was an early render of the diffuse lighting. It has many artifacting issues, and since the shapes are larger and longer, it has odd gradients that make it look like a height map of mountains rather than pebbles.