Autonomous optical navigation is one of the most promising techniques to estimate the position and velocity of a spacecraft in Earth orbit without the supports of Earth-based tracking stations. To improve the navigation performance, this paper presents a novel autonomous optical navigation method, where a star camera on the spacecraft is utilized to measure the line-of-sight (LOS) directions of a number of non-cooperative space targets, whose position vectors are supposed to be not precisely known in advance, and an improved Q-learning based extended Kalman filter (IQEKF) is developed to obtain the accurate motion state estimate of both the spacecraft and the space targets based on the LOS direction measurements. The main advantage of the presented method is that the LOS directions of the space targets can be acquired with high-accuracy by using the state-of-the-art star camera, such that the superior navigation accuracy is achievable. In addition, the whole motion state of the spacecraft, such as position, velocity, and attitude, can be obtained with the star camera, in the case that the space targets and the stars are observed simultaneously. The high performance of the presented autonomous navigation method is illustrated through a representative simulation of a medium Earth orbit (MEO) satellite. Furthermore, the simulation results indicate that the IQEKF yields more accurate solutions than the traditional navigation filtering algorithms.