1. A method for differentiating between background and foreground of a scenery in images recorded by an electronic camera, the background showing an arbitrary image coded with a coding such that the image is visible for a direct observer of the background, and the background being differentiated from the non-coded foreground in a signal produced by an image sensor, recording the images, of the camera by means of the coding the coding comprising the background displaying periodically alternating different components of the image, and the display of the components being synchronised with an exposure of the camera such that the camera records only one of the components in at least one period.