A theory is presented of the way in which the hypercolumns in primary visual cortex (V1) are organized to detect important features of visual images, namely local orientation and spatial-frequency. Given the existence in V1 of dual maps for these features, both organized around orientation pinwheels, we constructed a model of a hypercolumn in which orientation and spatial-frequency preferences are represented by the two angular coordinates of a sphere. The two poles of this sphere are taken to correspond, respectively, to high and low spatial-frequency preferences. In Part I of the paper, we use mean-field methods to derive exact solutions for localized activity states on the sphere. We show how cortical amplification through recurrent interactions generates a sharply tuned, contrast-invariant population response to both local orientation and local spatial frequency, even in the case of a weakly biased input from the lateral geniculate nucleus (LGN). A major prediction of our model is that this response is non-separable with respect to the local orientation and spatial frequency of a stimulus. That is, orientation tuning is weaker around the pinwheels, and there is a shift in spatial-frequency tuning towards that of the closest pinwheel at non-optimal orientations. In Part II of the paper, we demonstrate that a simple feed-forward model of spatial-frequency preference, unlike that for orientation preference, does not generate a faithful representation when amplified by recurrent interactions in V1. We then introduce the idea that cortico-geniculate feedback modulates LGN activity to generate a faithful representation, thus providing a new functional interpretation of the role of this feedback pathway. Using linear filter theory, we show that if the feedback from a cortical cell is taken to be approximately equal to the reciprocal of the corresponding feed-forward receptive field (in the two-dimensional Fourier domain), then the mismatch between the feed-forward and cortical frequency representations is eliminated. We therefore predict that cortico-geniculate feedback connections innervate the LGN in a pattern determined by the orientation and spatial-frequency biases of feed-forward receptive fields. Finally, we show how recurrent cortical interactions can generate cross-orientation suppression.