PetteriAimonen / focus-stack

Fast and easy focus stacking
MIT License
249 stars 37 forks source link

How to reduce halo? #42

Open roorco opened 8 months ago

roorco commented 8 months ago

Hi, Iìm quite new to focus stacking and working on Linux, your software seems one of the best option. Thank you. I'm testing the software with a bunch of mushroom's photos (click to download). The result is full of halos. There is a way with focus stak to ha ve a better result? I'm playing with --halo-radius and --depthmap-threshold, but the result is very similar. On other exemple I've got better result not using --no-contrast option, but in this case without --no-contrast, tehre is an error in building the stack.

PetteriAimonen commented 7 months ago

The error without --no-contrast results from DORO9270.JPG having large difference in exposure to the other photos and in particular to DORO9269.JPG. I'm not sure how that happened, considering based in EXIF data the exposure settings are locked - maybe there was a change in surrounding light?

But aside from that, no, I don't currently know of a way to get better results. Scenes with very large contrast like this one are a weak point of the algorithm I'm using.

If you compare details from 9266 and 9267:

image

In 9266 the background is blurred, while in 9267 it is obscured by the halo. Currently focus-stack picks 9267 for the edge of the halo, which looks pretty bad. It would be better to pick 9266, but even that would result in a "blur halo" around the object.

There just isn't any image in the stack where we could get a sharp image of the background from, so something more advanced is needed to fill in the missing background. But I'm not sure what algorithm would work or how to integrate it to the current flow.