Abstract:Lithium batteries, as an important component of the current new energy market, are widely used in consumer electronics, electric vehicles, and energy storage fields. To ensure the safety of lithium batteries, they are usually inspected internally using X-rays before leaving the factory to eliminate defective products. However, the original images of lithium batteries using X-ray imaging often have low contrast, uneven contrast, and concentrated grayscale values in narrow areas, making it difficult to distinguish the detailed information of the sample. This article proposes two methods to enhance the contrast of lithium battery X-ray images based on the above characteristics. The first method is to use a custom designed nonlinear grayscale transformation function combined with the CLAHE algorithm to enhance contrast, the second method is to use homomorphic filtering combined with CLAHE transform to enhance contrast. This article developed a program to implement the idea and tested on cylindrical wound lithium battery images. The results showed that the contrast enhancement algorithm proposed in this article increased the information entropy of the image by about 20%, made the grayscale histogram display more uniform, has higher contrast ratio, and then the quality of lithium battery X-ray images improved significantly. This study will provide technical support for the micro focus X-ray defect detection and automatic recognition of lithium batteries.