PetteriAimonen / focus-stack

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

Problems near borders #2

Closed raduprv closed 2 years ago

raduprv commented 4 years ago

Hi, it's me again. I compiled the new version, and I found some other problems (they are present in the old and new version also).

Here are the files output img_test000000 img_test000001 img_test000002 img_test000003 img_test000004

PetteriAimonen commented 3 years ago

This seems to be caused by the large distance difference between the background and foreground, which causes a lot of scale change between the images. When they get aligned, some images are too small and the border is artificially expanded.

The problem near top edge could probably be handled by keeping track of the original area of the image and changing Task_Reassign to only take into account pixels that are actually from input image. Not sure what could be done about the artifacts around the chair.

raduprv commented 3 years ago

Could you make an option to make the resulting image in such a way that all the images are downscaled to match the smallest image? That should take care of artifacts resulting from upsampling many images.

PetteriAimonen commented 3 years ago

Yeah, that is one option also. In any case, it would need tracking of the source image areas through the transformation done by Task_Align; not particularly difficult to do, just needs to be added.