<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">That's what I thought.  Some
      applications interpret an image as a pixel array where row=y and
      column=x, probably to better match our conceptual model of an
      image as a collection of scan lines arranged horizontally.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">John G.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 12/19/2022 7:56 AM, Pat Caron via
      DPRGlist wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+mr86fnYkW7F+aPi=6_-ENsnDYCuRgT1Nk0c6LpXkVeDu9QFQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_default" style="font-size:small">On Dec 13th I
          was having a problem with the example python script for the
          Arducam TOF camera.</div>
        <div class="gmail_default" style="font-size:small">
          <div class="gmail_default" style="color:rgb(0,0,0)">After some
            searching, I found that the row & column values for the
            numpy.mean range were reversed!</div>
          <div class="gmail_default" style="color:rgb(0,0,0)">
            <div class="gmail_default">np.mean(array[row_min:row_max+1,
              col_min:col_max+1])<br>
            </div>
            <div class="gmail_default"><br>
            </div>
            <div class="gmail_default">I found this at <a
href="https://stackoverflow.com/questions/20276055/get-mean-value-of-certain-part-of-array"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">https://stackoverflow.com/questions/20276055/get-mean-value-of-certain-part-of-array</a> just
              before the solution answer.</div>
            <div class="gmail_default">(I didn't use +1)</div>
          </div>
          <div class="gmail_default" style="color:rgb(0,0,0)"><br>
          </div>
          <div class="gmail_default" style="color:rgb(0,0,0)">print("select
            Rect distance:",np.mean(depth_buf[<b>selectRect_x1:selectRect_x2,selectRect_y1:selectRect_y2</b>]))<br>
          </div>
          <div class="gmail_default" style="color:rgb(0,0,0)"><br>
          </div>
          <div class="gmail_default" style="color:rgb(0,0,0)">should be:</div>
          <div class="gmail_default" style=""><font
              style="color:rgb(0,0,0)" color="#000000">print("select
              Rect distance:",np.mean(depth_buf[</font><font
              style="color:rgb(0,0,0)" color="#000000">selectRect_</font><b
              style="color:rgb(0,0,0)"><font color="#ff0000">y</font></b><font
              style=""><b style=""><font color="#ff0000">1</font></b><font
                color="#000000">:selectRect_</font></font><b
              style="color:rgb(0,0,0)"><font color="#ff0000">y</font></b><font
              style=""><b style=""><font color="#ff0000">2</font></b><font
                color="#000000">,</font></font><font
              style="color:rgb(0,0,0)" color="#000000">selectRect_</font><b
              style="color:rgb(0,0,0)"><font color="#ff0000">x</font></b><font
              style=""><b style=""><font color="#ff0000">1</font></b><font
                color="#000000">:selectRect_</font></font><b
              style="color:rgb(0,0,0)"><font color="#ff0000">x</font></b><font
              style=""><b style=""><font color="#ff0000">2</font></b><font
                color="#000000">]))</font></font><br>
          </div>
          <div class="gmail_default" style="color:rgb(0,0,0)"><br>
          </div>
          <div class="gmail_default" style="color:rgb(0,0,0)">This is
            now working!  I have sent my findings to Arducam.</div>
          <div class="gmail_default" style="color:rgb(0,0,0)"><br>
          </div>
          <div class="gmail_default" style="color:rgb(0,0,0)">Thanks to
            Carl O, Ray C, John G. and Doug P. and others for talking
            through the code and pointing me in the right direction,</div>
          <div class="gmail_default" style="color:rgb(0,0,0)">..Pat</div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
DPRGlist mailing list
<a class="moz-txt-link-abbreviated" href="mailto:DPRGlist@lists.dprg.org">DPRGlist@lists.dprg.org</a>
<a class="moz-txt-link-freetext" href="http://lists.dprg.org/listinfo.cgi/dprglist-dprg.org">http://lists.dprg.org/listinfo.cgi/dprglist-dprg.org</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>