Author Topic: Star Alignment of wide field drift image  (Read 6357 times)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Star Alignment of wide field drift image
« on: 2010 August 02 13:42:59 »
Hello,

As you have seen in previous posts (for instance http://pixinsight.com/forum/index.php?topic=1606.0, http://pixinsight.com/forum/index.php?topic=2068.0), I am experimenting with taking drift images (i.e. images without tracking). My latest experiment is the Cygnus region, photographed using a 15 mm wide angle lens, 55 shots of 20 seconds each every 30 seconds.

As Juan already pointed out (http://pixinsight.com/forum/index.php?topic=2039.msg13130#msg13130), Star Alignment is not terribly good with these images due to the distortions (gnomonic projection) you get. In the attached screenshot, you can see an integrated image obtained by stacking all 55 images after Star Alignment. Clearly, it did a good job for the central region, but a horrible job for the corners. Analyzing this a bit, I produced images of the matched stars. Bottom left are the matched stars for 2 images that are 60 seconds apart, top left for 10 minutes apart. The problem is obvious: The greater the time distance, the lower the match rate. Playing with the Star Alignment match parameters did not really produce better results.

Question: Is there any strategy that avoids to manually do Dynamic Alignment for all 55 images (I know, I am kind of lazy  ;) )? Could I do a pre-transformation for all images, ensuring that more stars are matched for large time differences? Is there an angle preserving transformation that would do the trick? Any other ideas?

Georg

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

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Star Alignment of wide field drift image
« Reply #1 on: 2010 August 03 01:00:50 »
I have recently processed some images (taken with a 17mm objective in a static tripod) similar to yours and I had similar problems. After several tests, I finally decided to make the alignment in two steps. First I used StarAlignment to approximate the individual frames to a reference frame. Then, using DynamicAlignment, I created a process of 55 alignment points that I had to apply manually to all frames. For each frame I had to check if any of the 55 alignment points was wrong. Luckily most points were right and I had only 15 frames so it didn't take too long.
I have another set of images to process but I was to wait to a cloudy afternoon in winter!!.

The result is attached. [The blue-white "cloud" to the top-right is a reflection of the moon in the lens]

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Star Alignment of wide field drift image
« Reply #2 on: 2010 August 03 02:33:25 »
Hi Georg,

The solution to this problem is something that you proposed some time ago: preprocess your images with a distortion correction script. This would be more or less a systematic approach that I haven't tested, but should work in theory:

- Generate a distortion map for one of your images. A distortion map would be a discrete function of the form:

D(xi,yi) -> {dxi,dyi} for 0 <= i < N

where D is your distortion map, x, y are input image coordinates, and dx, dy are the deviations from a prescribed geometry, for example from a Gnomonic projection, at each sampled position. You could also try to derive a distortion model if you know some optical properties of your lens. For example, a first and interesting approach would be assuming that your focal plane is a sphere. Perhaps this simple model --although being just a rough approximation-- could improve your results significantly.

- Apply D() to all your images to 'undo' the distortion by inverse mapping. This involves interpolation of a dx,dy pair for each pixel, and pixel interpolation from the original images.

- Use StarAlignment with one of your images as reference. The central frame of your sequence would minimize differences.

Does this make any sense? A lot of work. Probably using DynamicAlignment would be much easier, but this has much more fun for addicts to software development 8)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Star Alignment of wide field drift image
« Reply #3 on: 2010 August 03 02:39:19 »
By the way Georg, I see the word 'adler' in your screenshot? Does this mean something, or do I see things?  ;D
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Star Alignment of wide field drift image
« Reply #4 on: 2010 August 03 02:59:38 »
By the way Georg, I see the word 'adler' in your screenshot? Does this mean something, or do I see things?  ;D
You only see things... :P Adler is the german word for eagle/Aquila that is also somewhere on this image...

Regarding distortion map: I would need some distortion that is independent of the concrete region, and still preserves the triangles required by StarAlignment. My current understanding is that this just does not exist, since I am trying to map a sphere (the sky) to a plane (my screen) http://en.wikipedia.org/wiki/Map_projection#Classification .

I found some hints on the Iris website (http://www.astrosurf.com/buil/iris/new550/new550_us.htm, section MAPPING THE SKY). Here they basically compensate lens distortion, solve the images (manually, not Blind Solver), do the cartographic projection onto the plane, and finally merge the images. For PI, we already have some of the components that would be needed for this, but some parts are missing.

Georg
« Last Edit: 2010 August 03 03:20:02 by georg.viehoever »
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: Star Alignment of wide field drift image
« Reply #5 on: 2010 August 03 03:28:13 »
Quote
Adler is the german word for eagle/Aquila

Ah! Now that's funny. So we're going to give a workshop at the eagle planetarium. Vicent? :D

Quote
but some parts are missing

Which parts?
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Star Alignment of wide field drift image
« Reply #6 on: 2010 August 03 03:35:51 »
...
Quote
but some parts are missing

Which parts?
...

Here is what PI does (not) have, in my opinion:

- Lens Distortion (at least the usual models). Can probably be emulated by doing a Dynamic Alignment of one of the shots to a corresponding StarGenerator map, and then applying the transformation to all.
- Astrometric Calibration: Blind Solver (Linux only, with some accuracy deficits)
- Cartographic Projection: Do we have conversions between cartographic coordinate systems? Clearly that can be programmed, but it is tedious.
- Merge Images: Image Integration, or MergeMosaic script (probably better for this kind of wide field, Windows only).

So some things are there, some are lacking.

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

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Star Alignment of wide field drift image
« Reply #7 on: 2010 August 03 11:34:19 »
there is a package called "ptlens" that has a database of lenses and their barrel distortions, which can be used to fix your image before registration/alignment and stacking. unfortunately it is payware.

you can use hugin (free, open source) to do this, by taking a picture of a grid and then giving hugin control points which lie on straight lines, and it will compute the distortion parameters for your lens. it can correct the images for you as well, but you could probably use the distortion params in pixinsight as well, as juan describes.


Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Star Alignment of wide field drift image
« Reply #8 on: 2010 August 03 11:59:30 »
Brainstorm mode on:
What if we create a distortion map comparing the real image with a synthetic one (generating the stars from catalogs)? The result may be a two channel image, with the calculated distortions for both axis. Then another process may use that distortion map to batch process all the images (with a container).
[Well, this could be done too with a more complex interface and integrate everything..., similar to ImageIntegration or ImageCalibration]
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Star Alignment of wide field drift image
« Reply #9 on: 2010 August 03 12:04:11 »
I liked the grid solution too... This way we may be able to create the same sort of distortion map.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Star Alignment of wide field drift image
« Reply #10 on: 2010 August 07 12:06:04 »
Hi,

I think I have found a solution that does not require to manually transform each image separately. The three  important insights are these:
- drift images have one important property: They drift exactly along a circle of declination.
- certain map projections http://en.wikipedia.org/wiki/Map_projection, such as Mercator and Lambert Conformal Conical have the important property that their distortion does not change as long as you move along a circle of latitude/declination only.
- Star Generator generates star fields with just these projections.

To transform a single wide field shot into one that fits a Mercator projection I can use DynamicAlignment with a star field from StarGenerator as a source, and the photograph as the target. I just map a large number of stars between the two. The resulting transformation will map the photograph into the Mercator Projection, taking care of lens distortion, lens projection and map projection in one go. The real nice thing now is that I can use exactly the same transformation to map all my drift images into a mercator projection. As the sky drifts through my images, their transformed versions will need only an additional shift along the x/rectacentation axis in the mercator projection.

Here is the preliminary result of this procedure that still needs a lot of work in terms of using better flat frames, getting rid of aeroplane traces, and general processing. The right hand side of the screenshot is the result of
- applying the identical transformation obtained from one dynamic alignment to all  drift frames
- doing an automatic StarAlignment on all 55 transformed frames (that essentially adds x offsets)
- doing an integration (average, no rejection yet).
As you can see there are no traces of the "explosion" effect that you could see in my original post.

The left hand side of the screenshot is a closeup and basic processing of this data. You see the stars a nicely matched, except in a small patch where I apparently got the initial DynamicAligmnent wrong (region just below the center). This is something I will fix in later runs.

Only downside of this procedure: still quite a lot of work. The Dynamic Alignment took me (or more exactly: Sibylle, my wife) about 1.5 hours. And it needs to be done again for each wide field session...

Cheers,

Georg


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

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Star Alignment of wide field drift image
« Reply #11 on: 2010 August 11 10:34:21 »
Hi,

here some "debugging" information.

As you could see in the screenshot in the previous slide, some regions apparently were not properly transformed. So I wondered if there is some tool that helps me to debug the transform - short of doing the transformation, star alignment and stacking that is largely manual due to the problem described in http://pixinsight.com/forum/index.php?topic=2138.0 . What helped to some extend was writing a script (attached, no GUI) that just draws a grid on the target image. When you then transform this image, you see the grid transformed as well, and any irregularities show up (to some extend).

The attached screenshot demostrates the procedure: top left is the map generated by StarGenerator, top right the original camera shot (without grid), both with the 465 matched stars. The bottom image is the transformed version with grid. I have marked the "non-plausible" regions with preview boxes.

I'll file an improvement request in the wishlist section to add something like this to PI.

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