9

I have some images to rotate. I must rotate them (each by different angle) with as little as possible image artifacts (e.g. blurring) that occur during image rotation (due to interpolation).

At the moment I have GIMP 2.6 that has Cubic and Sinc(Lanczos3) interpolations available for image rotation. I'm not sure which one is better and introduces less artifacts? What are its disadvantaged, if any?

Also, is there some other software (e.g. a plugin for photoshop or gimp) or some script for Matlab that can provide near perfect image rotations (e.g. by using better interpolation algorithm than those available in GIMP)?

Many thanks in advance.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • 1
    Lanczos3 often gives the best results because it's a closer approximation for the ideal smoothing filter (in a certain theoretical sense). – Mr Fooz Jan 24 '11 at 13:13
  • @Mr Fooz. Thanks. I also found SAR image processor (general-cathexis.com) that rotates images using Lanczos in few iterations to improve rotation quality. Guess it is better than the one in GIMP. – Marcin Jan 25 '11 at 01:52

2 Answers2

6

I remember seeing a comparison of different interpolation algorithms that was quite clever - the image was rotated by a fixed angle repeatedly until it was rotated all the way back to 360 degrees. Any artifacts or blurring were immediately obvious, and the image could be directly compared to the original. Edit: Found the link - http://www.all-in-one.ee/~dersch/interpolator/interpolator.html

Please don't think that Lanczos is the same as Sinc - they're related, but Lanczos trades some accuracy for ease of computation.

Hat
  • 540
  • 8
  • 25
Mark Ransom
  • 299,747
  • 42
  • 398
  • 622
  • Thanks. Similar comparisons I found at http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=816070. They compare many interpolations algorithms on medical images. – Marcin Jan 25 '11 at 01:42
  • @Marcin, thanks for the link - it looks a step above the one I found. Unfortunately I don't have an IEEE membership. – Mark Ransom Jan 25 '11 at 03:58
  • @Mark Ransom. The same article I found also here: http://ee.sharif.edu/~miap/Files/Survey-%20Interpolation%20Methods%20in%20Medical%20Image%20Processing.pdf – Marcin Jan 25 '11 at 04:14
  • @Mark Ransom, it seems the address you gave is down. Do you know any other place to look for it? Thanks. – Royi May 09 '11 at 16:40
  • @Drazick, the original link was done by Helmut Dersch, called "Testing Interpolator Quality". I've found a couple of other pages based on his work: http://photocreations.ca/interpolator/index.html http://www.panoramafactory.com/quality/quality.html – Mark Ransom May 09 '11 at 17:23
  • @Drazick I finally remembered the wayback archive, which has a snapshot of the site before it disappeared: http://replay.web.archive.org/20090626095428/http://www.all-in-one.ee/~dersch/interpolator/interpolator.html – Mark Ransom May 10 '11 at 14:28
4

Another approach to image rotation is to apply two shear operations. See details in “A Fast Algorithm for General Raster Rotation” by Alan W. Paeth (can be found in the popular “Graphics Gems I” book in chapter 3 part 6 or here). As far as I understand, this method produces very crisp images.

ImageMagick's -rotate is implemented this way. So you may compare its results to the direct rotation method.

namatoj
  • 85
  • 6
sastanin
  • 40,473
  • 13
  • 103
  • 130
  • Thanks. I'll have a look at rotate. I also found SAR image processor (http://www.general-cathexis.com/) that rotates images using Lanczos in few iterations to improve rotation quality. – Marcin Jan 25 '11 at 01:51