Author Topic: Dynamic Alignment Mosaic?  (Read 7035 times)

Offline Neutronman

  • Newcomer
  • Posts: 24
    • Down The Wormhole
Dynamic Alignment Mosaic?
« on: 2011 July 14 20:31:34 »
Can the Dynamic Alignment tool be used to join two mosaic panels together?  I can register shared stars in the two panels, but when I execute the command I just get a subset of where the two panels overlap.  Does this tool not allow for a "union"?  I can't seem to find anywhere to designate a union type.

By the way, the Star Alignment tool is not working on this particular set of data which is why I am looking for a manual way to do this.

Thanks,

JOhn
__________________________________________________________

JOhn

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Dynamic Alignment Mosaic?
« Reply #1 on: 2011 July 15 01:46:26 »
Hi John,

First of all I'd like to take a look at those images where SA is failing to build a mosaic. That would help me diagnose what happens.

DynamicAlignment can indeed be used to build mosaics. Being a semi-manual tool, it allows you to align images subject to arbitrary distortions without any limits, something that SA can't do. However, DA is somewhat outdated. A complete rewrite of this tool is scheduled after Summer. Among other things, the new DA tool will be able to generate mosaics very easily.

In the meanwhile, to build mosaics with DA you have to do some extra manual work. Basically, you need to generate a sufficiently large canvas with enough room to place all mosaic panels. This is very easy to do with the Crop tool (Geometry category).

First you have to guess the approximate final dimensions of your mosaic in pixels; let's call them W and H. Select one of the panels as your first reference image. Open the Crop tool and activate Track View. Then enter W and H as the target dimensions in pixels. With the margins/anchors controls you can define where the extra space will be added. For example, if your reference image is the top left mosaic panel (a reasonable option), then your margins should be: top=0, left=0, bottom=H-h, right=W-w, where h and w are the current height and width of your reference frame. Note that the differences H-h and W-w will be calculated automatically by the Crop tool.

Leave the fill color parameters with default values (to fill the extra space with a solid black color) and apply Crop to your reference image. Now you can register all mosaic panels over this reference image. The final result will be a set of registered images, each of them put in place over a black canvas. Now you can merge these images with PixelMath using the maximum operator. For example, if you have 6 mosaic panels P1 ... P6 then this PixelMath expression would do the job:

max( P1, P2, P3, P4, P5, P6 )

That said, I am very interested in knowing why StarAlignment cannot generate your mosaic. Could you upload the images somewhere?
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Neutronman

  • Newcomer
  • Posts: 24
    • Down The Wormhole
Re: Dynamic Alignment Mosaic?
« Reply #2 on: 2011 July 15 08:18:46 »
Thanks Juan, I will try your method using Dynamic Alignment.  IN the meantime, I have PM you the links to the 2 files.

Best,

JOhn
__________________________________________________________

JOhn

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Dynamic Alignment Mosaic?
« Reply #3 on: 2011 July 15 10:23:22 »
Hi John,

Thank you for uploading the images. This mosaic can be built with StarAlignment without problems by tweaking a few parameters (click the image to see a full size version):


To build this mosaic you need to change two parameters on the star detection section of SA: increase peak response and decrease maximum distortion. In this way SA is more tolerant with less-than-perfect star shapes on the left-hand submosaic. If the left-hand submosaic had the same quality as the right-hand one, this mosaic could perhaps be built directly without defining previews, but given the differences and the rather small overlapping, you have to define previews covering roughly the overlapping region between both images, as shown above.

Along with star detection parameters, I have increased RANSAC tolerance to 6 pixels (which improves the registration quality from 0.4 to 0.55) and selected the 2D surface splines registration model, which is more accurate in these cases.

The mosaic builds correctly, but the result is not good. There are problems with the left submosaic that cannot be overcome with SA's frame adaptation feature. Signal levels are very low and the background is very high. The dynamics of the left submosaic are rather poor compared to the right one, which is pretty good. I would restart this mosaic from scratch to avoid these problems. I would also build the mosaic the opposite way: stitch the panels by successive horizontal rows. In this way the registration would be more accurate as the lengths of the overlapping sides would be smaller, and the accumulated alignment errors would also be reduced.

Hope this helps.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Neutronman

  • Newcomer
  • Posts: 24
    • Down The Wormhole
Re: Dynamic Alignment Mosaic?
« Reply #4 on: 2011 July 15 10:47:55 »
Hi Juan,

Thanks SO much for the excellent info!  It is clear to me now. 

Yes, I'm not sure what happened to the left submosaic -- it did not start out that way :sad:

Regarding the rows vs columns assembly... I totally agree with you, but I was "trapped" into assembling in columns because there was too much vertical offset between the rows to allow a rows assembly (I had to offset columns to match up, if that makes sense).  Although come to think of it, I could do quadrants (2 groups of 4) and offset those... hmmm.  That would be more accurate I suppose.

Again, thanks a bunch for your quick and detailed response!

Best,

JOhn
__________________________________________________________

JOhn

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Dynamic Alignment Mosaic?
« Reply #5 on: 2011 July 15 12:17:14 »
To build this mosaic you need to change two parameters on the star detection section of SA: increase peak response and decrease maximum distortion. In this way SA is more tolerant with less-than-perfect star shapes on the left-hand submosaic.

I currently dont have my PI handbook at hand  :-[, but I would have expected that I would have to increase maximum distortion to be more tolerant...

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

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Dynamic Alignment Mosaic?
« Reply #6 on: 2011 July 15 13:06:38 »
Quote
I would have expected that I would have to increase maximum distortion to be more tolerant...

For StarAlignment we measure distortion from the fraction of the bounding rectangle covered by the object. The minimum possible distortion is therefore that of a perfect square, which would cover the 100% of its bounding rectangle. The most distorted object would be an infinitely thin line, which would cover (as a limit) a 0% of its bounding rectangle. The distortion of a perfectly round star is pi/4, or about 0.79. I could have used 1 - distortion for SA's user interface (I considered doing so) but I think once one gets the concept, working with the actual numbers is more understandable (just visualize a square and an ellipse inside it).
« Last Edit: 2011 July 15 15:17:59 by Juan Conejero »
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: Dynamic Alignment Mosaic?
« Reply #7 on: 2011 July 16 01:56:26 »
The mosaic builds correctly, but the result is not good. There are problems with the left submosaic that cannot be overcome with SA's frame adaptation feature. Signal levels are very low and the background is very high. The dynamics of the left submosaic are rather poor compared to the right one, which is pretty good. I would restart this mosaic from scratch to avoid these problems.

The situation where "Frame adaptation" produces bad results has happened to me before. Sometimes, using the pre-frameadaptation method outlined in the first video you (Juan) made would work pretty well. In other cases where that wasn't producing the best results, what I did was deselect "Frame adaptation" in SA, and then, using the masks generated by SA, just go ahead and start my non-linear histogram adjustments, and adjust one pane or the other until visually they looked good - often I'd start working on a preview to get "close enough" - basically the same method you showed in the video but making non-linear adjustments with the histogram tool rather than linear adjustments with PixelMath. You lose the benefits of ending up with a whole non-linear mosaic to begin with, but what you gain is a seamless mosaic you can continue working on...

Offline Neutronman

  • Newcomer
  • Posts: 24
    • Down The Wormhole
Re: Dynamic Alignment Mosaic?
« Reply #8 on: 2011 July 16 06:22:14 »
- often I'd start working on a preview to get "close enough" - basically the same method you showed in the video but making non-linear adjustments with the histogram tool rather than linear adjustments with PixelMath. You lose the benefits of ending up with a whole non-linear mosaic to begin with, but what you gain is a seamless mosaic you can continue working on...

Yes, that is exactly what I end up doing about half the time.  Again, not elegant... but it works.  I'm not opposed to using brute force when needed  ;)

JOhn
__________________________________________________________

JOhn

Offline Neutronman

  • Newcomer
  • Posts: 24
    • Down The Wormhole
Re: Dynamic Alignment Mosaic?
« Reply #9 on: 2011 July 17 14:41:23 »
Thanks again for the help!  Thought I'd post a link to the final image (and yes, I had to use a little "brute force")  ;)

http://www.flickr.com/photos/neutronman/5947028358/

JOhn
__________________________________________________________

JOhn