For the generation of selections/masks, there are also lots of other tools available in ImageJ (e.g. Filters>Variance...), but that's getting a bit too involved in Digital Signal Processing of images for a quick explanation.
Hm- where can I read more about it? The ImageJ Help > Documentation only says
"29.11.9 Variance…Highlights edges in the image by replacing each pixel with the neighborhood variance."
Well, if there is a lot of detail, then the local variance will be high. So that should give an indication of where the focus is high and the detail is fine and of high contrast. But it would be one step in a series towards creating a mask, depending on image content. Thresholding of images, and differences between images may need to be done to get the detail out, but it still won't solve the issue of detail displacement between slices. It would only offer a means to select detail in a single image. This is a separate thing.
A good HDR application will automatically take care of Ghosting artifacts, or offer manual intervention in the process of stacking the exposure brackets.
Lumariver, my HDR app, takes care of ghosting artifacts to a good degree, if not 100%. But what is at stake here is the *focus* stacking, which I will try to work around.
Yes, I understand. But the Focus stacking algorithms are based on one image being (locally)
better focused than all others. When there are multiple candidates for the same image feature, then ghosting is likely to show up. Non-stationary subjects are not the prime candidates for focus-stacking, if you want to avoid a lot of manual intervention.
Occasionally it may help to divide the stacking procedure into multiple runs. One could e.g. try stacking the odd and the even images from a sequence separately, thus skipping one each time, and thereby create a better separation between the level of focus of each slice. Then stack the two resulting stacked images. The best strategy depends a lot on the actual images, and pre-processing the images into spatial frequency band masked versions may also be an option, but it's not all that easy.
The cleaner the slices can separate focused layers of the scene by distance, the easier the stacking should be,
but it doesn't help if each slice's detail has moved ... Maybe shooting with a slower shutterspeed will blur the movement enough for the branches and grass to blend, while the stationary parts of the image benefit from the enhanced DOF resolution.
Cheers,
Bart