[英]R: How to increase the pixel size (decrease the spatial resolution) of a satellite image by applying a Gaussian filter with a (large) width
The goal目标
I am trying to simulate coarse data as though they were measured with a coarse PSF (point spread function).我试图模拟粗略的数据,就好像它们是用粗略的 PSF(点扩散函数)测量的一样。
The data数据
I have a satellite image with 15m pixel size and I want to convolve it with a Gaussian kernel to reduce the spatial resolution at 460m.我有一个 15m 像素大小的卫星图像,我想将它与高斯 kernel 进行卷积,以降低 460m 的空间分辨率。 To do this I need to apply a transfer function (TF; eg, Gaussian) to the fine data, but with a very large width.为此,我需要将传输 function(TF;例如,高斯)应用于精细数据,但宽度非常大。 This produces the coarse data.这会产生粗略的数据。
Is there any function that takes as input a fine resolution image, applies a Gaussian TF and produces a coarse spatial resolution image?是否有任何 function 将高分辨率图像作为输入,应用高斯 TF 并生成粗空间分辨率图像?
To make my problem even more clear, I am following the paper ' The effect of the point spread function on downscaling continua '.为了使我的问题更加清楚,我正在关注论文“点扩散 function 对缩减连续体的影响”。 All in all, the authors wanted to downscale a coarse satellite image using an ancillary fine spatial resolution variable.总而言之,作者希望使用辅助精细空间分辨率变量来缩小粗糙的卫星图像。 The downscaling consists of two steps:缩小包括两个步骤:
During the regression, they had to upscale the fine resolution image to match the pixel size of the coarse resolution image and then they performed the regression.在回归过程中,他们必须放大精细分辨率图像以匹配粗分辨率图像的像素大小,然后执行回归。 This upscaling had to be done using the PSF .这种升级必须使用 PSF 完成。
Based on the this question , the code of the person who invented the method Area-to-point regression Kriging, Qunming Wang, and the description of the function down_sample_image
from the OpenImageR
package, I managed to upscale the image using a Gaussian blur
.基于这个问题,发明区域到点回归克里金法的人王群明的代码,以及来自OpenImageR
package 的 function down_sample_image
的描述,我设法使用Gaussian blur
来放大图像。 All in all, I had to multiply the PSF * the zoom factor .总而言之,我必须将 PSF * 缩放系数相乘。
library(raster)
library(OpenImageR)
r = raster("path/tirs.tif")
m = as.matrix(r)
psf = down_sample_image(m,
factor = 4.6, # zoom factor
gaussian_blur = T,
gauss_sigma = 0.5 * 100) # sigma * pixel size
e <- extent(r)
m2r <- raster(psf)
extent(m2r) <- e
raster::crs(m2r) <- "EPSG:7767"
res(m2r)
writeRaster(m2r, "path/tirs460.tif")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.