(Even) better interpolation

  • Hi Klaus,

    Not sure what the effort involved is, but would it be possible to offer an even better Lanczos / sinc interpolation function as an option? PTGui offers up to Lancsoz16 / sinc1024, and it produces noticeably better output compared to ktransform (which I often use for sphere=>cube=>sphere conversions).

    Thanks and have a great holiday period,

    Florian

  • Hi,

    okay, I have noted it as feature request.

    But I have also to say, I have already though about that and tested different interpolation and my conclusion was that the differences between the krpano default bicubic interpolation and better interpolations (like the Lancsoz16 interpolation) would very marginal (assumed you mean unscaled 1:1 remapping). The effect of the JPEG compression with typical web-quality has much more effect in the resulting image quality...

    E.g. here two uncompressed (png) images for comparison: (warning - big files )
    The front-cube-face of the same pano-image once converted with the krpano tools and the default settings and once manually with PTGUI and the Lancsoz16 setting:
    https://krpano.com/temp/interpola…bic_default.png
    https://krpano.com/temp/interpola…i_lanczos16.png

    Best regards,
    Klaus

  • Thanks Klaus!

    You probably know a million times more about interpolation and warping of images than me, but here's a counter-example I cooked up.

    I took a fully stitched pano and converted to cube faces and back to equirectangular. This is what I pretty much always do for various edits, etc. on my panos. However, I did it both in KRpano and PTGui (the latter was much more cumbersome since it's a pretty manual process). Specifically, I did the following.

    1. PTGui: Load the equirectangular pano, export to 6 cube faces ("manually", with Lanczos16/Sinc1024 interpolation, but exporting 90°x90° rectilinears, changing yaw and pitch appropriately). Then, in a new project, I loaded these 6 cube faces and re-assemble them back into equirectangular of the original size, again using Lanczos16/Sinc1024 interpolation.
    2. Krpano: Dropped pano onto sphere => cube droplet, and then took the 6 cube faces and dropped them onto cube => sphere droplet (making sure KRPano's best interpolation is used). This is obviously a much more convenient processing chain.

    Both equirectangulars (exactly same pixel dimensions, fitting 1:1 on top of each other) I then chucked into Photoshop, flattened them again and re-saved them with LZW to get observation number 1:

    1. PTGui pano is 94.1 MB, whereas
    2. KRPano's is only 84.9 MB

    Superficial conclusion: There's more "detail" in the file from PTGui.

    Result number 2: Comparing different crops from both equirects, the PTGui ones are visibly sharper and more detailed (for ease of exposition I've upscaled them to 300% here). Again, not just sharper, but more detail, since I tried different types of sharpening the KRpano output but could not achieve similar "detail". Plus, same file-size observation for the PNG attachments below as well.

    So that confirms to me that the better interpolation does matter, especially when going back and forth like this.

    Again, it's not a matter of life and death, and I'm sure there are more pressing things to work on in KRPano. However, hoping that it would be rather straight forward to enable these better interpolations (assuming you use existing libraries for this...), it would be great if they could make it into the next release. Just to make pixel-peepers like me happy *smile*

  • Hi,

    and back to equirectangular

    that's the key point - the more transformations, the better the Lanczos filters are!

    About the feature request itself - for the current krpano tools they will not come, but I'm already planing a complete rework of the tool-internals with multi-threading support and new and better memory/file management, and during this step, additional interpolation filters will be added too.

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!