On the first week, I started to look for one more algorithm to detect road lines. There are several algorithms developed by different authors during the Udacity course. All of these algorithms follow the same pipeline:
-1st. stage: Image undistort;
-2nd. stage: Image warping (Inverse Perspective Mapping application);
-3rd. stage: Isolate Lanes (Threshold application in a color channel or application of edge filters );
-4.th stage: Curve Fitting; This is the most important stage. Here, a histogram of the bottom half of the binary image is taken and wherever that histogram peaks that's where each line starts. Then, a box is drawn around those starting points and any of the white pixels that are inside of the box are stored. At the end of this, a vector of the points that belongs to the road lines is obtained and then a second order polyfit is applied to those pixels.
So, I found a C++ code of one of this algorithms and made it into a ROS package that is called advanced_lane_detection. It is important to say that unlike the first algorithm, it returns a polygon that corresponds to the road area and not the spatial location of the lines points.
After that, the architecture was prepared prepare to receive the polygn that is returned by this algorithm. However this was quite easy because the architecture is flexible enough.
This algorithm caused a computational performance problem- the architecture returning (probabilistic map) was slower than ever. So, a study was made: "What is the influence of the image size in the architecture performance and velocity?". As a conclusion, I think that the image size that provides more reliable results and that allows to obtain less processing time is 640*480. So, I did the necessary changes on the architecture to do the original image rescale.
Finally, the current stage of the architecture is the one that is showed on the video below:
One of the existing problems that aren't visual on this video as the road is always in the same location, is the asynchronous returning data. In a deeper way, it's possible to happen that the algorithms process different frames, which causes unreliable results because the final probabilistic map has different data sources.
So, the next step of my project is to find a way to do the synchronization between the algorithms in order to ensure that the probabilistic map is showing the road area that was determined through the same source data.