Design of an autofocus capsule endoscope system and the corresponding 3D reconstruction algorithm