Taking the quad flat no-lead (QFN) package chip as the experimental object, proposes a fast image correction method for the semiconductor chip to solve the problem of the chip's image tilt during visual detection of packaging defects. Firstly, an improved Harris corner detection algorithm is proposed to extract the corner vertices of the target contour in combination with the polygon approximation method; secondly, the line fitting on the vertex of the longest edge is conducted by the least square method; finally, the image correction is carried out according to the line fitting results. The experimental results show as follows: compared with the traditional Hough transform, the minimum enclosing rectangle, and the Fourier transform correction method, the tilt angle obtained by the proposed method is more accurate, and the running time is less than one fifth of the above-mentioned traditional methods. Namely, it owns faster speed and higher efficiency.