Let's Make Robots!

Machine Vision Obstacle Avoidance

Uses a webcam and robot vision to navigate around obstacles


There are many techniques that can be used for obstacle avoidance. The best technique for you will depend on your specific environment and what equipment you have available. We will first start with simpler techniques that are easy to get running and can be experimented on to improve their quality based on your environment.

Let's get started by first looking at an indoor scene that a mobile robot may encounter.

Robot View


Here the robot is placed on the carpet and faced with a couple obstacles. The following algorithms will refer to aspects of this images and exploit attributes that are common in obstacle avoidance scenarios. For example, the ground plane assumption states that the robot is placed on a relatively flat ground (i.e. no offroading for these robots!) and that the camera is placed looking relatively straight ahead or slightly down (but not up towards the ceiling).

By looking at this image we can see that the carpet is more or less a single color with the obstacles being different in many ways than the ground plane (or carpet).


Edge Based Technique


Edges Detected



Filled From Below


Horizontal Eroded


Smoothed Outline


Final Goal Point




Some other results using this technique.








 See more at http://www.roborealm.com/tutorial/Obstacle_Avoidance/slide010.php



Comment viewing options


Im am starting to look very hungy when I see small laptops!

I gotta get into this!

It just reminds me something I read yesterday about the boe bot

the fill,erode, smooth procedure

and oh surprise..  it came from you !




By the way, welcome to the site, Steven, I'm sure it will be really helpful to have access to your tutorials and your knowledge.


This is great.  Thanks a lot for posting it.  I could see someone on this site putting together a big project that uses an old laptop with this software instead of a microcontroller.


Is it Open Source ?

What operating systems does it run on?


This is actually one of the software packages I'd looked at for my arm. If I remember correctly, it's free but not open source, right? And I think Windows-only. But it looks pretty powerful and flexible. I really like how you put together your own algorithm by combining simple modules, rather than just being a pre-packaged solution that tries to do it all for you (and inevitably never does exactly what you want).


Dan is correct. RoboRealm is free but not open source (but it does have an extensive API) and it only runs on Windows (but you can communicate to it from any OS).

If you are looking for open source packages we maintain a list or free and open source image processing packages at





Thanks STeven for the links. 

If you would not mind, I was wondering why those choices? Why ask for Donations? Why not open source? Why windows only?

Again, appreciate your tutorial and info.