Automatic Detection and Classification of Road, Car, and Pedestrian Using Binocular Cameras in Traffic Scenes with a Common Framework
Algorithm 2
Road peripheral enveloping algorithm.
Require: : Road area detection results, : number of valid lines for road detection;
Ensure: Road peripheral contour;
(1) Whiledo
(2) Obtain the coordinate point sets and of the left and right edges of the , and count the number of left and right coordinate points and ;
(3) Whiledo
(4) Find the maximum values and in and , and use their corresponding coordinate points as the initial coordinate points and ;
(5) According to the vector outer product formula: , with and as the starting points, scan other coordinate points and , respectively, and sort them in ascending order from the longitudinal distance from their respective starting points;
(6) The obtained vertices are sequentially connected to obtain the road outline.