A traditional capsule endoscope can only take 2D images, and most of the images are not clear enough to be used for diagnosing. A 3D capsule endoscope can help doctors make a quicker and more accurate diagnosis. However, blurred images negatively affect reconstruction accuracy. A compact, autofocus capsule endoscope system is designed in this study. Using a liquid lens, the system can be electronically controlled to autofocus, and without any moving elements. The depth of field of the system is in the 3-100 mm range and its field of view is about 110°. The images captured by this optical system are much clearer than those taken by a traditional capsule endoscope. A 3D reconstruction algorithm is presented to adapt to the zooming function of our proposed system. Simulations and experiments have shown that more feature points can be correctly matched and a higher reconstruction accuracy can be achieved by this strategy.