Author Topic: Building large mosaics with StarAlignment  (Read 11981 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Building large mosaics with StarAlignment
« on: 2010 June 19 08:29:40 »
Hi everybody,

Recently I've been contacted by Antonio Pérez to help him in the construction of a large mosaic of the Sadr region in Cygnus. Antonio has kindly given me permission to use his raw images to show the mosaic construction procedure step by step, as I think it may be of interest to most users on this forum.

The mosaic in question has six frames covering about 2x2 degrees each. However we'll show just a partial mosaic here with four frames, as Antonio is still collecting data for the other two, as of writing this.

The resulting four-frame mosaic image has some 7000x5000 pixels. This is a JPEG version of the final result:


Click on the image to see a full-size version.

Overlapping between frames is excellent in right ascension (horizontal), but relatively small in declination (vertical). This makes the task somewhat difficult, but despite that, StarAlignment is able to generate the mosaic without any problems, with nearly default parameters. We'll see also how the new mosaic frame adaptation feature works remarkably well.

The first screenshot shows the four mosaic frames with automatic screen transfer functions. I have set the TL, BL, TR and BR image identifiers, respectively standing for top-left, bottom-left, top-right and bottom-right, to help identifying the frames by their position.


Click on the image to see a full-size version.

As you can see, there are significant variations between frames, in both background illumination and signal levels. They will be compensated by StarAlignment's automatic frame adaptation feature to yield a completely seamless mosaic, as you'll see later.

There are several ways to build a mosaic like this one:

1. Register individual frames one at a time. For example, register the BL frame on TL, then BR on the resulting two frame mosaic, and finally TR on the previous three-frame mosaic. This has the advantage that no frame is interpolated more than once. However, this is the worst way of building a mosaic in terms of geometrical accuracy, since small registration errors caused by distortion accumulate and get worse as we add successive frames.

2. Build several partial mosaics and build a final mosaic with them, following a strategy to minimize accumulated errors. This is, in general, much more accurate in geometrical terms, but has the disadvantage that several frames get interpolated twice. In practice this has, however, only marginal importance due to the accuracy of the implemented pixel interpolation algorithms. This is the method that we'll follow in this example.

3. Build the entire mosaic over a synthetic star field. For example, the StarGenerator tool can be used in PixInsight to this purpose, especially in the next version 1.6.1, where gnomonic projection provides much better results than the current conformal projections. This method is potentially the most accurate, since we are building the entire mosaic under controlled geometrical constraints, and all frames are interpolated only once. I'll generate this mosaic again using this method.

So let's put the second method into practice. We are going to register the bottom left frame over the top left frame. The first step is cropping the registration artifacts on the right edge of BL with DynamicCrop; otherwise those artifacts would look extremely ugly in the middle of the mosaic.


Click on the image to see a full-size version.

Below is the StarAlignment tool with the appropriate parameters to build the mosaic.


Click on the image to see a full-size version.

All parameters have default values except:

Working mode = Register/Union - mosaic

Generate masks = enabled. This is optional. The masks aren't really necessary, but they will allow us to verify the quality and correctness of the registration, as we'll see later.

Frame adaptation = enabled. With this option enabled, StarAlignment will compute a linear frame adaptation function of the form y = a + bx, to generate a seamless mosaic.

RANSAC Tolerance = 3.5 pixels (Star Matching section). Working with large mosaics as this one, an increased RANSAC tolerance will help StarAlignment to find more star pair matches to compute a registration model better adapted to local distortions. Large mosaics are particularly affected by distortions, both optical distortions (e.g. field curvature) and "natural" distortion caused by the fact that we are representing a relatively large portion of the sphere on the plane.

Registration model = 2D Surface Splines (Interpolation section). Cubic surface splines (also known as thin plates) are a much more adaptable interpolation device than the default homographic projection. This coordinate interpolation method will lead to a more accurate image registration in presence of relatively strong distortions, which is important for mosaics for the same reasons explained above.

This is the resulting partial mosaic and its corresponding mask:


Click on the image to see a full-size version.

StarAlignment masks are binary masks, that is, masks where pixels can have only pure black (0) or pure white (1) values. We are going to apply a simple PixelMath instance to raise the low levels to 0.7, instead of zero:

Max( 0.7, $T )

without rescaling. The result is below.


Click on the image to see a full-size version.

With this mask enabled on the partial mosaic image, we can check the correctness and accuracy of the mosaic registration very easily. Note for example how a star has been perfectly divided into two halves between both mosaic frames:


Click on the image to see a full-size version.

Another example where a diffraction pattern has been accurately represented just at the seam:


Click on the image to see a full-size version.

Further accuracy checks with a double star and a couple tiny stars near the right edge of the mosaic:


Click on the image to see a full-size version.


Click on the image to see a full-size version.

The next step in the construction of the mosaic is registering the two rightmost frames. We'll crop the registration artifacts that could be seen on the resulting mosaic with DynamicCrop, as before.


Click on the image to see a full-size version.

Here are the resulting partial mosaic and the mask:


Click on the image to see a full-size version.

On StarAlignment, note that I have selected TR as the reference image and have applied the process to BR. In the previous step the reference was TL and the instance was applied to BL.

Let's do a few accuracy checks. The mask has been limited to 0.7, as before, using PixelMath. First a bright star whose diffraction spikes lie just at the seam:


Click on the image to see a full-size version.

A star that also falls at the "bleeding edge":


Click on the image to see a full-size version.

Let's prepare for the final step. We'll register the right sub-mosaic over the left one. Hence, the left border of the right mosaic must be cropped.


Click on the image to see a full-size version.

And here is the final mosaic with its corresponding registration mask:


Click on the image to see a full-size version.

Checking accuracy is always important. These are three stars perfectly crossed by the junction line:


Click on the image to see a full-size version.

This one demonstrates the accuracy in the computed rotation angle between frames:


Click on the image to see a full-size version.

That's it. Hope you'll find it useful. Thanks to Antonio for letting me work with his images.
« Last Edit: 2014 January 23 10:41:26 by Juan Conejero »
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • PegasusAstronomy.com & Starshadows.com
Re: Building large mosaics with StarAlignment
« Reply #1 on: 2010 June 19 10:20:40 »
Steve Mazlin and I have been working on a mosaic of the Cats Paw area but weather went bad before we completed the color.  Here is the four frame Ha data done with a RCOS 16 f/11 and apogee U9 camera.  Not a big an area as Antonio's:-)



Click on the image to see it full size.
« Last Edit: 2010 June 19 10:28:40 by Pleiades »
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline sreilly

  • PixInsight Padawan
  • ****
  • Posts: 791
    • Imaging at Dogwood Ridge Observatory
Re: Building large mosaics with StarAlignment
« Reply #2 on: 2010 June 19 12:31:18 »
Very impressive indeed. The horizontal lines I see, is that where there wasn't sufficient data to cover those seams?
Steve
www.astral-imaging.com
AP1200
OGS 12.5" RC
Tak FSQ-106ED
ST10XME/CFW8/AO8
STL-11000M/FW8/AO-L
Pyxis 3" Rotator
Baader LRGBHa Filters
PixInsight/MaxIm/ACP/Registar/Mira AP/PS CS5

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • PegasusAstronomy.com & Starshadows.com
Re: Building large mosaics with StarAlignment
« Reply #3 on: 2010 June 19 13:40:44 »
SHould have been plenty of data as this is a 10% overlap approximately.  Also this is not the final image in that it is a quickly thrown together and processed image to get an idea of what the field would look like.  Yeah will have to work on the area of the seams for sure.

Thanks for looking.  Juan may also have some comment?
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: Building large mosaics with StarAlignment
« Reply #4 on: 2010 June 19 17:19:56 »
Jack, looks like you're going to have a spectacular image. Look forward to seeing the completed project.

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline luis

  • Newcomer
  • Posts: 23
Re: Building large mosaics with StarAlignment
« Reply #5 on: 2010 June 21 16:28:22 »
Hola , ante todo lamento no dominar el ingles asi que hago la pregunta en castellano , he seguido atentamente el tutorial como he podido a base de google traductor pero no se....me lio...la pregunta es , solo sirve para imagenes en balnco y negro o tambien para color?...lo digo porque tengo una m8 que con diferentes encuadres no puedo aprovechar las equinas de cielo y me la corta vilmente.....hesta hecha con un filtro LPS.V4 de Hutech....una especie de banda estrecha para canon , y como dije he intentado seguir el tutorial para ver si podia casar los cielos....un churro o no me entero , en fin , eso , se puede aplicar a imagenes en color?

Perdon por el toston y mi ignorancia.....a veces es atrevida...

saludos

Luis

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Building large mosaics with StarAlignment
« Reply #6 on: 2010 June 23 08:38:49 »
Hola Luis

Por supuesto que funciona con imágenes en color. Lo único que puede ocurrir es que el balance cromático resultante en el mosaico, una vez completado, necesite un reajuste debido a la ecualización aplicada por la oción frame adaptation. En cualquier caso, reajustar el balance de color debería ser muy sencillo puesto que StarAlignment sólo aplica transformaciones lineales a las imágenes.

Si no te funciona puede ser debido a diferentes motivos. Puede que la superposición entre teselas del mosaico sea demasiado pequeña o inexistente. También puede ocurrir, aunque es muy poco probable, que StarAlignment no encuentre suficientes estrellas en las imágenes. ¿No será que estás intentando componer el mosaico con imágenes raw de DSLR, es decir antes de debayerizarlas? Las imágenes con matriz de Bayer no se pueden utilizar con StarAlignment; es necesario calibrarlas y debayerizarlas primero.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline luis

  • Newcomer
  • Posts: 23
Re: Building large mosaics with StarAlignment
« Reply #7 on: 2010 June 23 13:57:10 »
Buenas noches Juan , gracias por la respuesta , con vuestro permiso cuelgo la imagen que quiero arreglar...exagerada con curvas para ver el descuadre.....esta calibrada con maxim , darks , bias y flats , guardada en fit de 32 bits......todas las tomas sigen el mismo paso , la mejor encuadrada como imagen de referencia  y el resto a seguir  a la primera.....creo que hay mucha informacion y me gustaria poderla sacar...es mi primera imagen decente desde que me termine el observatorio....


http://subefotos.com/ver/?f811957661ccdb4ec66cc82b923501a0o.jpg

os pongo el enlace porque no me sale lo de insertar imagen,




como vereis las esquinas el cielo es una pena que solo se esconde si oscurezco la imagen....y no es lo suyo...tambien podria solo sumar 36 imagenes pero me sabe muy mal perder otras 20 que se desencuadraron.....asi que agradezco cualquier consejo....
un millon de gracias `por anticipado

un saludo

Luis

Offline cs_pixinsight

  • PixInsight Addict
  • ***
  • Posts: 156
Re: Building large mosaics with StarAlignment
« Reply #8 on: 2012 May 28 20:51:32 »
Juan, is there any chance you still have the images for this tutorial?

Thanks,
Craig

Offline Martin

  • Newcomer
  • Posts: 19
Re: Building large mosaics with StarAlignment
« Reply #9 on: 2012 June 02 22:44:13 »
Yes please.  The pictures are no longer loading.

cheers
Martin

Offline twade

  • PTeam Member
  • PixInsight Old Hand
  • ****
  • Posts: 445
    • http://www.northwest-landscapes.com
Re: Building large mosaics with StarAlignment
« Reply #10 on: 2012 July 27 07:47:13 »
Juan,

For some odd reason, 2D Surface Splines (Interpolation section) fails every time when selected.  I have a two frame mosaic I'm trying to build. The default selection works just fine. 

As others have noted, it sure would be nice if you fixed the image problem with this tutorial.

Thanks,

Wade

Offline jmtanous

  • PixInsight Addict
  • ***
  • Posts: 155
Re: Building large mosaics with StarAlignment
« Reply #11 on: 2012 August 21 12:58:54 »
Hi,

The original post images are broken links... Is there a way to restore them?

Cheers,

Jose