System and method for detecting obstacles using a single camera