From top to bottom:
1) Basic diode-capacitor circuit
2) Diode-capacitor with input op amp buffer
3) Diode-capacitor with op amp buffers on input and output, plus diode reverse current correction.
1) is easiest to build but has a voltage offset, 2) has higher accuracy but still has a droop on its output and 3) is nearly perfect.
The top-right switch resets all detectors.