Visual Odometry was my main contribution to my bachelorโs degree. It represents the update step in the Kalman Filter and I based it on the lane-detection algorithm that was already implemented on the Raspberry. Itโs goal is to give the yaw-rate with respect to a starting point.
The main disadvantage of this approach is that the camera is very sensitive to any environmental variables, the most significant one being the proper lightning.
I approached this case by using the RANSAC - Random Sample Consensus algorithm.
By taking the POV to Bird-Eye-View, I succeeded in constraining the lines to always be parallel to each other. Having this achieved, I only needed to find out how to determine the rotation from one frame to the next one.

To enhance the confidence of the rotation I used RANSAC because the camera measurements can be very noisy depending on the lightning, angle, etc. It succeeds in separating the data into inliers and outliers and it tries to fit a model based on the inliers.

The algorithm used is based on affine transformations which preserves the parallelism of the lanes by solving the next equational system:
The third equation is only the second one but extended. In my case I has a vector of pixel coordinates for X and Y.
How good were the results?
I would say it depends on more factors but I wonโt go in depth. The only one I am willing to share is that I came up with a threshold in order to determine if the curve is to the left; to the right; or simply a straight line.
By using a threshold of 7, I managed to accentuate the angle of the curves, but the straight path suffered in this representation. On the other hand, a treshold of 10 accentuated the straight path while the curves had a little bit more to suffer.
Threshold of 10

Threshold of 7
