Aiming at the shortcomings of the existing wafer defect detection algorithms and the problem of low accuracy of wafer defect detection in the case of insufficient training samples, a wafer contour curve refinement extraction and linearization processing algorithm were developed for detecting minute edge defects. A new adaptive wafer image contrast enhancement algorithm was used to filter background noise, and the angle division method was used to rotate a wafer with any inclination to make it vertical. The target lines were extracted by using a single-pixel wide morphological convolution kernel, and then the wafer outline skeletal filling algorithm was proposed to make all the pixels of the extracted independent lines lie in the same rectangle when the lines meet the requirements. Finally, the length of the wafer contour straight lines was calculated based on the average value of two lines. Experiments show that the wafer contour straight lines extracted by this method can achieve a more precise coincidence with the original image. In this paper, an alternative algorithm, based on the image edge, especially when turning the contour curve into a straight line, is proposed for detecting the minute edge defects.