We propose a function-oriented model of the visual cortex. The model addresses an essential task of the visual system: to detect and represent objects. These are defined as sets, which reappear in the input with invariant inner relations. A network, incorporating an idealized description of anatomical and physiological data, is presented with a movie showing various moving objects. In the course of time, as a result of Hebbian plasticity, a connection scheme develops which embodies in its forward and lateral connections the information necessary to perform the operations involved in object recognition. We demonstrate that coherent neural activity can exploit this information. Two types of coherence have to be distinguished in this respect. Rate coherence performs invariance operations and association, while event coherence accomplishes segmentation tasks. The model reproduces and explains experimental findings made both in physiological recordings from the visual cortex and in psychophysical studies.