This paper aims at the fast recognition and location issue of the robot astronaut when grabbing objects. The main applications of the 3D target recognition and location algorithm in HALCON based on CAD models used in the vision of American Robonaut 2 were described. Then the parameter optimization of the algorithm was studied. The effect of various parameters on the algorithm was analyzed. In addition, the selection principle and harmonious collocation of all parameters were discussed. Finally, an experimental platform was set up and it was validated that the proposed optimization improved the similarity of template matching, achieved 100% correct recognition rate, and only spent more than 200ms for the megapixel image. The mean position accuracy was less than 2mm and the orientation accuracy was less than 1 degree.