We present a method to calibrate a high-resolution wavefront-correcting device with a single, static camera, located in the focal plane; no moving of any component is needed. The method is based on a localized diversity and differential optical transfer functions (dOTF) to compute both the phase and amplitude in the pupil plane located upstream of the last imaging optics. An experiment with a spatial light modulator shows that the calibration is sufficient to robustly operate a focal-plane wavefront sensing algorithm controlling a wavefront corrector with åisebox-0.5ex~40 000 degrees of freedom. We estimate that the locations of identical wavefront corrector elements are determined with a spatial resolution of 0.3% compared to the pupil diameter.