# Edge following using Hough transform

I am trying to improve an edge following algorithm developed by some students who did a project at my work. The algorithm is supposed to make a robot follow a line with the use of a camera. Their approach was to detect edges with Canny's algorithm and then extract lines from this image using the Hough transform. Three suggested lines will then be presented to the user, who may choose which line the robot should try to follow.

What I want feedback about is data association using the Hough transform. Is there any good criteria for matching of lines between frames? The used solution right now is to measure the angle and distance between followed line and extracted lines and to choose the one that is most similar.

One other problem I see is that they did not filter the signal, i.e. detected lines between frames. I have an idea about using Kalman filter to estimate the current parameters of the edge by using the extracted lines so that it is dynamic and less error prone. What do you think about that?

I have thought about making a SLAM algorithm instead but since we only want a proof of concept that will be a huge remake and requires much more data than I currently have.

• As this is just an idea and not an actual answer, I answer in the comments. Instead of selecting highest maximas in the hough space for two successive frames and then try to match the lines parameters, you could try to find the highest maximas in the successive frames taking the previous maximas into account(ie have a window in the hough space around your previous maximas, and selecting your new maximas in those subspaces). By fine tuning the window, you may be able to follow the lines more accurately. – Al_th Mar 18 '14 at 10:19

1) Matching lines across multiple views is a common research problem and is reasonably well studied: If you have the end points for example : http://cmp.felk.cvut.cz/~werner/software/lmatch/lmatch_memo.pdf

Even tough this deals with more geometric properties, if your scenes are well conditioned, you could as well use the gradient/intensity information to match the lines.

Here is a full source code on multiview line matching from monocular setups: https://github.com/manhofer/Line3Dpp

For straight lines, Canny+Hough pipeline works relatively well in detection. Are the lines within each frame strictly linear? Will they curve? Assuming that you are dealing with straight lines, the output will be a line parameterization, e.g. $ax + by = c$. There are many establish methods in measuring distances between lines, and you can definitely integrate this into a single target tracker to associate the most likely lines as you step through the frames.