The wide application of intelligent manufacturing technologies imposes higher requirements for the quality inspection of industrial products; however, the existing industrial product quality inspection methods generally have a few shortcomings such as requiring many inspectors, too complicated methods, difficulty in realizing standardized monitoring, and the low inspection efficiency, etc. Targeting at these problems, this paper proposed an automatic detection and online quality inspection method for workpiece surface cracks based on the machine vision technology. At first, it proposed a vision-field environment calibration method, gave the specific method for workpiece shape feature recognition and size measurement based on machine vision, and achieved the on-line monitoring of workpiece quality problems such as feature defects and size deviations. Then, this study integrated the multi-scale attention module and the up-sampling module that can restore the locations of image pixels based on the high-level and low-level hybrid feature maps, built a workpiece crack extraction network, and realized workpiece crack feature extraction, crack type classification, and damage degree division. At last, experimental results verified the effectiveness of the proposed method, and this paper provided a reference for the application of machine vision technology in other fields.