1
votes

My goal to for an autonomous robot to navigate a walled mazed using a camera. The camera is fixed atop the robot and facing down to be able to view the walls and the robot from above. enter image description here

The approach I took that seemed most straightforward from my experience was to

  1. Threshold the image to extract the red walls
  2. Perform Canny edge detection
  3. Use the Hough transform the detect the strong lines from the edges

as seen below after some parameter tweaking enter image description here

I want to have the robot move forward and avoid "hitting" the red walls. The problem is that there are multiple lines detected per wall edge from the hough transform. One idea I had was to perform k-means clustering to cluster the lines and find the centers (means) of each cluster, but I do not know the number of wall edges (and therefore number of clusters to input to the k-means algorithm) I will have at any time in navigating the maze (walls ahead, behind, multiple turn intersections, etc.).

Any help in finding a good way to have a consistent wall location to compare the robot's location (which is always fixed in every image frame) to at any time in navigating the maze would be greatly appreciated. I'm also open to any other approach to this problem.

1
The obvious approach seems to me to just discard any found lines if they are close in direction and position to a stronger line, i.e. go through the list of lines and discard any that are similar to an earlier line. No need to cluster them, especially since these lines will all have different confidence levels, and you do not know those, only their relative order, if you use the opencv hough transformHugoRune

1 Answers

1
votes

Run a skeletonization algorithm before extracting the HoughLines.