jmurphy
Well-known member
A new script to mosaic together previously registered images. It uses photometry to accurately scale the target image. The target image is also corrected for the relative gradient between the two images. This script requires at least one star in the overlapping region.
The PhotometricMosaic script, and two helper scripts (TrimMosaicTile and SplitMosaicTile) are attached, see MosaicScripts.zip.
The help files can be downloaded from:
To produce a seamless join between two aligned frames, it is vitally important that both the brightness scale and the background offset are correct. When multiple frames are combined, accumulative errors make this requirement even more critical. Light pollution gradients create an even greater challenge.
Most mosaic algorithms simply compare the pixel values within the overlap region and use this data to compute the scale and offset. This can work well provided that the images are both of high quality.
Unfortunately, images taken by amateur astrophotographers can suffer from poor seeing. The star FWHM may differ significantly between the two images. For example, on one image the stars may be spread over more pixels. This causes each star's peak value to be significantly lower in this image. Hence if the star profiles differ between the image frames, most mosaic algorithms will fail to accurately calculate the scale difference between the images. The calculated scale can be wildly wrong. An incorrectly calculated scale then causes errors in the calculated background offset level.
To some extent the scale and offset errors cancel each other out but only for a narrow range of pixel values. If the scale is wrong, the two images will end up with different levels of contrast. For example, Milky Way star fields can end up looking less dense in one tile. Or the sky background can look noisier than it should.
The PhotometricMosaic script calculates the scale by using photometry to compare the stars in the overlap region. A least squares fit algorithm is then used to accurately calculate the scale difference. This can produce very accurate results that are resilient against differences in star profiles. The scale is calculated separately for each color channel, so the target frame's color balance will automatically be adjusted to match the reference frame.
The script works best for planned mosaics were the tiles are organized in a grid. For these mosaics, the default parameters should usually work well. Displaying the diagnostic graphs will make it easy to see how to fine tune the parameters.
For ad hoc mosaics, make sure you consult the help files.
Diagnostic graph showing the detected gradient:
Diagnostic graph showing least squares fit lines and the photometric data points
(there is one outlier point that should be removed):
The PhotometricMosaic script, and two helper scripts (TrimMosaicTile and SplitMosaicTile) are attached, see MosaicScripts.zip.
The help files can be downloaded from:
PhotometricMosaicHelp.zip
drive.google.com
To produce a seamless join between two aligned frames, it is vitally important that both the brightness scale and the background offset are correct. When multiple frames are combined, accumulative errors make this requirement even more critical. Light pollution gradients create an even greater challenge.
Most mosaic algorithms simply compare the pixel values within the overlap region and use this data to compute the scale and offset. This can work well provided that the images are both of high quality.
Unfortunately, images taken by amateur astrophotographers can suffer from poor seeing. The star FWHM may differ significantly between the two images. For example, on one image the stars may be spread over more pixels. This causes each star's peak value to be significantly lower in this image. Hence if the star profiles differ between the image frames, most mosaic algorithms will fail to accurately calculate the scale difference between the images. The calculated scale can be wildly wrong. An incorrectly calculated scale then causes errors in the calculated background offset level.
To some extent the scale and offset errors cancel each other out but only for a narrow range of pixel values. If the scale is wrong, the two images will end up with different levels of contrast. For example, Milky Way star fields can end up looking less dense in one tile. Or the sky background can look noisier than it should.
The PhotometricMosaic script calculates the scale by using photometry to compare the stars in the overlap region. A least squares fit algorithm is then used to accurately calculate the scale difference. This can produce very accurate results that are resilient against differences in star profiles. The scale is calculated separately for each color channel, so the target frame's color balance will automatically be adjusted to match the reference frame.
The script works best for planned mosaics were the tiles are organized in a grid. For these mosaics, the default parameters should usually work well. Displaying the diagnostic graphs will make it easy to see how to fine tune the parameters.
For ad hoc mosaics, make sure you consult the help files.
Diagnostic graph showing the detected gradient:
Diagnostic graph showing least squares fit lines and the photometric data points
(there is one outlier point that should be removed):
Last edited: