The original image has geometric deformation in geometric position, shape, size and orientation due to the shooting angle or capturing in the process of image shooting. It brings a lot of inconveniences and great challenges in image processing field such as image fusion, de-noising, recognition and segmentation. In order to improve the processing ability and recognition accuracy of deformation images, an adaptive image deformity correction algorithm for the quadrilateral and the triangular is proposed. Firstly, the deformation image is pre-processed and the contour of image edge is extracted. And then, discrete points of image edge are found to locate image edge accurately. Finally, the deformation of the quadrilateral or the triangle is processed into standard rectangle or equilateral triangle image by using the proposed algorithm of three-dimensional homography transformation, so as to complete the transformation from irregular image to regular image adaptively. A lot of experiments show that the proposed algorithm is superior to the traditional methods such as Hough transform and Radon transform, which improves the effect of deformation images correction, solves the problem of geometric deformation images well, and provides a new technical method for image processing of deformation images.