<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Javier,</p>
    <p>I've just advertized bilinear.</p>
    <p>For average_mp vs average_magphase, they are indeed different
      code paths.</p>
    <p>My understanding of the code is that:</p>
    <p>- average_magphase is only available for the complex data types<br>
    </p>
    <p>- 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.</p>
    <p>- 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.</p>
    <p>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).<br>
    </p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 23/07/2024 à 10:57, Javier Jimenez
      Shaw via gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CADRrdKspEgMBuVdmC=9A-0jaq1e7QMGeaqCP73CxRSkY8GyTFw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Reading carefully <a
            href="https://gdal.org/programs/gdaladdo.html"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://gdal.org/programs/gdaladdo.html</a></div>
        <div>I saw that the summary mentions</div>
        <div><br>
        </div>
        <div>[-r
{nearest|average|rms|gauss|cubic|cubicspline|lanczos|average_mp|average_magphase|mode}]</div>
        <div><br>
        </div>
        <div>but later in the options "bilinear" is included. Either it
          should be in both or in none.<br>
        </div>
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>Should that be changed? if yes, how?</div>
        <div><br>
        </div>
        <div>Cheers</div>
        <div>Javier<br>
        </div>
        <div>
          <div>
            <div dir="ltr" class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">
                <div>.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ...
                  .... ._ .__</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>