Image processing-based plate spraying effect detection method and system
By extracting feature pixels in the panel coating effect detection and combining radial line and gradient direction traversal, the white reflective outer ring of the pinhole defect area is identified and enhanced, solving the detection problem that traditional algorithms struggle to identify and achieving efficient and accurate coating quality assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DONGGUAN YITAI INTELLIGENT MFG TECH CO LTD
- Filing Date
- 2025-11-13
- Publication Date
- 2026-05-01
AI Technical Summary
Existing image processing algorithms struggle to effectively identify two types of pinhole defects during the coating process, especially in defect areas where the surrounding white reflective rings are not obvious, resulting in low detection accuracy and efficiency.
By extracting feature pixels and combining radial line scanning and gradient direction traversal, the edge and outer ring pixels of the defect area are identified. Morphological processing is then used to connect the outer ring pixels to enhance the integrity of the white reflective outer ring of the defect area. Finally, the coating effect is evaluated by defect probability quantification.
It improves the accuracy and efficiency of pinhole defect detection, adapts to different types of pinhole defects, and supports the optimization of spraying processes.
Smart Images

Figure CN121190465B_ABST
Abstract
Description
Image Processing-Based Method and System for Detecting Sheet Coating Effect Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and system for detecting the coating effect of sheet metal based on image processing. Background Technology
[0002] As a basic material, sheet materials are used in many fields such as construction, furniture, and automobile manufacturing. In order to improve the aesthetics, durability, and functionality of sheet materials, the spraying process has become a key step in the sheet material processing.
[0003] UV varnish spraying is a common process. The viscosity characteristics of UV varnish and the high-speed stirring during mixing can cause micron-sized bubbles to form during spraying, ultimately creating nearly circular pinhole defects in the coating. These defects can impair the appearance, durability, and function of the substrate; therefore, post-spraying defect detection is crucial.
[0004] In recent years, deep learning technology has made significant progress in the field of sheet metal coating effect inspection. Against this backdrop, image processing-based sheet metal coating effect inspection methods have gradually attracted attention. However, existing image processing algorithms still struggle to effectively detect pinhole defects. This is because pinhole defect areas generally fall into two categories: one type has a distinct white reflective ring around it. These pinhole defects have low grayscale values within their internal area and high contrast with the background, making them easy to identify. The other type has a less distinct white reflective ring. While the grayscale values within this type of pinhole defect are low, the lack of a complete white reflective ring makes it difficult to distinguish the edge of the pinhole defect from the sheet metal background, thus affecting the accurate identification of the pinhole defect area. Therefore, effectively identifying pinhole defects has become a crucial requirement in the current field of sheet metal coating quality control. Summary of the Invention
[0005] To address the technical problem of effectively detecting pinhole defects in the above-mentioned panel coating effect inspection, the present invention provides solutions in the following aspects.
[0006] In a first aspect, the present invention provides a method for detecting the coating effect of sheet metal based on image processing; the method includes the following steps:
[0007] A surface image of the board material is acquired and preprocessed to obtain a grayscale image of the board material. The center points of several pinhole defect regions in the grayscale image of the board material are obtained according to preset conditions and recorded as feature pixels. Using any feature pixel as the center point, a preset number of radial lines are set, and pixels on all radial lines are traversed to obtain several edge pixels of the pinhole defect region. Using the adjacent pixels of any edge pixel as a reference point, pixels in the gradient direction of the reference point are traversed until a preset termination condition is met, at which point the traversal stops, and the pixel at the point of termination is recorded as an outer ring pixel. The outer ring pixels corresponding to all edge pixels are obtained one by one, and multiple outer ring pixels are processed using morphology to obtain an outer ring defect region centered on the feature pixel. The defect regions of all feature pixels in the grayscale image of the board material are obtained one by one, and the coating effect of the board material is evaluated based on the total area of the defect regions of all feature pixels.
[0008] This invention first selects the center of the defect region by extracting feature pixels. Next, it locates the edge pixels of the defect region using radial line scanning. Then, it identifies the outer ring pixels by traversing the gradient direction of a reference point, solving the problem that traditional algorithms struggle to effectively identify two types of pinhole defect regions. Then, morphological processing is used to connect several outer ring pixels, enhancing and completing the integrity of the white reflective outer ring of the defect region, adapting to the complex shapes of different pinhole defects. Finally, through defect probability quantification evaluation, it effectively detects intact, broken, and light-colored low-contrast pinhole defects, improving detection accuracy, adaptability, and efficiency, and providing support for optimizing the spraying process.
[0009] Preferably, the preset termination condition includes: the confidence that a pixel in the gradient direction of the reference point belongs to an outer ring pixel is greater than a preset outer ring threshold. The calculation of the confidence includes: calculating the absolute value of the difference between the gray value of the reference point and the gray value of any pixel in its gradient direction, and normalizing it to obtain a first gray value difference; calculating the absolute value of the difference between the gray value of the pixel in the gradient direction of the reference point and its adjacent pixels, and normalizing it to obtain a second gray value difference; calculating the negative exponential function of the ratio of the total number of pixels in the gradient direction of the reference point to a preset maximum allowed traversal number to obtain a distance influence index; and adding the first gray value difference, the second gray value difference, and the distance influence index and averaging them to obtain the confidence.
[0010] This invention combines a confidence formula to locate outer ring pixels. This formula integrates three pieces of information: the grayscale difference between the reference point and the current pixel, the grayscale difference between the current pixel and its neighboring pixels, and a maximum traversal constraint. This accurately quantifies the probability that a pixel along the gradient direction belongs to the outer ring. The grayscale difference term captures the abrupt grayscale changes inside and outside the reflection ring, while the maximum traversal constraint adapts to the narrowness of the ring region. This ensures accurate identification of outer ring pixels in both intact and broken reflection ring scenarios, providing a reliable basis for subsequent morphological processing to construct a complete defect region and improving the accuracy and robustness of pinhole defect detection.
[0011] Preferably, the step of traversing all pixels along the radial lines to obtain a number of edge pixels in the pinhole defect region includes: calculating the absolute value of the difference between the gray value of the center point and the gray value of any pixel along the radial line, normalizing it, and taking half of it as the third gray value difference; calculating the ratio of the variance of the gray values of all pixels traversed along the radial line of the center point to the maximum value of the variance, and taking half of it as the gray value variance difference; taking the negative exponential function of the sum of the third gray value difference and the gray value variance difference as the first probability component; calculating the absolute value of the difference between the gray values of the pixel along the radial line of the center point and its adjacent pixels, and normalizing it to obtain the second probability component; adding the first probability component and the second probability component and taking the average to obtain the probability; and recording the pixels with a probability greater than a preset edge threshold as edge pixels.
[0012] This invention combines a probabilistic formula to locate edge pixels in defect regions. This formula integrates grayscale differences: the grayscale difference between the target pixel and pixels on the radial line, the grayscale difference between the current pixel on the radial line and its adjacent pixels, and the grayscale variance, to construct an edge pixel probability model. By combining exponential and linear methods, it accurately captures the characteristics of low and uniform grayscale inside pinhole defects and abrupt grayscale changes at the edges, effectively distinguishing real edges from noise, improving the accuracy of edge pixel localization during radial line scanning, and laying a reliable foundation for subsequent defect region construction.
[0013] Preferably, the evaluation of the coating effect of the board based on the total area of the defect region of all feature pixels includes: recording the ratio of the total area of the defect region of all feature pixels to the total area of the grayscale image as the defect probability; when the defect probability is greater than a preset defect threshold, the grayscale image corresponds to the presence of a defect in the coating effect of the board, and the staff is notified to handle it.
[0014] This invention quantifies the coating effect by calculating the ratio of the total area of defect regions of all feature pixels to the total area of the grayscale image. When the probability exceeds a preset defect threshold, the defect is determined to be large, and staff are notified for handling. This achieves automated and quantitative quality inspection, providing a basis for process optimization and quality control, and improving inspection efficiency and reliability.
[0015] Preferably, the step of obtaining several feature pixels in the grayscale image of the board material according to preset conditions includes: constructing a grayscale histogram based on the grayscale values of the pixels in the grayscale image of the board material; obtaining the leftmost peak value of the grayscale histogram, expanding the peak value to the left and right by preset grayscale levels to obtain a feature grayscale interval; and extracting all pixels within the feature grayscale interval and recording them as feature pixels.
[0016] This invention extracts feature pixels by constructing a grayscale histogram and obtaining its leftmost peak value, and then expanding the grayscale feature range based on the leftmost peak value. Utilizing the low grayscale characteristic of the pinhole defect center, the core defect region is accurately located, providing reliable initial positioning for subsequent detection of edges, outer ring pixels, and defect regions centered on these points, thus improving detection targeting and efficiency.
[0017] Preferably, setting a preset number of radial lines includes: setting the interval angle of the radial lines, and generating radial lines along the interval angle direction of the radial lines with the target pixel as the center point.
[0018] Preferably, the interval angle of the radial lines is .
[0019] Preferably, the step of obtaining several feature pixels in the grayscale image of the board material according to preset conditions includes: selecting pixels whose grayscale value is lower than a preset grayscale value and whose grayscale variance of local pixels is greater than a preset variance as feature pixels.
[0020] Preferably, the step of acquiring the surface image of the board and preprocessing it to obtain a grayscale image of the board includes: using adaptive filtering to process the surface image of the board to obtain a denoised board image; and performing grayscale processing on the denoised board image to obtain a grayscale image of the board.
[0021] In a second aspect, the present invention provides a panel coating effect detection system based on image processing. The panel coating effect detection system includes a memory and a processor. The memory stores computer program instructions, which, when executed by the processor, implement the panel coating effect detection method based on image processing of the first aspect of the present invention.
[0022] By adopting the above technical solution, the image processing-based plate coating effect detection method of the first aspect of the present invention is generated into a computer program and stored in a memory so that it can be loaded and executed by a processor, thereby creating a terminal device based on the memory and processor for convenient use.
[0023] The beneficial effects of this invention are as follows: First, it selects the center of the defect region by extracting feature pixels. Second, it locates the edge pixels of the defect region by combining radial line scanning and probability formulas. Next, it identifies the outer ring pixels by combining the gradient direction of the reference point, solving the problem that traditional algorithms are unable to effectively identify two types of pinhole defect regions. Then, it uses morphological processing to connect several outer ring pixels, enhancing and completing the integrity of the white reflective outer ring of the defect region, adapting to the complex shapes of different pinhole defects. Finally, through defect probability quantification evaluation, it effectively detects intact, broken, and light-colored low-contrast pinhole defects, improving detection accuracy, adaptability, and efficiency, and providing support for the optimization of the spraying process. Attached Figure Description
[0024] Figure 1 is a flowchart of the plate spraying effect detection method based on image processing provided in an embodiment of the present invention;
[0025] Figure 2 is a schematic diagram of the grayscale image of the plate material provided in the embodiment of the present invention;
[0026] Figure 3 is a structural block diagram of the plate coating effect detection system based on image processing provided in an embodiment of the present invention.
[0027] In the image: 1. White reflective ring-shaped defect area; 2. White reflective broken ring-shaped defect area; 3. Light-colored defect area. Detailed Implementation
[0028] The first aspect of this invention provides a method for detecting the coating effect of sheet metal based on image processing, as shown in Figure 1. The method includes steps S100-S500:
[0029] Step S100: Acquire a surface image of the board and preprocess it to obtain a grayscale image of the board.
[0030] It should be noted that surface images of the board material can be affected by various factors, such as uneven lighting, noise, and blurring, all of which can impact subsequent analysis and processing. Therefore, after acquiring surface images of the board material, preprocessing is necessary to improve image quality and ensure that subsequent steps can be performed more accurately.
[0031] Specifically, first, the surface of the finished board after UV curing is photographed using a camera; second, noise in the surface image of the board is removed by adaptive filtering, and edge sharpening technology is used to enhance the edge details in the surface image of the board, the two working together to improve image quality; then, the brightness distribution is adjusted and the local contrast is improved by adaptive histogram equalization, making the contrast difference between different areas more significant; finally, the processed image is converted into a grayscale image to reduce the amount of subsequent processing.
[0032] At this point, the grayscale image of the board material has been obtained.
[0033] Step S200: Obtain the center points of several pinhole defect areas in the grayscale image of the board according to preset conditions, and record them as feature pixels.
[0034] It should be noted that pixels belonging to pinhole defect areas are generally of two types. As shown in Figure 2, which is a schematic diagram of the grayscale image of the board, there are two main types of defect areas. The first type is a pinhole defect area 1 with a relatively obvious white reflective ring around it. The grayscale value of the internal area of this type of pinhole defect is low, and the contrast with the background is high. The second type is a pinhole defect area 2 with a less obvious white reflective broken ring around it. The grayscale value of the internal area of this type of pinhole defect is low, but due to the lack of a complete white reflective ring area, the edge is blurred and the separation from the board background is blurred, affecting accurate identification.
[0035] In addition, some pinhole defect areas are relatively shallow and have little contrast with the background, such as the light-colored defect area 3 in Figure 2. The pixels in this type of area have the characteristics of small gray values in the middle pixels and large gray values in the edge direction pixels, and they need to be included in the processing scope.
[0036] Specifically, the feature pixel extraction method is as follows: First, a grayscale histogram is constructed based on the grayscale values of the pixels in the grayscale image of the board material; then, the leftmost peak of the grayscale histogram is selected, and the peak is expanded to the left and right by a preset grayscale level to obtain the feature grayscale interval; finally, all pixels within the feature grayscale interval are extracted and recorded as feature pixels. The construction of the grayscale histogram is existing technology and will not be elaborated on here.
[0037] For example, select 30 gray values before and after the peak, and use all pixels within the feature interval as feature pixels.
[0038] Preferably, pixels with grayscale values lower than a preset grayscale value and grayscale variances of local pixels greater than a preset variance can also be selected as feature pixels. The preset grayscale value can be set to 100, and the preset variance can be set to 50. Both the preset grayscale value and the preset variance can be set according to requirements.
[0039] At this point, several feature pixels in the grayscale image have been obtained.
[0040] Step S300: Using any feature pixel as the center point, set a preset number of radial lines, and traverse all the pixels on the radial lines to obtain a number of edge pixels in the pinhole defect area.
[0041] It should be noted that feature pixels with low grayscale values have already been acquired in step 200. These pixels are usually located at the center of the defect area. Combining the features mentioned above: the white reflective ring defect area 1 has a low grayscale value and a high contrast with the background, and has a complete white reflective ring area; the white reflective broken ring defect area 2 has a low grayscale value and lacks the characteristics of a complete white reflective ring area. Therefore, these feature pixels can be scanned one by one.
[0042] Specifically, firstly, select the first [item] in the grayscale image. The nth feature pixel is taken as the target pixel, and the nth feature pixel is taken as the target pixel. The grayscale value of each pixel is denoted as . Then, with the first Using a given pixel as the center point, set a preset number of radial lines. Finally, iterate through all pixels on the radial lines to confirm whether each pixel is an edge pixel.
[0043] The method for identifying any edge pixel is as follows: taking the first edge pixel as an example. Starting from the nth pixel, along the nth pixel... Given a radial line with n pixels, iterate through all pixels along that radial line. When it reaches the nth pixel... Stop when the pixel is reached, then the The nth pixel is an edge pixel. The traversal must end if the following condition is met: the nth pixel... grayscale value of each pixel With the grayscale value of each pixel The differences between them are small, but the first grayscale value of each pixel With the grayscale value of each pixel The differences between them are significant. grayscale value of each pixel With the grayscale value of each pixel The differences between them are large, indicating that the first The first pixel belongs to the interior of the white ring-shaped reflective area and has a relatively large grayscale value, while the second pixel... Each pixel belongs to the interior of the pinhole defect area and has a small grayscale value.
[0044] Based on the above logic, the termination condition for traversal can be calculated by the probability that a pixel belongs to the edge pixel of the defect region, and the probability satisfies the following relationship:
[0045] ;
[0046] in, It is the first The radial line of the nth feature pixel The probability that a pixel belongs to an edge pixel. It is the first The grayscale value of each feature pixel , They are the first The radial line of the nth feature pixel The pixel, the The grayscale value of each pixel It represents the maximum difference in grayscale values between pixels in the grayscale image of the board material. , They are the first The variance of the grayscale values of all pixels traversed along the radial line of each feature pixel, and the maximum value of the variance. It is a natural exponential function. It is the absolute value symbol.
[0047] In this formula, when the first... grayscale value of each pixel With the grayscale value of each pixel Normalized differences between Smaller, but the first grayscale value of each pixel With the grayscale value of each pixel Normalized differences between When it is large, and the first From the pixel to the The normalized variance of the grayscale values of the pixels traversed along the corresponding radial line between pixels. When smaller, It is the first on the radial line of the target pixel. The greater the probability that a pixel belongs to an edge pixel.
[0048] It should be noted that the preset edge threshold can be set to 0.8, or it can be set according to requirements. When the calculated probability is greater than 0.8, the traversal stops, and the pixel at which the traversal stops is considered an edge pixel. Furthermore, to prevent excessive computation, a maximum number of traversals can be set. The traversal stops when the maximum number of traversals is reached, and the pixel at which the traversal stops is considered an edge pixel. The maximum number of traversals can be set to 50, but the actual number can be adjusted according to requirements.
[0049] It should be noted that the radial lines are set by: setting the interval angle of the radial lines, and generating radial lines along the interval angle direction with the target pixel as the center point. Alternatively, the number of radial lines can be set directly.
[0050] For example, setting the interval angle to 15 The corresponding radial line is In other words, each feature pixel will eventually find 24 edge pixels.
[0051] At this point, several edge pixels of all feature pixels have been obtained.
[0052] Step S400: Using the neighboring pixels of any edge pixel as a reference point, traverse the pixels along the gradient direction of the reference point until a preset termination condition is met, and stop traversing. Record the pixel at the point of termination as the outer ring pixel. Obtain the outer ring pixels corresponding to all edge pixels one by one, and use morphological processing on multiple outer ring pixels to obtain the outer ring defect region centered on the feature pixel.
[0053] It should be noted that both types of defect areas described above exhibit white reflective ring-shaped regions, one complete and the other incomplete. Therefore, by utilizing the characteristic of the defect area having a reflective ring-shaped region, combined with the previously obtained edge pixels, the pixels of the reflective region, i.e., the pixels of the outer ring of the defect area, can be obtained.
[0054] Specifically, first, for any edge pixel found above, its neighboring pixels are recorded as reference points. Second, the pixels along the gradient direction of the reference point are traversed until a preset termination condition is met, at which point the traversal stops, and the pixel at which the traversal stops is recorded as the outer ring pixel.
[0055] The method for confirming any outer ring pixel is as follows: based on the first... Using the nth pixel as a reference point, traverse along the gradient direction of the reference point until the nth pixel is reached. The process stops when the first pixel is reached, meaning it stops when the outer ring of the white reflective ring area of the pinhole defect region is reached. The preset termination condition must be met: [The text abruptly ends here, likely due to an incomplete sentence or missing information.] grayscale value of each pixel With the grayscale value of each pixel The differences between them are small, meaning they belong to the same white annular reflective area; it is also necessary to satisfy the following condition. The pixel and the Number of pixels between pixels The condition of "less is more" is to accommodate the narrower shape of the annular region. Furthermore, the condition of "[missing information]" also needs to be met. grayscale value of each pixel With the grayscale value of each pixel The differences between them are significant; this condition can distinguish the first... Is each pixel located within the outer ring region? grayscale value of each pixel With the grayscale value of each pixel The significant difference between them indicates that the first The first pixel belongs to the outer ring of the white ring-shaped reflective area, while the second pixel belongs to the outer ring of the white ring-shaped reflective area. Each pixel belongs to the gray background area.
[0056] Based on the above logic, the preset termination condition can be calculated by determining the confidence level that a pixel belongs to an outer ring pixel. The confidence level satisfies the following relationship:
[0057] ;
[0058] in, It is the first The gradient direction of the nth pixel The confidence level of each pixel belonging to the outer ring pixels. It is the first The grayscale value of each pixel , They are the first The gradient direction of the nth pixel The pixel, the The grayscale value of each pixel It represents the maximum difference in grayscale values between pixels in the grayscale image of the board material. It is the first The nth pixel and its gradient direction The number of pixels between pixels, It is the maximum allowed number of traversals. It is a natural exponential function. It is the absolute value symbol.
[0059] In this formula, when the first... grayscale value of each pixel With the grayscale value of each pixel Normalized differences between Larger, but the first grayscale value of each pixel With the grayscale value of each pixel Normalized differences between When it is large, and the first The pixel and the Number of pixels between pixels When smaller, It is the first gradient direction of the reference point. The greater the confidence that a pixel belongs to an outer ring pixel, the higher the confidence level, and vice versa.
[0060] It should be noted that a preset outer ring threshold is also required. When the calculated confidence score exceeds this threshold, a preset termination condition is met, and the pixel at the termination point is considered the outer ring pixel. The preset outer ring threshold can be set to 0.8, but can be adjusted according to actual needs. Furthermore, to prevent excessive computation, a maximum allowed number of iterations needs to be set. The iteration stops when this maximum number of iterations is reached, and the pixel at the stop point is considered the outer ring pixel. The maximum allowed number of iterations can be set to 30, but can be adjusted according to actual needs.
[0061] Based on the above calculation method, each edge pixel is calculated one by one to obtain several outer ring pixels of the target pixel.
[0062] Morphological dilation or closing operations are used to connect adjacent edge pixels and outer ring pixels to obtain the white reflective area of the pinhole defect region. This step enhances the connection of the white reflective annular defect region 1, and enhances the connection between the outer ring pixels of the partially missing white reflective area 2, thus obtaining a more complete pinhole defect region. Morphological dilation and closing operations are existing technologies and will not be elaborated upon here.
[0063] At this point, the defect areas of all feature pixels have been obtained.
[0064] Step S500: Obtain the defect areas of all feature pixels in the grayscale image of the board one by one, and evaluate the effect of the board coating based on the total area of the defect areas of all feature pixels.
[0065] It should be noted that, based on the steps above, all defect areas in the board image have been obtained, and the coating effect of the board in the image can be evaluated by the area of the defect areas.
[0066] Specifically, the ratio of the total area of the defect region of all feature pixels to the total area of the grayscale image is recorded as the defect probability; when the defect probability is greater than the preset defect threshold, the defect in the grayscale image corresponding to the board coating effect is large, and staff are notified to handle it.
[0067] The second aspect of this embodiment provides a panel coating effect detection system based on image processing, as shown in Figure 3. The panel coating effect detection system includes a memory and a processor. The memory stores computer program instructions. When the computer program instructions are executed by the processor, the panel coating effect detection method based on image processing of the first aspect of this invention is implemented.
[0068] The panel coating effect detection system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces. Their settings and functions are known in the art and will not be described in detail here.
[0069] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as resistive random access memory (DRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (DRAM), high-bandwidth memory, hybrid memory cube, etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device.
[0070] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for detecting the coating effect of sheet metal based on image processing, characterized in that, The steps include: acquiring a surface image of the board and preprocessing it to obtain a grayscale image of the board; obtaining the center points of several pinhole defect areas in the grayscale image of the board according to preset conditions, and recording them as feature pixels. Using any feature pixel as the center point, a preset number of radial lines are set. Pixels on all radial lines are traversed to obtain several edge pixels of the pinhole defect region. This includes: calculating the absolute value of the difference between the gray value of the center point and the gray value of any pixel on its radial lines, normalizing it, and taking half of the result, which is recorded as the third gray value difference; calculating the ratio of the variance of the gray values of all pixels traversed on the radial lines of the center point to the maximum value of this variance, and taking half of the ratio, which is recorded as the gray variance difference; denoteing the negative exponential function of the sum of the third gray value difference and the gray variance difference as the first probability component; and calculating the absolute value of the difference between the gray values of a pixel on the radial lines of the center point and its adjacent pixels, and normalizing it. The first probability component is obtained by averaging the first and second probability components. Pixels with probabilities greater than a preset edge threshold are recorded as edge pixels. Using the adjacent pixels of any edge pixel as reference points, the pixels along the gradient direction of the reference point are traversed until a preset termination condition is met. The pixel at the point of termination is recorded as an outer ring pixel. The outer ring pixels corresponding to all edge pixels are obtained one by one. Multiple outer ring pixels are processed using morphology to obtain the outer ring defect region centered on the feature pixels. The defect regions of all feature pixels in the grayscale image of the board are obtained one by one. The effect of the board coating is evaluated based on the total area of the defect regions of all feature pixels.
2. The method for detecting the coating effect of sheet metal based on image processing according to claim 1, characterized in that, The preset termination condition includes: the confidence that a pixel in the gradient direction of the reference point belongs to an outer ring pixel is greater than a preset outer ring threshold. The confidence is calculated by: calculating the absolute value of the difference between the gray value of the reference point and the gray value of any pixel in its gradient direction, and normalizing it to obtain a first gray value difference; calculating the absolute value of the difference between the gray values of a pixel in the gradient direction of the reference point and its adjacent pixels, and normalizing it to obtain a second gray value difference; calculating the negative exponential function of the ratio of the total number of pixels in the gradient direction of the reference point to a preset maximum allowed number of traversals to obtain a distance influence index; and averaging the first gray value difference, the second gray value difference, and the distance influence index to obtain the confidence.
3. The method for detecting the coating effect of sheet metal based on image processing according to claim 1, characterized in that, The method of evaluating the coating effect of the board based on the total area of the defect region of all feature pixels includes: the ratio of the total area of the defect region of all feature pixels to the total area of the grayscale image, which is recorded as the defect probability; when the defect probability is greater than a preset defect threshold, the grayscale image corresponds to a large defect in the coating effect of the board, and the staff is notified to handle it.
4. The method for detecting the coating effect of sheet metal based on image processing according to claim 1, characterized in that, The step of obtaining several feature pixels in the grayscale image of the board material according to preset conditions includes: constructing a grayscale histogram based on the grayscale values of the pixels in the grayscale image of the board material; obtaining the leftmost peak value of the grayscale histogram, and expanding the peak value to the left and right by preset grayscale levels to obtain a feature grayscale interval; and extracting all pixels within the feature grayscale interval and recording them as feature pixels.
5. The method for detecting the coating effect of sheet metal based on image processing according to claim 1, characterized in that, The setting of a preset number of radial lines includes: setting the interval angle of the radial lines, and generating radial lines along the interval angle direction of the radial lines with the target pixel as the center point.
6. The method for detecting the coating effect of sheet metal based on image processing according to claim 5, characterized in that, The interval angle of the radial lines is 。 7. The method for detecting the coating effect of sheet metal based on image processing according to claim 1, characterized in that, The step of obtaining several feature pixels in the grayscale image of the board material according to preset conditions includes: selecting pixels whose grayscale value is lower than a preset grayscale value and whose local pixel grayscale variance is greater than a preset variance as feature pixels.
8. The method for detecting the coating effect of sheet metal based on image processing according to claim 1, characterized in that, The process of acquiring a surface image of the board material and preprocessing it to obtain a grayscale image of the board material includes: using adaptive filtering to process the surface image of the board material to obtain a denoised board material image; and performing grayscale processing on the denoised board material image to obtain a grayscale image of the board material.
9. A sheet metal coating effect detection system based on image processing, characterized in that, The panel coating effect detection system includes a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the panel coating effect detection method based on image processing according to any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Crown cap surface defect online detection method based on image processing
CN110220917A
Drilling hole layering defect quantitative detection method
CN113740364A