PCB visual inspection method, device, system, equipment and medium
By obtaining the front and back images of the PCB motherboard and performing automated defect analysis, the problems of low efficiency and low accuracy of traditional detection are solved, and efficient and accurate automated detection is achieved.
Patent Information
- Application Number
- CN202510041882.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-13
AI Technical Summary
Traditional PCB detection methods are inefficient and rely on labor, resulting in insufficient detection efficiency and low accuracy, affecting production.
By obtaining the front and back images of the PCB motherboard, using the linear array camera and robotic arms for automatic flip and image acquisition, combined with AI algorithm and OpenCV for defect analysis, we will determine whether the plate is qualified.
Automatic inspection is realized, detection efficiency and accuracy are improved, manual intervention is reduced, and production efficiency and product quality are improved.
Smart Images

Figure CN119985528A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine vision detection, and in particular to a PCB vision detection method, device, system, equipment and medium. Background Art
[0002] In the process of PCB manufacturing, it is necessary to ensure that the position and shape of each component on the board are correct. Therefore, during production, it is necessary to perform defect detection on the PCB products on the production line so that defects can be detected in time. Find defective products and effectively control their quality.
[0003] The traditional inspection method is to manually flip the motherboard and use microscopes and other equipment to manually inspect the defects. However, this inspection has certain limitations. If it is detected that a component is missing or the position is deviated, it is still necessary to manually adjust the placement. The process is very cumbersome, resulting in insufficient overall inspection efficiency and insufficient inspection accuracy, which seriously affects product production. Therefore, how to improve inspection efficiency has become an urgent problem to be solved. Summary of the invention
[0004] Based on this, it is necessary to provide a PCB visual inspection method, device, system, equipment and medium to address the above technical issues, so as to solve the problem of low inspection efficiency in the prior art.
[0005] A first aspect of an embodiment of the present application provides a PCB visual inspection method, the PCB visual inspection method comprising: Get the front and back images of the PCB mainboard; Performing defect analysis on the front image and the back image respectively to obtain a first analysis result and a second analysis result; Whether the PCB main board is qualified is determined according to the first analysis result and the second analysis result.
[0006] A second aspect of an embodiment of the present application provides a PCB visual inspection device, the PCB visual inspection device comprising: An acquisition module is used to acquire a front image and a back image of a PCB mainboard; An analysis module, used to perform defect analysis on the front image and the back image respectively to obtain a first analysis result and a second analysis result; A determination module is used to determine whether the PCB main board is qualified according to the first analysis result and the second analysis result.
[0007] A third aspect of an embodiment of the present application provides a PCB visual inspection system, the PCB visual inspection system comprising a linear array camera, a robotic arm, and a control platform, the control platform being connected to the linear array camera and the robotic arm respectively; The line array camera is used to collect the front image and the back image of the PCB mainboard; The mechanical arm is used to flip the PCB main board according to the position signal of the PCB main board on the guide rail; The control platform is used to receive the front image and the back image of the PCB mainboard sent by the linear array camera; perform defect analysis on the front image and the back image respectively to obtain a first analysis result and a second analysis result; and determine whether the PCB mainboard is qualified according to the first analysis result and the second analysis result.
[0008] In a fourth aspect, an embodiment of the present invention provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the PCB visual inspection control method as described in the second aspect when executing the computer program.
[0009] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the PCB visual inspection control method as described in the second aspect is implemented.
[0010] In summary, the present invention provides a PCB visual inspection method, device, system, equipment and medium, which obtains a front image and a back image of a PCB mainboard, performs defect analysis on the front image and the back image respectively, obtains a first analysis result and a second analysis result, and determines whether the PCB mainboard is qualified according to the first analysis result and the second analysis result, thereby solving the shortcoming that traditional inspection requires excessive reliance on manual inspection, and can accurately and effectively perform defect inspection on the PCB mainboard, thereby improving inspection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0012] Figure 1 It is a structural schematic diagram of a PCB visual inspection system provided by one embodiment of the present invention; Figure 2is another structural schematic diagram of a PCB visual inspection system provided by one embodiment of the present invention; Figure 3 It is a flow chart of a PCB visual inspection method provided by one embodiment of the present invention; Figure 4 It is a structural schematic diagram of a PCB visual inspection device provided by one embodiment of the present invention; Figure 5 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0014] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0015] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0016] As used in the present specification and the appended claims, the term “if” may be interpreted as “when” or “uponce” or “in response to determining”, depending on the context. Similarly, the phrase “if it is determined” or “if matched to [described condition or event]” may be interpreted as meaning “upon determination” or “in response to determination” or “uponce matched to [described condition or event]” or “in response to matching to [described condition or event]”, depending on the context.
[0017] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0018] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0019] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0020] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0021] See also Figure 1 , Figure 1 It is a structural schematic diagram of a PCB visual inspection system provided by one embodiment of the present invention. The PCB visual inspection system includes at least a linear array camera, a robotic arm and a control platform. The linear array camera, the robotic arm and the control platform can be directly or indirectly connected by wired or wireless communication, and the present application does not make any specific limitations here.
[0022] The linear array camera is a camera using a linear array image sensor, which is used to capture the front image and the back image of the PCB mainboard, and send the front image and the back image of the PCB mainboard taken by itself to the control platform. The number of linear array cameras can be one or more, and this application does not make specific restrictions here. The mechanical arm is specifically the mechanical arm of an industrial robot, and a structure for flipping, such as a clamp, a suction cup, etc., is set at the end of the mechanical arm, which is used to flip the PCB mainboard according to the position signal of the PCB mainboard on the guide rail. The control platform is used to provide the user end with relevant business services of the company or enterprise, and receives the front image and the back image of the PCB mainboard sent by the linear array camera, and then respectively performs defect analysis on the front image and the back image to obtain a first analysis result and a second analysis result, thereby determining whether the PCB mainboard is qualified based on the first analysis result and the second analysis result, so that the PCB visual inspection system performs corresponding processing, thereby improving the inspection efficiency. The control platform may include an independent physical server, a server cluster or distributed system consisting of multiple physical servers, and a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The cloud platform can be a platform with security management and property management capabilities such as smart cities and smart communities, and this application does not make any restrictions on this.
[0023] It should be noted that if Figure 2 As shown, the PCB visual inspection system also includes a guide rail, which is a hanging guide rail. In the inspection mode of the assembly line, the guide rail can be transmitted to other assembly lines for the next step of inspection, which is very convenient and realizes full utilization of the workshop space, providing convenience for the equipment layout on the ground. In addition, a sensor device is set on both sides of the guide rail. Specifically, the sensor device is a photoelectric sensor, and its transmitting end and receiving end are set on both sides of the guide rail to detect the passage of the PCB board and give feedback signals to the control platform. That is, when the sensor device detects that a PCB board passes, the photoelectric sensor will detect it and send a feedback signal to the control platform, and then the control platform will transmit the control instruction to the linear array camera to enable the linear array camera to capture an image.
[0024] In this embodiment, when the torque motor is running, the absolute value incremental encoder continuously sends pulses to the data acquisition card, thereby triggering the linear array camera to scan line by line to obtain a complete front image (T-side image) or back image (B-side image) of the PCB main board. When the PCB main board enters the guide rail, the photoelectric sensors on both sides of the guide rail entrance trigger a position signal to the robot arm, so that the robot arm flips the PCB main board by sensing the position information of the PCB main board on the guide rail, and then the linear array camera scans line by line to obtain a complete front image (T-side image) or back image (B-side image) of the PCB main board, thereby obtaining the front image (T-side image) and back image (B-side image) of the PCB main board, and sending the front image (T-side image) and back image (B-side image) of the PCB main board to the control platform, and performing defect analysis of the board surface image based on the AI algorithm and the OpenCV algorithm library to analyze information such as short circuit, open circuit, scratches, etc., and sending the analysis result to the automatic guided transport vehicle (AGV module). The automatic guided transport vehicle (AGV module) transports the parts with two inspection results, qualified (OK) and unqualified (NG) PCB mainboards (if the surface of the PCB mainboard is unqualified, it means that there are abnormal defects in the image information, which is considered NG, otherwise the image information is OK) to different WIP areas, where the WIP area refers to an area specifically used to store products or parts in the manufacturing process. At the same time, it records the types of PCB mainboard defects (wrong parts, missing parts, insufficient tin, search errors, offsets), the proportion of defective original parts, and other information, which are used to trace the parameter data of the PCB mainboard and optimize the process flow. Through the architecture of the above-mentioned PCB visual inspection system, it changes from manual to automatic, reducing the possibility of local deformation and damage of the board affected by personnel, realizing the automatic flipping of the PCB mainboard by the robotic arm, meeting the intelligent needs, thereby improving the accuracy and efficiency of the final PCB visual inspection results, and by adopting guide rails, the full utilization of the workshop space is achieved, which provides convenience for the layout of equipment on the ground.
[0025] It can be understood that the structural diagram of the PCB visual inspection system described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the system structure and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0026] It can be seen that the above Figure 1 and Figure 2 The system architecture shown is only an example and is not specifically limited in the embodiments of the present application.
[0027] See also Figure 3, is a flow chart of a PCB visual inspection method provided by an embodiment of the present invention. The above PCB visual inspection method can be applied to a PCB visual inspection system, such as Figure 3 As shown, the PCB visual inspection method may include the following steps.
[0028] S301: Acquire a front image and a back image of a PCB mainboard.
[0029] In one embodiment of the invention, obtaining a front image and a back image of a PCB mainboard includes: Get the position signal of the PCB mainboard on the guide rail; According to the incoming position signal, the robot arm is controlled to flip the PCB main board so that the line array camera collects the front image and the back image of the PCB main board.
[0030] In this embodiment, the front image (T-side image) or the back image (B-side image) of the complete PCB main board is obtained by scanning line by line with the linear array camera. When the PCB main board enters the guide rail, the photoelectric sensors on both sides of the guide rail entrance trigger the position signal to the robot arm, so that the robot arm flips the PCB main board by sensing the position information of the PCB main board on the guide rail, and then the linear array camera is scanned line by line to obtain the front image (T-side image) or the back image (B-side image) of the complete PCB main board, thereby obtaining the front image (T-side image) and the back image (B-side image) of the PCB main board, and sending the front image (T-side image) and the back image (B-side image) of the PCB main board to the control platform, so that the control platform performs defect analysis on the front image and the back image of the PCB main board. Through the above steps, the detection time is greatly shortened, the production efficiency is improved, and compared with the traditional manual detection method, the defects and problems on the PCB main board can be discovered more quickly in the future.
[0031] S302: Perform defect analysis on the front image and the back image respectively to obtain a first analysis result and a second analysis result.
[0032] In an embodiment of the invention, defect analysis is performed on the front image to obtain a first analysis result, including: Preprocessing the front image based on the OpenCV algorithm library to obtain a preprocessed front image; Dividing the preprocessed frontal image into a plurality of different detection areas, and extracting image features in the plurality of different detection areas using a CSPDarknet53 network and a Mish activation function; Comparing the image features in the multiple different detection areas with the preset standard image features corresponding to the PCB mainboard in sequence; Determining whether the image features of each detection area in the front image are the same as the preset standard image features, wherein the image features include color features, shape features and / or texture features; If the image features are not the same, the image features are input into a pre-trained defect model for defect recognition and classification to obtain a first analysis result.
[0033] Specifically, the front image is preprocessed by the OpenCV algorithm library, that is, the front image is read by the cv2.imread() function of OpenCV, and the color image is converted into a grayscale image by the cv2.cvtColor() function, the color information is removed, and only the brightness information is retained to simplify the subsequent processing steps and improve the accuracy of defect detection. Smoothing techniques such as mean filtering, median filtering or Gaussian filtering are applied to remove noise and details in the image, making the defect features more obvious, and then the contrast and brightness of the image are improved by using techniques such as histogram equalization, contrast stretching or sharpening, making the defect features more prominent. According to the characteristics of the front image and the detection requirements, multiple different detection areas are divided manually or automatically using algorithms, and then the image features in multiple different detection areas are extracted using the CSPDarknet53 network and the Mish activation function. Among them, CSPDarknet53 is a deep convolutional neural network, which is characterized by a cross-stage partial connection structure, which helps to reduce the amount of calculation and improve the feature extraction capability. The Mish function replaces the traditional ReLU function as an activation function. The Mish function has better smoothness and nonlinear characteristics, which helps to improve the performance of the network. In the CSPDarknet53 network, as the convolutional layer goes deeper, the extracted features gradually change from low-level to high-level. Low-level features usually contain more detailed information, while high-level features focus more on global structure and semantic information. For each selected detection area, its corresponding image features can be extracted. Through the above steps, the CSPDarknet53 network and the Mish activation function can be used to extract image features in multiple different detection areas and apply them to subsequent analysis and processing tasks.
[0034] It should be noted that image features include color features, shape features and / or texture features. Shape features can also be obtained by edge detection, contour extraction and other methods. Color features can also be extracted by color space conversion, color distribution statistics and other methods, such as extracting the histogram features of RGB channels or HSV channels; Texture features can also be obtained by texture analysis, grayscale co-occurrence matrix, wavelet transform and other methods. This application does not limit the method of extracting image features. After obtaining the image features, it can also be combined with feature engineering and dimensionality reduction algorithms and other technologies to further process and optimize them to improve the expressiveness and classification effect of the features.
[0035] After acquiring the image features in multiple different detection areas, the control platform will pre-set the corresponding standard image features, which contain all color, state, texture and other image features. By comparing the image features in multiple different detection areas with the preset standard image features corresponding to the PCB board in turn, various similarity measurement methods can be used, such as Euclidean distance, cosine similarity, Jaccard similarity, etc., to determine whether the image features of each detection area in the front image are the same as the preset standard image features, so as to perform quality assessment and classification judgment. For example, if the color depth of a certain position on the PCB motherboard is different from the depth of the corresponding position of the standard image feature, the image feature is input into the pre-trained defect model for defect identification and classification, that is, according to the output result of the model, determine whether there is a defect in the detection area and the type of defect, and then integrate the defect identification results of all detection areas to form a first analysis result, and use OpenCV's drawing functions (such as cv2.rectangle(), cv2.circle(), cv2.putText(), etc.) to mark the location, type, size and other information of the defect on the original image for intuitive visualization, and output the first analysis result in the format of text, image or JSON for subsequent quality control and decision analysis. Through the above steps, defect analysis can be performed on multiple different detection areas in the front image based on the AI algorithm and the OpenCV algorithm library, and the first analysis result can be obtained. A large amount of image data can be quickly processed, and the defect features in the image can be accurately identified, thereby achieving rapid detection and improving the accuracy of PCB board defect detection.
[0036] In one embodiment of the invention, defect analysis is performed on the reverse image to obtain a second analysis result, including: Preprocessing the reverse image based on the OpenCV algorithm library to obtain a preprocessed reverse image; Dividing the preprocessed reverse image into a plurality of different detection areas, and extracting image features in the plurality of different detection areas using a CSPDarknet53 network and a Mish activation function; Comparing the image features in the multiple different detection areas with the preset standard image features corresponding to the PCB mainboard in sequence; Determining whether the image features of each detection area in the reverse image are the same as the preset standard image features, wherein the image features include color features, shape features and / or texture features; If the image features are not the same, the image features are input into a pre-trained defect model for defect recognition and classification to obtain a second analysis result.
[0037] Specifically, the reverse image is preprocessed by the OpenCV algorithm library, that is, the reverse image is read by using the cv2.imread() function of OpenCV, and the color image is converted into a grayscale image by using the cv2.cvtColor() function, the color information is removed, and only the brightness information is retained to simplify the subsequent processing steps and improve the accuracy of defect detection. Smoothing techniques such as mean filtering, median filtering or Gaussian filtering are applied to remove noise and details in the image, making the defect features more obvious, and then using histogram equalization, contrast stretching or sharpening techniques to improve the contrast and brightness of the image, making the defect features more prominent. According to the characteristics of the reverse image and the detection requirements, multiple different detection areas are divided manually or automatically using algorithms, and then the image features in multiple different detection areas are extracted using the CSPDarknet53 network and the Mish activation function. Among them, CSPDarknet53 is a deep convolutional neural network, which is characterized by a cross-stage partial connection structure, which helps to reduce the amount of calculation and improve the feature extraction capability. The Mish function replaces the traditional ReLU function as an activation function. The Mish function has better smoothness and nonlinear characteristics, which helps to improve the performance of the network. In the CSPDarknet53 network, as the convolutional layer goes deeper, the extracted features gradually change from low-level to high-level. Low-level features usually contain more detailed information, while high-level features focus more on global structure and semantic information. For each selected detection area, its corresponding image features can be extracted. Through the above steps, the CSPDarknet53 network and the Mish activation function can be used to extract image features in multiple different detection areas and apply them to subsequent analysis and processing tasks.
[0038] It should be noted that image features include color features, shape features and / or texture features. Shape features can also be obtained by edge detection, contour extraction and other methods. Color features can also be extracted by color space conversion, color distribution statistics and other methods, such as extracting the histogram features of RGB channels or HSV channels; Texture features can also be obtained by texture analysis, grayscale co-occurrence matrix, wavelet transform and other methods. This application does not limit the method of extracting image features. After obtaining the image features, it can also be combined with feature engineering and dimensionality reduction algorithms and other technologies to further process and optimize them to improve the expressiveness and classification effect of the features.
[0039] After acquiring the image features in multiple different detection areas, the control platform will pre-set the corresponding standard image features, which contain all color, state, texture and other image features. By comparing the image features in multiple different detection areas with the preset standard image features corresponding to the PCB board in turn, various similarity measurement methods can be used, such as Euclidean distance, cosine similarity, Jaccard similarity, etc., to determine whether the image features of each detection area in the reverse image are the same as the preset standard image features, so as to perform quality assessment and classification judgment. For example, if the color depth of a certain position on the PCB motherboard is different from the depth of the corresponding position of the standard image feature, the image feature is input into the pre-trained defect model for defect identification and classification, that is, according to the output result of the model, determine whether there is a defect in the detection area and the type of defect, and then integrate the defect identification results of all detection areas to form a first analysis result, and use OpenCV's drawing functions (such as cv2.rectangle(), cv2.circle(), cv2.putText(), etc.) to mark the location, type, size and other information of the defect on the original image for intuitive visualization, and output the first analysis result in the format of text, image or JSON for subsequent quality control and decision analysis. Through the above steps, defect analysis can be performed on multiple different detection areas in the front image based on the AI algorithm and the OpenCV algorithm library, and the first analysis result can be obtained. A large amount of image data can be quickly processed, and the defect features in the image can be accurately identified, thereby achieving rapid detection and improving the accuracy of PCB board defect detection.
[0040] S303: Determine whether the PCB main board is qualified according to the first analysis result and the second analysis result.
[0041] In an embodiment of the invention, determining whether the PCB mainboard is qualified according to the first analysis result and the second analysis result includes: If the first analysis result meets the preset image quality requirement, and the second analysis result meets the preset image quality requirement, then determining that the PCB main board is qualified; If the first analysis result meets the preset image quality requirement, and the second analysis result does not meet the preset image quality requirement, determining that the PCB main board is unqualified; If the first analysis result does not meet the preset image quality requirement, and the second analysis result meets the preset image quality requirement, determining that the PCB main board is unqualified; If the first analysis result does not meet the preset image quality requirement, and the second analysis result does not meet the preset image quality requirement, it is determined that the PCB main board is unqualified.
[0042] In this embodiment, there are multiple AOI areas in the front image (T side) or the back image (B side) of the PCB mainboard, and each area needs to be tested for qualification. After the test, the test results are statistically analyzed, and Since the manufacturing process of the T side and the B side of the PCB motherboard are different, it is necessary to judge the image quality of the T side and the B side respectively. After judging the T side, judge the B side. In the process of judging, if defects are found, such as line short circuit, open circuit, film breakage, gold on copper, copper leakage, etc., the defect information needs to be recorded in the information of the board, that is, the control platform will be pre-set with the corresponding image quality requirements. If the first analysis result meets the preset image quality requirements, and the second analysis result meets the preset image quality requirements, that is, there are no defects on the T side and the B side of the PCB motherboard, then the PCB motherboard is determined to be qualified. If the first analysis result meets the preset image quality requirements, and the second analysis result does not meet the preset image quality requirements, then the PCB motherboard is determined to be unqualified. If the first analysis result does not meet the preset image quality requirements, and the second analysis result meets the preset image quality requirements, then the PCB motherboard is determined to be unqualified. If the first analysis result does not meet the preset image quality requirements, and the second analysis result meets the preset image quality requirements, then the PCB motherboard is determined to be unqualified. It can be seen that as long as there is a defect on either the T side or the B side of the PCB motherboard, the PCB motherboard is determined to be unqualified. Through the above steps, the accuracy and efficiency of detection can be improved, so as to optimize and improve the production process in the future, such as adjusting process parameters, improving equipment performance, etc., so as to improve production efficiency and product quality.
[0043] In an embodiment of the invention, after determining whether the PCB mainboard is qualified, the method includes: If the PCB main board is unqualified, an alarm will be given in real time, and the PCB main board will be transported to a corresponding position for repair.
[0044] In this embodiment, when it is detected that the PCB main board is unqualified, an alarm is issued in real time, and the PCB main board is transported to the corresponding position for repair. The control platform organizes the records to generate reports on influencing factors such as product qualification rate and defect rate, so that corresponding exception processing and troubleshooting can be carried out according to the influencing factor reports, thereby avoiding further losses and risks and improving production quality and efficiency.
[0045] In summary, the present invention provides a PCB visual inspection method, device, system, equipment and medium, which obtains a front image and a back image of a PCB mainboard, performs defect analysis on the front image and the back image respectively, obtains a first analysis result and a second analysis result, and determines whether the PCB mainboard is qualified according to the first analysis result and the second analysis result, thereby solving the shortcoming that traditional inspection requires excessive reliance on manual inspection, and can accurately and effectively perform defect inspection on the PCB mainboard, thereby improving inspection efficiency.
[0046] See also Figure 4 , Figure 4 Schematic diagram of the structure of the PCB visual inspection device provided by the embodiment of the present invention. In this embodiment, the terminal includes various units for executing Figure 3 For details, please refer to the steps in the corresponding embodiment. Figure 3 as well as Figure 3 For the convenience of explanation, only the parts related to this embodiment are shown. Figure 4 The PCB visual inspection device 40 includes: an acquisition module 41, an analysis module 42, and a determination module 43.
[0047] An acquisition module 41 is used to acquire a front image and a back image of the PCB mainboard; An analysis module 42 is used to perform defect analysis on the front image and the back image respectively to obtain a first analysis result and a second analysis result; The determination module 43 is used to determine whether the PCB main board is qualified according to the first analysis result and the second analysis result.
[0048] Optionally, the acquisition module 41 is specifically used for: Get the position signal of the PCB mainboard on the guide rail; According to the incoming position signal, the robot arm is controlled to flip the PCB main board so that the line array camera collects the front image and the back image of the PCB main board.
[0049] Optionally, the above analysis module 42 is specifically used for: Preprocessing the front image based on the OpenCV algorithm library to obtain a preprocessed front image; Dividing the preprocessed frontal image into a plurality of different detection areas, and extracting image features in the plurality of different detection areas using a CSPDarknet53 network and a Mish activation function; Comparing the image features in the multiple different detection areas with the preset standard image features corresponding to the PCB mainboard in sequence; Determining whether the image features of each detection area in the front image are the same as the preset standard image features, wherein the image features include color features, shape features and / or texture features; If the image features are not the same, the image features are input into a pre-trained defect model for defect recognition and classification to obtain a first analysis result.
[0050] Optionally, the analysis module 42 is further used for: Preprocessing the reverse image based on the OpenCV algorithm library to obtain a preprocessed reverse image; Dividing the preprocessed reverse image into a plurality of different detection areas, and extracting image features in the plurality of different detection areas using a CSPDarknet53 network and a Mish activation function; Comparing the image features in the multiple different detection areas with the preset standard image features corresponding to the PCB mainboard in sequence; Determining whether the image features of each detection area in the reverse image are the same as the preset standard image features, wherein the image features include color features, shape features and / or texture features; If the image features are not the same, the image features are input into a pre-trained defect model for defect recognition and classification to obtain a second analysis result.
[0051] Optionally, the determination module 43 is specifically used for: If the first analysis result meets the preset image quality requirement, and the second analysis result meets the preset image quality requirement, then determining that the PCB main board is qualified; If the first analysis result meets the preset image quality requirement, and the second analysis result does not meet the preset image quality requirement, determining that the PCB main board is unqualified; If the first analysis result does not meet the preset image quality requirement, and the second analysis result meets the preset image quality requirement, determining that the PCB main board is unqualified; If the first analysis result does not meet the preset image quality requirement, and the second analysis result does not meet the preset image quality requirement, it is determined that the PCB main board is unqualified.
[0052] Optionally, the determination module 43 is then specifically used to: If the PCB main board is unqualified, an alarm will be given in real time, and the PCB main board will be transported to a corresponding position for repair.
[0053] It should be noted that the information interaction, execution process and other contents between the above-mentioned units are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0054] Figure 5 Schematic diagram of the structure of a computer device provided by an embodiment of the present invention. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5Only one is shown in the figure), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps in any of the above-mentioned PCB visual inspection embodiments are implemented.
[0055] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Figure 5 These are merely examples of computer devices and do not constitute limitations on the computer devices. The computer devices may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, they may also include a network interface, a display screen, and an input system.
[0056] In one embodiment, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by a processor in a computer device, the computer device can perform the steps of any embodiment of a PCB visual inspection disclosed in the present invention, which will not be repeated here. The computer-readable storage medium can be non-volatile or volatile.
[0057] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0058] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments, it may also be an external storage device of the computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory may also include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of a computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0059] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0060] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0061] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A PCB visual inspection method, characterized in that: include: Get the front and back images of the PCB mainboard; Performing defect analysis on the front image and the back image respectively to obtain a first analysis result and a second analysis result; Whether the PCB main board is qualified is determined according to the first analysis result and the second analysis result.
2. The PCB visual inspection method according to claim 1, characterized in that: The performing defect analysis on the front image to obtain a first analysis result includes: Preprocessing the front image based on the OpenCV algorithm library to obtain a preprocessed front image; Dividing the preprocessed frontal image into a plurality of different detection areas, and extracting image features in the plurality of different detection areas using a CSPDarknet53 network and a Mish activation function; Comparing the image features in the multiple different detection areas with the preset standard image features corresponding to the PCB mainboard in sequence; Determining whether the image features of each detection area in the front image are the same as the preset standard image features, wherein the image features include color features, shape features and / or texture features; If the image features are not the same, the image features are input into a pre-trained defect model for defect recognition and classification to obtain a first analysis result.
3. The PCB visual inspection method according to claim 1, characterized in that: The performing defect analysis on the reverse side image to obtain a second analysis result includes: Preprocessing the reverse image based on the OpenCV algorithm library to obtain a preprocessed reverse image; Dividing the preprocessed reverse image into a plurality of different detection areas, and extracting image features in the plurality of different detection areas using a CSPDarknet53 network and a Mish activation function; Comparing the image features in the multiple different detection areas with the preset standard image features corresponding to the PCB mainboard in sequence; Determining whether the image features of each detection area in the reverse image are the same as the preset standard image features, wherein the image features include color features, shape features and / or texture features; If the image features are not the same, the image features are input into a pre-trained defect model for defect recognition and classification to obtain a second analysis result.
4. The PCB visual inspection method according to claim 1, characterized in that: The determining whether the PCB mainboard is qualified according to the first analysis result and the second analysis result includes: If the first analysis result meets the preset image quality requirement, and the second analysis result meets the preset image quality requirement, then determining that the PCB main board is qualified; If the first analysis result meets the preset image quality requirement, and the second analysis result does not meet the preset image quality requirement, determining that the PCB main board is unqualified; If the first analysis result does not meet the preset image quality requirement, and the second analysis result meets the preset image quality requirement, determining that the PCB main board is unqualified; If the first analysis result does not meet the preset image quality requirement, and the second analysis result does not meet the preset image quality requirement, it is determined that the PCB main board is unqualified.
5. The PCB visual inspection method according to claim 1, characterized in that: The obtaining of the front image and the back image of the PCB mainboard includes: Get the position signal of the PCB mainboard on the guide rail; According to the incoming position signal, the robot arm is controlled to flip the PCB main board so that the line array camera collects the front image and the back image of the PCB main board.
6. The PCB visual inspection method according to claim 1, characterized in that: After determining whether the PCB mainboard is qualified, the method includes: If the PCB main board is unqualified, an alarm will be given in real time, and the PCB main board will be transported to a corresponding position for repair.
7. A PCB visual inspection device, characterized in that: include: An acquisition module is used to acquire a front image and a back image of a PCB mainboard; An analysis module, used to perform defect analysis on the front image and the back image respectively to obtain a first analysis result and a second analysis result; A determination module is used to determine whether the PCB main board is qualified according to the first analysis result and the second analysis result.
8. A PCB visual inspection system, characterized in that: The PCB visual inspection system comprises a linear array camera, a robotic arm and a control platform, wherein the control platform is connected to the linear array camera and the robotic arm respectively; The line array camera is used to collect the front image and the back image of the PCB mainboard; The mechanical arm is used to flip the PCB main board according to the position signal of the PCB main board on the guide rail; The control platform is used to receive the front image and the back image of the PCB mainboard sent by the line array camera; Performing defect analysis on the front image and the back image respectively to obtain a first analysis result and a second analysis result; Whether the PCB main board is qualified is determined according to the first analysis result and the second analysis result.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the PCB visual inspection method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the PCB visual inspection method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Double-sided AOI detection equipment of circuit board and detection method of double-sided AOI detection equipment
CN121324385A
A double-sided AOI detection device for a circuit board and a detection method thereof
CN121324385B