The invention discloses a preserved egg crack online detection method and device based on machine vision. The detection device comprises a conveyor belt, a camera obscura, a light source, an industrial camera, an electromagnetic valve, a controller and a computer. The method comprises the following steps: 1 collecting preserved egg images; 2, automatically cutting the preserved egg images; 3, preprocessing the preserved egg images; 4, extracting relevant characteristic parameters; 5, establishing a crack discrimination model; 6, judging whether cracks exist on a surface of a preserved egg. According to the method, the machine vision is used for detection, the online detection and grading of preserved egg cracks can be achieved, the application environment requirement is low, the equipmentcost is low, the selection freedom degree is high, and better application and popularization prospects are achieved compared with acoustic detection; the industrial camera is used for overturning thepreserved egg for multi-angle photographing such that the detection range is wide; Haar feature detection is utilized, an area is automatically selected, and the method and the device are real-time, concise, accurate and high in flexibility; the images are efficiently processed, a discrimination model is established, and an effective detection method is provided for a relatively vacant part of online detection of the preserved egg cracks.