Abstract:I In order to solve the current document image transform are random, document object edge detection and pattern transfer accuracy problem, leading to poor document image scanning, this paper from the perspective transformation of Hof line detection and two dimensional point of view, the author presents a document image and twodimensional scanning Hof line detection based on perspective transformation. First of all, according to the clustering segmentation and morphological processing, we get the two value image which contains the target of the document. Then, based on the linear detection of Hof, the linear coordinates of the document edges are calculated, and the contour of the two value image is coupled. Finally, the transformation matrix, the affine transformation and the rigid body transformation are used to construct the twodimensional perspective transformation matrix, and then the image coordinates are redistributed to achieve the purpose of image correction and conversion. The experimental results show that compared with the current scanning mechanism, this paper has a higher accuracy and antijamming performance. The proposed algorithm has good correction and recovery quality, and has important application value in the field of twodimensional code recognition