View full-text article in PMC Sensors (Basel). 2019 Jul 17;19(14):3136. doi: 10.3390/s19143136 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1 Convex-hull model (CHM) fitting. Input:P=(p1,p2,...,pn)T, Dy; 1:K=ConvexHull(Px,Py); 2:fori=1,...,m−1do 3: (k1i,b1i)=ParameterofLine(pi,pi+1); 4: Di=DistancetoLine(K,k1i,b1i); 5: pmaxi={pj|dj=max(Di)}; 6: b2i=ParameterofLine(pmaxi,k1i); 7: Xpi=ProjectiontoLine(k1i,b1i); 8: ppmaxi={pj|xpj=max(Xpi)}; ppmini={pj|xpj=min(Xpi)}; 9: b3i=ParameterofLine(ppmini,−1k1i); b4i=ParameterofLine(ppmaxi,−1k1i); 10: R(i)=[k1i,b1i,b2i,b3i,b4i]; 11: A(i)=AreaofBoundingBox(R(i)); 12: D(i)=SumofMinDistancetoEdges(K,R(i)); 13: M(i)=MaxofMinDistancetoEdges(K,R(i)); 14: Θ(i)=SelectYawAngleDif(Dy,k1i); 15:end for 16:(Roptimal,θ)=SelectOptimalParameter(R,A,D,M,Θ); 17:(xrect,yrect)=IntersectionofLine(Roptimal); Output:(xrect,yrect,θ);