[R-sig-Geo] How to upscale (reduce the spatial resolution) an image using a Gaussian filter in R?

Michael Sumner md@umner @end|ng |rom gm@||@com
Wed Sep 7 01:41:19 CEST 2022


Hi,  I would construct the kernel and push it through terra::focal.

It should be easy enough to find the right kernel matrix but (below, as a
kind of strange alt -  to give you something to compare with) -  you might
invoke gauss resampling with overviews:

Make a dummy copy with GDAL

gdal_translate pan15.tif dummy.tif -outsize 200% 200%

then add overviews with gauss resampling, then your 2nd level will have the
same resolution as your input tif

gdaladdo dummy.tif -r gauss

then extract that level (you can't do this with gdal_translate until GDAL
3.6 but it can be arranged in R, and if you gdal_translate to the exact
outsize of the 2nd level you probably will get it exactly):

You otherwise can't control the parameters  with the app, but you possibly
could with a computed band in VRT.

Cheers, Mike

On Wed, Sep 7, 2022 at 2:46 AM Nikolaos Tziokas <nikos.tziokas using gmail.com>
wrote:

> Hi,
>
> I want to resample a raster from 15m to 460m (pixel size) using a Gaussian
> filter.
>
> *The goal*
>
> I am having a coarse image which I want to downscale. I also have a fine
> resolution band to assist the downscaling. The downscaling method I am
> using is called geographically weighted area-to-point regression Kriging
> (GWATPRK). The method consists of two steps:
>
>    1. GWR
>    2. area-to-point Kriging on the GWR's residuals
>
> In order to perform GWR using raster data, those needs to have the same
> pixel size. This means that, my fine resolution image needs to be upscaled
> to match the spatial resolution of the coarse band. This upscaling of the
> fine band needs to be done using a Gaussian kernel with σ=0.5(i.e., the
> PSF).
>
> How can I upscale (reduce the spatial resolution) a satellite image using a
> Gaussian kernel (i.e., point spread function)?
>
> For reference, I am following the paper The effect of point spread function
> on downscaling continua
> <https://www.sciencedirect.com/science/article/pii/S092427162030229X>
> where
> the authors at p.253 in Eq (9) mention:
>
> *the coarse image produced by upscaling the corresponding fine band k using
> a PSF.*
>
> I googled how I can achieve that but unfortunately I couldn't find any
> solution. So to do this, how can I use this Gaussian filter to change the
> resolution (pixel size) of my image?
>
> Here is the image
> <
> https://drive.google.com/drive/folders/18_1Kshb8WbT04gwOw4d_xhfQenULDXdB?usp=sharing
> >
> I
> am trying to convolve.
>
>
> Many thanks
>
>
> --
> Tziokas Nikolaos
> Cartographer
>
> Tel:(+44)07561120302
> LinkedIn <http://linkedin.com/in/nikolaos-tziokas-896081130>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsumner using gmail.com

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list