Siril Download

2 views
Skip to first unread message

Kody Baril

unread,
Aug 5, 2024, 1:04:05 AM8/5/24
to tocizanbanc
Variablepixel linear reconstruction, and more commonly referred to as Drizzle,was developed for Hubble Space Telescope (HST) work by Andy Fruchter and RichardHook [FruchterHook1997], initially for the purposes of combining ditheredimages of the Hubble Deep Field North (HDF-N). This algorithm can be thought ofas a continuous set of linear functions that vary smoothly between the optimumlinear combination technique (interlacing) and shift-and-add. This often allowsan improvement in resolution and a reduction in correlated noise, compared withimages produced by only using shift-and-add.

There is an excellent page summarising the technique and providing a goodgraphical representation of how the pixel data "drizzles" down from the coarseinput pixel grid onto a finer output pixel gridhere.


The degree to which the algorithm departs from interlacing and moves towardsshift-and-add depends upon how well the PSF is subsampled by the shifts in theinput images. In practice, the behavior of the Drizzle algorithm is controlledthrough the use of a parameter called the pixel fraction, that represents theamount by which input pixels are shrunk before being mapped onto the outputimage plane. At a pixel fraction of 0, drizzle is equivalent to pure interlacing;at a pixel fraction of 1, it is equivalent to shift-and-add.


To understand the difference between drizzle and the interpolation methods ofapplying registration, firstly consider how the standard interpolation method works.The registration data takes the form of a 3x3 Homography matrix, which encodesan 8 degrees of freedom linear transformation from one set of coordinates toanother (i.e. from each frame to the reference frame). This is used to map thevalues from each pixel in each input image onto the correct place in the outputimage, aligning the output with the reference image. The actual alignment usesan interpolation method, which can be selected in the registration options.Interpolation results in a smearing of the point spread function, especiallywhen upscaling images. It can also result in artefacts, although Siril implementsa clamping mechanism to minimize this.


Drizzle, by contrast, turns each pixel in the input image into a droplet, anddrizzles it through a grid pattern onto the output reference frame. Each droplethas a size, and by choosing a scaled-up output pixel grid but smaller dropletsize you can achieve improved resolution if your imaging train isundersampled. (If your sampling is correct for the resolving power of yourtelescope, Drizzle can't produce detail beyond the diffraction limit.) This comes atthe cost of increased image noise: because each droplet "paints" a smaller areain the output image, the average coverage of droplets per output pixel in thefinal stack is reduced.


Note that Drizzle doesn't replace all of the registration process: you stilluse the Global Star Alignment, 1-2-3 Star Alignment, Comet registration orwhichever registration method you wish prior to drizzling: it is an alternativeonly to the interpolation method used when applying registration.


Resolution enhancement If your image is significantly undersampled, youmay be able to achieve an improvement in resolution using Drizzle that youcould not achieve using the Interpolation upscaling x2 registrationoption.


CFA imaging If your images have a CFA pattern (i.e. if you use a one-shotcamera or dSLR), Drizzle provides a significant improvement over debayering.This is sometimes referred to separately to Drizzle as Bayer Drizzle, butreally it's exactly the same process. When drizzling a CFA image the CFA colorof the current droplet sets which channel of the output image it lands on,whereas when drizzling a mono image all droplets land in the (only) monooutput channel. Drizzling CFA images avoids the artefacts that occur with alldebayering algorithms, which gives improved noise characteristics whenstrongly stretching images. This supports improved noise reduction anddeconvolution for drizzled CFA sequences compared with debayered andregistered CFA images, and makes the shadows look better.


Avoid artefacts It is possible to drizzle a sequence using scale = 1,pixel fraction = 1 and achieve essentially the same result as applyingregistration with one of the interpolated methods.You might wish to consider this if you see interpolation artefacts from thestandard interpolated method (though these are generally effectively suppressedby the clamping feature). Note that drizzle can produce differentartefacts of its own (see the "Some Common Issues" heading below) however thesecan be completely avoided by choice of drizzle kernel or by having a greaternumber of input frames, and are generally handled perfectly by stacking.


When used for upsampling, Drizzle achieves its resolution improvements at thecost of increased image noise. Therefore you may wish to collect more integrationtime when drizzling than when using an interpolation-based upsampling method.


The above issue is especially true for CFA images. Consider that only 1 in 2of the pixels are green, and only 1 in 4 are red or blue. Therefore for thered or blue channels, CFA drizzle effectively already involves the same levelof reduction in droplet coverage as a 2x upscale drizzle. If you upscale on topof that, you need as much droplet coverage as you would for a 4x upscale drizzle!Therefore it is generally recommended to drizzle CFA images at scale = 1.


The following image shows a comparison between drizzle and the legacy upscalingmethod. The image is Ha extracted from an OSC session with a dual band filter.On the left you can see the result of the legacy OSC_Extract_HaOIII script, whichextracts the Ha data captured by the red pixels in the OSC Bayer matrix as ahalf-size image and uses OpenCV upscaling with lanczos4 interpolation to producean image tat matches the size of the OIII image.


On the right you can see the result of the updated OSC_Extract_HaOIII_drizzlescript (available through the siril-scripts repository), which extracts the Hadata captured by the red pixels in the OSC Bayer matrix as a half-size image anddrizzles it using scale = 2.0, pixel fraction = 0.5, to produce an image thatmatches the size of the OIII image.


Viewing it at 100% scale it is clear that the drizzled stack restores much of theresolution of the optical system that is undersampled by the spaced-out redpixels in the Bayer matrix: it looks much sharper, and the numbers confirm it:the average fwhm in the left-hand image is 3.59, whereas in the right-hand imageit is 3.25.


The Drizzle workflow begins with registering your sequence. This is done in theusual way but you must ensure that the chosen registration algorithm does notapply the registration but only saves the registration data in the sequence. Forthe 1-2-3 stars, two-pass global star alignment, image pattern alignment, KOMBATand comet alignment methods nothing extra needs to be configured; for the globalstar alignment method, the Save transformation in seq file onlycheckbox must be active, otherwise the registration will be applied usinginterpolation.


Once the sequence has registration data you are now ready to drizzle it. Thistime, select the Apply Existing Registration registration method.This will reveal a Drizzle checkbox. Checking this checkbox willshow the Drizzle-specific options.


Scale sets the scale of the drizzle output image with regard to the input image.A typical drizzle scale for an undersampled mono image is 2.0. This means thatthe input will be drizzled onto an output pixel grid with twice the resolution.(If your input reference image was 1024 x 512 pixels, your output image would be2048 x 1024 pixels.) Note: becase the image represents the same area of the sky,although there are twice as many pixels along each axis in the output image,effectively each output pixel is half as wide and half as tall.


The greater the scale, the sparser each drizzled output image and the fewerpixels end up getting stacked into each output pixel. This results in anoisier image: the resolution gain provided by drizzle comes at the expenseof noise. This has to be mitigated by using a greater overall integrationtime than you would need without drizzling to a greater resolution.


Pixel Fraction sets the size of the droplet taken from the input grid. Consider adrizzle scale of 2.0: since the output pixels are half as wide and half as tall,that means that in order for each input pixel "droplet" to be the same size as anoutput pixel it should be shrunk to half the linear dimensions. This is a pixelfraction of 0.5. A good rule of thumb is that the pixel fraction should beroughly the reciprocal of the drizzle scale (with some kernels it helps to setit a little bigger than this, in order to reduce pixels that receive zeroinput from any drizzled droplets.


There is scope for experimentation with the pixel fraction: setting a larger pixelfraction means that each input droplet will influence more output pixels. On theother hand, setting a smaller pixel fraction means that each input droplet willinfluence fewer output pixels. The "point" kernel is a special case where thepixel fraction is zero (and with this kernel selected, the pixel fractionsetting has no effect).


Square. This models the droplet as a square droplet aligned exactly withthe input pixel. It is accurately mapped to the output reference frame. Thisand the Turbo method are the only flux preserving drizzle kernels, so theseshould be chosen if there is a desire to use the output for accuratephotometry.


Accurate photometry is important for the PCC and SPCC color calibrationprocesses, therefore if these are to be used later in the workflow it isstrongly recommended to choose a drizzle kernel that preserves flux.


Turbo. This is a simplification of the Square kernel. It assumes thatrotation between the input and output reference is negligible. This results ina much faster computation, but is approximate. It is a "quick and dirty" kerneloriginally intended for use within the HST workflow where it was used togenerate input for an initial stack that was used for pixel rejection and thendiscarded, with the square kernel being used for the final drizzle. You mayfind it usable for some purposes, especially where scale = pixfrac = 1.0, buttreat it with caution.

3a8082e126
Reply all
Reply to author
Forward
0 new messages