In today's competitive passive components market, the quality and delivery time of products are the key factors to survive. The traditional quality control process is performed by human experts, which is slow and error prone. In recent years, automatic inspection becomes a mainstream and many works have been published. However, the industry still demands a faster and more accurate inspection method. In this paper, a novel image inspection algorithm to detect defects of Multilayer Ceramic Capacitor (MLCC) is proposed. A testing system is developed and integrated into a production line. In our experiment, the proposed algorithm is proved to be very effective. The inspection system speeds up the testing process 2.5 times as well as increases the yield rate considerably.