A flatness detection method for composite plates based on image processing
By chunking and sub-blocking the composite sheet surface image, noise possibility is evaluated and fuzzy membership calculation is optimized, the problem of noise interference affecting flatness detection is solved, and the accuracy and reliability of the detection results are improved.
Patent Information
- Application Number
- CN202510265543.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-07
AI Technical Summary
The surface images of composite sheets are easily disturbed by noise during transmission, resulting in deviations in the calculation of fuzzy membership between sub-blocks, affecting the accuracy and reliability of flatness detection results.
By chunking and sub-blocking the composite sheet surface image, the noise possibility of each pixel point is evaluated, and when calculating the distance between the sub-blocks, the grayscale difference value and noise possibility are combined to optimize the calculation method of fuzzy membership.
The accuracy of the distance between sub-blocks is improved, and the accuracy of fuzzy entropy is improved, and the accuracy and reliability of the flatness detection results of composite sheets are enhanced.
Smart Images

Figure CN119784745B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing. Specifically, it relates to a method for detecting the flatness of composite plates based on image processing. Background Art
[0002] Due to its excellent performance, composite materials are often used in many industries such as aviation, automotive, construction, and electronics. If the surface of the plate is uneven, it will affect the processing accuracy and make it difficult for the product quality to meet the expected standards. Seriously, it may also damage the equipment. Therefore, achieving accurate flatness detection is of great significance for ensuring the smooth progress of subsequent processing and improving the accuracy of processing.
[0003] As an extension of the entropy value concept in the field of fuzzy mathematics, fuzzy entropy can more precisely reflect the fuzziness and uncertainty of an image and is more suitable for flatness detection. When using the fuzzy entropy-based method to detect the flatness of composite plates, first, the surface image of the composite plate is evenly divided into multiple sub-blocks with equal areas. Then, by calculating the fuzzy entropy within each sub-block, the flatness of the composite plate area corresponding to the sub-block is determined.
[0004] In the process of calculating the fuzzy entropy within the sub-block, each sub-block is further divided into multiple sub-sub-blocks, and the fuzzy membership degree between the sub-sub-blocks is determined according to the distance between the sub-sub-blocks. The fuzzy entropy of the sub-block is calculated based on the difference in the average fuzzy membership degree between the sub-sub-blocks before and after the expansion of the sub-sub-block size. And the method for determining the distance between the sub-sub-blocks in this scheme is: comparing the gray-scale differences between the pixel points at several corresponding positions of two sub-sub-blocks and selecting the maximum value as the distance between the sub-sub-blocks.
[0005] However, in the process of using the above-mentioned fuzzy entropy-based method to detect the flatness of composite plates, when the surface image of the composite plate is transmitted from the camera to the processing unit, it is extremely vulnerable to various interferences, such as signal interference, data loss, or transmission errors. These interferences will introduce noise pixel points into the image. The gray-scale values of the noise pixel points cannot accurately reflect the true information of the image, resulting in errors in calculating the distance between the sub-sub-blocks, deviations in calculating the fuzzy membership degree between the sub-sub-blocks, and further affecting the accuracy of the fuzzy entropy of the sub-block to which the sub-sub-block belongs, reducing the accuracy and reliability of the flatness detection result. Summary of the Invention
[0006] To solve the problem that the interference of noise points affects the accuracy of the fuzzy entropy of each sub-block of the surface image of the composite plate and reduces the accuracy and reliability of the flatness detection result of the composite plate, the present invention proposes a method for detecting the flatness of composite plates based on image processing, including:
[0007] Collect the surface image of the composite board, divide the surface image into blocks, divide each block into multiple sub-blocks of the same size, and evaluate the noise possibility of each pixel point in the surface image;
[0008] Within each block, any two sub-blocks form a group of sub-blocks. For each group of sub-blocks, pair the pixel points at the same coordinate positions in pairs to form multiple groups of pixel points. Among the multiple groups of pixel points, select the top groups of pixel points with the largest gray difference, and calculate the distance between each group of sub-blocks:
[0009] , is the distance between the th group of sub-blocks of the th block, is the gray difference of the th group of pixel points among the top groups of pixel points with the largest gray difference in the th group of sub-blocks of the th block, is the sum of the noise possibilities of the th group of pixel points among the top groups of pixel points with the largest gray difference in the th group of sub-blocks of the th block, is the natural exponential function, is the preset quantity;
[0010] Based on the distance between each group of sub-blocks within each block, determine the fuzzy membership degree between each group of sub-blocks. According to the difference in the mean of the fuzzy membership degrees between all groups of sub-blocks before and after the dilation operation, obtain the fuzzy entropy of each block. Determine the flatness of each block based on the fuzzy entropy of each block to perform flatness detection on the composite board.
[0011] The above technical solution helps to decompose a large image into multiple small areas by processing the surface image of the composite plate in blocks, which is convenient for subsequent refined analysis of local areas. Each block is further subdivided into multiple sub-blocks, which can capture the local features of the image more carefully, evaluate the noise possibility of each pixel point, and provide a quantitative index of noise interference for subsequent processing, so that the noise impact can be targeted in subsequent calculations. And forming any two sub-blocks into a group and studying the relationship between different sub-blocks can help to explore the texture, grayscale changes and other features within the block. By focusing on the pixel point with the largest grayscale difference, the key differences between sub-blocks can be highlighted, so that the distance calculated later can better reflect the essential difference between sub-blocks, thereby more accurately describing the local features within the block and providing more effective information for flatness detection. And by comprehensively considering the grayscale difference and noise effects, the calculated distance between sub-blocks can better reflect the real local differences of the image, remove the unreasonable influence of pixels with large noise interference on the distance calculation, so as to more accurately quantify the real differences between sub-blocks, make the calculated distance between sub-blocks more consistent with the actual situation of the image, improve the accuracy of distance calculation, and improve the accuracy of fuzzy membership between sub-blocks based on accurate distance calculation, so as to obtain more accurate fuzzy entropy of each block. Through fuzzy entropy, the relationship between sub-blocks within the block is comprehensively considered, the image features are closely linked to the flatness of the composite board, and the accuracy and reliability of flatness detection are improved.
[0012] Furthermore, the noise probability of each pixel of the surface image is evaluated based on the following formula:
[0013] ;
[0014] In the formula, For the The noise probability of each pixel is is the normalization function, For the The grayscale abnormality of each pixel point is is the preset abnormality threshold, For the The ripple characteristic factor of the local area of the pixel point.
[0015] The above technical solution can more accurately evaluate the degree to which each pixel is disturbed by noise based on the degree of pixel grayscale abnormality and the local area ripple characteristic factor combined with a preset threshold.
[0016] Furthermore, the grayscale abnormality degree is determined based on the following formula:
[0017] , For the The gray anomaly degree of a pixel is the difference between the gray value of the -th pixel and the maximum gray value of its 8-neighborhood pixels, is the difference between the gray value of the -th pixel and the minimum gray value of its 8-neighborhood pixels, is the minimum value function, is the number of pixels in the surface image whose difference from the gray value of the -th pixel is within , where is the preset difference, is the natural exponential function.
[0018] The above technical solution comprehensively considers the gray difference between local pixels, reflects the anomaly degree of pixel gray values in the neighborhood, and provides key parameters for evaluating the noise possibility.
[0019] Furthermore, the calculation formula for the ripple feature factor of the local area is:
[0020] , where is the ripple feature factor of the local area of the -th pixel, is the information entropy value of the gray values of all pixels located in the gradient change direction of the -th pixel within the local area of the -th pixel, is the average gray difference of all adjacent pixels located in the gradient change direction of the -th pixel within the local area of the -th pixel, is the variance value of the gray values of all pixels located in the direction perpendicular to the gradient change direction of the -th pixel within the local area of the -th pixel.
[0021] The above technical solution describes the texture features of the local area from different perspectives, provides more comprehensive local feature information for noise possibility evaluation, and makes the evaluation of noise possibility more comprehensive and accurate.
[0022] Furthermore, determining the flatness of each block based on the fuzzy entropy of each block is carried out based on the following formula:
[0023] , where is the flatness of the -th block, is the natural exponential function, is the The fuzzy entropy of each block.
[0024] The above technical solution converts the fuzzy entropy into flatness through the natural exponential function, realizing the quantitative conversion from fuzzy entropy to flatness, making the evaluation of the flatness of each block of the composite board more objective and accurate, and facilitating the rapid judgment of the flatness of the composite board.
[0025] Furthermore, the method for detecting the flatness of the composite board is as follows:
[0026] Preset a flatness threshold; if the flatness of a certain block is less than the flatness threshold, it is determined that the flatness of the composite board in the area of this block is unqualified, and the staff is notified for handling; if the flatness of a certain block is not less than the flatness threshold, it is determined that the flatness of the composite board in the area of this block is qualified.
[0027] Furthermore, the fuzzy membership degree between each group of sub-blocks is determined based on the following formula:
[0028] , is the th fuzzy membership degree between the th block's th group of sub-blocks, is the distance between the th group of sub-blocks of the
[0029] The above technical solution accurately describes the fuzzy relationship between sub-blocks using the Gaussian function, making the calculation of fuzzy entropy better reflect the internal structural characteristics of the block.
[0030] Furthermore, the method for obtaining the fuzzy entropy of each block is as follows:
[0031] Before expanding all the sub-blocks of the th block, calculate the mean value of the fuzzy membership degrees of all groups of sub-blocks of the th block as ;
[0032] After expanding all the sub-blocks of the th block, calculate the mean value of the fuzzy membership degrees of all groups of sub-blocks of the th block as ;
[0033] Calculate the fuzzy entropy of the th block, where
[0034] The above technical solution provides a reasonable method for calculating the fuzzy entropy of divided blocks, comprehensively considering the relationship and its changes among sub-blocks within the divided blocks, and providing a reliable index for flatness detection based on fuzzy entropy.
[0035] Further, the local area is an area formed by each pixel point and the surrounding pixel points as the local area of the pixel point, where is a preset number.
[0036] Further, the dilation operation is: adding a preset fixed length on the basis of the side length of each sub-block to implement the dilation operation of the sub-block.
[0037] The present invention has the following effects:
[0038] By reducing the interference of noise points, the present invention optimizes the way of obtaining the distance between sub-blocks of each divided block, obtains a distance that can more accurately reflect the true difference, and improves the accuracy of the fuzzy entropy of each divided block based on this distance. The accurate fuzzy entropy makes the flatness detection result of the composite board more accurate and reliable. Description of the Drawings
[0039] Figure 1 is a schematic flowchart of the method of the present invention. Detailed Embodiments
[0040] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention.
[0041] Referring to Figure 1 , a method for detecting the flatness of a composite board based on image processing provided by the present invention includes steps S1 - S3:
[0042] S1: Collect the surface image of the composite board and perform preprocessing.
[0043] Use a high-definition camera to shoot and collect the surface of the composite board directly to obtain the surface image of the composite board, and then perform grayscale processing on the surface image of the composite board. Therefore, the "surface image" involved in this solution is an image after grayscale processing.
[0044] S2: Optimize the method for detecting flatness based on the fuzzy entropy of the traditional surface image to obtain an accurate fuzzy entropy.
[0045] First, explain the method for detecting flatness based on the fuzzy entropy of the traditional surface image:
[0046] First, perform image block division. Then, determine the distance between sub-blocks based on the block division result. Next, calculate the fuzzy membership degree between blocks based on the distance between sub-blocks. Finally, determine the fuzzy entropy of the block according to the change in the average fuzzy membership degree before and after the expansion of the sub-block, and perform flatness detection based on the fuzzy entropy of the block.
[0047] In the above traditional method, in the process of "determining the distance between sub-blocks based on the block division result", the gray difference between the pixel points at several corresponding positions of two sub-blocks is compared, and the maximum value is selected as the distance between the two sub-blocks. For example, in sub-block A and sub-block B, 3 pixel points at the same coordinate positions are selected respectively. The gray values of the 3 pixel points selected in sub-block A are 20, 30, and 40 respectively; the gray values of the 3 pixel points selected in sub-block B are 50, 80, and 20 respectively. Then the gray differences are 30, 50, and 20 respectively. Therefore, 50 is taken as the distance between sub-block A and sub-block B.
[0048] However, due to the interference of noise, if the pixel points selected when determining the distance between sub-blocks are noise points, the distance between sub-blocks cannot be accurately reflected, which will further affect the subsequent calculation of the fuzzy membership degree between blocks and the accuracy of determining the fuzzy entropy of the block based on the fuzzy membership degree, resulting in inaccurate and unreliable results for flatness detection based on the fuzzy entropy.
[0049] Therefore, this solution mainly optimizes the process of "determining the distance between sub-blocks based on the block division result" to obtain a distance that can better reflect the actual differences between sub-blocks, thereby improving the accuracy of the subsequent fuzzy entropy and making the flatness detection results based on the fuzzy entropy more reliable.
[0050] Specifically, it includes the following steps:
[0051] S21: Perform block division and sub-block division on the surface image:
[0052] Since the surface image of the composite board usually contains a large amount of complex information, directly analyzing the entire image not only has a huge amount of calculation but also is difficult to accurately capture local features. Therefore, by evenly dividing the image into multiple blocks, the complex overall problem can be decomposed into multiple relatively simple local problems. Each block represents a specific area of the board surface, so that targeted analysis can be carried out according to the characteristics of different areas, avoiding the problem of ignoring local details due to overall analysis.
[0053] Therefore, taking the upper left corner of the surface image as the reference, the surface image is evenly divided into blocks according to a preset size, and the preset size is pixel points (empirical value).
[0054] During the chunking process, since the size of the surface image and the chunk size cannot always be evenly divisible, it may result in some pixel points on the right or bottom side of the surface image not being exactly and completely divided. If the width or length of the area formed by these pixel points is less than or equal to 10 pixel points, to ensure the integrity of chunking and the convenience of subsequent calculations, the area formed by these pixel points is divided into the adjacent chunk on its left or upper side. If the width or length of the area formed by these pixel points is greater than 10 and less than 25, considering that this area has a certain degree of independence and analysis value, the area formed by these pixel points is treated as a new separate chunk.
[0055] In this way, the surface image is divided into multiple chunks, and the size of each chunk is not necessarily the same. Ideally, the size of each chunk is exactly the same, but according to the foregoing, there will also be a situation where the sizes of the vast majority of chunks are the same, and the sizes of very few chunks are different.
[0056] After completing the chunking operation of the surface image, further divide each chunk into smaller sub-chunks:
[0057] Preset the side length of the sub-chunks within each chunk to be pixel points, that is, the size of each sub-chunk is pixel points, and for any chunk, the total number of sub-chunks within this chunk is calculated through the following formula: , in this formula, is the total number of sub-chunks within this chunk, is the width of this chunk, is the length of this chunk, is the side length of the sub-chunk.
[0058] Through this series of operations, the surface image of the composite board is evenly divided into several chunks, and each chunk represents a specific area on the board surface, enabling targeted analysis based on the characteristics of different areas and avoiding the neglect of local details during overall analysis. Further dividing each chunk into multiple sub-chunks can deeply study the microscopic structure and texture features within each chunk.
[0059] S22: Evaluating the noise possibility of each pixel point in the surface image is based on the following formula.
[0060] Since the cause of noise pixel points is the gray value distortion caused by data loss during image transmission, and the gray values of noise pixel points are generally relatively extreme. Therefore, when analyzing the degree of gray value abnormality of a pixel point, if the difference between the gray value of a certain pixel point and the gray values of the pixel points in its neighborhood is greater, it indicates that the gray value of this pixel point is more likely to have an abnormality, and the possibility that this pixel point belongs to a noise pixel point is greater.
[0061] First, analyze the gray - scale abnormality degree of each pixel point:
[0062]
[0063] In the formula, is the gray - scale abnormality degree of the th pixel point, is the difference between the gray - scale value of the th pixel point and the maximum gray - scale value of its 8 - neighborhood pixel points, is the difference between the gray - scale value of the th pixel point and the minimum gray - scale value of its 8 - neighborhood pixel points, is the minimum - value - taking function, is the number of pixel points in the surface image whose difference from the gray - scale value of the th pixel point is within , is the preset difference, takes the value of 3 (empirical value).
[0064] In this formula, quantifies the difference in gray - scale values between the th pixel point and its 8 - neighborhood pixel points. When has a smaller value, it indicates that the gray - scale value of the th pixel point is closer to the maximum or minimum gray - scale value of the pixel points in its neighborhood, which means that the difference between the gray - scale value of the th pixel point and the gray - scale values of the pixel points in its neighborhood is larger, and the gray - scale value of the th pixel point is more likely to be abnormal, and the gray - scale abnormality degree of the th pixel point is also larger, and vice versa. Because in a normal image, the gray - scale values of pixel points usually show a relatively smooth transition within the neighborhood.
[0065] In this formula, is smaller, indicating that the th pixel point shows more characteristics of being isolated in the entire surface image. Because in a normal image, the gray - scale value of a pixel point should be similar to those of a certain number of surrounding pixel points. If there are very few pixel points with similar gray - scale values around the th pixel point, then the higher the credibility that the difference between the gray - scale value of the th pixel point and the gray - scale values of the pixel points in its neighborhood is larger, which also means that the gray - scale abnormality degree of the th pixel point is larger.
[0066] In summary, through and The combined effect of these two parameters can accurately evaluate the gray-scale abnormality degree of each pixel point.
[0067] Then, analyze the ripple feature factor of the local area of each pixel point:
[0068] On the surface of the composite board, uneven areas are usually caused by factors such as the manufacturing process and material properties of the board itself. For example, during the board production process, if the pressure is uneven, it may cause local thickness changes or surface undulations in the board. From the perspective of the image, some uneven areas will be generated, and such uneven areas will be reflected as the continuous change of the gray-scale value of pixel points in space, forming a ripple-like feature.
[0069] Since the gray-scale abnormality degree of each pixel point obtained in the previous step is determined based on the gray-scale value performance of a single pixel point. However, in the surface image, the gray-scale values of some edge pixel points in uneven areas may be relatively close to those of noise pixel points. Then, obtaining the gray-scale abnormality degree of each pixel point only by analyzing the gray-scale value performance of each pixel point cannot exclude the interference of some edge pixel points in uneven areas on the noise possibility analysis.
[0070] Therefore, in this step, the texture features within the area surrounded by pixel points within a certain range around each pixel point will be analyzed to optimize the gray-scale abnormality degree of each pixel point to obtain the noise possibility of each pixel point.
[0071] When a pixel point is located in an uneven area, the pixel points around it will show a gray-scale gradient due to this physical continuous change. In the gradient change direction, due to the continuous change trend of the uneven area, the gray-scale value of the pixel point will gradually change, just like moving along a gently undulating slope, and the gray-scale value will gradually rise or fall. Therefore, there is a gray-scale gradient feature for the pixel points in this direction. And the direction perpendicular to the gradient change direction of this pixel point is similar to the contour line direction of the uneven area. In this direction, since the physical properties of the uneven area are relatively consistent within this local range, the gray-scale values of the pixel points are relatively uniform, that is, the change of the gray-scale value is relatively small.
[0072] When a pixel is a noise pixel, noise pixels are usually caused by interference factors during the image acquisition process, such as sensor noise, electronic interference, signal loss or errors during transmission, etc. The appearance of these noise pixels is random and has no direct relation to the physical characteristics and surface morphology of the composite board. The gray value of noise pixels changes randomly and does not follow any rule related to the surface morphology of the board. Around the noise pixels, neither in the gradient direction nor in the direction perpendicular to the gradient, will there be characteristics such as gray-scale gradual change and unified gray value like those in uneven areas. For example, salt-and-pepper noise will suddenly change the gray value of pixels to extremely large or extremely small values, forming distinct and irregular differences from the surrounding pixels, and unable to show the orderly gray-scale changes of pixels in uneven areas.
[0073] Therefore, for each pixel, taking it as the center, all the pixels within the range of the pixel and its surrounding pixels form the local area of this pixel. The reason for doing this is that within this relatively small local range, the relationship between this pixel and its surrounding pixels can be analyzed more effectively, and local texture features can be captured, so as to determine whether it is in an uneven area. The empirical value of
[0074] The main purpose of this step is to distinguish the edge pixels of the uneven area from the noise pixels to obtain the noise possibility of each pixel. Specifically, within the local area of a pixel, all the pixels located in the gradient change direction of this pixel and all the pixels located in the direction perpendicular to the gradient change direction of this pixel are obtained. If all the pixels located in the gradient change direction of this pixel show more gray-scale gradual change characteristics, and the gray values of all the pixels located in the direction perpendicular to the gradient change direction of this pixel are more unified, then this pixel is more likely to be located in the uneven area and less likely to be a noise pixel, and vice versa.
[0075] For those pixels with a relatively low degree of gray-scale abnormality, like noise pixels, they do not have the texture characteristics of the edge pixels of the uneven area. Therefore, a gray-scale abnormality threshold of 0.75 (empirical value) is set. For pixels with a gray-scale abnormality less than 0.75, they do not participate in the in-depth analysis in this step, and directly use the gray-scale abnormality of these pixels as their respective noise possibilities, which simplifies the judgment process.
[0076] For those pixels with a relatively high degree of gray-scale abnormality (pixels with a gray-scale abnormality greater than or equal to 0.75), further calculate and analyze the ripple feature factor of their local area to reflect the degree of the local area of the pixel having ripple characteristics.
[0077] In one embodiment, the calculation formula for the ripple feature factor of the local area of each pixel is as follows:
[0078]
[0079] In this formula, is the ripple feature factor of the local area of the th pixel. The larger is, the greater the possibility that the local area of the th pixel belongs to an uneven area. The th pixel is more in line with the ripple characteristics of the uneven area, and the possibility of belonging to a noise pixel is smaller. is the information entropy value of the gray values of all pixels located in the gradient change direction of the th pixel within the local area of the th pixel. The larger is, the more chaotic the distribution of the gray values of all pixels located in the gradient change direction of the th pixel. is the average gray difference of all adjacent pixels located in the gradient change direction of the th pixel within the local area of the th pixel. The smaller is, the more the gray value differences of all adjacent pixels located in the gradient change direction of the th pixel conform to the gradual change characteristics. is the variance value of the gray values of all pixels located in the direction perpendicular to the gradient change direction of the th pixel within the local area of the th pixel. The smaller is, the more uniform the gray values of all pixels in the direction perpendicular to the gradient change direction of the th pixel. This also conforms to the characteristics of the uneven area. Therefore, the th pixel has a greater possibility of belonging to the uneven area and a smaller possibility of belonging to a noise pixel.
[0080] In this formula, quantifies the degree of gradual change of the gray values of all pixels located in the gradient change direction of the th pixel in the local area of the th pixel. When is larger, it indicates that in the local area of the The more the gray - level values of all pixel points in the gradient change direction of a pixel point conform to the gradual - change feature, that is, the ripple feature of the uneven area, the greater the possibility that the pixel point belongs to the uneven area, and the smaller the possibility that the pixel point is a noise pixel point. Vice versa.
[0081] In summary, through this formula, the gray - level features of all pixel points located in the gray - level change direction and perpendicular to the gray - level change direction of each pixel point in the local area of each pixel point are comprehensively considered, and the ripple feature factor of each pixel point is obtained. The ripple feature factor is an important basis for judging whether a pixel point belongs to an uneven area or a noise pixel point, and provides key information for determining the noise possibility of pixel points.
[0082] Finally, combining the ripple feature factor of a pixel point with the degree of gray - level abnormality of the pixel point can more comprehensively evaluate the noise possibility of the pixel point, making up for the deficiency of judging pixel points only based on the degree of gray - level abnormality.
[0083] In one embodiment, the noise possibility of each pixel point is determined based on the following formula:
[0084]
[0085] In this formula, is the noise possibility of the th pixel point, is the normalization function, is the degree of gray - level abnormality of the th pixel point, is the preset threshold of the degree of abnormality (0.75), is the th pixel point's ripple feature factor of the local area.
[0086] In this formula, The larger it is, it indicates that from the perspective of the gray - level value performance analysis, the th pixel point is more likely to belong to a noise pixel point, and then its noise possibility will also be greater. The larger it is, it can indicate that the possibility that the local area of the th pixel point belongs to an uneven area is greater, the local area of the th pixel point more conforms to the ripple feature of the uneven area, then the possibility that the th pixel point belongs to an uneven area is greater, and the possibility that the th pixel point belongs to a noise pixel point is smaller. Vice versa.
[0087] This formula combines the grayscale abnormality of pixels and the ripple characteristic factors of local areas to determine the possibility of noise. It analyzes pixels from two important dimensions: grayscale value performance and local texture characteristics, comprehensively capturing the characteristics of pixels and making the basis for judging the possibility of noise richer and more accurate.
[0088] S23: Introducing the possibility of noise to optimize the method of determining the distance between sub-blocks and obtain a more accurate distance between sub-blocks.
[0089] In each block, any two sub-blocks form a group of sub-blocks. For each group of sub-blocks, the pixels with the same coordinate position are paired to form multiple groups of pixel points. The coordinate position is obtained by taking the upper left corner of each block as the origin, the horizontal axis to the right as the horizontal axis, and the vertical axis downward as the vertical axis to construct a coordinate system to obtain the coordinate position of each pixel point in each sub-block.
[0090] Among multiple groups of pixels, select the one with the largest grayscale difference. Group pixels and calculate the distance between each group of sub-blocks. (Experience points).
[0091] Select the one with larger grayscale difference The reason for grouping pixels is that the grayscale differences of these pixels are obvious, and they are more likely to contain key information about the differences between sub-blocks. Each pixel has its corresponding noise probability, which represents the probability that the pixel belongs to a noise pixel. When the noise probability of a group of sub-block pixels is greater, it means that this group of pixels is more likely to be noise pixels. Since the grayscale values of noise pixels are often random and do not represent the real differences between sub-blocks, when calculating the distance between two sub-blocks, the grayscale difference corresponding to this group of pixels should have a smaller weight in the weighted calculation, and vice versa.
[0092] Based on the above logic, within each block, for any group of sub-blocks, the distance between the group of sub-blocks, that is, the distance between two sub-blocks contained in a group of sub-blocks, is finally obtained by weighted calculation of the noise possibility and grayscale difference of several groups of pixels with large grayscale differences.
[0093] In one embodiment, the distance between any group of sub-blocks of each block is calculated based on the following formula:
[0094]
[0095] In this formula, For the The first The distance between the group sub-blocks, For the The first in the group of sub - blocks with the largest gray - level difference among the first groups of pixel points, the gray - level difference of the th group of pixel points in the group of sub - blocks with the largest gray - level difference among the first groups of pixel points in the th group of pixel points, is the natural exponential function.
[0096] This calculation method can more reasonably reflect the true difference degree between two sub - blocks. Because it takes into account both the gray - level difference of pixel points and the possibility that pixel points belong to noise pixel points, it avoids the excessive interference of noise on distance calculation, makes the calculation of distance more focused on the true image feature differences, and the calculated distance between sub - blocks is more accurate and reliable.
[0097] S24: Determine the fuzzy membership degree between sub - blocks according to the distance between sub - blocks.
[0098] The fuzzy membership degree is used to measure the similarity degree between two sub - blocks. The smaller the distance, the more similar the two sub - blocks are in terms of gray - level features, etc., and the higher the fuzzy membership degree; conversely, the larger the distance, the lower the fuzzy membership degree. Generally, according to a specific algorithm formula, the fuzzy membership degree between sub - blocks is calculated in combination with the distance between sub - blocks.
[0099] In one embodiment, determining the fuzzy membership degree between each group of sub - blocks is based on the following formula:
[0100]
[0101] In this formula, is the fuzzy membership degree between the th group of sub - blocks of the th block, is the distance between the th group of sub - blocks of the
[0102] The essence of this formula is to define the fuzzy membership degree based on the form of the Gaussian function. It can determine the membership degree according to the distance between sub - blocks in a smooth and reasonable way, uses the characteristics of the Gaussian function to achieve the non - linear mapping between distance and membership degree, and conforms to the general law of the change of fuzzy membership degree with distance, that is, when the distance changes within a certain range, the change of membership degree is gradual, continuous, and has certain symmetry, etc.
[0103] Among them, The determination method is as follows: First, set an initial value of 0.1 (empirical value), and use the current to calculate the fuzzy membership degrees between all sub-blocks, obtain the fuzzy membership degree set, and calculate the information entropy of the current corresponding fuzzy membership degree set;
[0104] An iterative algorithm is used to adjust so that the information entropy is minimized. Information entropy is an important indicator to measure the uncertainty of a system. The information entropy of the fuzzy membership degree set reflects the degree of chaos of the membership degree distribution. By minimizing the information entropy, the distribution of the fuzzy membership degree can be made more concentrated and ordered, thus more accurately reflecting the similarity relationship between sub-blocks.
[0105] Specifically, use the gradient descent method to calculate the partial derivative of the information entropy with respect to , and then update according to the gradient direction. The update formula is:
[0106]
[0107] In this formula, is at the th iteration, is the learning rate, which is used to control the step size of the iteration. Usually, a relatively small value is taken, such as . A smaller learning rate can ensure the stability of the iteration process, avoid the algorithm from not converging or skipping the optimal solution due to too large a step size. At the same time, it can also avoid the algorithm falling into a local optimal solution to a certain extent. represents the number of iterations, is at the th iteration, is at the th iteration corresponding to the information entropy of the fuzzy membership degree set. is the value of the partial derivative function of the information entropy with respect to at . The partial derivative function describes the change rate of the information entropy with respect to . In the th iteration, substitute the current into this partial derivative function, and the obtained value is used to determine the update direction and step size of .
[0108] Set a convergence threshold . When after two consecutive iterations, the change amount of | |Less than When it is considered that the iteration converges, at this time The value of is the determined
[0109] In summary, the fuzzy membership is defined based on the Gaussian function. The Gaussian function has good mathematical properties such as smoothness, continuity, and symmetry. By iteratively adjusting to optimize the membership, these characteristics of the Gaussian function are fully utilized, making the mapping between the distance and the fuzzy membership more scientific and reasonable.
[0110] S25: Obtain the fuzzy entropy of each block.
[0111] For the th block, it contains groups of sub - blocks. Each group of sub - blocks corresponds to a fuzzy membership. First, calculate the average value of the fuzzy memberships of these groups of sub - blocks before expansion; then, expand these groups of sub - blocks. After expansion, since the size of the sub - blocks becomes larger, the number of sub - blocks will also be appropriately reduced. Re - obtain the number of sub - blocks included after the expansion operation. Suppose there are groups of sub - blocks after expansion. Finally, calculate the average value of the fuzzy memberships of these groups of sub - blocks; finally, calculate the fuzzy entropy of the th block, where
[0112] is the absolute - value symbol.
[0113] In one embodiment, the method for expanding all sub - blocks within each block is: On the basis of the side length of each sub - block, add a preset fixed length to achieve the expansion operation of the sub - block. Specifically, within each block, increase the side length of the 5 5 - sized sub - blocks by 2, and increase the size of each sub - block from 5 5 to 7
[0114] 7 to complete the expansion operation of the sub - block.
[0115] The expansion of the sub - block size is to observe the relationship between sub - blocks from different scales. Assume that there are a certain number of sub - block pairs before the expansion of the sub - block. Calculate their fuzzy memberships and find the average value. After the expansion, calculate the fuzzy memberships again and find the average value. The difference between the average values of the two fuzzy memberships is related to the fuzzy entropy. The fuzzy entropy of each block can be calculated through a specific formula.
[0116] The fuzzy entropy reflects the degree of chaos of the fuzzy membership between sub-blocks within a block. Generally speaking, if the change of the fuzzy membership between sub-blocks within a block is complex and the uncertainty is high, that is, the fuzzy entropy of the block is larger, which means the situation within the block is more complex. Intuitively, it is less likely that the block is flat, so the flatness of the block should be lower, and vice versa.
[0117] In one embodiment, the flatness of each block is determined based on the fuzzy entropy of each block according to the following formula:
[0118]
[0119] In this formula, is the flatness of the th block, is the natural exponential function, is the fuzzy entropy of the th block.
[0120] Through the mathematical transformation in this formula, a connection is established between the fuzzy entropy and the flatness, such that the larger the fuzzy entropy, the smaller the calculated flatness, which conforms to the characteristics of the relationship between the flatness and the fuzzy entropy of the block. Finally, the fuzzy entropy is converted into a quantifiable flatness index, providing a basis for the detection of flatness.
[0121] In one embodiment, the method for detecting the flatness of a composite board is as follows:
[0122] Preset the flatness threshold to 0.8 (empirical value). For each block of the surface image of the composite board, if the flatness of the block is less than 0.8, it is determined that the flatness of the area of the composite board in this block is unqualified, and the flatness of the area of this block fails to meet the pre-set quality standard. At this time, the staff will be notified to handle it. The staff will further check and analyze the area of this block according to the actual situation, which may involve adjusting production process parameters, troubleshooting equipment failures, or rechecking raw materials, etc., to ensure that the quality of the final product meets the requirements; if the flatness of the block is not less than 0.8, it is determined that the flatness of the area of the composite board in this block is qualified, and the flatness of the area of this block meets the pre-set quality standard, which means that the area of this block meets the production process and quality requirements and can enter the next production link.
[0123] This block detection method based on threshold judgment not only has high accuracy and reliability, can effectively identify the flatness defects on the surface of the composite board, but also is simple and efficient to operate, and is applicable to large-scale industrial production detection processes.
[0124] Although this specification has shown and described several embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many variations, modifications, and alternative means will occur to those skilled in the art without departing from the spirit and scope of the present invention. It should be understood that various alternatives to the embodiments of the present invention described herein may be employed in practicing the present invention.
Claims
1. A composite plate flatness detection method based on image processing, characterized in that: include: Collecting a surface image of the composite board, dividing the surface image into blocks, dividing each block into a plurality of sub-blocks of the same size, and evaluating the noise possibility of each pixel point of the surface image; In each block, any two sub-blocks form a group of sub-blocks. For each group of sub-blocks, the pixels at the same coordinate position are paired to form multiple groups of pixels. Among the multiple groups of pixels, the front pixel with the largest grayscale difference is selected. Group pixels and calculate the distance between each group of sub-blocks: , For the The first The distance between the sub-blocks, For the The first The front of the group with the largest grayscale difference among the sub-blocks The first pixel in the group The grayscale difference of a group of pixels, For the The first The front of the group with the largest grayscale difference among the sub-blocks The first pixel in the group The sum of the noise probabilities of the pixel points in the group, is the natural exponential function, is the preset quantity; Based on the distance between each group of sub-blocks in each block, the fuzzy membership between each group of sub-blocks is determined. According to the difference between the mean values of the fuzzy membership between all groups of sub-blocks before and after the expansion operation, the fuzzy entropy of each block is obtained. The flatness of each block is determined based on the fuzzy entropy of each block to perform flatness detection on the composite board. The noise possibility of each pixel point of the surface image is evaluated based on the following formula: ; In the formula, For the The noise probability of each pixel is is the normalization function, For the The grayscale abnormality of each pixel point is is the preset abnormality threshold, For the The ripple characteristic factor of the local area of the pixel point; The local area is an area consisting of each pixel and M×M pixels around it as the local area of the pixel, where M is a preset number.
2. The method for detecting the flatness of a composite sheet material based on image processing according to claim 1, characterized in that: The grayscale abnormality level is determined based on the following formula: , For the The grayscale abnormality of each pixel point is For the The difference between the gray value of a pixel and the maximum gray value of its 8 neighboring pixels. For the The difference between the gray value of a pixel and the minimum gray value of its 8 neighboring pixels. To obtain the minimum function, is the surface image with The difference in the gray value of each pixel is The number of pixels within is the preset difference amount, is a natural exponential function.
3. The method for detecting the flatness of a composite sheet material based on image processing according to claim 1, characterized in that: The calculation formula of the ripple characteristic factor in the local area is: , For the The ripple characteristic factor of the local area of pixels, It is in In the local area of pixels, The information entropy value of the grayscale values of all pixels in the gradient change direction of the pixel point, It is in In the local area of pixels, The average grayscale difference of all adjacent pixels in the gradient change direction of a pixel, It is in In the local area of the pixel, The variance of the grayscale values of all pixels in the direction perpendicular to the gradient change direction of each pixel.
4. The method for detecting the flatness of a composite sheet material based on image processing according to claim 1, characterized in that: The flatness of each block is determined based on the fuzzy entropy of each block based on the following formula: , where For the The flatness of each block, is the natural exponential function, For the The fuzzy entropy of the blocks.
5. The method for detecting the flatness of a composite sheet material based on image processing according to claim 1, characterized in that: The method for flatness detection of composite panels is: A flatness threshold is preset; if the flatness of a certain block is less than the flatness threshold, it is determined that the flatness of the composite board in the area of the block is unqualified, and the staff is notified to handle it; If the flatness of a certain block is not less than the flatness threshold, it is determined that the flatness of the composite board in the area of the block is qualified.
6. The method for detecting the flatness of a composite sheet material based on image processing according to claim 1, characterized in that: The fuzzy membership between each group of sub-blocks is determined based on the following formula: , For the The first The fuzzy membership between the group sub-blocks, For the The first The distance between the sub-blocks, is the standard deviation of the Gaussian function, is a natural exponential function.
7. The method for detecting the flatness of a composite sheet material based on image processing according to claim 1, characterized in that: The method for obtaining the fuzzy entropy of each block is: In the Before the expansion operation is performed on all sub-blocks of a block, calculate the The mean of the fuzzy membership of all the sub-blocks of the blocks is ; In the After all sub-blocks of the block are expanded, calculate the The mean of the fuzzy membership of all the sub-blocks of the blocks is ; Calculate the Fuzzy entropy of blocks , is the absolute value symbol.
8. The method for detecting the flatness of a composite sheet material based on image processing according to claim 7, characterized in that: The expansion operation is: adding a preset fixed length on the basis of the side length of each sub-block to implement the expansion operation of the sub-block.
Citation Information
Patent Citations
Artificial board defective product rapid tracing method and system based on big data
CN116740065A