A fundamental everyday visual task is to detect target objects within a background scene. Using relatively simple stimuli, vision science has identified several major factors that affect detection thresholds, including the luminance of the background, the contrast of the background, the spatial similarity of the background to the target, and uncertainty due to random variations in the properties of the background and in the amplitude of the target. Here we use an experimental approach based on constrained sampling from multidimensional histograms of natural stimuli, together with a theoretical analysis based on signal detection theory, to discover how these factors affect detection in natural scenes. We sorted a large collection of natural image backgrounds into multidimensional histograms, where each bin corresponds to a particular luminance, contrast, and similarity. Detection thresholds were measured for a subset of bins spanning the space, where a natural background was randomly sampled from a bin on each trial. In low-uncertainty conditions, both the background bin and the amplitude of the target were fixed, and, in high-uncertainty conditions, they varied randomly on each trial. We found that thresholds increase approximately linearly along all three dimensions and that detection accuracy is unaffected by background bin and target amplitude uncertainty. The results are predicted from first principles by a normalized matched-template detector, where the dynamic normalizing gain factor follows directly from the statistical properties of the natural backgrounds. The results provide an explanation for classic laws of psychophysics and their underlying neural mechanisms.natural scene statistics | detection | masking | normalization | Weber's law V isual systems are the result of evolution by natural selection, and, as a consequence, their design is strongly constrained by the properties of natural visual stimuli and by the specific visual tasks performed to survive and reproduce. Thus, to understand the human visual system, it is critical to characterize natural visual stimuli and performance in natural visual tasks (1, 2).Perhaps the most fundamental visual task is to identify target objects in the natural backgrounds that surround us. It is known that the specific properties of a background can have a strong influence on detectability (Fig. 1). For example, the detectability of a target pattern with given amplitude decreases with increases in background luminance (3, 4), background contrast (5-7), and the similarity of the spatial properties of the background to those of the target (8-12). In addition to the direct effects of such background properties, there are other factors that affect detection performance. Specifically, under natural conditions, the strength (amplitude) and location of the target often randomly vary on every occasion, and the target typically appears against a different background scene on every occasion. The uncertainty created by the random amplitude and location of the target ("target...