A planet centroid is an important observable object in autonomous optical navigation. A high-accuracy algorithm is presented to extract the planet centroid from its raw image. First, we proposed a planet segmentation algorithm to segment the planet image block to eliminate noise and to reduce the computation load. Second, we developed an effective algorithm based on Prewitt-Zernike moments to detect sub-pixel real edges by determining possible edges with the Prewitt operator, removing pseudo-edges in backlit shady areas, and relocating real edges to a sub-pixel accuracy in the Zernike moments. Third, we proposed an elliptical model to fit sub-pixel edge points. Finally, we verified the performance of this algorithm against real images from the Cassini-Huygens mission and against synthetic simulated images. Simulation results showed that the accuracy of the planet centroid is up to 0·3 pixels and that of the line-of-sight vector is at 2·1 × 10−5 rad.