Friday 23 May 2014

DOF and diffraction part 2 - the software: hugin, photoshop and helicon focus

As soon as I looked a little harder at the output from enfuse, I realised that there were some strange things going on....

This first crop is the output file which at first glance looks promising - the card and the distant hedge are both looking reasonable,but there is a bit of a dark halo around the black lines as well as a thin line in the centre of the black line which is darker than the rest.
Here is the image from the stack where this card is in focus. not only is the strange halo absent, but there is a lot more texture detail showing up in the card surface.

Clearly there is detail in the stack that does not make it through the process... 
Here is a quick go with two other obvious contenders for focus stacking:

photoshop CC

Helicon Focus

The output from Photoshop CC, which claims to be able to focus stack, but in reality make a complete mess of it. This crop shows that it has failed on the distant hedge immediately above the card and also there are some wierd things going on with the railings. the output from Helicon focus using all default settings. This looks much more promising - there is a small area of softness immediately around the card, but this is where the distant focus image has blurred white from the card into the foliage, so this is actually a sensible default.
I gave CombineZP a quick go as well, but it crashed most reliably on all but the simplest mode, and in that mode it's output was nowhere near as good as Helicon.

Read on for info on how enfuse and photoshop get it so wrong, and why Helicon focus looks to be the best option.


Enfuse - where did it all go wrong?

Enfuse has a nice option to output the masks it uses. With the hardmask option on (and focus stacking without hardmask is not sensible) we get a set of masks which show the selection of individual pixels from each image in the stack. The strange things here is that in almost all areas of the picure it is picking a few pixels from almost every image.

Here are resized images of the masks from the final few images in the stack. The hot spots in the image show that enfuse was sort of getting the right area, but still picks random pixels from pretty much the whole image.


Finally for enfuse here are masks from a few images before the 5m flag was in focus, the in focus image and a few images after. This really just confirms the story, far too much random pixel selection going on for a good result


Photoshop - epic fail

It is diffcult to understand what on earth Photoshop thinks it is doing here. Below are a group of adjacent masks from around the centre of the stack. While the overall hotspots are sort of clustered around the right areas, they appear to have been overlaid with what I can only describe as a random splodge generator. I suppose with some stack this might result in an interesting artistic effect, but for what I am trying to do here, this can only be described epic failure.

Helicon focus

Well many folks say this is the best answer, and the default try gave by far the best results so far. The depth mask which it can output are a very good guide to what is going on, in that each shade of gray represents a layer used to populate the final image, so they are a sort of combined version of the masks I've shown above.
Method C - pyramid
Pyramid mode shows a tendency to flip between images on the cards, and also on the sloping tape measure in the foreground
Method B - depth map (default)
This is the method used for the example at the top of this post. It looking pretty good, but is still not perfect - for example it misses the cable running across the top
Method A - weighted average
Overall this isn't really helping - depth map is stil;l the best.


The depth map method here is looking pretty good, but not perfect, so two things could help - changing the parameters used by this method / retouching in Helicon

No comments:

Post a Comment