Hi Harry,
here is my hypothesis regarding the cause of those artefacts:
- the algorithm first combines images only by overlay (as in StarAlignment) or by average (computing the average where images overlap). At this point, it does nothing to hide the seams - the results are simular to what you see after StarAlignment. The algorithms also generates a mask that identifies which pixel belongs to which image or combination of images (toggle "Generate Mask" to see it).
- It then computes x and y gradients of the combined image. If I would feed this information to the poisson solver, I would get the combined image again - with seams and everything.
- So what I do is first patch the gradients, by setting the gradient to 0 where two image regions meet. Feeding these patched gradients to the solver thus causes the solver to try to give neighboring pixels the same value, thus smoothing out possible seams at this location. Any remaining "tension" is smoothed out over a larger region. Visually, the patched pixels are almost invisible, but the are there...
- Now, if we have a star just at a seam, the star usually causes a strong gradient. The algorithm patches this gradient to be 0. The solver now finds that the core of the star should not be as bright as it currently is, it therefore reduces the core brightness. However, other gradients in the vicinity that are not patched still tell the solver to produce a bright star. So the solver tries to find a compromise between the conflicting gradients, slightly enhancing brightness with respect to the patched gradient, slightly reducing the brightness with regard to the other gradients, and distributing the remaining tension into the neighborhood.
This results in the artifact you see in the screenshot below. I guess the papers I have read about the Gradient Domain algorithms never mentioned this problem because daylight images rarely have the kind of intense points sources that astronomical pictures have.
My current idea to eliminate/reduce those is to limit the gradient patching to regions with low gradients, but I do not yet know if this produces other problems. I think I have also seen some article that suggest how to select optimal seems...but I have not yet found it.
Kind regards,
Georg