Image Processing-Based Method and System for Quality Inspection of Composite Plates
By analyzing the pixel structure tensor in the grayscale image of the laminated board and constructing a fusion function to adjust the diffusion tensor, the problem of distinguishing cracks and wood grain on wooden laminated boards was solved, improving the accuracy and precision of quality inspection.
Patent Information
- Application Number
- CN202511114862.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-08-11
AI Technical Summary
Existing technologies cannot accurately distinguish between cracks and wood grain in wood-based composite boards, leading to errors in quality inspection results.
By analyzing the pixel structure tensor in the grayscale image of the laminated plate, the principal and secondary eigenvalues are obtained, the directional coherence and periodicity are determined, and a fusion function is constructed to adjust the adaptive diffusion tensor of the Perona-Malik equation, thereby enhancing image edge detection and distinguishing wood grain from cracks.
It improves the accuracy of composite board quality inspection, ensures the sharpening of crack edges and the continuity of wood grain, and enhances the detection accuracy of edge detection algorithms.
Smart Images

Figure CN120598967B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology, and in particular to a method and system for inspecting the quality of laminated plates based on image processing. Background Technology
[0002] Wood-based composite panels can be used in the construction and decoration industries as a base material for floor slabs and wall panels, utilizing their high compressive and bending strength to distribute building loads. Compared to traditional solid wood panels, composite panels are more stable and less prone to deformation due to temperature and humidity changes, effectively reducing the risk of cracking in building structures. However, wood-based composite panels may contain cracks and defects. To ensure their effectiveness in relevant fields, quality testing is necessary before use.
[0003] Currently, machine vision and deep learning technologies are mainly used to identify cracks and defects in wood-based composite boards. On the one hand, two-dimensional image acquisition combined with convolutional neural networks is used to achieve multi-target recognition and detection of the dimensions and surface defects of the composite board base plate. On the other hand, three-dimensional point cloud scanning and close-range photogrammetry technologies are integrated to construct a high-precision digital twin model, enabling quantitative analysis of the thickness and flatness of the composite board.
[0004] The aforementioned existing technologies can identify cracks and defects on wood-based composite boards using machine vision and deep learning techniques. However, cracks and wood grain have similar visual features. Extracting edges using conventional edge recognition algorithms may misidentify minute cracks that are consistent with the direction of wood grain as wood grain. Furthermore, the performance of deep learning models depends on a large amount of labeled data. If the types of crack sample data are not comprehensive, it may lead to errors in the quality inspection results of composite boards.
[0005] Therefore, how to accurately distinguish between cracks and wood grain on wood-based composite boards, so as to obtain accurate quality inspection results for composite boards, is an urgent problem to be solved. Summary of the Invention
[0006] To address the technical problem of accurately distinguishing between cracks and wood grain on wood-based laminated boards, thereby obtaining accurate quality inspection results, this invention provides a laminated board quality inspection method and system based on image processing.
[0007] In a first aspect, the present invention provides a method for detecting the quality of laminated plates based on image processing, employing the following technical solution:
[0008] The image processing-based composite plate quality inspection method includes the following steps:
[0009] Based on the structure tensor of pixels in the grayscale image of the laminated plate, the principal eigenvalues, secondary eigenvalues, and principal orientation angles of each pixel are obtained. The directional coherence of the pixel is determined based on its principal and secondary eigenvalues. A rectangular region is constructed centered on the pixel, and the autocorrelation coefficients between the pixel and other pixels in the rectangular region with their principal orientation angles are obtained, resulting in an autocorrelation coefficient sequence. The periodicity of the pixel is determined based on the maximum value, median, and standard deviation of its grayscale value in the autocorrelation coefficient sequence. A fusion function is constructed, which is positively correlated with both the directional coherence and periodicity of the pixel. The adaptive diffusion tensor in the Perona-Malik equation is adjusted according to the fusion function to enhance each pixel in the grayscale image of the laminated plate. Edge detection is performed on the enhanced grayscale image of the laminated plate to obtain crack edges.
[0010] This invention effectively enhances the distinction between wood grain and cracks in the grayscale image of laminated veneer, thereby improving the accuracy of quality detection. During the enhancement process, this invention analyzes the directional coherence of pixels to determine their probability of being wood grain pixels and further acquires the periodic features of the pixels. Combining these two methods allows for the accurate capture of pixels in the grayscale image of the laminated veneer that match wood grain characteristics, thus accurately constructing a pixel fusion function to assess their probability of being wood grain pixels. Furthermore, this invention iteratively processes the grayscale image of the laminated veneer by adjusting the adaptive diffusion tensor in the Perona-Malik equation using the pixel fusion function value. This results in more continuous wood grain with smoother gradients, while the edges of cracks are sharper, improving the detection accuracy of edge detection algorithms and thus effectively enhancing the accuracy of the laminated veneer quality detection results.
[0011] According to the image processing-based composite plate quality detection method provided by the present invention, the step of determining the directional coherence of a pixel based on its principal and secondary feature values includes:
[0012] ;
[0013] Let i be the directional coherence of the i-th pixel. , Let be the principal feature value and the secondary feature value of the i-th pixel, respectively. To prevent the coefficient from being zero.
[0014] This invention takes into account that the principal feature value and the secondary feature value of a pixel can represent the direction of the most drastic gradient change and the direction of the gentlest gradient change, respectively. Therefore, by obtaining the difference between the two, the difference in the rate of change of the pixel along the direction of the greatest gradient change rate and the direction of the least gradient change rate is evaluated, thereby accurately assessing the possibility that the gradient direction of the pixel conforms to the wood grain region.
[0015] According to the image processing-based composite plate quality detection method provided by the present invention, obtaining the periodic intensity of the pixel includes: obtaining the difference between the maximum value and the median in the autocorrelation coefficient sequence of the pixel as a first index; obtaining the product of the normalized standard deviation of the gray value of the pixel in the rectangular region of the pixel and a preset sensitivity coefficient as a second index; and obtaining the periodic intensity of the pixel based on the ratio of the first index to the second index.
[0016] According to the image processing-based composite plate quality detection method provided by the present invention, the step of adjusting the adaptive diffusion tensor in the Perona-Malik equation based on the pixel fusion function includes: , This is a pixel fusion function. , These represent the directional coherence and periodicity intensity of the pixel, respectively. is the periodicity sensitivity coefficient, and e is the natural constant; the adaptive diffusion tensor of the pixel in the Perona-Malik equation is decomposed into the sum of the principal direction component and the vertical direction component; wherein, the fusion function of the pixel is decomposed into the principal direction diffusion coefficient and the vertical direction diffusion coefficient, the principal direction component is obtained by multiplying the principal direction angle component of the pixel with the principal direction diffusion coefficient, and the vertical direction component is obtained by multiplying the vertical principal direction angle component of the pixel with the vertical direction diffusion coefficient.
[0017] This invention adjusts the adaptive diffusion tensor in the Perona-Malik equation by using a fusion function, which makes the wood grain pixels more continuous and the gradient smoother, while sharpening the edges of the cracks, effectively increasing the difference between the two so that different edges can be accurately identified in the future.
[0018] According to the image processing-based composite plate quality detection method provided by the present invention, the method for obtaining the main direction diffusion coefficient of a pixel includes:
[0019] ;
[0020] Let be the diffusion coefficient in the main direction of the i-th pixel. The value of the fusion function for the i-th pixel is... Let be the sensitivity coefficient of the fusion function in the principal direction. It is an exponential function with base e.
[0021] The image processing-based composite plate quality detection method provided by the present invention includes the following method for obtaining the vertical diffusion coefficient of a pixel:
[0022] ;
[0023] Let be the vertical diffusion coefficient of the i-th pixel. It is the minimum diffusion constant. The value of the fusion function for the i-th pixel is... The sensitivity coefficient of the fusion function in the vertical direction is denoted as . It is an exponential function with base e.
[0024] According to the image processing-based composite plate quality detection method provided by the present invention, the edge detection of the enhanced composite plate grayscale image further includes: constructing the overlap coefficient of a pixel by using the directional coherence of pixels in a preset local area; marking pixels with overlap coefficients greater than the overlap threshold as pixels in the overlapping region; and enhancing the vertical principal direction of the gradient of the pixels in the overlapping region.
[0025] This invention takes into account that wood grain and cracks may overlap in some areas, causing them to be mixed together and indistinguishable. Therefore, this invention further obtains the overlap coefficient of pixels and performs secondary enhancement on the pixels in the overlapping areas, thereby further increasing the distinction between wood grain and cracks and improving the accuracy of edge recognition.
[0026] According to the image processing-based composite plate quality detection method provided by the present invention, the step of constructing the overlap coefficient of a pixel by means of the directional coherence of pixels in a preset local region of the pixel includes: sorting the directional coherence of pixels in the preset local region of the pixel to obtain a coherence sequence;
[0027] ;
[0028] , Let be the overlap coefficient and directional coherence of the i-th pixel, respectively. Let be the upper quartile of the coherence sequence of the i-th pixel. Let be the projection of the gradient of the i-th pixel onto the vertical principal direction. A normalized value for the grayscale standard deviation within a local region is preset for the i-th pixel. This is for adjusting the coefficient.
[0029] According to the image processing-based composite plate quality detection method provided by the present invention, the enhancement of the vertical principal direction of the gradient of the overlapping region pixels includes: taking the product of the vertical principal direction of the gradient of the overlapping region pixels and a preset enhancement coefficient as the enhanced gradient value of the vertical principal direction of the overlapping region pixels.
[0030] This invention enhances the gradient value of pixels in the vertical main direction, which can further enhance the gradient on the basis of continuous and smooth wood grain, thereby improving the accuracy of edge detection algorithms in distinguishing wood grain areas and crack defects in overlapping areas.
[0031] Secondly, the present invention provides an image processing-based composite plate quality inspection system, which adopts the following technical solution:
[0032] The image processing-based laminate quality inspection system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-described image processing-based laminate quality inspection method is implemented.
[0033] By adopting the above technical solution, the above image processing-based composite plate quality inspection method is generated into a computer program and stored in a memory for loading and execution by a processor. This allows for the creation of a terminal device based on the memory and processor, facilitating its use.
[0034] The present invention has the following technical effects:
[0035] Based on the above technical solution, the image processing-based composite board quality detection method and system provided by this invention can effectively increase the distinction between wood grain and cracks in the grayscale image of the composite board, thereby improving the accuracy of quality detection. During the enhancement process, this invention analyzes the directional coherence of pixels to determine their probability of being wood grain pixels and further obtains the periodic features of the pixels. Combining these two methods allows for the accurate capture of pixels in the grayscale image of the composite board that match wood grain characteristics, thus accurately constructing a pixel fusion function to assess their probability of being wood grain pixels. Furthermore, this invention adjusts the adaptive diffusion tensor in the Perona-Malik equation by adjusting the pixel fusion function value to iteratively process the grayscale image of the composite board, making the wood grain more continuous and the gradient smoother, while sharpening the edges of cracks. This improves the detection accuracy of the edge detection algorithm, thereby effectively improving the accuracy of the composite board quality detection results. Attached Figure Description
[0036] Figure 1 This is a schematic flowchart of the image processing-based composite plate quality detection method provided in an embodiment of the present invention. Detailed Implementation
[0037] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0038] This invention discloses a method for detecting the quality of laminated plates based on image processing. For details, please refer to [link to relevant documentation]. Figure 1 As shown, Figure 1 This is a flowchart illustrating the image processing-based composite plate quality detection method provided in this embodiment of the invention. The method analyzes the difference between cracks and wood grain, and enhances different gradient directions of pixels to varying degrees to increase the distinction between wood grain and cracks, thereby effectively improving the accuracy of crack identification on the composite plate. The method specifically includes the following steps:
[0039] S1: Obtain each pixel in the grayscale image of the composite plate.
[0040] For example, when acquiring a grayscale image of a laminated plate, an image of the laminated plate can be captured by a high-definition industrial camera, and the captured image of the laminated plate can be converted to grayscale to obtain a grayscale image of the laminated plate.
[0041] The camera resolution can be set to at least 5 megapixels. When shooting in a uniformly lit environment, the laminated plate can be placed on a horizontal worktable, a fixed-focus lens can be used to reduce distortion, and the focal length can be adjusted according to the shooting distance to ensure that the surface of the laminated plate fills the lens image. The specific shooting parameters can be set according to the shooting environment, and this embodiment of the invention does not impose too many restrictions.
[0042] For example, after obtaining the grayscale image of the composite plate based on the above steps, the gradient of each pixel can be obtained through the Sobel operator.
[0043] It should be noted that the grain pattern reflects the direction of cell arrangement during wood growth. Therefore, pixels within the grain area exhibit a high degree of consistency in orientation, and the grain direction is typically stable and has good continuity. Cracks, on the other hand, usually appear as irregular gaps, so pixels within the crack area generally have a more random orientation.
[0044] Based on this, embodiments of the present invention can construct a direction measurement function for each pixel to evaluate the degree of directional consistency of the pixel, thereby distinguishing between wood grain pixels and crack pixels in a grayscale image of a laminated board. The structure tensor, by calculating the statistical characteristics of the grayscale gradient of pixels in an image, can be decomposed into principal eigenvalues and secondary eigenvalues describing the local patterns within the pixel's neighborhood. The principal eigenvalue reflects the intensity of the strongest grayscale change direction within the pixel's neighborhood, i.e., the main direction of the edge or texture, while the secondary eigenvalue reflects the intensity of the secondary change direction perpendicular to the main direction. Therefore, the degree of directional consistency of pixels can be analyzed by obtaining the principal and secondary eigenvalues of the pixels, i.e., by performing the following steps:
[0045] S2: Based on the structural tensor of pixels in the grayscale image of the composite plate, obtain the principal eigenvalues and secondary eigenvalues of the pixels; determine the directional coherence of the pixels based on the principal eigenvalues and secondary eigenvalues of the pixels.
[0046] In this embodiment, the principal eigenvalue of a pixel is greater than its secondary eigenvalue. The specific steps for obtaining the principal and secondary eigenvalues of a pixel based on the structure tensor of the pixel in the grayscale image of the overlay plate can be implemented using existing technologies, and will not be elaborated upon here.
[0047] For example, in an embodiment of the present invention, the directional coherence of a pixel is determined based on its principal and secondary feature values, as detailed in the following formula:
[0048] ;
[0049] Let i be the directional coherence of the i-th pixel. Let i be the principal feature value of the i-th pixel. Let i be the secondary feature value of the i-th pixel. To prevent the coefficient from being divided by zero, it can be set to 0.001.
[0050] In the above formula, When it approaches 1, close to , A gradient close to 0 indicates that the gradient change of this pixel is mainly concentrated in the main direction corresponding to the main feature value, while the gradient perpendicular to the main direction approaches 0. Therefore, the pixel is more likely to correspond to a region with obvious directionality, such as wood grain. Conversely, When it approaches 0, Approaching In other words, the gradient change of a pixel point changes at a relatively consistent rate in the principal direction corresponding to the principal feature value and the vertical direction corresponding to the secondary feature value. Therefore, the pixel point is more likely to correspond to a region without obvious directionality, such as a crack or smooth area in the composite plate.
[0051] Based on the above steps, the directional coherence of each pixel can be obtained. Directional coherence can measure the general direction of the pixel texture. However, the direction of cracks may be similar to that of wood grain, both extending in the same direction. Therefore, it is necessary to further distinguish between the two.
[0052] It should be noted that wood grain and cracks have a relatively obvious difference: wood grain has a periodic growth pattern, while cracks are usually generated randomly, so their periodicity is usually poor.
[0053] Based on this, embodiments of the present invention can further obtain the periodicity of the pixel, and assess the possibility that the pixel is a crack pixel by combining the directional coherence and periodicity of the pixel, that is, continue to perform the following steps.
[0054] S3: Obtain the principal direction angle of the pixel, construct a rectangular region of the pixel with the pixel as the center, and obtain the autocorrelation coefficient between the pixel and other pixels with the principal direction angle in the rectangular region, starting from the position of the pixel in the rectangular region, to obtain the autocorrelation coefficient sequence of the pixel, and calculate the periodic intensity of the pixel.
[0055] Specifically, the principal orientation angle of a pixel can be obtained based on the structure tensor of the pixel in the grayscale image of the composite plate. The specific steps for obtaining the principal orientation angle of a pixel based on the structure tensor can be implemented by existing technology, and will not be elaborated here in this embodiment of the invention. The principal orientation angle of a pixel is the direction in which the grayscale gradient of that pixel changes the fastest, and can reflect the general direction of the texture.
[0056] It should be noted that wood grain exhibits repeating texture patterns with similar spacing along the main direction. In the grayscale image of the laminate, this manifests as high grayscale similarity between pixels after shifting a specific periodic distance along the main direction.
[0057] Based on this, embodiments of the present invention can specifically analyze the texture features of pixels in the dominant direction within a certain range, eliminate non-periodic interference in the vertical direction, quantify the similarity between pixels after being translated a certain distance along the dominant direction and the central pixel, thereby accurately obtaining its periodicity.
[0058] It should be further explained that the maximum similarity in the autocorrelation coefficient sequence obtained after pixel translation corresponds to the most likely period length, while the median of the sequence represents the overall baseline level of the sequence, and the standard deviation of the gray value measures the degree of fluctuation of the autocorrelation coefficient and can be used for normalization.
[0059] For example, the size of the rectangular area of a pixel can be set to 50×50; the specific size of the rectangular area can be set according to actual needs.
[0060] Understandably, if the camera resolution is 5 megapixels, the wood grain period commonly seen in the resulting grayscale image is usually 25 pixels, so the size of the rectangular area can also be set to 25 pixels.
[0061] For example, in an embodiment of the present invention, the periodic intensity of a pixel is obtained based on the maximum value, median value, and standard deviation of the gray value of the pixel in the autocorrelation coefficient sequence. This includes: obtaining the difference between the maximum value and the median value in the autocorrelation coefficient sequence of the pixel as a first index; obtaining the product of the normalized standard deviation of the gray value of the pixel in the rectangular region of the pixel and a preset sensitivity coefficient as a second index; and obtaining the periodic intensity of the pixel based on the ratio of the first index to the second index.
[0062] The normalized standard deviation of a pixel's grayscale value can be obtained by comparing the standard deviation of the pixel's grayscale value to the maximum grayscale value. The preset sensitivity coefficient can be set to 1.
[0063] In this calculation method, the first indicator highlights the difference between significant periodic peaks and background fluctuations. If strong periodicity exists, the first indicator will be larger; if the texture is random, the difference between the two is smaller, and the first indicator will also be smaller.
[0064] The standard deviation of grayscale reflects the overall degree of grayscale fluctuation in a region. The grayscale value of the region containing cracks changes more significantly, so the standard deviation is also larger. The grayscale value of the region containing wood grain changes less significantly, so the standard deviation is also smaller. Normalization can eliminate the differences between different regions.
[0065] The periodic intensity of each pixel can be obtained by following the above steps. By fusing the directional coherence and periodic intensity of each pixel, even if the periodic intensity is too high due to noise interference, it can be reduced by lower directional coherence. Finally, the possibility of the pixel being a crack or wood grain can be accurately assessed.
[0066] S4: Construct a pixel fusion function; adjust the adaptive diffusion tensor in the Perona-Malik equation according to the pixel fusion function to enhance each pixel in the grayscale image of the composite plate; perform edge detection on the enhanced grayscale image of the composite plate to obtain the crack edge.
[0067] For example, in an embodiment of the present invention, the pixel fusion function is constructed as shown in the formula:
[0068] ;
[0069] This is a pixel fusion function. The directional coherence of this pixel. The periodic intensity of this pixel. is the periodicity sensitivity coefficient, and e is the natural constant.
[0070] in, It can be set to 0.05.
[0071] In this fusion function, the periodicity sensitivity coefficient determines the degree to which the fusion function is sensitive to periodicity.
[0072] Because wood grain exhibits significant differences across its various directions and possesses periodicity, both its directional coherence and periodicity are high, resulting in larger fusion function values. Conversely, if the periodicity is high but the directional coherence is low, it suggests that the pixel may be a crack with an interval of less than 25 pixels, thus leading to a smaller fusion function value.
[0073] In summary, a pixel can only be a wood grain pixel if both its directional coherence and periodicity are high; otherwise, it is a crack pixel.
[0074] It should be noted that the fusion function constructed in the above steps can characterize the probability that a pixel is wood grain or a crack. Noise interference may exist in the grayscale image of the laminate, causing the wood grain to appear broken. In this case, the Canny algorithm is prone to misclassifying it as a crack. The edges of the crack need to be sharpened to make it easier to detect; therefore, image filtering is required to suppress noise and enhance the distinction between cracks and wood grain.
[0075] Based on this, embodiments of the present invention can adjust the gradient of pixels according to the pixel fusion function value to highlight the difference between wood grain and cracks.
[0076] For example, embodiments of the present invention can use anisotropic algorithms to filter grayscale images of laminates.
[0077] Among them, anisotropic algorithms can use the Perona-Malik equation, the Catte model, and the variable exponential anisotropic diffusion algorithm. The Perona-Malik equation has a high computation speed, which can meet the real-time requirements of detection, and is suitable for composite plates with relatively smooth surfaces and obvious cracks.
[0078] Therefore, this embodiment of the invention uses the example of adjusting the Perona-Malik equation with a fusion function to achieve image filtering processing.
[0079] It should be further explained that the adaptive diffusion tensor in the Perona-Malik equation can control the degree of denoising and edge preservation during noise smoothing. Therefore, embodiments of the present invention can achieve denoising by adjusting the adaptive diffusion tensor in the Perona-Malik equation through a fusion function. However, the original form of this equation uses the same diffusion intensity in all directions, while edges in overlay grayscale images are usually directional, and directly using this will result in poor image denoising performance.
[0080] Based on this, embodiments of the present invention can use a fusion function to diffuse along the direction of the edge to smooth noise, and suppress diffusion in the direction perpendicular to the edge to preserve edge details.
[0081] For example, in this embodiment of the invention, adjusting the adaptive diffusion tensor in the Perona-Malik equation according to the pixel fusion function includes: decomposing the adaptive diffusion tensor of the pixel in the Perona-Malik equation into the sum of the principal direction component and the vertical direction component; wherein, the principal direction component is obtained by multiplying the principal direction angle component of the pixel with the principal direction diffusion coefficient, and the vertical direction component is obtained by multiplying the vertical principal direction angle component of the pixel with the vertical direction diffusion coefficient; and the pixel fusion function is decomposed into the principal direction diffusion coefficient and the vertical direction diffusion coefficient.
[0082] For example, the principal direction angle component and the vertical principal direction angle component of a pixel can be obtained through the principal direction angle of the pixel. The specific steps can be implemented by existing technology, and will not be described in detail in this embodiment of the invention.
[0083] Among them, the principal direction angle component reflects the direction in which the gradient of the pixel changes most drastically, usually corresponding to the normal direction, while the perpendicular principal direction angle component reflects the direction in which the gradient of the pixel changes most gently, usually corresponding to the tangent direction.
[0084] When constructing the main direction diffusion coefficient and the perpendicular direction diffusion coefficient, it is necessary to ensure that the adaptive diffusion tensor obtained based on this can diffuse along the main direction of the wood grain, making the wood grain more continuous and the gradient amplitude smaller, while diffusing less in the direction perpendicular to the wood grain, so that the edges of the wood grain are effectively protected. Specifically:
[0085] For example, in an embodiment of the present invention, the method for obtaining the main direction diffusion coefficient of a pixel includes:
[0086] ;
[0087] Let be the diffusion coefficient in the main direction of the i-th pixel. The value of the fusion function for the i-th pixel is... Let be the sensitivity coefficient of the fusion function in the principal direction. It is an exponential function with base e.
[0088] in, It can be set to 0.2; the specific setting can be adjusted according to actual needs.
[0089] In the above formula, The closer the value is to 1, the greater the probability that the i-th pixel is a pixel in the wood grain region. The closer the exponential part is to 0, the better. The closer the value is to 1, the better. Conversely, The closer the value is to 0, the greater the probability that the i-th pixel is a pixel in the crack region. The more the index part approaches , The closer it gets to 0.
[0090] For example, in an embodiment of the present invention, the method for obtaining the vertical diffusion coefficient of a pixel includes:
[0091] ;
[0092] Let be the vertical diffusion coefficient of the i-th pixel. It is the minimum diffusion constant. The value of the fusion function for the i-th pixel is... The sensitivity coefficient of the fusion function in the vertical direction is denoted as . It is an exponential function with base e.
[0093] The minimum diffusion constant can be set to 0.001; It can be set to 5.0; the specific setting can be adjusted according to actual needs. It can be smaller than This is to avoid the wood grain cracks being mistaken for fissures.
[0094] In the above formula, the minimum diffusion constant is used to avoid the vertical diffusion coefficient. Too large The closer it is to 1, The closer it gets to 0.
[0095] In summary, the closer the diffusion coefficient of pixels in the wood grain region is to 1 in the main direction and the closer the diffusion coefficient is to 0 in the vertical direction, the more the equation will spread along the wood grain region and protect the edges. Conversely, the closer the diffusion coefficient of pixels in the non-wood grain region is to 0 in both the main and vertical directions, the less the equation will spread in either direction.
[0096] Based on the main direction diffusion coefficient and vertical direction diffusion coefficient of the pixel obtained from the above steps, the adaptive diffusion tensor of the pixel can be obtained. Using the adaptive diffusion tensor of the pixel for discretization and iterative solution in the Perona-Malik equation can make the wood grain continuous while protecting the edge of the wood grain, thus obtaining the enhanced image.
[0097] For example, edge detection can be performed on the enhanced grayscale image of the laminate to obtain crack defects in the enhanced grayscale image of the laminate.
[0098] As can be seen, in this embodiment of the invention, when obtaining the quality inspection results of the laminated plate, the principal eigenvalues, secondary eigenvalues, and principal direction angles of the pixels can be obtained based on the structural tensor of the pixels in the grayscale image of the laminated plate. The directional coherence of the pixels is determined based on the principal and secondary eigenvalues. A rectangular region of the pixel is constructed centered on the pixel, and the autocorrelation coefficients between the pixel and other pixels in the rectangular region with the principal direction angle are obtained, resulting in an autocorrelation coefficient sequence for the pixel. The periodicity intensity of the pixel is obtained based on the maximum value, median, and standard deviation of the grayscale value in the autocorrelation coefficient sequence. A fusion function is constructed for the pixels, which is positively correlated with both the directional coherence and periodicity intensity of the pixel. The adaptive diffusion tensor in the Perona-Malik equation is adjusted according to the pixel fusion function to enhance each pixel in the grayscale image of the laminated plate. Edge detection is performed on the enhanced grayscale image of the laminated plate to obtain crack edges, effectively improving the accuracy of the quality inspection results of the laminated plate.
[0099] In step S4 above, after image enhancement is achieved by adjusting the adaptive diffusion tensor in the Perona-Malik equation through the pixel fusion function, this embodiment of the invention can also perform targeted enhancement on the overlapping parts in the image.
[0100] It should be noted that in grayscale images of laminated boards, wood grain and cracks may overlap. In overlapping areas, wood grain and cracks are mixed together, and the enhancement steps described above may not be able to accurately distinguish them. However, wood grain and cracks also have substantial differences. Wood has weaker resistance to deformation in the transverse direction. When wood laminated boards are subjected to external forces or environmental factors that cause cracks, the cracks tend to form along the transverse direction, eventually forming cracks perpendicular to the wood grain.
[0101] Based on this, embodiments of the present invention can construct an overlap coefficient through the directional coherence of pixels, determine the overlap between wood grain and cracks, and enhance the wood grain gradient along the vertical direction of the wood grain within the overlap area.
[0102] It should be further explained that when wood grain and cracks overlap, the directional coherence of each pixel in the overlapping area will be significantly weakened, while when cracks and wood grains are perpendicular, the projection of the gradient in the vertical principal direction will be significantly increased. Based on this, the overlapping area can be identified.
[0103] For example, in an embodiment of the present invention, edge detection of the enhanced composite plate grayscale image further includes: constructing the overlap coefficient of a pixel by using the directional coherence of pixels in a preset local area of the pixel.
[0104] The size of the preset local area for each pixel can be set to a 7×7 rectangular area, which can be set according to actual needs.
[0105] For example, in an embodiment of the present invention, the overlap coefficient of a pixel is constructed by means of the directional coherence of pixels within a preset local region of the pixel, including: sorting the directional coherence within the preset local region of the pixel to obtain a coherence sequence; and calculating the overlap coefficient of the pixel, as shown in the formula:
[0106] ;
[0107] Let be the overlap coefficient of the i-th pixel. Let i be the directional coherence of the i-th pixel. Let be the upper quartile of the coherence sequence of the i-th pixel. Let be the projection of the gradient of the i-th pixel onto the vertical principal direction. A normalized value for the grayscale standard deviation within a local region is preset for the i-th pixel. This is for adjusting the coefficient.
[0108] One of them can be set to 20; the specific setting can be adjusted according to actual needs.
[0109] In the above formula, the directional coherence of the wood grain region is relatively high. Within this region, the directional coherence of a local pixel is close to that of the central pixel of the local region. The differences will be smaller, and the projection of the pixel gradient in the vertical main direction will be smaller, so the overlap coefficient of the corresponding pixels will be smaller.
[0110] The purpose is to reduce noise interference, but since the standard deviation of the wood grain area is small, it will increase the overall score. In order to suppress the influence of the standard deviation, the square root standard deviation is used to suppress it, and a constant K is added to prevent the excessive influence of the square root standard deviation.
[0111] In the overlapping region, the directional coherence of pixels in the crack area is lower, while that in the wood grain area is higher. Therefore... The differences can be significant; the characteristic of cracks being perpendicular to the wood grain causes the gradient to project in the principal direction. The overlap coefficient of the corresponding pixels will increase significantly, and the probability that the pixels are in the overlapping area will also be greater.
[0112] For regions with only cracks, directional coherence will be low, but It is relatively high, and its overlap coefficient is between the overlap area and the wood grain area.
[0113] Based on the above steps, the overlap coefficients of each region, from largest to smallest, are: overlapping region, crack region, and wood grain region.
[0114] Therefore, if the overlap coefficient of a pixel is greater than the overlap coefficient of the crack area and the wood grain area, then the pixel can be determined as an overlapping area.
[0115] For example, in an embodiment of the present invention, pixels with an overlap coefficient greater than an overlap threshold can be marked as pixels in the overlapping region; the vertical principal direction of the gradient of the pixels in the overlapping region is enhanced.
[0116] The overlap threshold can be set to 0.5, and can be specifically set according to the overlap coefficient between the crack area and the wood grain area. This embodiment of the invention does not impose too many restrictions here.
[0117] For example, in an embodiment of the present invention, enhancing the vertical principal direction of the gradient of pixels in the overlapping region includes: multiplying the vertical principal direction of the gradient of pixels in the overlapping region with a preset enhancement coefficient as the enhanced gradient value of the vertical principal direction of pixels in the overlapping region.
[0118] The above steps can be used to enhance the gradient of wood grain pixels in the overlapping area of the grayscale image of the laminate.
[0119] This invention also discloses an image processing-based laminate quality inspection system, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the image processing-based laminate quality inspection method provided by this invention.
[0120] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0121] In this invention, the aforementioned memory can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0122] 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 inspecting the quality of laminated plates based on image processing, characterized in that, include: Based on the structure tensor of pixels in the grayscale image of the composite plate, the principal eigenvalues, secondary eigenvalues, and principal orientation angles of the pixels are obtained. The directional coherence of a pixel is determined based on its principal and secondary eigenvalues. Construct a rectangular region centered on the pixel, and take the position of the pixel in the rectangular region as the starting point to obtain the autocorrelation coefficient between the pixel and other pixels in the rectangular region with the main direction angle, thus obtaining the autocorrelation coefficient sequence of the pixel; The periodic intensity of a pixel is obtained by taking the maximum value, median value, and standard deviation of the gray value of the pixel from the autocorrelation coefficient sequence. A pixel fusion function is constructed, which is positively correlated with the directional coherence and periodicity of the pixel. The adaptive diffusion tensor in the Perona-Malik equation is adjusted according to the pixel fusion function to enhance each pixel in the grayscale image of the overlay plate. Edge detection is performed on the enhanced grayscale image of the composite plate to obtain the crack edges; Adjusting the adaptive diffusion tensor in the Perona-Malik equation based on the pixel fusion function includes: decomposing the adaptive diffusion tensor of the pixel in the Perona-Malik equation into the sum of the principal direction component and the vertical direction component; wherein, the pixel fusion function is decomposed into the principal direction diffusion coefficient and the vertical direction diffusion coefficient, the principal direction component is obtained by multiplying the pixel's principal direction angle component with the principal direction diffusion coefficient, and the vertical direction component is obtained by multiplying the pixel's vertical principal direction angle component with the vertical direction diffusion coefficient. Methods for obtaining the main direction diffusion coefficient of a pixel include: ; Let be the diffusion coefficient in the main direction of the i-th pixel. The value of the fusion function for the i-th pixel is... Let be the sensitivity coefficient of the fusion function in the principal direction. It is an exponential function with base e; Methods for obtaining the vertical diffusion coefficient of a pixel include: ; Let be the vertical diffusion coefficient of the i-th pixel. It is the minimum diffusion constant. This is the sensitivity coefficient of the fusion function in the vertical direction.
2. The image processing-based composite plate quality detection method according to claim 1, characterized in that, Determining the directional coherence of a pixel based on its principal and secondary feature values includes: ; Let i be the directional coherence of the i-th pixel. , Let be the principal feature value and the secondary feature value of the i-th pixel, respectively. To prevent the coefficient from being zero.
3. The image processing-based composite plate quality inspection method according to claim 1, characterized in that, Obtaining the periodic intensity of the pixel includes: The difference between the maximum value and the median in the autocorrelation coefficient sequence of a pixel is recorded as the first index. The product of the normalized standard deviation of the gray value of the pixel in the rectangular region of the pixel and the preset sensitivity coefficient is recorded as the second index. The periodic intensity of the pixel is obtained based on the ratio of the first index to the second index.
4. The image processing-based composite plate quality inspection method according to claim 1, characterized in that, The step of adjusting the adaptive diffusion tensor in the Perona-Malik equation based on the pixel fusion function includes: , This is a pixel fusion function. , These represent the directional coherence and periodicity intensity of the pixel, respectively. is the periodicity sensitivity coefficient, and e is the natural constant.
5. The image processing-based composite plate quality detection method according to claim 1, characterized in that, The edge detection of the enhanced grayscale image of the laminated plate further includes: The overlap coefficient of a pixel is constructed by pre-setting the directional coherence of pixels within a local region; pixels with an overlap coefficient greater than the overlap threshold are marked as pixels in the overlapping region; and the vertical principal direction of the gradient of pixels in the overlapping region is enhanced.
6. The image processing-based composite plate quality detection method according to claim 5, characterized in that, The step of constructing the overlap coefficient of a pixel by pre-setting the directional coherence of pixels within a local region of the pixel includes: The directional coherence of pixels within a preset local region is sorted to obtain a coherence sequence; ; , Let be the overlap coefficient and directional coherence of the i-th pixel, respectively. Let be the upper quartile of the coherence sequence of the i-th pixel. Let be the projection of the gradient of the i-th pixel onto the vertical principal direction. A normalized value for the grayscale standard deviation within a local region is preset for the i-th pixel. This is for adjusting the coefficient.
7. The image processing-based composite plate quality inspection method according to claim 5, characterized in that, The enhancement of the vertical principal direction of the gradient of pixels in the overlapping region includes: The product of the vertical principal direction of the gradient of the pixels in the overlapping region and the preset enhancement coefficient is used as the enhanced gradient value of the vertical principal direction of the pixels in the overlapping region.
8. A composite plate quality inspection system based on image processing, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the image processing-based composite plate quality inspection method according to any one of claims 1-7.
Citation Information
Patent Citations
Carbonate rock fracture-cavity enhanced recognition method based on gradient structure tensor spectrum decomposition
CN111290021A
Smart home production board quality detection method and system
CN119006446A