Author Topic: Crop/Rotate with Mitchell-Netravali distorts stars  (Read 3814 times)

ruediger

  • Guest
Crop/Rotate with Mitchell-Netravali distorts stars
« on: 2013 April 23 07:33:40 »
While using DynamicCrop to crop and rotate a 11172x8736 pixel image with Interpolation set to "auto", the chosen algorithm defaults to "Mitchell-Netravali". The log states:

Bicubic interpolation, Mitchell-Netravali cubic filter (3x9): 11294x3619 pixels, 3 channels, rotate -28.484 deg: done

In parts of the image the stars get distorted. This does not happen when explicitly selecting Lanczos-3 as interpolation algorithm.

The sad thing is, that I noticed the distorted stars much later during processing and then thought, the stacking and alignment process went wrong... which I unnecessarily repeated. But I'm happy now that I nailed the problem down to the interpolation algorithm.

Attached are two screenshots. First one showing part of the original file (left), the Mitchel-Netravali result (middle) and the Lanczos-3 result (right).
Second screenshot shows the dynamic crop settings with "auto" leading to the wrong/distorted stars result.

Rüdiger

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Crop/Rotate with Mitchell-Netravali distorts stars
« Reply #1 on: 2013 April 23 08:37:26 »
Hi Rüdiger,

This has happened because you have (1) scaled down the cropped image, and (2) applied different scaling ratios to the horizontal and vertical axes. I know (1) because in Auto interpolation mode, Mitchell-Netravali cubic filter interpolation can only be selected if the image is to be scaled down (downsampled). I know (2) because the interpolation filter dimensions are 3x9 pixels. This means that the Y-axis has been scaled down more (filter size = 9 pixels) than the X-axis (filter size = 3 pixels). Obviously this leads to distortion.

Have you changed the Scale parameters of DynamicCrop?
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

ruediger

  • Guest
Re: Crop/Rotate with Mitchell-Netravali distorts stars
« Reply #2 on: 2013 April 23 09:10:52 »
This has happened because you have (1) scaled down the cropped image, and (2) applied different scaling ratios to the horizontal and vertical axes.
Juan, thanks for fast response.

I repeated the task again and double-checked if I accidentally changed scaling ratios. Attached is a full screenshot of what I do and the console log:

Bicubic interpolation, Mitchell-Netravali cubic filter (3x9): 11294x3619 pixels, 1 channels, rotate -28.480 deg: done


If I only change the "auto" to "Lanczos-3", all other settings identical (by double clicking the history entry), everything is ok.

Rüdiger

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Crop/Rotate with Mitchell-Netravali distorts stars
« Reply #3 on: 2013 April 23 09:18:47 »
OK, bug confirmed. This is a very easy to fix regression (just a stupid "improvement" I did in the automatic interpolation selection routine).

Since I'm going to publish a new RC6 version (build 1013), I'll include a fixed Geometry module there, instead of releasing an update for 1012. Thank you for discovering this error, and sorry for the trouble.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

ruediger

  • Guest
Re: Crop/Rotate with Mitchell-Netravali distorts stars
« Reply #4 on: 2013 April 23 09:31:15 »
I'll include a fixed Geometry module there, instead of releasing an update for 1012
Sounds good, thanks very much!

Rüdiger

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Crop/Rotate with Mitchell-Netravali distorts stars
« Reply #5 on: 2013 April 23 12:39:41 »
Juan,
do yourself a favor and dont overload version numbers. Its bad enough that we now have 6 release candidates (all with new features - in my opinion, any release candidate should be feature complete). But now you are starting to have pre-releases, releases and second releases of RC6.... Its gets more and more difficult to identify which version people actually are talking about.
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: Crop/Rotate with Mitchell-Netravali distorts stars
« Reply #6 on: 2013 April 23 13:05:19 »
I was trying to avoid an RC7, since in this case we only have a few minor corrections in the PI Core application (basically, the JavaScript engine initialization problem on 32-bit Windows and a couple glitches).

Anyway, we'll have the number of release candidates necessary to achieve a fully stable 1.8.0 platform, no matter if we need RC7 or RC99. We have actually reached that goal on Linux and Windows. The real problem now is with Mac OS X, which is fully stable on my machines (again, I am testing RC6 intensively the whole day without a *single* problem on Mac OS X), but a complete piece of trash on most of the rest of the world. I confess this is putting me to the test...
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Crop/Rotate with Mitchell-Netravali distorts stars
« Reply #7 on: 2013 April 23 13:14:39 »
there are a lot of mac variants now, for instance, my PI temp directory is on an SSD and that thing can really sink and source data fast. that may lead to timing issues which you can't see on your machine.