Abstract:A method based on a comparison with the coordinates of the peaks in gray scale was proposed to detect the assembly defects of thermal battery. The stack of thermal battery was extracted by template matching. Then image preprocessing methods such as affine transformation, gamma correction and image pyramid were used to improve the contrast of the gray scale. Five defects included the deficiency of monomer thermal battery, the missing of negative electrode, the missing of current collector, wrong assembly order and the overall flip-chip of thermal battery were analyzed. Characteristics in defective battery such as the number of peaks and valleys in gray histogram, distances between the peak and valley were compared with corresponding ones in standard battery. Verified by 400 test images, the experimental results showed that the proposed method possesses an accuracy of 95. 5% and proved that this method can quickly and efficiently detect the defects in thermal battery.