Robot Navigation by Stereoscopic Camera

My goal was to create a navigation algorithm for a mobile robotic platform. Information about distance and location of and direction to the nearest object is necessary. Robot can "see" objects and obstacles in its neighborhood by two cameras, which are located in a fixed distance from each other. Two shifted images of a scene are taken, and location and distance of the nearest object is computed. For better visualisation, colorful depth maps were created. In the end, robot was programmed to behave like "a fearful dog". It tries to maintain a constant distance from the nearest object. If you come closer to the robot, it starts running backwards (is scared, fearful), if you start moving away from it, it gets confidence and starts to follow you.

Image