A non-transitory computer-readable medium on which is stored a computer program including commands for representing an environment of a vehicle having a coupled trailer, the vehicle including at least three vehicle cameras, which are situated respectively on different sides of the vehicle, and the trailer having at least one trailer camera situated on a rear side of the trailer, the commands, when executed by a computer, causing the computer to perform the following steps:
- recording a sequence of vehicle camera images using each of the at least three vehicle cameras, the vehicle camera images respectively representing a partial area of the environment;
- recording a sequence of trailer camera images using the trailer camera, which represent a rearward environment behind the trailer;
- acquiring odometry data of the vehicle;
- ascertaining a trailer angle between a longitudinal axis of the trailer and a longitudinal axis of vehicle;
- preprocessing the recorded current vehicle camera images and the recorded current trailer camera image;
- storing items of image information about a close range of the vehicle as a function of the preprocessed vehicle camera images and/or of the preprocessed trailer camera image, a position relative to the vehicle being assigned to the stored items of image information;
- adjusting the position of the stored items of image information as a function of the detected odometry data of the vehicle;
- and
- displaying an environment model from a virtual observational perspective, the preprocessed current vehicle camera images and the preprocessed current trailer camera image being projected onto a projection area of the environment model and being joined, and for partial areas of the environment of the vehicle that are not represented in the current vehicle camera images or in the current trailer camera image, the stored items of information being projected onto the projection area according to their position relative to the vehicle and being joined to the vehicle camera images and the trailer camera image.