The primary visual cortex is organized in a way that assigns a specific collection of neurons the job of providing the rest of the brain with all of the information it needs about each small part of the image present on the retina: Neighboring patches of the visual cortex provide the information about neighboring patches of the visual world. Each one of these cortical patches-often identified as a "pinwheel"-contains thousands of neurons, and its corresponding image patch is centered on a particular location in the retina. For stimuli within their image patch, neurons respond selectively to lines or edges with a particular slope (orientation tuning) and to regions of the patch of different sizes (known as spatial frequency tuning). The same number of neurons is devoted to reporting each possible slope (orientation). For the cells that cover different-sized regions of their image patch, however, the number of neurons assigned depends strongly on their preferred region size. Only a few neurons report on large and small parts of the image patch, but many neurons report visual information from medium-sized areas. I show here that having different numbers of neurons responsible for image regions of different sizes actually carries out a computation: Edges in the image patch are extracted. I also explain how this edge-detection computation is done.visual cortex | neural computation | population code | theory S ingle neurons in sensory systems generally have receptive fields that are tuned to some particular characteristics of the environment, and the firing rate of these neurons signals how well the stimulus matches the preferred environmental features. For example, neurons in primary visual cortex (V1) have receptive fields that are tuned to stimulus location, the orientation of edges that enter the receptive field, and to an image property that is related to the size of the receptive field (spatial frequency). The firing rate of these neurons depends jointly on all three variables. In addition, firing rate reflects the contrast of the stimulus-how strongly the relevant stimulus features differ from the background-and not absolute stimulus intensity (1). Our ability to detect a particular feature in the environment depends not just on the firing rate of individual neurons but also on the number of neurons tuned to those features in the population of cortical neurons [a population code (2-7)]. The percept related to a stimulus feature depends, then, jointly on the number of neurons that are responding to the feature and the firing rates of the individual cells. This dual encoding is, as described in the next paragraph, dramatically illustrated in Campbell and Robson's figure (first published in ref. 8) (Fig. 1) in which a sine-wave grating is presented with spatial frequency increasing along the horizontal axis and contrast of the grating decreasing along the vertical axis. This figure "draws out" the contrast function for our visual system by appearing, at each spatial frequency, to be gray above a certain contrast a...