This article aims to propose an autonomous navigation method to simultaneously obtain precise position and velocity estimation of a deep space probe both with respect to Earth and with respect to the target, and estimate and correct the ephemeris uncertainty of the target that has a great influence on the navigation accuracy with respect to Earth. In this article, based on the analysis of the influences of ephemeris error on the state model, optical measurement, and the navigation accuracy, the ephemeris error is modeled. By taking the differences between the planned image and the actual image of the target as the ephemeris uncertainty measurement, the method is carried out by augmenting ephemeris uncertainty as system states, and is able to estimate and correct the ephemeris uncertainty of the target planet, and the position and velocity of the probe with respect to Earth and with respect to the target planet autonomously. The results show the influence of ephemeris error is removed from the orbital dynamics of the navigation system, and the proposed method can improve the accuracy with respect to Earth. The results demonstrate the proposed method autonomously yields superior performance with respect to Earth and with respect to the target.