The collimator is a significant equipment for optical experiments and measuring. Collimator defocus state will bring adverse effects in tests. Using rhombic prism to pan the optical axis, two marginal lights of the collimator are imaged in a CCD. Different reticle imaging positions show that the reticle deviates from the focal plane of objective lens. Then by adjusting the position of the reticle according to the imaging position, the collimator can be calibrated. Potential errors are analyzed, and it is concluded that the precision can reach 2″ by using a 8-power telescope, and the feasibility and accuracy of the method are verified by experiments.