PCB three-proofing paint coating thickness detection method and device, and storage medium
By analyzing the grayscale difference between the PCB conformal coating image and a standard image, a grayscale difference histogram is generated and the coating thickness is analyzed. This solves the problem of the inability to detect coating thickness in existing technologies and improves detection efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GD MIDEA AIR CONDITIONING EQUIP CO LTD
- Filing Date
- 2022-12-29
- Publication Date
- 2026-07-03
AI Technical Summary
Existing conformal coating inspection technologies can only detect the coated area, but cannot detect the coating thickness, resulting in low inspection efficiency.
The first spatial grayscale histogram of the conformal coating image of the PCB to be tested is determined, and pixel difference is performed between it and the second spatial grayscale histogram of the standard PCB conformal coating image to generate a grayscale difference image. The coating thickness is analyzed using the grayscale difference histogram, abnormal pixel differences are removed, and frequency information is statistically analyzed to determine the coating thickness.
This technology enables the detection of conformal coating thickness, thereby improving the efficiency of PCB conformal coating quality inspection.
Smart Images

Figure CN116007512B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of conformal coating inspection, and more particularly to a method, apparatus and storage medium for detecting the thickness of PCB conformal coating. Background Technology
[0002] Currently, conformal coating inspection technology uses ultraviolet (UV) imaging. This technology leverages the principle that conformal coatings mixed with phosphors fluoresce under UV light to visually inspect PCB (Printed Circuit Board) conformal coatings. Specifically, a UV light source is used to illuminate a lightbox, and an industrial camera captures images of the PCB. The captured images undergo color channel segmentation and binarization, and are then compared with images of a standard-coated PCB to determine the quality of the conformal coating, identifying areas with excessive or insufficient coating.
[0003] However, current conformal coating inspection technology can only detect the conformal coating area on PCBs, but cannot detect the coating thickness, resulting in low efficiency in the current PCB conformal coating quality inspection. Summary of the Invention
[0004] This application aims to at least solve one of the technical problems existing in the related art. To this end, this application proposes a method for detecting the thickness of PCB conformal coating, which can realize the detection of the thickness of PCB conformal coating, thereby improving the detection efficiency of PCB conformal coating quality.
[0005] This application also proposes a PCB conformal coating thickness detection device, electronic equipment, storage medium, and computer program product.
[0006] The PCB conformal coating thickness detection method according to the first aspect of this application includes:
[0007] Determine the first spatial grayscale histogram of the conformal coating image of the PCB to be inspected;
[0008] Pixel difference is performed based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image; the standard PCB conformal coating image is an image of a PCB uniformly coated with a preset thickness of conformal coating.
[0009] A first gray-level difference histogram is determined based on the first spatial gray-level difference image;
[0010] The thickness of the conformal coating of the PCB to be detected is determined based on the first gray-level difference histogram.
[0011] According to the PCB conformal coating thickness detection method of this application, a first spatial grayscale difference image is obtained by performing pixel difference between the first spatial grayscale histogram of the PCB conformal coating image to be detected and the second spatial grayscale histogram of the standard PCB conformal coating image. The first grayscale difference histogram is then determined from the first spatial grayscale difference image, so that the conformal coating thickness detection result can be obtained by analyzing the first grayscale difference histogram, thereby realizing the detection of coating thickness and improving the detection efficiency of PCB conformal coating quality.
[0012] According to one embodiment of this application, determining the first gray-level difference histogram based on the first spatial gray-level difference image includes:
[0013] Data cleaning is performed on the abnormal pixel differences in the first spatial grayscale difference image, and the remaining pixel differences in the first spatial grayscale difference image after cleaning are determined as the target pixel differences.
[0014] Frequency statistics are performed on the target pixel differences, and a first gray-level difference histogram is generated based on the frequency statistics results.
[0015] According to one embodiment of this application, the data cleaning of abnormal pixel differences in the first spatial grayscale difference image includes:
[0016] Determine the average value of all pixel differences in the first spatial grayscale difference image and the standard deviation of all pixel differences in the first spatial grayscale difference image;
[0017] Based on the three sigma criterion, combined with the average value of all pixel differences in the first spatial gray-level difference image, the standard deviation of all pixel differences in the first spatial gray-level difference image, and all pixel differences in the first spatial gray-level difference image, abnormal pixel differences are identified from all pixel differences in the first spatial gray-level difference image.
[0018] Data cleaning is performed on the abnormal pixel differences.
[0019] According to one embodiment of this application, the PCB conformal coating thickness detection method further includes:
[0020] Pixel difference is performed between the third space grayscale histogram of the PCB image without conformal coating and the second space grayscale histogram of the standard PCB conformal coating image to obtain the second space grayscale difference image.
[0021] A second gray-level difference histogram is determined based on the second spatial gray-level difference image;
[0022] The average frequency of all pixel differences in the second gray-level difference histogram is determined as the thickness detection threshold.
[0023] According to one embodiment of this application, determining the conformal coating thickness detection result of the conformal coating image of the PCB to be detected based on the first gray-level difference histogram includes:
[0024] The thickness detection range is determined based on the thickness detection threshold.
[0025] The maximum frequency value of the target pixel difference in the first gray-level difference histogram is compared with the thickness detection range to obtain a comparison result.
[0026] Based on the comparison results, the conformal coating thickness detection result of the PCB conformal coating image to be detected is determined.
[0027] According to one embodiment of this application, determining the first spatial grayscale histogram of the conformal coating image of the PCB to be detected includes:
[0028] Identify the area to be inspected in the conformal coating image of the PCB to be inspected;
[0029] Based on the pixel information of the area to be detected, a first spatial grayscale histogram of the conformal coating image of the PCB to be detected is determined.
[0030] According to one embodiment of this application, determining the region to be detected in the conformal coating image of the PCB to be inspected includes:
[0031] The marker points in the conformal coating image of the PCB to be inspected are determined; the marker points are determined based on the markings on the PCB corresponding to the conformal coating image of the PCB to be inspected.
[0032] The area to be detected in the conformal coating image of the PCB to be detected is determined based on the marked points.
[0033] The PCB conformal coating thickness detection device according to the second aspect of this application includes:
[0034] The first determining module is used to determine the first spatial grayscale histogram of the conformal coating image of the PCB to be inspected.
[0035] The difference module is used to perform pixel difference based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image; the standard PCB conformal coating image is an image of a PCB uniformly coated with a preset thickness of conformal coating.
[0036] The second determining module is used to determine a first gray-level difference histogram based on the first spatial gray-level difference image;
[0037] The third determining module is used to determine the conformal coating thickness detection result of the conformal coating image of the PCB to be detected based on the first gray-level difference histogram.
[0038] An electronic device according to a third aspect of this application includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the PCB conformal coating thickness detection method as described above.
[0039] A computer-readable storage medium according to a fourth aspect of this application stores a computer program thereon, which, when executed by a processor, implements the PCB conformal coating thickness detection method as described above.
[0040] A computer program product according to a fifth aspect of this application includes a computer program that, when executed by a processor, implements the PCB conformal coating thickness detection method described above.
[0041] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects:
[0042] By performing pixel difference analysis between the first spatial grayscale histogram of the PCB conformal coating image to be tested and the second spatial grayscale histogram of the standard PCB conformal coating image, a first spatial grayscale difference image is obtained. The first grayscale difference histogram is then determined from the first spatial grayscale difference image. This allows for analysis based on the first grayscale difference histogram to obtain the conformal coating thickness detection result, thereby improving the efficiency of PCB conformal coating quality detection.
[0043] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is one of the flowcharts illustrating the PCB conformal coating thickness detection method provided in this application embodiment;
[0046] Figure 2 This is a schematic diagram of a high-contrast lighting scheme for the PCB conformal coating thickness detection method provided in this application embodiment;
[0047] Figure 3 This is the second flowchart illustrating the PCB conformal coating thickness detection method provided in this application embodiment;
[0048] Figure 4 This is the third flowchart illustrating the PCB conformal coating thickness detection method provided in this application embodiment;
[0049] Figure 5 This is the fourth flowchart of the PCB conformal coating thickness detection method provided in the embodiments of this application;
[0050] Figure 6 This is the fifth flowchart illustrating the PCB conformal coating thickness detection method provided in this application embodiment;
[0051] Figure 7 This is the sixth flowchart of the PCB conformal coating thickness detection method provided in the embodiments of this application;
[0052] Figure 8 This is a schematic diagram of the PCB conformal coating thickness detection device provided in the embodiments of this application;
[0053] Figure 9 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0054] The embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but should not be used to limit the scope of this application.
[0055] In the description of the embodiments of this application, it should be noted that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application. In addition, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0056] In the description of the embodiments of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application based on the specific circumstances.
[0057] In the embodiments of this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0058] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0059] This application provides a method for detecting the thickness of PCB conformal coating; Figure 1 This is one of the flowcharts illustrating the PCB conformal coating thickness detection method provided in this application embodiment, such as... Figure 1 As shown, the method for detecting the thickness of the conformal coating on a PCB includes:
[0060] Step 110: Determine the first spatial grayscale histogram of the conformal coating image of the PCB to be inspected.
[0061] It should be noted that the PCB conformal coating thickness detection method provided in this application embodiment can be executed by a computer device, such as a mobile phone, tablet computer, laptop computer, handheld computer, vehicle electronic device, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc.
[0062] Among them, the conformal coating image of the PCB to be inspected can be an image of a PCB coated with conformal coating that is being inspected online.
[0063] A spatial grayscale histogram is constructed based on the pixel values and coordinates of each pixel in an image.
[0064] Understandably, this application may include a high-contrast lighting scheme that allows for the acquisition of PCB conformal coating images under this lighting scheme.
[0065] Reference Figure 2 , Figure 2 This is a schematic diagram of a high-contrast lighting scheme for the PCB conformal coating thickness detection method provided in this application embodiment, as shown below. Figure 2 As shown, the high-contrast lighting scheme of this application includes a camera 1, a PCB 2, and an ultraviolet bar light source 3. The camera 1 is used to capture images of the conformal coating on the PCB.
[0066] In this application, two ultraviolet strip light sources are installed above the two sides of the PCB, at a height slightly higher than the top surface of the PCB, for example, 10 cm above the top surface of the PCB.
[0067] Two ultraviolet strip light sources emit light in parallel opposite directions, with the light-emitting surfaces perpendicular to the PCB surface;
[0068] This through-beam parallel low-angle lighting method allows areas coated with fluorescent conformal coating to exhibit normal fluorescence, thus creating bright areas, while areas without conformal coating form a dark field. This makes it easier for image processing algorithms to distinguish coated areas and determine coating thickness. This lighting scheme has a positive impact on the pixel distribution and image processing of the standard image, a core technical point. Under this lighting scheme, the dark field image formed by the uncoated PCB area is beneficial for pixel statistics and data cleaning of the grayscale histogram, while the bright surface formed by the coated area allows for better threshold setting of the standard grayscale image, distinguishing whether the thickness meets the standard.
[0069] Therefore, this application can acquire the image of the conformal coating of the PCB to be tested under a high-contrast lighting scheme, and construct a spatial grayscale histogram based on the pixel value and coordinates of each pixel in the image, and determine the constructed spatial grayscale histogram as the first spatial grayscale histogram.
[0070] Step 120: Perform pixel difference based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image.
[0071] The second spatial grayscale histogram in this application is determined based on a standard PCB conformal coating image.
[0072] Specifically, a second spatial grayscale histogram can be constructed based on the pixel values and coordinates of each pixel in the standard PCB conformal coating image.
[0073] A standard PCB conformal coating image is an image of a PCB with a uniform conformal coating of a preset thickness.
[0074] The preset thickness is a value that can be set and adjusted according to actual needs.
[0075] Pixel difference based on the first spatial gray-level histogram and the second spatial gray-level histogram can be achieved by subtracting the first spatial gray-level histogram from the second spatial gray-level histogram, and the resulting spatial gray-level difference image is determined as the first spatial gray-level difference image.
[0076] The difference between the grayscale histogram of the first space and the grayscale histogram of the second space can be calculated using the following formula:
[0077]
[0078] Where (x,y) represents the image coordinates, A represents the region to be detected, and region A is a set of several smaller regions A1, A2, etc., and V' and V are the pixel values of the PCB conformal coating image to be detected and the standard PCB conformal coating image, respectively.
[0079] Step 130: Determine the first gray-level difference histogram based on the first spatial gray-level difference image.
[0080] In this application, the pixel differences in the first spatial gray-level difference image can be cleaned to remove pixel differences with large fluctuations, and the frequency of the remaining pixel differences can be statistically analyzed. A gray-level difference histogram can be constructed based on the statistical frequency information and determined as the first gray-level difference histogram.
[0081] Step 140: Determine the conformal coating thickness detection result of the conformal coating image of the PCB to be detected based on the first gray-level difference histogram.
[0082] This application can compare and analyze the frequency information of the pixel difference in the first gray-level difference histogram with the thickness detection threshold to determine the thickness detection result of the conformal coating of the PCB to be detected.
[0083] The thickness detection threshold can be the average frequency of pixel differences determined by comparing a standard PCB conformal coating image with an uncoated PCB image, or it can be the frequency of pixel differences obtained by summarizing or predicting based on human experience.
[0084] The results of conformal coating thickness testing can be classified as too thick, too thin, or normal.
[0085] According to the PCB conformal coating thickness detection method of this application, a first spatial grayscale difference image is obtained by performing pixel difference between the first spatial grayscale histogram of the PCB conformal coating image to be detected and the second spatial grayscale histogram of the standard PCB conformal coating image. The first grayscale difference histogram is then determined from the first spatial grayscale difference image, so that the conformal coating thickness detection result can be obtained by analyzing the first grayscale difference histogram, thereby realizing the detection of coating thickness and improving the detection efficiency of PCB conformal coating quality.
[0086] Figure 3 This is the second flowchart illustrating the PCB conformal coating thickness detection method provided in this application embodiment. Figure 3 As shown, step 110 above includes:
[0087] Step 111: Determine the area to be inspected in the conformal coating image of the PCB to be inspected;
[0088] This application allows for the pre-setting of markers on the PCB for subsequent area detection. The content of the markers is not specifically limited in this application, but the number of markers is greater than or equal to two. Each marker can form one or more areas to be detected on the PCB.
[0089] Since there are markings on the PCB in this application, the markings will also be present in the conformal coating image of the PCB to be inspected.
[0090] Based on this, the area to be detected in the conformal coating image of the PCB to be inspected can be identified by marking and recognizing the image, and then the area to be inspected in the conformal coating image of the PCB to be inspected can be determined according to the recognition results.
[0091] Step 112: Determine the first spatial grayscale histogram of the conformal coating image of the PCB to be detected based on the pixel information of the area to be detected.
[0092] After obtaining the region to be detected, pixel information such as the coordinates and pixel values of each pixel in the region can be obtained, and a spatial grayscale histogram can be constructed based on the pixel values and coordinates of each pixel. The constructed spatial grayscale histogram is then determined as the first spatial grayscale histogram.
[0093] Based on the above embodiments, step 111 includes:
[0094] Step 1111: Determine the marker points in the conformal coating image of the PCB to be inspected;
[0095] In this application, the markers in the conformal coating image of the PCB to be detected can be located using a marker point localization algorithm, and the points corresponding to each marker are determined as marker points in the conformal coating image of the PCB to be detected.
[0096] The marker localization algorithm in this application can be an artificial intelligence-based image recognition algorithm or other algorithms capable of marker localization; no specific limitations are imposed in this application.
[0097] Step 1112: Determine the area to be detected in the conformal coating image of the PCB to be inspected based on the marked points.
[0098] Understandably, in this application, the coordinate information of the marker points can be correlated with one or more areas of the PCB to be inspected.
[0099] Therefore, in this application, the coordinate information of each marker point can be obtained, and the associated detection area in the conformal coating image of the PCB to be detected can be found based on the coordinate information of the marker points.
[0100] It should be noted that most current conformal coating inspection technologies use PCB image matching for localization. However, the appearance of uncoated and coated PCB images differs significantly, resulting in a low matching success rate and unstable algorithm recognition in practical applications. Furthermore, region localization is a crucial step in image preprocessing. This embodiment can locate the PCB region to be inspected from different images, preparing for subsequent thickness detection. This enables the detection of coating thickness, and the conformal coating quality inspection result of the PCB conformal coating image can be determined based on the conformal coating thickness detection result, thereby improving the efficiency of PCB conformal coating quality inspection.
[0101] Figure 4 This is the third flowchart illustrating the PCB conformal coating thickness detection method provided in this application embodiment, as shown below. Figure 4 As shown, step 130 above includes:
[0102] Step 131: Perform data cleaning on the abnormal pixel differences in the first spatial grayscale difference image, and determine the remaining pixel differences in the first spatial grayscale difference image after cleaning the abnormal pixel differences as the target pixel differences.
[0103] In this application, the pixel differences in the first spatial grayscale difference image can be extracted, and it can be identified whether there are abnormal pixel differences in each pixel difference. If there are abnormal pixel differences, the abnormal pixel differences are cleaned, and after the abnormal pixel differences are cleaned, the remaining pixel differences are determined as the target pixel differences.
[0104] Step 132: Perform frequency statistics on the target pixel differences and generate the first gray-level difference histogram based on the frequency statistics results.
[0105] Furthermore, frequency statistics are performed on each pixel difference in the target pixel difference to determine the number of times each pixel difference occurs, thus obtaining the frequency statistics results.
[0106] Furthermore, a gray-level difference histogram can be constructed based on the pixel differences and corresponding frequencies in the frequency statistics results, and the constructed gray-level difference histogram can be determined as the first gray-level difference histogram.
[0107] Based on the above embodiments, step 131 includes:
[0108] Step 1311: Determine the average value of all pixel differences in the first spatial grayscale difference image and the standard deviation of all pixel differences in the first spatial grayscale difference image;
[0109] Step 1312: Based on the three sigma criterion, combine the average value of all pixel differences in the first spatial gray-level difference image, the standard deviation of all pixel differences in the first spatial gray-level difference image, and all pixel differences in the first spatial gray-level difference image to determine abnormal pixel differences from all pixel differences in the first spatial gray-level difference image.
[0110] Step 1313: Perform data cleaning on the abnormal pixel differences.
[0111] The Three Sigma criterion, also known as the Raida criterion, assumes that a set of test data contains only random errors. It calculates and processes the data to obtain the standard deviation, determines an interval with a certain probability, and considers any error exceeding this interval as gross error rather than random error, and data containing such errors should be discarded.
[0112] In a normal distribution, σ represents the standard deviation and μ represents the mean. x = μ is the axis of symmetry of the graph.
[0113] The 3σ principle is:
[0114] The probability that the value is distributed in (μ-σ,μ+σ) is 0.6826;
[0115] The probability that the value is distributed in (μ-2σ,μ+2σ) is 0.9545;
[0116] The probability that the value is distributed in (μ-3σ,μ+3σ) is 0.9973.
[0117] Therefore, in this application, the average value of all pixel differences in the first spatial grayscale difference image and the standard deviation of all pixel differences in the first spatial grayscale difference image can be calculated, and it can be determined whether each pixel difference is between (μ-3σ, μ+3σ). If it is, the pixel difference is retained; otherwise, the pixel difference is determined as an abnormal pixel difference and cleaned.
[0118] This embodiment can perform abnormal pixel difference cleaning on the first spatial gray-level difference image to avoid interference from abnormal data, making the first gray-level difference histogram generated based on the frequency statistics of the remaining pixel differences in the first spatial gray-level difference image more accurate, and thus making the conformal coating quality detection result determined based on the first gray-level difference histogram more accurate.
[0119] Figure 5 This is the fourth flowchart illustrating the PCB conformal coating thickness detection method provided in this application embodiment, as follows: Figure 5 As shown, the PCB conformal coating thickness detection method further includes:
[0120] Step 510: Perform pixel difference between the third space grayscale histogram of the PCB image without conformal coating and the second space grayscale histogram of the standard PCB conformal coating image to obtain the second space grayscale difference image.
[0121] In this application, an image of a PCB without conformal coating can be obtained under a high-contrast lighting scheme, and a spatial grayscale histogram can be constructed based on the pixel value and coordinates of each pixel in the image. The constructed spatial grayscale histogram is then determined as the third spatial grayscale histogram.
[0122] Furthermore, the difference between the third spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image can be calculated, and the resulting spatial grayscale difference image can be determined as the second spatial grayscale difference image. The specific process can refer to the above process of performing pixel difference based on the first and second spatial grayscale histograms to obtain the first spatial grayscale difference image.
[0123] Step 520: Determine the second gray-level difference histogram based on the second spatial gray-level difference image;
[0124] After obtaining the second spatial gray-level difference image, data cleaning can be performed on the second spatial gray-level difference image to remove abnormal pixel differences with large fluctuations, and frequency statistics can be performed on the remaining pixel differences. Based on the statistical frequency information, a gray-level difference histogram can be constructed and determined as the second gray-level difference histogram.
[0125] Step 530: The average frequency of all pixel differences in the second gray-scale difference histogram is determined as the thickness detection threshold.
[0126] After obtaining the second gray-level difference histogram, the average frequency of occurrence of each pixel difference in the second gray-level difference histogram can be calculated, and the average frequency of occurrence can be determined as the thickness detection threshold.
[0127] For example, if the frequency of occurrence of pixel differences of 10, 15, 20, and 25 in the second gray-scale difference histogram is 10, 15, 15, and 20 respectively, then the thickness detection threshold is 15.
[0128] This embodiment can determine the thickness detection threshold based on the spatial grayscale histogram of the PCB image without conformal coating and the spatial grayscale histogram of the standard PCB conformal coating image. This allows the conformal coating thickness to be detected based on the first grayscale difference histogram and the thickness detection threshold, thereby improving the detection efficiency of PCB conformal coating quality.
[0129] Figure 6 This is the fifth flowchart illustrating the PCB conformal coating thickness detection method provided in this application embodiment, as shown below. Figure 6 As shown, step 140 above includes:
[0130] Step 141: Determine the thickness detection range based on the thickness detection threshold;
[0131] After obtaining the thickness detection threshold, this application can form a thickness detection range based on the thickness detection threshold and a preset floating value.
[0132] The preset floating value can be set and adjusted according to both process and quality requirements.
[0133] For example, if the thickness detection threshold is 15 and the preset floating value is ±2 or ±3, then the thickness detection range can be 13-17 or 12-18.
[0134] Understandably, this application can also determine the thickness detection range based on multiple standard PCB conformal coating images with different coating thicknesses.
[0135] Specifically, the average frequency of pixel differences between the first and second standard PCB conformal coating images can be determined through the above steps, as well as the average frequency of pixel differences between the third and second standard PCB conformal coating images. These two average values are then used as the upper and lower limits for determining the thickness detection range, respectively.
[0136] Step 142: Compare the maximum frequency of the target pixel difference in the first gray-level difference histogram with the thickness detection range to obtain the comparison result;
[0137] After obtaining the first gray-level difference histogram and the thickness detection range, this application can extract the maximum frequency value among the frequencies corresponding to the differences of each target pixel in the first gray-level difference histogram.
[0138] Furthermore, the maximum frequency value is compared with the thickness detection range to determine the relationship between the maximum frequency value and the thickness detection range, and to obtain the comparison results of the maximum frequency value being within the thickness detection range, the maximum frequency value being less than the minimum value of the thickness detection range, or the maximum frequency value being greater than the maximum value of the thickness detection range.
[0139] Step 143: Based on the comparison results, determine the conformal coating thickness detection result of the conformal coating image of the PCB to be inspected.
[0140] Furthermore, if the comparison result shows that the maximum frequency is within the thickness detection range, then the thickness detection result of the conformal coating of the PCB to be detected is determined to be normal.
[0141] If the comparison result shows that the maximum frequency is less than the minimum value of the thickness detection range, then the thickness detection result of the conformal coating of the PCB to be detected is determined to be too thin.
[0142] If the comparison result shows that the maximum frequency is greater than the maximum value of the thickness detection range, then the thickness detection result of the conformal coating of the PCB to be detected is determined to be too thick.
[0143] This embodiment can compare the maximum frequency of the target pixel difference in the first gray-level difference histogram with the thickness detection range, and accurately determine the thickness detection result of the conformal coating of the PCB conformal coating image to be detected based on the comparison result, thereby realizing the detection of coating thickness and improving the detection efficiency of PCB conformal coating quality.
[0144] Understandably, after obtaining the quality test results of the conformal coating, the process parameters of the conformal coating can be standardized and tested. Then, a standard thickness analyzer can be used to obtain the correspondence between the thickness and the differential grayscale image. The corresponding threshold can be set to accurately calculate the actual thickness.
[0145] The process parameters may include the components and proportions of the conformal coating.
[0146] Figure 7 This is the sixth flowchart of the PCB conformal coating thickness detection method provided in this application embodiment, as shown below. Figure 7 As shown, in this application, the spatial grayscale histogram of the uncoated PCB image and the spatial grayscale histogram of the standard coated PCB image can be determined separately, and pixel difference can be performed on the two spatial grayscale histograms to obtain a spatial grayscale difference image.
[0147] Furthermore, the aforementioned spatial gray-level difference images are subjected to data cleaning and analysis, and a standard difference gray-level histogram is constructed based on the data cleaning and analysis results.
[0148] Furthermore, a threshold is set based on the frequency information of pixel differences in the standard difference grayscale histogram.
[0149] Furthermore, the spatial grayscale histogram of the PCB image detected online can be obtained, and pixel difference can be performed between the spatial grayscale histogram of the PCB image detected online and the spatial grayscale histogram of the standard coated PCB image to obtain a spatial grayscale difference image. Data cleaning and analysis are performed on the spatial grayscale difference image, and a grayscale difference histogram is constructed based on the data cleaning and analysis results.
[0150] Furthermore, the maximum frequency of pixel differences in the grayscale difference histogram is compared and analyzed with the threshold set in the above steps to obtain the detection result of the conformal coating thickness of the PCB image detected online.
[0151] Figure 8 This is a schematic diagram of the PCB conformal coating thickness detection device provided in the embodiments of this application, as shown below. Figure 8 As shown, the PCB conformal coating thickness detection device includes:
[0152] The first determining module 810 is used to determine the first spatial grayscale histogram of the conformal coating image of the PCB to be inspected.
[0153] The difference module 820 is used to perform pixel difference based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image; the standard PCB conformal coating image is an image of a PCB uniformly coated with a preset thickness of conformal coating.
[0154] The second determining module 830 is used to determine a first gray-level difference histogram based on the first spatial gray-level difference image;
[0155] The third determining module 840 is used to determine the conformal coating thickness detection result of the conformal coating image of the PCB to be detected based on the first gray-level difference histogram.
[0156] According to the PCB conformal coating thickness detection device of this application embodiment, a first spatial grayscale difference image is obtained by performing pixel difference between the first spatial grayscale histogram of the PCB conformal coating image to be detected and the second spatial grayscale histogram of the standard PCB conformal coating image, and the first grayscale difference histogram is determined by the first spatial grayscale difference image. The conformal coating thickness detection result can be obtained by analyzing the first grayscale difference histogram, thereby realizing the detection of coating thickness and improving the detection efficiency of PCB conformal coating quality.
[0157] Based on any of the above embodiments, the first determining module 810 is specifically used for:
[0158] Identify the area to be inspected in the conformal coating image of the PCB to be inspected;
[0159] Based on the pixel information of the area to be detected, a first spatial grayscale histogram of the conformal coating image of the PCB to be detected is determined.
[0160] Based on any of the above embodiments, the first determining module 810 includes a first determining unit, the first determining unit being used for:
[0161] The marker points in the conformal coating image of the PCB to be inspected are determined; the marker points are determined based on the markings on the PCB corresponding to the conformal coating image of the PCB to be inspected.
[0162] The area to be detected in the conformal coating image of the PCB to be detected is determined based on the marked points.
[0163] Based on any of the above embodiments, the second determining module 830 is specifically used for:
[0164] Data cleaning is performed on the abnormal pixel differences in the first spatial grayscale difference image, and the remaining pixel differences in the first spatial grayscale difference image after cleaning are determined as the target pixel differences.
[0165] Frequency statistics are performed on the target pixel differences to generate a first gray-level difference histogram based on the frequency statistics results.
[0166] Based on any of the above embodiments, the second determining module 830 includes a cleaning unit, which is specifically used for:
[0167] Determine the average value of all pixel differences in the first spatial grayscale difference image and the standard deviation of all pixel differences in the first spatial grayscale difference image;
[0168] Based on the three sigma criterion, combined with the average value of all pixel differences in the first spatial gray-level difference image, the standard deviation of all pixel differences in the first spatial gray-level difference image, and all pixel differences in the first spatial gray-level difference image, abnormal pixel differences are identified from all pixel differences in the first spatial gray-level difference image.
[0169] Data cleaning is performed on the abnormal pixel differences.
[0170] Based on any of the above embodiments, the PCB conformal coating thickness detection device further includes a second determining unit, the second determining unit being used for:
[0171] Pixel difference is performed between the third space grayscale histogram of the PCB image without conformal coating and the second space grayscale histogram of the standard PCB conformal coating image to obtain the second space grayscale difference image.
[0172] A second gray-level difference histogram is determined based on the second spatial gray-level difference image;
[0173] The average frequency of all pixel differences in the second gray-level difference histogram is determined as the thickness detection threshold.
[0174] Based on any of the above embodiments, the third determining module 840 is specifically used for:
[0175] The thickness detection range is determined based on the thickness detection threshold.
[0176] The maximum frequency value of the target pixel difference in the first gray-level difference histogram is compared with the thickness detection range to obtain a comparison result.
[0177] Based on the comparison results, the conformal coating thickness detection result of the PCB conformal coating image to be detected is determined.
[0178] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930, and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute the following method: determining a first spatial grayscale histogram of the conformal coating image of the PCB to be inspected;
[0179] Pixel difference is performed based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image; the standard PCB conformal coating image is an image of a PCB uniformly coated with a preset thickness of conformal coating.
[0180] A first gray-level difference histogram is determined based on the first spatial gray-level difference image;
[0181] The thickness of the conformal coating of the PCB to be detected is determined based on the first gray-level difference histogram.
[0182] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0183] On the other hand, this application discloses a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided in the above-described method embodiments, such as: determining a first spatial grayscale histogram of a conformal coating image of a PCB to be detected.
[0184] Pixel difference is performed based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image; the standard PCB conformal coating image is an image of a PCB uniformly coated with a preset thickness of conformal coating.
[0185] A first gray-level difference histogram is determined based on the first spatial gray-level difference image;
[0186] The thickness of the conformal coating of the PCB to be detected is determined based on the first gray-level difference histogram.
[0187] In another aspect, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the methods provided in the above embodiments, such as: determining a first spatial grayscale histogram of a conformal coating image of a PCB to be detected;
[0188] Pixel difference is performed based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image; the standard PCB conformal coating image is an image of a PCB uniformly coated with a preset thickness of conformal coating.
[0189] A first gray-level difference histogram is determined based on the first spatial gray-level difference image;
[0190] The thickness of the conformal coating of the PCB to be detected is determined based on the first gray-level difference histogram.
[0191] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0192] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0193] Finally, it should be noted that the above embodiments are only used to illustrate this application and are not intended to limit this application. Although this application has been described in detail with reference to the embodiments, those skilled in the art should understand that various combinations, modifications, or equivalent substitutions of the technical solutions of this application do not depart from the spirit and scope of the technical solutions of this application and should be covered within the scope of the claims of this application.
Claims
1. A PCB three-proofing paint coating thickness detection method, characterized in that, include: Determine the first spatial grayscale histogram of the conformal coating image of the PCB to be inspected; Pixel difference is performed based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image; the standard PCB conformal coating image is an image of a PCB uniformly coated with a preset thickness of conformal coating. A first gray-level difference histogram is determined based on the first spatial gray-level difference image; The thickness detection result of the conformal coating of the PCB to be detected is determined based on the first gray-level difference histogram. Pixel difference is performed between the third space grayscale histogram of the PCB image without conformal coating and the second space grayscale histogram of the standard PCB conformal coating image to obtain the second space grayscale difference image. A second gray-level difference histogram is determined based on the second spatial gray-level difference image; The average frequency of all pixel differences in the second gray-level difference histogram is determined as the thickness detection threshold.
2. The method for detecting the thickness of PCB conformal coating according to claim 1, characterized in that, Determining the first gray-level difference histogram based on the first spatial gray-level difference image includes: Data cleaning is performed on the abnormal pixel differences in the first spatial grayscale difference image, and the remaining pixel differences in the first spatial grayscale difference image after cleaning are determined as the target pixel differences. Frequency statistics are performed on the target pixel differences, and a first gray-level difference histogram is generated based on the frequency statistics results.
3. The method for detecting the thickness of PCB conformal coating according to claim 2, characterized in that, The step of cleaning abnormal pixel differences in the first spatial grayscale difference image includes: Determine the average value of all pixel differences in the first spatial grayscale difference image and the standard deviation of all pixel differences in the first spatial grayscale difference image; Based on the three sigma criterion, combined with the average value of all pixel differences in the first spatial gray-level difference image, the standard deviation of all pixel differences in the first spatial gray-level difference image, and all pixel differences in the first spatial gray-level difference image, abnormal pixel differences are identified from all pixel differences in the first spatial gray-level difference image. Data cleaning is performed on the abnormal pixel differences.
4. The method for detecting the thickness of PCB conformal coating according to claim 1, characterized in that, The determination of the conformal coating thickness detection result of the conformal coating image of the PCB to be detected based on the first gray-level difference histogram includes: The thickness detection range is determined based on the thickness detection threshold. The maximum frequency value of the target pixel difference in the first gray-level difference histogram is compared with the thickness detection range to obtain a comparison result. Based on the comparison results, the conformal coating thickness detection result of the PCB conformal coating image to be detected is determined.
5. The method for detecting the thickness of PCB conformal coating according to claim 1, characterized in that, The determination of the first spatial grayscale histogram of the conformal coating image of the PCB to be detected includes: Identify the area to be inspected in the conformal coating image of the PCB to be inspected; Based on the pixel information of the area to be detected, a first spatial grayscale histogram of the conformal coating image of the PCB to be detected is determined.
6. The method for detecting the thickness of PCB conformal coating according to claim 5, characterized in that, The process of determining the area to be detected in the conformal coating image of the PCB to be inspected includes: The marker points in the conformal coating image of the PCB to be inspected are determined; the marker points are determined based on the markings on the PCB corresponding to the conformal coating image of the PCB to be inspected. The area to be detected in the conformal coating image of the PCB to be detected is determined based on the marked points.
7. A device for detecting the thickness of PCB conformal coating, characterized in that, include: The first determining module is used to determine the first spatial grayscale histogram of the conformal coating image of the PCB to be inspected. The difference module is used to perform pixel difference based on the first spatial grayscale histogram and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain the first spatial grayscale difference image; the standard PCB conformal coating image is an image of a PCB uniformly coated with a preset thickness of conformal coating. The second determining module is used to determine a first gray-level difference histogram based on the first spatial gray-level difference image; The third determining module is used to determine the conformal coating thickness detection result of the conformal coating image of the PCB to be detected based on the first gray-level difference histogram; The second determining unit is used to perform pixel difference analysis on the third spatial grayscale histogram of the PCB image without conformal coating and the second spatial grayscale histogram of the standard PCB conformal coating image to obtain a second spatial grayscale difference image; and to determine the second grayscale difference histogram based on the second spatial grayscale difference image. The average frequency of all pixel differences in the second gray-level difference histogram is determined as the thickness detection threshold.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the PCB conformal coating thickness detection method as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the PCB conformal coating thickness detection method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the PCB conformal coating thickness detection method as described in any one of claims 1 to 6.