A method of detecting the shape of an object comprises the following steps: a)
producing a camera image of the object; b) mapping an outline of the object, which
appears sharp in the camera image, in a first plane by means of an analyzer connected
to the camera; c) altering the focusing distance of the camera; d) mapping a sharp
outline of the object in a second plane by means of the analyzer; e) repeating
steps b) to d) until a sufficient number of outlines has been mapped so that the
three-dimensional shape of the object can be established. Also disclosed is an
apparatus for implementing the method.