1. A method for recognition of an obstacle in an environment in view of an optical sensor attached to a vehicle, said environment including a travel path of the vehicle, comprising: taking a first image by using the optical sensor at a first time and taking a second image at a later second time; generating a first transformed lower image of the first image lying below the horizon by projecting an image section from an image plane of the optical sensor into a ground plane; generating a first transformed upper image of the first image lying above the horizon by projecting an image section from the image plane of the optical sensor into a virtual plane parallel to the ground plane; generating a second transformed lower image of the second image lying below the horizon by projecting an image section from the image plane of the optical sensor into the ground plane; generating a second transformed upper image of the second image lying above the horizon by projecting the image section from the image plane of the optical sensor into the virtual plane parallel to the ground plane; determining a lower difference image from the first and the second transformed lower part images; determining an upper difference image from the first and the second upper part images; and determining by evaluation of the lower difference image and the upper difference image whether the obstacle is located in the travel path of the vehicle.