Author Topic: New DrizzleIntegration Tool Released  (Read 61749 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6415
    • View Profile
    • http://pixinsight.com/
New DrizzleIntegration Tool Released
« on: 2014 May 31 14:53:19 »
Hi everybody,

Today I have released new versions of the ImageRegistration and ImageIntegration tools, along with a new version of the BatchPreprocessing script, which support a new PixInsight tool: DrizzleIntegration.

The Variable-Pixel Linear Reconstruction [1] algorithm, better known as drizzle, was originally developed at the Space Telescope Science Institute to process Hubble Deep Field images. Drizzle is an algorithm for the linear reconstruction of images from undersampled, dithered data. The new DrizzleIntegration tool brings this fundamental image processing technique to the PixInsight platform to fill a long-standing gap in our image preprocessing tool set.

There are plenty of resources on the Internet and the literature that provide general and in-depth descriptions of the drizzle method. In my opinion, this important algorithm is generally little known among the astrophotography community, mainly because the existing implementations lack the necessary flexibility and/or are too limited to be of practical value. With the new tool that we have just released, I hope this will change definitely for all PixInsight users.

With the appropriate data sets, the results of drizzle can be spectacular. To use drizzle in a useful way, you need the following:

- Undersampled images. If your images are already well sampled, drizzle won't give you anything that you don't already have besides a good bite out of your RAM. You know that your images are undersampled when your stars look square, or when you measure the PSF (for example, with the DynamicPSF tool, or the FWHMEccentricity script) and get FWHM values smaller than about two pixels. For example, images acquired with photographic lenses or small refractors are typically undersampled, but also images acquired with larger instruments and sensors with large pixels.

- Dithered images. Dithering is always important, but for drizzle it is absolutely necessary. Without proper dithering, all input pixels will always be projected over the same output pixels by drizzle, and the reconstruction process won't work.

- Many images. Drizzle requires more images than a normal integration. The more the better, but typically you should acquire at least 15-20 images to achieve good results.

In this presentation I'm just going to describe the procedure to perform a drizzle integration in PixInsight. I'll show some practical examples in forthcoming posts.

Using the DrizzleIntegration Tool

A drizzle integration of images is a three-step process in PixInsight involving registration, pre-integration, and drizzle reconstruction. This allows us to enrich the drizzle task with all the power and flexibility implemented in our StarAlignment and ImageIntegration tools.

Step 1. Registration

The drizzle algorithm works by projecting input image pixels on a finer grid of output pixels. This applies the same geometrical transformations used to register images in a normal preprocessing task, but instead of being an isolated step, image registration is performed during the drizzle integration process directly from calibrated data without interpolation. This requires to pre-compute and store the image registration transformations. To this purpose the StarAlignment tool has a new option to generate drizzle data, as shown on the next screenshot.


When this option is enabled, StarAlignment generates a drizzle data file for each registered image. Drizzle data files carry the .drz suffix and store all the information required by the DrizzleIntegration tool, including image registration data, statistical data, and pixel rejection maps. DrizzleIntegration supports the same image registration devices implemented by StarAlignment, including projective transformations (homographies) and two-dimensional surface splines (thin plates).

If you use the BatchPreprocessing script, its latest version 1.35 has a generate drizzle data option that you should activate to create drizzle data files during the image registration phase:


Note that StarAlignment (used either directly or indirectly through the BPP script) will always create new drizzle data files with fresh registration data, so existing .drz files will always be replaced to start a new drizzle integration procedure.

Step 2. Integration

To use the DrizzleIntegration tool, the registered images generated by StarAlignment must be integrated with ImageIntegration, and the corresponding .drz files must also be selected. The following screenshot shows an example where a set of registered images is being pre-integrated as part of a drizzle procedure.


First you must select the registered images that you want to integrate, as usual. Then you have to select the drizzle data files generated by StarAlignment, by clicking the Add Drizzle Files button. Note that when a .drz file has been associated with an input image, a special "<d>" indicator is shown on the Input Images file list for the corresponding item. For a drizzle data file to be associated with its corresponding registered image, both files must have the same file name (only different suffixes).

Second, you have to activate the generate drizzle data option on ImageIntegration. Then you can proceed to integrate the images as usual: Find optimal pixel rejection parameters and maximize SNR in the result, just as you do for normal image integration tasks. Each time you run the ImageIntegration tool, the selected .drz files are updated with statistical and rejection data automatically. Make sure you perform a last integration without a selected region of interest.

Note that drizzle files cannot be selected for integration on the BatchPreprocessing script. This shouldn't surprise you, since the image integration feature of BPP is for previewing purposes only, not for generation of production images. Image integration must always be fine tuned manually, and drizzle makes no exception to this rule.

Step 3. Drizzle

After StarAlignment and ImageIntegration, the drizzle data files (*.drz) are now ready for the DrizzleIntegration tool. Using this tool is really easy: just select your .drz files, execute the tool globally, and wait until the process completes and you get a drizzle integrated image.


The drizzle algorithm can be controlled with two main parameters:

Output scale, or subsampling ratio. This is the factor that multiplies input image dimensions (width, height) to compute the dimensions in pixels of the output integrated image. For example, to perform a 'drizzle x2' integration, the corresponding drizzle scale is 2 and the output image will have four times the area of the input reference image in square pixels.

Drop shrink factor. This is a reduction factor applied to input image pixels. Smaller input pixels or drops tend to yield sharper results because the integrated image is formed by convolution with a smaller PSF. However, smaller input pixels are more prone to dry output pixels, visible patterns caused by partial sampling, and overall decreased SNR. Low shrink factors require more and better dithered input images. The default drop shrink factor is 0.9, and typical values range from 0.7 to 1.0.

Along with these important parameters, DrizzleIntegration allows you to enable/disable pixel rejection, image weighting, and the use of surface splines (when available) for image registration.

Finally, you can define a region of interest (ROI) to accelerate repeated tests. This is useful because the task's execution time (and also its memory space consumption) grows quadratically with the dimensions of the output integrated image. Note that the coordinates and dimensions of the ROI are expressed in input reference pixels, not in output pixels. You can define ROI coordinates on an integrated image generated by the ImageIntegration tool, or on a registered image created by StarAlignment, by defining a preview and clicking the From Preview button.

DrizzleIntegration always generates two images: the result of the drizzle reconstruction and a drizzle weights image. The value of each pixel on the weights image represents the (normalized) amount of data gathered by the corresponding pixel on the integrated result. Note that the integrated image has already been divided by the weights image when both of them are made available as new image windows.

____________________
[1] Fruchter AS & Hook RN, Drizzle: A Method for the Linear Reconstruction of Undersampled Images, PASP, 114, 144
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline mschuster

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 987
    • View Profile
Re: New DrizzleIntegration Tool Released
« Reply #1 on: 2014 May 31 15:31:28 »
Thanks for your hard work Juan. Having drizzle without registration interpolation and with proper rejection is excellent!

Mike

Offline ajbarr

  • PixInsight Old Hand
  • ****
  • Posts: 383
    • View Profile
Re: New DrizzleIntegration Tool Released
« Reply #2 on: 2014 May 31 19:28:35 »
Juan I just downloaded the new update. I tried to run Star Alignment on some data I recently acquired and the program crashed with this message: "Critical Signal Caught (11) Segmentation Violation."

This has never happened before and I am wondering if it has anything to do with the update?

Thanks

Albert


Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6415
    • View Profile
    • http://pixinsight.com/
Re: New DrizzleIntegration Tool Released
« Reply #3 on: 2014 May 31 23:03:28 »
Hi Albert,

Yes, there was a problem with yesterday's update on Mac OS X. It is now fixed with a new update that I've just released. Sorry for the trouble!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
    • View Profile
Re: New DrizzleIntegration Tool Released
« Reply #4 on: 2014 June 01 05:24:49 »
This is great, Juan, thanks!

For dithering, is there a 'best' amount? Is more separation between images better, leading to wider crop regions at the edges? Or are a couple (under 10) pixels of movement per image okay? Perhaps it doesn't matter as long as they're not *right* on top of each other.

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2124
    • View Profile
Re: New DrizzleIntegration Tool Released
« Reply #5 on: 2014 June 01 06:13:27 »
I wonder if there is an interaction between drizzle and distortion correction. Will distortion correction possible correct away the slight differences between images that are necessary for the drizzle method? Or are both methods compatible with each other?
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • View Profile
    • Astrocava.com
Re: New DrizzleIntegration Tool Released
« Reply #6 on: 2014 June 01 06:22:43 »
Great work, Juan!

I'm thinking how to use this new tool with OSC (DSLR) images. DSRL images are spatially under sampled in origin because each channel has only half of the pixels.

I think the proper step by step process would be:

1.Calibrating frames as usual.
2.Split CFA in four channels (RG1G2B)
3.Registration with drizzle data each of the channels (*)
4.Integration of each channel(*)
5.Drizzle integration (Scale=2 and shrink=1)(*)
6. Align channels with green as reference.

(*) Perhaps is best to combine G1 and G2 data, because you will benefit from increased number of frames yielding for a better spatial resolution on the green channel.

Or can the BPPScript to do all the work except steps 5 and 6)?

Sergio


Moonfish ED80 over a Meade LX200GPS 8"

Offline naavis

  • Member
  • *
  • Posts: 66
    • View Profile
Re: New DrizzleIntegration Tool Released
« Reply #7 on: 2014 June 01 11:17:20 »
Hi!

I'm able to crash PixInsight after running the DrizzleIntegration process. After running the process, I close the weighting image, then auto-STF the result file by pressing Ctrl+A and then enabe the 24-bit lookup table for STF by pressing the button on the toolbar. I'm running Windows 8.1 64-bit. Also, saturated parts of the images (some stars and galaxy cores) turn black in the drizzled image.
« Last Edit: 2014 June 02 04:19:32 by naavis »
Samuli Vuorinen

Offline Ignacio

  • PixInsight Old Hand
  • ****
  • Posts: 369
    • View Profile
    • PampaSkies
Re: New DrizzleIntegration Tool Released
« Reply #8 on: 2014 June 01 11:45:09 »
Beautiful, Juan! Thanks for the hard work! I got new data last night and plan to try this asap.

BTW, reading about the drizzle files with geomertic registration information, reminded me about the Theli discussion we had way back, as well as my top "wish-list" item: postponing debayering of OSC images to the intergation stage, where SNR is best. Any plans in this direction?

thanks again,
Ignacio

Offline IanL

  • PixInsight Addict
  • ***
  • Posts: 116
    • View Profile
    • The Imaging Toolbox
Re: New DrizzleIntegration Tool Released
« Reply #9 on: 2014 June 01 14:29:19 »
Great work, Juan!

I'm thinking how to use this new tool with OSC (DSLR) images. DSRL images are spatially under sampled in origin because each channel has only half of the pixels.

I think the proper step by step process would be:

1.Calibrating frames as usual.
2.Split CFA in four channels (RG1G2B)
3.Registration with drizzle data each of the channels (*)
4.Integration of each channel(*)
5.Drizzle integration (Scale=2 and shrink=1)(*)
6. Align channels with green as reference.

(*) Perhaps is best to combine G1 and G2 data, because you will benefit from increased number of frames yielding for a better spatial resolution on the green channel.

Or can the BPPScript to do all the work except steps 5 and 6)?

Sergio

I haven't experimated much yet, but just calibrated my images as normal, debayered them and then followed the tutorial steps as given by Juan above.  Results seem reasonably good for a first attempt.  See below for a sample from a reasonably small data set of 24 x 600 seconds on a Canon 500D and SW 80ED & 0.85FR.  Left image in comparison is a normal integration, right image is a drizzle integration with the default 2x scale and 0.9 drop shrink.  Looking at stretched data there is a clear increase in noise, and trying to push the drop shrink any further than 0.9 lead to obvious artefacts.


Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2124
    • View Profile
Re: New DrizzleIntegration Tool Released
« Reply #10 on: 2014 June 01 15:41:57 »
A first try for me also looks good. 90 images @85 mm, left conventional stack, right drizzle stack.
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Ignacio

  • PixInsight Old Hand
  • ****
  • Posts: 369
    • View Profile
    • PampaSkies
Re: New DrizzleIntegration Tool Released
« Reply #11 on: 2014 June 01 17:38:14 »
I tried a couple of runs, on 30 registered frames from a canon 6D, on my win7x64 PC with 12GB ram, and in the last step (DrizzleIntegration) I got the blue screen of death in both tries! First time ever this happens to me with pixinsight.

Ignacio

Offline bwana

  • Newcomer
  • Posts: 7
    • View Profile
Re: New DrizzleIntegration Tool Released
« Reply #12 on: 2014 June 01 18:32:10 »
FINALLY!  Thank you, thank you, thank you!!

Up to this point I've had to drop out of PixInsight, Drizzle in Registax and back into PixInsight.

And it works wonderfully!  Ran several sessions last night and beautiful!

bwa

Offline jerryyyyy

  • PixInsight Old Hand
  • ****
  • Posts: 409
    • View Profile
    • Astrobin Images
Re: New DrizzleIntegration Tool Released
« Reply #13 on: 2014 June 02 04:58:20 »
Joining the bandwagon.  My comparisons also show the superiority of the new method.  Can someone explain to me why the new files are 4x larger?  I get the 2X setting.  Is the computation projected into a larger image. 
Takahashi 180ED
Astrophysics Mach1
SBIG STT-8300M and Nikon D800
PixInsight Maxim DL 6 CCDComander TheSkyX FocusMax

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2124
    • View Profile
Re: New DrizzleIntegration Tool Released
« Reply #14 on: 2014 June 02 04:59:54 »
...Can someone explain to me why the new files are 4x larger?
Images are twice the size in X, and twice the size in Y, and 2*2=4  :)
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)