PCB defect detection using OpenCV
1.Introduction: - In today's fast-paced world, electronic devices have become an integral part of our daily lives. From smartphones to household appliances, these gadgets rely on Printed Circuit Boards (PCBs) to function effectively. As the demand for more efficient and reliable electronic products continues to rise, ensuring the quality of PCBs becomes paramount. However, with the complexity of PCB designs and the increasing volume of manufacturing, traditional manual inspection methods fall short in detecting subtle defects, leading to potential malfunctions and costly recalls. To address these challenges, our project focuses on developing an innovative solution for PCB defect detection using OpenCV and image processing technology. Leveraging the powerof computer vision and image processing technology, we aim to create an automated system that can accurately identify defects on PCBs, enabling manufacturers to ensure the deliveryof high-quality products to their customers. The core of our approach involves comparing images of defective PCBs with reference images of non-defective PCBs. By carefully curating a diverse dataset of labelled images, consisting of both defective and non-defective PCBs through this, the system will become capable of efficiently discriminating between defective and non-defective PCBs, achieving a high level of accuracy and precision. In this synopsis report, we present the methodology and progress of our PCB defect detection project. Additionally, we will discuss the validation and testing procedures to ensure the reliability and effectiveness of our system. Ultimately, our project seeks to contribute to the advancement of quality control in the electronics industry. By automating the PCB defect detection process, we aim to streamline production, reduce costs, and enhance product reliability, benefiting both manufacturers and end-users. We believe that our innovative approach will pave the way for improved electronic devices that are not only cutting-edge in design but also excel in performance and longevity.
2.Proposed Methodology: - The proposed methodology for PCB defect detection using image processing and OpenCV encompasses several key steps to ensure accurateand efficient identification of defects. Firstly, the system preloads a reference image, representing a defect-free PCB, which serves as the template for comparison. Careful consideration is given to the acquisition of images to avoid lighting variations that could lead to false failures. The process then proceeds to image registration, where the inspection image is aligned with the reference image using geometric transformation matrices. This step ensures that both images are of the same size and properly aligned, laying the foundation for accurate comparison. Moving on to the image pre-processing stage, the inspection and reference images undergo several image processing algorithms to achieve a desirable binary representation. Smoothing or blurring is applied to reduce noise and camera artifacts. Intensity adjustment enhances the contrast and brightness distribution, resulting in improved visual clarity. Thresholding follows, converting the grayscale image into a binary image by categorically rejecting pixels below or above a specified threshold value while retaining others. This binary image representation simplifies subsequent comparisons and highlights potential defects effectively. Finally, the pre-processed inspection and reference images are compared using an absolute difference operation. This comparison step facilitates the identification of discrepancies and areas of interest, potentially indicative of defects in the PCB.
3.Flowchart of Methodology: -
4.Expected Outcome / Output: - When the input sample image and the reference images will be executed in the code the Python code will subtract the two images using OpenCV and it will display an image which will highlight the differences between the two images. These differences would be considered as defects and are highlighted by red color.If there are no differences then it means that both the PCB are similar i.e., the PCB is non defective. Based on if the images are similar or not, we will get a return code for both the cases and accordingly the message would be send regarding whether we should consider the PCB or we should discard it. Like this we would be able to differentiate between a defective and a non-defective PCB
Comments