Here is a video showing how a robot can recognize the contours of an object. The blue line represents the computer's best gues as to what the object is shaped like. Using this, it can find the exterior shape of the object.