[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-geo
Subject:    [R-sig-Geo]  Spatial Resampling
From:       adrian () maths ! uwa ! edu ! au
Date:       2008-07-25 1:59:50
Message-ID: 60141.124.182.15.91.1216951190.squirrel () 124 ! 182 ! 15 ! 91
[Download RAW message or body]

Pujan Raj Regmi <regmi_pujan@hotmail.com> writes:

> I have a satellite image of 12m spatial resolution (4 bands). I want to
> resample to coarser level. i.e. to 18m, 24m,30m,36m and so on.
> The result I got from ENVI are not realistic so I want to do it in R
> using weighted average from neighboring pixels.

In package 'spatstat' the function 'blur' will perform spatial averaging
of a pixel image, using Gaussian weights. The function 'as.im' can be used
to change the dimensions of a pixel image.

So for example if Z is a pixel image (object of class "im") then
    old.pixelsize <- Z$xstep
    blurZ <- blur(Z, 1.5 * old.pixelsize)
    old.dim <- Z$dim
    new.dim <- floor(old.dim/2)
    Y <- as.im(blurZ, dimyx=new.dim)
computes a Gaussian kernel-weighted average of pixel values, then
subsamples the image.

Adrian Baddeley

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic