hillshade

A forum to ask questions, post setups, and generally discuss anything having to do with photomacrography and photomicroscopy.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

iconoclastica
Posts: 486
Joined: Sat Jun 25, 2016 12:34 pm
Location: Wageningen, Gelderland

hillshade

Post by iconoclastica »

I was intrigued with Lou's suggestion to apply hill shade to the depth map and decided to try this a few times. So far, my experience is not that it reveals all kind of extra detail, but I think it is another tool to use in the post. And perhaps results may be further improved.

Here is an example**) of where it worked quite well. This is an (increasingly drying) utricle of Carex arenaria. The surface bears a number of shallow length ribs that are quite hard to see in this stage.

Image

Here's the depth map. Note that the stack consists of 30 steps, so terraces are notable:

Image

From this it's an easy step in ImageJ to produce the hill shade:

Image

My depth maps always are rather rough and full of pits or spikes. I guess those are interpolated areas where the sharpest layer could not be determined. Using the hill shaded map like this would result in a very warty image, therefore I blurred the HS before applying it to the image.
Here the result is blended with overlay 100%, which does not look good, but clearly shows the combined result:

Image

Changing the blending mode to soft-light looks better:

Image Image

The ribs are more distinct now and the wings left and right of the neck look flatter.

Wim


**) This 30-photo stack was not shot for this purpose but to see if the 10x mitutoyo could act as c. 5x objective for these 3-5mm subjects by stacking it with the Canon 70-200/4
--- felix filicis ---

rjlittlefield
Site Admin
Posts: 23562
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: hillshade

Post by rjlittlefield »

This looks like a very useful technique. Thanks for the investigation!
iconoclastica wrote:My depth maps always are rather rough and full of pits or spikes. I guess those are interpolated areas where the sharpest layer could not be determined.
Pits and spikes definitely occur where the sharpest layer could not be determined. But regarding interpolation, it's the other way around: pits and spikes occur in non-interpolated areas. Interpolated areas -- the ones that go "black in preview" in Zerene Stacker -- will err on the side of unrealistic smoothness.

--Rik

Lou Jost
Posts: 5947
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

Thanks very much for testing my idea! It may only be practical for surfaces that have no overlaps, like the complex leaf surfaces that I am currently working on. These surfaces have steep mountains and valleys and craters, but no overlapping elements. They look just like miniature mountain ranges, which is what gave me the idea. Epi lighting gives nice uniform illumination to all parts, and if shadows could be applied in post, it would result in better detail and less noise(especially in areas where you want to have shadows) than one would be able to get with undiffused lighting that produces real shadows.

And of course the ability to experiment with the light direction and quality AFTER taking the stack is a big advantage.

iconoclastica
Posts: 486
Joined: Sat Jun 25, 2016 12:34 pm
Location: Wageningen, Gelderland

Post by iconoclastica »

Here's a more realistic example (Equisetum variegatum), the same that if have used previously with another technique. Here, the HS brings out the surface details more pronounced and actually reveals details that I couldn't distinguish before.

Here's the stacked image:

Image

Its depthmap is cleaner than the one above and therefore its HS too. I now applied only 3 pixels gaussian blur (30 in the example above):

Image Image

And here's the result (original, again, at the left). I have outlined areas with new detail. The small particles are sand or dust, but the rectangular area contains meaningfull detail:

Image Image
--- felix filicis ---

Lou Jost
Posts: 5947
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

Nice! It would be really interesting if you had an epi-lighting original with no shadows. Then you could adjust the hillshading to completely control the locations of the shadows. You could choose the direction that gave the best result.

iconoclastica
Posts: 486
Joined: Sat Jun 25, 2016 12:34 pm
Location: Wageningen, Gelderland

Post by iconoclastica »

Lou Jost wrote:Nice! It would be really interesting if you had an epi-lighting original with no shadows. Then you could adjust the hillshading to completely control the locations of the shadows. You could choose the direction that gave the best result.
With truly flat lighting surface details become almost indiscernable. Such originals I don't have, quite the opposite indeed, but it can be simulated in photoshop by removing the luminosity information and only leave a colour layer. Then add the HS in blending mode luminosity (OK, that first step is not necessary unless you want to see it):

Image Image Image
original | colour only | added Hillshade

It is definitely not the same, e.g. all luster has gone, which is surface information too. In fact it is much like a SEM-image. But when you're interested in the topography, it could be an interesting artifact in itself.
--- felix filicis ---

Lou Jost
Posts: 5947
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

That's a very interesting idea. I jiust downloaded ImageJ and will try to play with this on my epi "leaf landscape" images.

Lou Jost
Posts: 5947
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

The highlights, especially the leftmost band of bright highlights, show fine ridges and valleys that appear flat on the hillshaded image. Maybe your depth map smoothing did that, even though it was only 3 pixels?

iconoclastica
Posts: 486
Joined: Sat Jun 25, 2016 12:34 pm
Location: Wageningen, Gelderland

Post by iconoclastica »

Lou Jost wrote:The highlights, especially the leftmost band of bright highlights, show fine ridges and valleys that appear flat on the hillshaded image. Maybe your depth map smoothing did that, even though it was only 3 pixels?
That, and also that the altitudinal variation there is not greater than the step size (assuming we are looking at the same area).

I think the hillshade algorithm expects a regular raster of a continuous (floating point) variable. Our depthmap steps integer steps and then needs an interpolating function to estimate the slopes and with that the intermediate values.
--- felix filicis ---

Lou Jost
Posts: 5947
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

We might have to use smaller step sizes than normal when using this technique.

Post Reply Previous topicNext topic