Author Topic: Mosaic: add blending feature  (Read 4843 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Mosaic: add blending feature
« on: 2009 February 21 16:44:45 »
Hi,

it seems that the big challenge with creating a mosaic is to get comparable intensity levels on the images that are being stitched together. Clearly this is something that needs to be done before attempting to do the mosaic but I doubt the seam between images can ever be expected to be invisible.

I imagine when mosaics are made with conventional tools (PS) folks use blending masks of some sort. I propose a similar feature for PI but more sophisticated :)

Each pixel in the overlapping area has a distance to both images. Let's have the pixel value be a inversely proportional mix of the two image values and their distance. Assume images A and B with pixel P being in the overlap area:

O(AB) = overlap between A and B at pixel P
D(A) = distance from pixel P to the edge of A
D(B) = distance from pixel P to the edge of B
P(A) = value of pixel P in image A (same for B, M)

P(M) = P(A) * D(B)/(D(A) + D(B) + P(B) * D(A)/(D(A)+D(B)

So when we reach the edge of the overlap it takes the value of the image we're about to transition into. I think this also works in corners.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Mosaic: add blending feature
« Reply #1 on: 2009 February 23 06:45:56 »
Hi Sander,

Very interesting. It looks like a clever way to avoid mosaic seams. I'll try to implement it into StarAlignment, then I'll show here how it works. The main difficulty lies in the fact that the seams are in general not orthogonal with image borders. But of course we can overcome this :)

Thank you for this excellent idea ;)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Mosaic: add blending feature
« Reply #2 on: 2009 February 23 06:57:26 »
Thanks Juan for considering this. It would be computationally intensive to calculate the shortest line through each point to both edges but maybe a short cut can be devised. Let me think about that. Maybe pick one border and draw a line orthogonal to that through the point in question. That would favor one of the images but the result would most likely still be acceptable. Some constant adjustment based on the rotation angle may help but I can't wrap my brain around that yet :)
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity