The combination of perspective transformation technology and Hough transformation can achieve good image correction effect. In the application process, in order to determine the perspective transformation parameters, for the rectangular seal, the four vertices of the seal can be selected as the reference points of the transformation. However, the above method can not be directly applied to oval and circular seals. Therefore, this paper puts forward a simple and effective solution. Firstly, the minimum circumscribed frames of circular and elliptical seals are made respectively, and the vertex position coordinates are calculated. Using the constructed external frame, the above problem is transformed into the correction of a rectangular or square image, so that the perspective transformation technology can be extended to the correction of other shapes such as ellipse and circle. At the same time, BM3D filtering is used to reduce the impact of noise. In the basic estimation, K-means clustering is used to search the matching block in the neighborhood of the reference block, and the generated weight matrix is used to improve the matching degree of the module and the accuracy of subsequent aggregation. The preliminary experimental results show that the idea proposed in this paper is simple and effective, and can realize the unified correction of seal image posture of different shapes.