It is provided a method for quick switching to realize anterior and posterior eye segments imaging, which can realize quick switch and real-time image for locations at different depths. On one hand, with an ability of quick switch, objects at different depths can be measured, and the detection scope of the OCT system can be enhanced the switch system is able to work stably and change positions accurately without influencing the signal-to-noise ratio of the system. On the other hand, the light beam can be respectively focalized at different locations. Thus, high quality of anterior and posterior eye segments imaging can be achieved with a relatively high lateral resolution for human eyes having different ametropia. Furthermore, based on the anterior and posterior eye segments imaging, an ability of real-time eye axial length measurement can be added.