Author Topic: bug in StarAlignment or expected behavior?  (Read 5180 times)

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
bug in StarAlignment or expected behavior?
« on: 2013 December 25 22:31:52 »
in "Register/Union - Separate" mode (such as when you are preparing images for GradientsMergeMosaic), if the target image does not lie completely within the reference image, the resultant image is enlarged to contain the target image.

this completely messes up GMM which expects all the images to have the same pixel dimensions.

is the observed behavior expected, and if so, is there a way to constrain the output to be the size of the reference image?

this happened when i created a synthetic star field to register my mosaic panes to, but i apparently missed a little bit on the correct size.

thanks

rob

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: bug in StarAlignment or expected behavior?
« Reply #1 on: 2013 December 26 02:26:33 »
You are right, this is not the behaviour that GMM expects. And I am not sure how useful it is for other processes, since the "registered" panels are no longer registered after this.
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: bug in StarAlignment or expected behavior?
« Reply #2 on: 2013 December 26 11:07:36 »
actually i think besides this there may also be a bug. i just increased the size of my star field to make sure all the panels fit, and while registering the second panel, the registered image came out as 9065x7000 while the reference image is 8800x7000.

i wonder if this is a regression because anyone trying to make a GMM mosaic should have this problem. hard to believe it would have been like this throughout 1.8RCx

rob

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: bug in StarAlignment or expected behavior?
« Reply #3 on: 2014 January 07 08:00:14 »
Hi Juan,
since you are back from holidays, I would like to bring this thread to your attention...
Georg
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: bug in StarAlignment or expected behavior?
« Reply #4 on: 2014 January 07 08:51:57 »
In "Register/Union - Separate" mode, StarAlignment creates two new images, one for each mosaic frame, and both with the same dimensions. The registered mosaic frames are given the necessary dimensions to fit the whole mosaic, and empty regions are filled with zeros. This is the expected behavior, so I don't see any bug here.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: bug in StarAlignment or expected behavior?
« Reply #5 on: 2014 January 07 09:48:21 »
Hi Juan.
according to Rob  (pfile, see first post), this completly messes up GMM that expects all images to have identical dimensions. I did not test it myself, but Rob certainly is someone who knows the ways of PI.

Georg
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: bug in StarAlignment or expected behavior?
« Reply #6 on: 2014 January 07 10:01:30 »
As far as I have tested (and you can bet I have tested it), both generated images have exactly the same dimensions in union/separate mode. Indeed we all are Jedis, so the problem must be that we're talking about different things...
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: bug in StarAlignment or expected behavior?
« Reply #7 on: 2014 January 07 10:04:04 »
yes, i can imagine it's a legitimate mode, so i guess i am asking for a mode where the registered image is then cropped to the reference image. as georg says it completely messes up GMM and i had to iteratively increase the size of my reference until all the images fit within the reference frame, and all the output images were the same size.

when this first happened to me (long back) the images were differing by 1-2 pixels which seemed like some kind of rounding error. it was difficult to understand what was happening; at that time i just cropped the images. but i recently did a 3x2 mosaic where one of the panels had bad pointing and it hung way off the edge of what i thought should be the correct reference star field. it took me a few tries to understand what was happening. figuring out how to crop one of these images properly is too hard…

so i guess perhaps SA needs a "GMM mode" if that makes sense.

rob

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: bug in StarAlignment or expected behavior?
« Reply #8 on: 2014 January 07 10:07:51 »
i can provide some example images. but all you should have to do is generate a reference of, say, 1000x1000 and a target image of 500x500 which is centered near the left middle edge of the reference. the dimensions of the registered image should be something like 1250x1000.

then if you have another target image that's 500x500 but centered on the 1000x1000 reference, the registered image will be 1000x1000. those two output images are incompatible with GMM…

rob

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: bug in StarAlignment or expected behavior?
« Reply #9 on: 2014 January 07 10:08:45 »
What about feeding GMM with the two mosaic frames generated by SA? The reference mosaic frame is never interpolated; it is just copied in place, in case you are concerned about it.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: bug in StarAlignment or expected behavior?
« Reply #10 on: 2014 January 07 10:17:06 »
maybe i am doing it wrong…?

isn't the 2-panel mosaic a special case? when you get to 3 panels and you are registering the 3rd, you end up with one image that contains the panels stitched by SA and one of panel 3 by itself. for GMM you always want to use the 'standalone' images so that it can do the merging, right?

i think if the reference mosaic is built up pane by pane you are less likely to run into this issue (though because of the distortion fixing you may still see small differences). in my case i had generated a synthetic field which was the size that i wanted. in the end i only had to use Crop to extend the size of the image; i did not have to regenerate the star field.

rob

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: bug in StarAlignment or expected behavior?
« Reply #11 on: 2014 January 07 10:28:32 »
Thinking about it: Is "Register/Union-Separate" the correct mode for aligning to a reference star field? Should you rather use "Register/Match Images". In this case, the matched images (hopefully) all have the size of the reference star field.
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: bug in StarAlignment or expected behavior?
« Reply #12 on: 2014 January 07 11:01:01 »
yes maybe you are right, i will have to go back and experiment with this. i might have been stuck in cookbook thinking, not sure.

i think in the parlance of StarAlignment what i am asking for is "Register/Intersection-Separate" but it might be redundant as you point out.

rob