Author Topic: How to register sun images between each other ?  (Read 5299 times)

Offline Cyril

  • Newcomer
  • Posts: 5
How to register sun images between each other ?
« on: 2014 April 17 12:08:36 »
Can anyone help me with a solution to register different sun pictures so that a movie could be done later with the sun's rotation chaining pictures one after the other ?
Images should be cropped first ?
Resized if different ?
etc...
How to locate the center of the image (sun disk) ?
Many thanks in advance.

Offline dnault42

  • PixInsight Addict
  • ***
  • Posts: 125
Re: How to register sun images between each other ?
« Reply #1 on: 2014 April 17 12:43:46 »
Cyril,

You can use the FFTRegistration script.  Instead of registering based on stellar centroids it uses frequency analysis to line things up.  I've found it works very well with lining up shots of the Moon.  For example, here's a video I made of the recent Lunar Elcipse:
    https://www.youtube.com/watch?v=uxf6rjvrbW0

Because the edge of the moon represents a very strong high frequency element it did a good job of lining up the lunar disk's edge but did not handle rotation of the surface well.  Also, my images had the moon showing different phases of the eclipse making for crescent like patterns that didn't always line up with the original full disk.  Despite that, most of the images did register perfectly.

It sounds like your application will likely not have these issues.  You will need to disable "Integrate registered images' and enable the 'Write registered images' option to output your frames.  In fact you might leave the rotation option off as well since you are not trying to correcting image rotation and instead are looking for rotation of the solar surface in your video which might throw the rotation correction off.

Hope this helps.

Regards,
David

Offline Cyril

  • Newcomer
  • Posts: 5
Re: How to register sun images between each other ?
« Reply #2 on: 2014 April 17 23:34:57 »
Hi David,
Thanks for your advice. Nice video on YouTube !
Once registered, what do you to be sure that all pictures will be cropped the same way ?
To be clearer, I have 12 images of the sun (3 hours long) that I would like to chain one after the other in a short movie file, a bit like what you've done with the Moon.
My current issue is that the sun is not centered on the picture on each of my 12 pictures.
Now that I have applied the FFTRegistration script the way you've mentioned, I now need to center the sun on each picture and then crop, no ?
Any additional advice would be helpful.
Thanks.

Offline dnault42

  • PixInsight Addict
  • ***
  • Posts: 125
Re: How to register sun images between each other ?
« Reply #3 on: 2014 April 18 11:02:58 »
Hey Cyril,

After you run FFTRegistraion I would expect that the Sun should be aligned through all frames (maybe not exactly in the center depending on where it was in your reference frame).  So the next step is, like you said, to center the Sun's disk and crop the image to the size you want (and possibly re-sizing for the video).  One of the way's I do this is to take all the registered frames and stack them with ImageIntegration.  I use a really low for 'Sigma low' rejection setting, something like 2.0 (make sure to have Generate Rejection Maps enabled).  Then I examine the rejection_low image to see where the images did overlap (the center portion should be much darker with the outside edges light).  I use dynamic crop to create a boundary inside the dark region (centering the Sun at the same time) then drag the New Instance icon to the PI desktop to save that crop.  You can close all the integrated image and rejection maps at this point.  Then I use an ImageContainer to iterate on the individual frames applying it to the DynamicCrop instance icon I placed on the PI desktop (setting the output directory and template as appropriate - for the template I would use something like: &filename;_crop.fit).  When that completes you should hopefully have a bunch of cropped & centered images of the Sun that all line up.

Regards,
David

Offline Cyril

  • Newcomer
  • Posts: 5
Re: How to register sun images between each other ?
« Reply #4 on: 2014 April 18 12:32:16 »
David,

After the FFTregistration, if I do the image integration, PI says that I have an incompatible image geometry !
I confirm that the sun is not really centered on each registered image.
Each image has a different size, so... not so much difference, but a difference.
Doing a STF, I can see that each new registered image has really been modified since I can see some gaps due to the registration.
Overlaying the registered pictures doesn't overlap correctly.
I don't know how to fix this "ncompatible image geometry" error and what it really means.
If you know, do not hesitate to tell me.
Thx.

Offline dnault42

  • PixInsight Addict
  • ***
  • Posts: 125
Re: How to register sun images between each other ?
« Reply #5 on: 2014 April 18 14:30:25 »
Cyril,

That is interesting.  I'm not really sure why you got images of different sizes.  All my images ended up the same size after FFTRegistration and despite the Earth's shadow changing position throughout the frames they all registered to within a few pixels.  There were a couple that were a little farther off, but these looked like a crescent Moon which did not register that well with the full Moon image I used as the reference.  I attached a snapshot of my FFTRegistration.

As an alternative, since you only have 12 images, you could shift them all manually.  You can do this with the Crop tool (you can do it with PixelMath as well).  The image I attached shows a shift down and to the right of 6 x 13 pixels.

I hope this gets you past your problems.

Regards,
David

Offline Cyril

  • Newcomer
  • Posts: 5
Re: How to register sun images between each other ?
« Reply #6 on: 2014 April 21 14:22:44 »
Hi David,
Thanks for this advice. I'll have a look at this and will keep you informed.
Thanks a lot.
Cyril

Offline Cyril

  • Newcomer
  • Posts: 5
Re: How to register sun images between each other ?
« Reply #7 on: 2014 April 22 10:32:05 »
Hi David,

You canfinally see the registration I've done at http://www.astrobin.com/92094/
I did it manually (painful) with the Crop Tool thanks to you.
Looking at each picture being zoomed in, the registration seemed to be OK (same picture size, same center, etc...) but the final AVI or GIF animation shows a small difference in the sun's positions in the picture.
Anyway, many thanks for your precious advice.
I'll try to do better next time  :)

Offline dnault42

  • PixInsight Addict
  • ***
  • Posts: 125
Re: How to register sun images between each other ?
« Reply #8 on: 2014 April 22 10:40:39 »
That looks amazing Cyril!  Glad I could help.

Regards,
David

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: How to register sun images between each other ?
« Reply #9 on: 2014 April 22 12:00:22 »
this should be possible with fftregistration.

2 years ago guy made this eclipse video:

https://www.youtube.com/watch?v=DtkoAlwIpWY

i downloaded it and realigned all the frames with fftregistration and made a new movie. as the clouds hit the sun it kind of lost it but in the bright parts the registration was dead on:

https://www.youtube.com/watch?v=CkqFxPetZls

i never published it since i sought his permission and at the time we could just not get private youtube sharing to work, so that he could look at it first.

rob