<div dir="ltr"><div>Until we refactor according to Matt L.'s suggested changes, one remaining problem is that in cases where two bounding boxes don't intersect, intersect() can still return a bounding box that has bottom-right > top-left, indicating it is a non-empty box, but those top-left and bottom-right coordinates are garbage values that you would need to look into Eigen::AlignedBox and query isEmpty() to know whether it is valid. Presumably the solution in intersection() is to check isEmpty() on the Eigen::AlignedBox and if it is, generate a bounding box with top-left > bottom-right. That is why it might be convenient to define a function generate an empty bounding_box, perhaps compliant with Roddy's specified vgl_intersection convention for an empty box.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 11, 2019 at 12:11 PM Matt Leotta <<a href="mailto:matt.leotta@kitware.com">matt.leotta@kitware.com</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 dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 11, 2019 at 11:59 AM Matt Brown <<a href="mailto:matt.brown@kitware.com" target="_blank">matt.brown@kitware.com</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"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>You should not hit this case.  This is a bounding box, not a polygon.  You should warp the corners of this box (or other data within) and then compute a new bounding box on the warped points.</div></blockquote><div>Maybe this is contrived, but as an example, let's say you are working with orbiting WAMI data and you warp a raw-image bbox from one side of the orbit to a raw image from the other side of the orbit. The top/left and bottom/right corners may get inverted so that top/left > bottom/right. If you naively generated a new bbox with that top/left and bottom/right specification, the new bbox encodes empty. Is it the detection-warping-code implementer's responsibility to manage this accordingly?<br></div><div><br></div></div></blockquote><div>The right way to do this is to warp all four corner points and then add them to a new empty box with the "extend()" function to recompute the new box. </div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(0,0,0)"><span>Matt Brown</span>, Ph.D.<br></span><div style="font-size:small" dir="ltr"><span style="color:rgb(0,0,0)">Staff R&D Engineer</span></div><div dir="ltr"><span style="color:rgb(0,0,0)">Kitware, Inc.<br>101 E Weaver St. Suite G4</span></div><div dir="ltr"><span style="color:rgb(0,0,0)">Carrboro, NC 27510<br>(908) 910-3385</span></div></div></div></div></div></div></div></div></div></div>