Machine vision systems that consist of cameras and image-processing components for visual inspection and identification tasks play a critical role in various intelligent applications, including pilotless vehicles and surveillance systems. However, current systems usually possess a limited dynamic range and fixed photoresponsivity, restricting their capability of gaining high-fidelity images when encoding a high-contrast scene. Here, it is shown that a photovoltaic memristor incorporating two antagonistic photovoltaic junctions can autonomously adjust its response to varying light stimuli, enabling the amplification of shadows and inhibition of highlight saturation. Due to the dynamic photodoping effect at the p-n junction with an asymmetrical profile, the photocurrent polarities of the antagonistic memristor can be changed as the light intensity increases. The light-intensity-dependent switchable photovoltaic behaviors match Weber's law where photosensitivity is inversely proportional to the light stimuli. An 11×11 memristor array is used to detect a high-contrast scene with light intensities ranging from 1 to 5×104 µW cm-2, achieving a similar active contrast adaptation performance compared with the human visual systems (less than 1.2 s at 94 dB). This work paves the way for innovative neuromorphic device designs and may lead to the development of state-of-the-art active visual adaptation photosensors.