The paper analyses the problem of beer bottles detection techniques on the beer bottles production line, uses digital image processing technique on the beer bottles online defect detection. The paper puts forward the designing ideas of the hardware, developing flow of the software and the algorithm of beer bottles detection. TMSDM642 is used to set up the real-time video processing system of the hardware .The hardware system is mainly composed of three parts: the part of memory, the part of the input and the part of the output. When beer bottles are put into the work area, the video images of the bottle-mouth and bottle-bottom will be gained by the CCD camera, firstly, preprocessing is used to eliminate video image noise. Secondly, the image segmentation algorithm is used to detect defects in video images. Lastly the goal of extracting defects will be accomplished. The experimental result indicated that this system may effectively exam the flaw or the unqualified beer bottles.