CS-SI / SIRIUS

Sirius - Fast and simple to plug-in C++ resampling library that is taking advantage of the Fourier Transform
https://cs-si.github.io/SIRIUS/html/Sirius.html
GNU General Public License v3.0
6 stars 5 forks source link

Keep image extent #38

Open savmickael opened 6 years ago

savmickael commented 6 years ago

When we zoom or dezoom an image which used a center pixel convention, the geographical extent of the image is modified. If we support translation #10, it could be nice to provide an option to keep the same extent or at minimum keep the same UL.

A good example is when we deal with Sentinel-2 data. The 10m and 20m bands didn't use the same grid so a zoom from 20m to 10m lead to an image with a UL which is different. It is good mathematical behavior but quite confusing for end user.

dumasl commented 6 years ago

I am afraid #10 will not be able to cover this scenario because Sirius shall not be allowed to provide data outside of the input image definition.

In other words, and using your example, say you have a 20m Sentinel2 and you upsample it by a factor 2 then what you get is a 20m Sentinel upsampled by a factor 2:

To compare this now 10m Sentinel2 with an original 10m Sentinel2 you could translate the Sirius output by 5cm in both directions when #10 is done. But you would then have to crop the original 10m Sentinel2 you wish to compare you data with to get rid off its first & last rows and cols because you won't have them with Sirius translated output.

We could ask Sirius to create data outside of the original input scope. I assume it would/could be done by mirroring the input before resampling. While this is not a tricky task, we need to define carefully what kind of parameters Sirius should provide to users. We do not want to confuse him and the very first message should be that Sirius upsamples and downsamples but it does not split nor does it averages.