In optical cameras, there are deviations in the manufacturing process and assembly accuracy of image sensors, lenses and other related components, which will produce various forms of image distortions, seriously affecting the application and development of Computer Vision (CV) in real life. In order to solve these problems, a hybrid solution algorithm (GPSO-ILM) based on Global Particle Swarm Optimization (GPSO) and improved Levenberg-Marquardt (LM) is proposed on the basis of Homography Transformation, which transforms the solution of nonlinear distortion equations into a parameter optimization problem, and can quickly iterate to obtain the optimal solution of the target function. It can effectively avoid the problems that traditional LM depends on initial values and is easy to fall into local convergence. In order to verify the effectiveness of the algorithm, the improved GPSO-ILM method is compared with the Tasi method of two-steps and traditional Zhang's correction method in OpenCV. The experimental results show that the RMSE errors of the improved GPSO-ILM method are relatively reduced by more than 23% and 18%, and the processing time is saved by about 25%. Compared with other methods, this method has higher correction accuracy and faster processing efficiency.