<div dir="ltr">Pat,<div>    The case is a bit of a botch in my opinion. To use it you need to replace the supplied cable with a longer one. They should have made it so the cable came out the same direction as the tripod mount. Oh well. </div><div>Regards,</div><div>Doug P.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 20, 2022 at 6:58 PM <a href="mailto:secretary@dprg.org">secretary@dprg.org</a> <<a href="mailto:secretary@dprg.org">secretary@dprg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Pat,<div>    To get the ArduCAM image so that it would be the same orientation that would work in the case they provided (i.e., camera cable out top of case, power to right - looking from front).</div><div><br></div><div>from:</div><div>cv2.imshow("preview_amplitude", amplitude_buf.astype(np.uint8))</div><div>to:</div><div>cv2.imshow("preview_amplitude", cv2.flip(amplitude_buf.astype(np.uint8),0))</div><div><br></div><div>from:</div><div>result_image = process_frame(depth_buf,amplitude_buf)</div><div>to:</div><div>result_image = cv2.flip(process_frame(depth_buf,amplitude_buf), 0)</div><div><br></div><div>These 2 changes are in addition to the correction you found.</div><div><br></div><div>Regards,</div><div>Doug P.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 19, 2022 at 7:57 AM Pat Caron via DPRGlist <<a href="mailto:dprglist@lists.dprg.org" target="_blank">dprglist@lists.dprg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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">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"><font color="#000000" style="color:rgb(0,0,0)">print("select Rect distance:",np.mean(depth_buf[</font><font color="#000000" style="color:rgb(0,0,0)">selectRect_</font><b style="color:rgb(0,0,0)"><font color="#ff0000">y</font></b><font><b><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><b><font color="#ff0000">2</font></b><font color="#000000">,</font></font><font color="#000000" style="color:rgb(0,0,0)">selectRect_</font><b style="color:rgb(0,0,0)"><font color="#ff0000">x</font></b><font><b><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><b><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>
DPRGlist mailing list<br>
<a href="mailto:DPRGlist@lists.dprg.org" target="_blank">DPRGlist@lists.dprg.org</a><br>
<a href="http://lists.dprg.org/listinfo.cgi/dprglist-dprg.org" rel="noreferrer" target="_blank">http://lists.dprg.org/listinfo.cgi/dprglist-dprg.org</a><br>
</blockquote></div>
</blockquote></div>