[Gdal-dev] New Resampling Algorithm

Frank Warmerdam fwarmerdam at gmail.com
Tue Sep 6 11:26:43 EDT 2005


On 9/2/05, Julien Demaria <dem at acri-st.fr> wrote:
> Hi,
> 
> I want to implement an utility to reduce resolution of an image by
> averaging all input pixels contributing to one output pixel,
> and I need use exactly the real contribution of each input pixel (may be a
> part of it if it is at the border of the input computed window
> corresponding to the output pixel coverage).
> 
> I've taken a look on the GDAL Warp API and the GDALWarpKernel class, to
> know if I can implement this as another resampling algorithm, as bilinear
> or bicubic,
> but I'm not clear about the input pixels contribution : can I know in the
> resampling algorithm what are inputs pixels corresponding to one output
> pixel and how they contribute ?

Julien, 

I think it would be pretty hard to implement support for averaging all
contributing pixels in the Warp API.  I think for simple downsampling 
of images, you would be better off using gdaladdo which already 
supports averaged downsampling.  You may need to do a bit of fiddling
to isolate the resulting downsampled overview.  If the format is TIFF making
the file read-only will result in the overview being written to a separate
file. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list