This paper describes a system that detects and categorizes workpieces with random defects on electrodeposits glossy metal surface. The system is developed on the basis of combination CCD photoelectricity inspection technology, image processing and automatic control technology. In the system, a special illumination apparatus with a light source of diffused light is designed. Workpieces with defects are automatically selected through measurement with image enhancement retreatment, gray scale analysis, image binaryzation, feature extraction and image recognition. Hardware comprises sections of optics, image collection, and control circuits. Software is programmed in Visual C++ and assembly language. The system can resolve the difficulty of detecting random defects on surface under the conditions of high reflection and complex surfaces.