An essential task of the human visual system is to detect the presence of objects embedded within spatial backgrounds of the kind found in common visual scenes. Object backgrounds can differ from regions of effectively uniform luminance to areas of almost arbitrarily complex spatial structure. Detection on uniform backgrounds classically shows Weber behavior, but the form taken by the threshold function in the general case of spatially variable backgrounds is not known. For this it is proposed that a general expression of Weber's law would apply, that accounts for the local contrast contributions both of the background and the feature. The new general law states that threshold is reached when feature contrast exceeds background contrast by an amount equal to a typical Weber constant. To define contrast on a spatially variable background, an adaptable contrast metric is used with variable position and spatial scale terms. It is shown that the detection thresholds of transient (triangle-profile) pulses at any phase on a sinusoidal background follow the general but not the familiar expression of Weber's law. The results also demonstrate that for highly localized features local contrast can be computed at scales as fine as 0.6 arcmin. Further implications including the possible neural locus of the implied adaptation to local contrast are discussed.