Since the safety evaluation of large crane is closely related to the key dimensions or key points,in this paper,a crane photogrammetry based on standard particle swarm optimization is proposed to figure out how to obtain its three-dimensional coordinates efficiently and stably.In the traditional calibration methods of camera image principal distance,the customized calibration plate or the method of exhaustion are mainly used to search in a certain range,but their calculation accuracy and efficiency are too low to meet the needs of current engineering applications.A method for calibrating the principal distance of binocular camera of cranes is proposed,which combines the mathematical principle of binocular ranging with particle swarm optimization algorithm,and introduces particle swarm optimization algorithm into camera calibration to find the optimal solution through iteration,so that particles can decide the next action through their own experience and the best experience of their peers.After the standard particle swarm optimization(PSO)algorithm is integrated into the photogrammetry method to obtain the accurate effective focal length,key dimensions of the crane are measured.Experiments were carried out with a gantry crane as the object.The results show that compared with the traditional method of exhaustion,the proposed method has obvious advantages in speed and its measurement accuracy can meet the engineering needs.