[gdal-dev] r option in gdaladdo
Even Rouault
even.rouault at spatialys.com
Tue Jul 23 02:38:36 PDT 2024
Javier,
I've just advertized bilinear.
For average_mp vs average_magphase, they are indeed different code paths.
My understanding of the code is that:
- average_magphase is only available for the complex data types
- for the complex data types, average_magphase makes sure that the norm
of the output pixel is the average of the norms of the contributing
input pixels, for each pixel. Whereas average_mp (according to
4d678d358354497813c2933ad1c18a924a3859e3, this stands for Magnitude
Preserving averaging) does first standard averaging on the real and
imaginary parts, but then multiply both components by gain =
standard_deviation_of_input_band /
standard_deviation_of_overview_band_before_correction.
- average_mp is also available for the non-complex data types, but then
it modifies the output pixels such that output_pixel =
(output_pixel_before_correction -
mean_of_overview_band_before_correction) * gain + mean_of_input_band.
Feel free to experiment a bit to confirm my reading, and provide doc
enhancements. As far as I can see, there is zero regression testing of
those 2 methods (they date back to 2001, not sure the autotest framework
was available at that time).
Even
Le 23/07/2024 à 10:57, Javier Jimenez Shaw via gdal-dev a écrit :
> Reading carefully https://gdal.org/programs/gdaladdo.html
> I saw that the summary mentions
>
> [-r
> {nearest|average|rms|gauss|cubic|cubicspline|lanczos|average_mp|average_magphase|mode}]
>
> but later in the options "bilinear" is included. Either it should be
> in both or in none.
>
> In addition to that, in the summary there are "average_magphase" and
> "average_mp", but in the later description, only average_magphase. It
> is not clear if they are the same or different. Looking at the code I
> think they are not the same thing.
>
> Should that be changed? if yes, how?
>
> Cheers
> Javier
> .___ ._ ..._ .. . ._. .___ .. __ . _. . __.. ... .... ._ .__
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240723/5f0ba9f7/attachment.htm>
More information about the gdal-dev
mailing list