Author Topic: Gradient Merge Mosaic Issues. A strange artifact...  (Read 3780 times)

Offline nmontec

  • Member
  • *
  • Posts: 71
    • View Profile
    • SkyMonsters
Gradient Merge Mosaic Issues. A strange artifact...
« on: 2013 February 20 09:40:45 »
Hello,

I am getting this strange artifact on gradient merge mosaic. Do you know why and how to overcome it?
See screenshot.

Thanks a lot!
Nicola

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2173
  • Join the dark side... we have cookies
    • View Profile
    • http://www.astrophoto.cl
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #1 on: 2013 February 20 11:13:32 »
Try cropping the image. Operations in the gradient domain do not like black edges, or very wild oscillations.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline nmontec

  • Member
  • *
  • Posts: 71
    • View Profile
    • SkyMonsters
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #2 on: 2013 February 20 11:45:38 »
Hmmm I don't I understand your suggestion. Do you mean cropping the dark edges of the single frames before running the script?

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2173
  • Join the dark side... we have cookies
    • View Profile
    • http://www.astrophoto.cl
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #3 on: 2013 February 20 12:15:04 »
Yes, those black pixels that are not covered by other images in the mosaic.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline nmontec

  • Member
  • *
  • Posts: 71
    • View Profile
    • SkyMonsters
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #4 on: 2013 February 20 13:41:52 »
It does not work, it says "current image width differs from first image width". It would seem I can't crop the dark side because they are needed to keep same width and height.

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2173
  • Join the dark side... we have cookies
    • View Profile
    • http://www.astrophoto.cl
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #5 on: 2013 February 20 14:21:38 »
You have to apply the same crop to both images.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline nmontec

  • Member
  • *
  • Posts: 71
    • View Profile
    • SkyMonsters
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #6 on: 2013 February 20 14:45:48 »
It does not work either, I chopped the images and I get other kinds of artifacts.....hmm
« Last Edit: 2013 February 20 15:16:08 by nmontec »

Offline nmontec

  • Member
  • *
  • Posts: 71
    • View Profile
    • SkyMonsters
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #7 on: 2013 February 20 15:38:37 »
Issue solved, I found the reason it wasn't working fine. The initial images (i.e. before image registration) had a background level very different from each other, something that frame adaptation didn't adjust and that was causing the artifact.
If someone finds the same issue remember to check the histogram of the images to merge before registration and use the histogram to offset the background to similar values. The you may proceed and it works like charm.

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2173
  • Join the dark side... we have cookies
    • View Profile
    • http://www.astrophoto.cl
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #8 on: 2013 February 20 16:03:24 »
Hmmm... this should have no impact at all. Gradients are the first derivative, so constant additive differences should not matter at all (thats the idea behind this algorithm). I think Georg should take a look at his code :D
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Tom OD

  • PixInsight Enthusiast
  • **
  • Posts: 88
    • View Profile
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #9 on: 2013 February 20 17:15:10 »
Hi Carlos / Nmontec,
I'm in the middle of using GMM and Star Align for my next pic, and I'm learning a lot by making poor pictures so far. I thought that the Gradient Merge Mosaic needed linear frames to use for the GMM routine. Isn't adjusting the Histogram making it Non linear then?
Or do you mean adjust the histo midpoint as per Georgs tip then readjust the midpoint before GMM to minimise the Star Artifacts?
Tom

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2129
    • View Profile
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #10 on: 2013 February 21 01:34:14 »
Hmmm... this should have no impact at all. Gradients are the first derivative, so constant additive differences should not matter at all (thats the idea behind this algorithm). I think Georg should take a look at his code :D
You are right, constant additives should not have any impact. However, different scaling has: Suppose you have 2 images that meet just at a star. In those 2 images brightness is scaled differently (i.e. they have different contrasts). If image 1 has twice the contrast of image 2, its gradients are twice as high. Now see what happens at the star: Coming from image 1, the increase in brightness as described by the gradients is twice has high as the brightness change when moving into image 2. When GMM tries to smoothly balance the brightness changes described by those gradients, you get the typical articfact that happen when a star is just on the border beween 2 images.

See http://pixinsight.com/forum/index.php?topic=4105.0 and http://pixinsight.com/forum/index.php?topic=3572.0 for hints on fighting those artifacts.

Having said that: I am not sure about the causes of the artifacts that I see in image in the first post. If possible, I would like to play with this data. Can you upload it somewhere?
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2129
    • View Profile
Re: Gradient Merge Mosaic Issues. A strange artifact...
« Reply #11 on: 2013 February 21 01:43:11 »
I thought that the Gradient Merge Mosaic needed linear frames to use for the GMM routine. Isn't adjusting the Histogram making it Non linear then?

Tom,

GMM needs the images to have the same contrast (=gradient) for corresponding regions of the image. GMM is doing its work by smoothing out differences in brightness offsets and the gradients. If the gradients are wildly different for corresponding regions of the image, you get the typical artifacts for stars at the border between two images.

Having the images linear (with frame adaption) is one way to have identical contrast. You can also histogram transform (e.g. using the MTF function) them identically, which is one of the methods of fighting artifacts described in http://pixinsight.com/forum/index.php?topic=4105.0.

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)