Composite board flatness detection method based on image processing
By chunking and sub-blocking the composite sheet surface image, noise possibility is evaluated and distance calculation method is optimized, the problem of noise interference affecting flatness detection is solved, and a more accurate and reliable flatness detection is achieved.
Patent Information
- Application Number
- CN202510265543.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-04-08
- 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.
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 sub-blocks, the distance calculation method is optimized to improve the accuracy of fuzzy membership and fuzzy entropy.
It effectively reduces the impact of noise interference on flatness detection and improves the accuracy and reliability of flatness detection of composite sheets.
Smart Images

Figure CN119784745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a composite plate flatness detection method based on image processing. Background Art
[0002] Composite materials are often used in many industries such as aviation, automobiles, construction, and electronics due to their excellent performance. 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. In serious cases, it may also damage the equipment. Therefore, accurate flatness detection is of great significance to ensure the smooth progress of subsequent processing and improve the accuracy of processing.
[0003] As an extension of the concept of entropy in the field of fuzzy mathematics, fuzzy entropy can more carefully reflect the blur and uncertainty of an image and is more suitable for flatness detection. When using the fuzzy entropy method to detect the flatness of a composite sheet, the surface image of the composite sheet is first evenly divided into multiple blocks of equal area. Then, the fuzzy entropy in each block is calculated to determine the flatness of the composite sheet area corresponding to the block.
[0004] In the process of calculating the fuzzy entropy within a block, each block is further divided into multiple sub-blocks, and the fuzzy membership between the sub-blocks is determined according to the distance between the sub-blocks, and the fuzzy entropy of the block is calculated according to the difference between the average fuzzy membership between each sub-block before and after the sub-block size expansion. And the method for determining the distance between sub-blocks in this scheme is: compare the grayscale difference between the pixels at several corresponding positions of two sub-blocks, and select the maximum value as the distance between the sub-blocks.
[0005] However, in the process of flatness detection of composite board using the above-mentioned fuzzy entropy-based method, the surface image of the composite board is easily interfered by various factors when it is transmitted from the camera to the processing unit, such as signal interference, data loss or transmission errors. These interferences will introduce noise pixels into the image, and the grayscale value of the noise pixels cannot accurately reflect the real information of the image, resulting in errors in calculating the distance between sub-blocks, resulting in deviations in the calculation of fuzzy membership between sub-blocks, thereby affecting the accuracy of the fuzzy entropy of the block to which the sub-block belongs, and reducing the accuracy and reliability of the flatness detection results. Summary of the invention
[0006] In order to solve the problem that the accuracy of the fuzzy entropy of each block of the composite plate surface image is affected by the interference of noise points, and the accuracy and reliability of the flatness detection result of the composite plate are reduced, the present invention proposes a composite plate flatness detection method based on image processing, comprising: 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 group 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 in the mean value 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 according to the fuzzy entropy of each block to perform flatness detection on the composite board.
[0007] 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.
[0008] Furthermore, the noise probability of each pixel 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.
[0009] 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.
[0010] Furthermore, the grayscale abnormality degree 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 grayscale value of each pixel is The number of pixels within is the preset difference amount, is a natural exponential function.
[0011] The above technical solution comprehensively considers the grayscale differences between local pixels, reflects the abnormality of the grayscale value of the pixel in the neighborhood, and provides a key parameter for evaluating the possibility of noise.
[0012] Furthermore, the calculation formula of the ripple characteristic factor of 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 pixels, The variance of the grayscale values of all pixels in the direction perpendicular to the gradient change direction of each pixel.
[0013] The above technical solution describes the texture features of the local area from different angles, provides more comprehensive local feature information for noise possibility assessment, and makes the noise possibility assessment more comprehensive and accurate.
[0014] Furthermore, 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.
[0015] The above technical solution converts fuzzy entropy into flatness through a natural exponential function, thereby realizing a 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 a quick judgment of the flatness condition of the composite board.
[0016] Furthermore, the method for testing the flatness of the composite sheet is as follows: A flatness threshold is preset; if the flatness of a certain block is less than the flatness threshold, the flatness of the composite board in the area of the block is determined to be unqualified, and the staff is notified to handle it; if the flatness of a certain block is not less than the flatness threshold, the flatness of the composite board in the area of the block is determined to be qualified.
[0017] Furthermore, 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 group sub-blocks, is the standard deviation of the Gaussian function, is a natural exponential function.
[0018] The above technical solution uses Gaussian function to accurately describe the fuzzy relationship between sub-blocks, so that the calculation of fuzzy entropy can better reflect the structural characteristics within the block.
[0019] Furthermore, the fuzzy entropy of each block is obtained as follows: In the Before the expansion operation is performed on all sub-blocks of the block, 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.
[0020] The above technical solution provides a reasonable method for calculating the fuzzy entropy of a block, comprehensively considers the relationship and changes between sub-blocks within the block, and provides a reliable indicator for flatness detection based on fuzzy entropy.
[0021] Furthermore, the local area is each pixel and its surrounding The area formed by pixels is regarded as the local area of the pixel. The preset quantity.
[0022] Furthermore, 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.
[0023] The present invention has the following effects: The present invention reduces the interference of noise points and optimizes the method of obtaining the distance between sub-blocks of each block, so as to obtain a distance that can more accurately reflect the real difference. Based on the distance, the accuracy of the fuzzy entropy of each block is improved. The accurate fuzzy entropy makes the flatness detection result of the composite plate more accurate and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a schematic flow chart of the method of the present invention. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0026] Reference Figure 1 The present invention provides a composite plate flatness detection method based on image processing, comprising steps S1 to S3: S1: Collect the surface image of the composite board and perform preprocessing.
[0027] A high-definition camera is used to shoot and collect the surface of the composite board to obtain a surface image of the composite board, and then the surface image of the composite board is gray-scaled. Therefore, the "surface images" involved in this solution are all images after gray-scale processing.
[0028] S2: The traditional method of flatness detection based on fuzzy entropy of surface image is optimized to obtain accurate fuzzy entropy.
[0029] First, the traditional method of flatness detection based on fuzzy entropy of surface image is explained: First, the image is divided into blocks, and then the distance between sub-blocks is determined based on the block results. Then, the fuzzy membership between sub-blocks is calculated based on the distance between sub-blocks. Finally, the fuzzy entropy of the block is determined according to the change of the average fuzzy membership before and after the sub-block expansion, and flatness detection is performed based on the fuzzy entropy of the block.
[0030] Since the above-mentioned traditional method compares the grayscale differences between the pixels at several corresponding positions of the two sub-blocks in the process of "determining the distance between the sub-blocks based on the block results", the maximum value is selected as the distance between the two sub-blocks. For example, 3 pixels at the same coordinate position are selected in sub-block A and sub-block B, and the grayscale values of the 3 pixels selected in sub-block A are 20, 30, and 40 respectively; the grayscale values of the 3 pixels selected in sub-block B are 50, 80, and 20 respectively, and the grayscale differences are 30, 50, and 20 respectively. Therefore, 50 is used as the distance between sub-block A and sub-block B.
[0031] 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 the sub-blocks cannot be accurately reflected, which in turn affects the subsequent calculation of the fuzzy membership between the blocks and the accuracy of determining the fuzzy entropy of the blocks based on the fuzzy membership, resulting in the results of flatness detection based on fuzzy entropy being inaccurate and unreliable.
[0032] Therefore, this scheme mainly optimizes the process of "determining the distance between sub-blocks based on the block results" to obtain a distance that can better reflect the actual differences between sub-blocks, thereby improving the accuracy of subsequent fuzzy entropy and making the flatness detection results based on fuzzy entropy more reliable.
[0033] Specifically, the steps include: S21: Divide the surface image into blocks and sub-blocks: Since the surface image of a composite sheet usually contains a lot of complex information, directly analyzing the entire image not only requires huge computational effort, but also makes it difficult to accurately capture local features. Therefore, by evenly dividing the image into multiple blocks, the complex overall problem can be broken down into multiple relatively simple local problems. Each block represents a specific area on the surface of the sheet, so that targeted analysis can be performed based on the characteristics of different areas, avoiding the problem of ignoring local details due to overall analysis.
[0034] Therefore, the surface image is evenly divided into blocks based on the upper left corner of the surface image according to the preset size. The preset size is Pixels (experience points).
[0035] In the process of block segmentation, since the size of the surface image and the block size are not always completely divisible, some pixels on the right or lower side of the surface image may not be completely divided. If the width or length of the area formed by this part of the pixels is less than or equal to 10 pixels, in order to ensure the integrity of the block and the convenience of subsequent calculations, the area formed by this part of the pixels is divided into the block immediately adjacent to its left or upper side. If the width or length of the area formed by this part of the pixels is greater than 10 and less than 25, considering that the area has certain independence and analysis value, the area formed by this part of the pixels is processed as a new block.
[0036] In this way, the surface image is divided into multiple blocks, and the size of each block is not necessarily the same. Ideally, the size of each block is exactly the same, but according to the above content, there may be a situation where the size of most blocks is the same, and the size of a very small number of blocks are different.
[0037] After completing the block operation of the surface image, each block is further divided into smaller sub-blocks: The default side length of each sub-block is pixels, that is, the size of each sub-block is pixels, and for any block, the total number of sub-blocks in the block is calculated by the following formula: , in this formula, is the total number of sub-blocks in the block, is the width of the block, is the length of the block, is the side length of the sub-block.
[0038] Through this series of operations, the surface image of the composite board is evenly divided into several blocks. Each block represents a specific area on the board surface, which can be analyzed specifically according to the characteristics of different areas to avoid ignoring local details during overall analysis. Further dividing each block into multiple sub-blocks can deeply study the microstructure and texture characteristics inside each block.
[0039] S22: Evaluating the noise likelihood of each pixel of the surface image is based on the following formula.
[0040] Since the cause of noise pixels is the grayscale distortion caused by data loss during the transmission of the image, and the grayscale value of noise pixels is generally more extreme, when analyzing the grayscale abnormality of a pixel, the greater the difference between the grayscale value of a pixel and the grayscale values of the pixels in its neighborhood, the more likely the grayscale value of the pixel is abnormal, and the more likely the pixel is a noise pixel.
[0041] First, analyze the grayscale abnormality of each pixel:
[0042] In the 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 grayscale value of each pixel is The number of pixels within is the preset difference amount, The value of is 3 (experience value).
[0043] In this formula, Quantified the The difference between the grayscale values of a pixel and its eight neighboring pixels. The smaller the value, the The closer the gray value of a pixel is to the maximum or minimum gray value of the pixels in its neighborhood, the The greater the difference between the grayscale value of a pixel and the grayscale values of the pixels in its neighborhood, the The gray value of the pixel is more likely to be abnormal. The grayscale abnormality of a pixel is greater, and vice versa, because in a normal image, the grayscale value of a pixel usually presents a smoother transition within the neighborhood.
[0044] In this formula, The smaller the The more the pixel point in the entire surface image appears isolated. Because in a normal image, the gray value of a pixel point should be close to a certain number of surrounding pixels. There are few pixels with similar grayscale values around the pixel, so The greater the difference between the grayscale value of the pixel and the pixels in the neighborhood, the higher the credibility, which means that the The greater the grayscale abnormality of the pixel.
[0045] In short, through and The combined effect of these two parameters can accurately evaluate the grayscale abnormality of each pixel.
[0046] Then, the ripple characteristic factor of the local area of each pixel is analyzed: On the surface of composite panels, uneven areas are usually caused by factors such as the manufacturing process and material properties of the panel itself. For example, if the pressure is uneven during the production of the panel, the thickness of the panel may change or the surface may fluctuate. From the perspective of the image, some uneven areas will be generated, which will be reflected as the continuous change of the gray value of the pixel point in space, forming a ripple-like feature.
[0047] Since the grayscale abnormality of each pixel point obtained in the previous step is determined based on the grayscale value of a pixel point, however, in the surface image, the grayscale values of some edge pixels in some uneven areas may have grayscale values close to those of noise pixels. Therefore, only by analyzing the grayscale value of each pixel point to obtain the grayscale abnormality of each pixel point, it is impossible to exclude the interference of some edge pixels in the uneven area on the noise possibility analysis.
[0048] Therefore, in this step, the texture features of the area surrounded by pixels within a certain range around each pixel are analyzed, and the grayscale abnormality of each pixel is optimized to obtain the noise possibility of each pixel.
[0049] When a pixel is located in an uneven area, the surrounding pixels will show grayscale gradient due to this physical continuous change. In the direction of gradient change, due to the continuous change trend of the uneven area, the grayscale value of the pixel will gradually change, just like moving along a gently undulating slope, the grayscale value gradually rises or falls, so the pixels in this direction have grayscale gradient characteristics, and the direction perpendicular to the gradient change direction of the pixel is similar to the direction of the contour line along the uneven area. In this direction, since the physical characteristics of the uneven area are relatively consistent within this local range, the grayscale value of the pixel is relatively uniform, that is, the change in grayscale value is relatively small.
[0050] When a pixel is a noise pixel, it is usually caused by interference factors in the image acquisition process, such as sensor noise, electronic interference, signal loss or error in the transmission process, etc. The appearance of these noise pixels is random and has no direct correlation with the physical properties and surface morphology of the composite board. The grayscale value of the noise pixel changes randomly and does not follow any rules related to the surface morphology of the board. Around the noise pixel, whether in the gradient direction or perpendicular to the gradient direction, it does not show the characteristics of grayscale gradient and uniform grayscale value like the uneven area. For example, salt and pepper noise will cause the grayscale value of the pixel to suddenly become a maximum or minimum value, forming a sharp and irregular difference with the surrounding pixels, and cannot show the orderly grayscale change of the pixels in the uneven area.
[0051] Therefore, for each pixel, take it as the center and compare the pixel with its surroundings. All pixels within the size range of a pixel constitute the local area of the pixel. This is done because within this relatively small local range, the relationship between the pixel and the surrounding pixels can be more effectively analyzed, and the local texture features can be captured to determine whether it is in an uneven area. The experience value is 9.
[0052] The main purpose of this step is to distinguish the edge pixels and noise pixels in the uneven area to obtain the noise possibility of each pixel. Specifically, in the local area of a pixel, all the pixels located in the gradient change direction of the pixel and all the pixels located in the vertical direction of the gradient change direction of the pixel are obtained. If all the pixels located in the gradient change direction of the pixel show grayscale gradient characteristics, and the grayscale values of all the pixels located in the vertical direction of the gradient change direction of the pixel are more uniform, the pixel is more likely to be located in the uneven area and less likely to be a noise pixel, and vice versa.
[0053] For those pixels with low grayscale abnormality, they, like noise pixels, do not have the texture characteristics of edge pixels in uneven areas. Therefore, the grayscale abnormality threshold is set to 0.75 (empirical value). For pixels with grayscale abnormality less than 0.75, they do not participate in the in-depth analysis in this step. The grayscale abnormality of these pixels is directly regarded as the possible noise, which simplifies the judgment process.
[0054] For those pixels with a high degree of grayscale abnormality (pixels with a grayscale abnormality greater than or equal to 0.75), the ripple characteristic factor of their local area is further calculated and analyzed to reflect the degree to which the local area of the pixel has ripple characteristics.
[0055] In one embodiment, the calculation formula of the ripple characteristic factor of the local area of each pixel is:
[0056] In this formula, For the The ripple characteristic factor of the local area of pixels, The larger the The greater the possibility that the local area of the pixel belongs to the uneven area, the The more the pixel point conforms to the ripple characteristics of the uneven area, the less likely it is to be a noise pixel point. 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, The larger the The distribution of the grayscale values of all pixels in the direction of the gradient change of each pixel is more chaotic. 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, The smaller the The gray value difference of all adjacent pixels in the gradient change direction of a pixel point is more consistent with the gradient characteristics. It is in In the local area of pixels, The variance value of the grayscale values of all pixels in the direction perpendicular to the gradient change direction of the pixel point, The smaller it is, the closer it is to the The direction in which the gradient change direction of each pixel is perpendicular to that of the other pixel is more uniform, which is consistent with the characteristics of the uneven area. The greater the possibility that a pixel belongs to an uneven area, the smaller the possibility that it belongs to a noise pixel.
[0057] In this formula, Quantified the The degree of gradient change of the grayscale values of all pixels in the local area of a pixel in the direction of gradient change of the pixel. The larger the value, the In the local area of pixels, The more the grayscale value changes of all pixels in the gradient change direction of a pixel point conform to the gradient characteristics, that is, the ripple characteristics 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, and vice versa.
[0058] To summarize, this formula comprehensively considers the grayscale characteristics of all pixels in the local area of each pixel, in the direction of grayscale change of the pixel and perpendicular to the direction of grayscale change, and obtains the ripple characteristic factor of each pixel. The ripple characteristic factor is an important basis for judging whether the pixel belongs to an uneven area or a noise pixel, and provides key information for determining the noise possibility of the pixel.
[0059] Finally, combining the ripple characteristic factor of the pixel with the grayscale abnormality of the pixel can more comprehensively evaluate the noise possibility of the pixel, making up for the deficiency of judging the pixel only based on the grayscale abnormality.
[0060] In one embodiment, the noise probability of each pixel is determined based on the following formula:
[0061] In this 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 (0.75), For the The ripple characteristic factor of the local area of the pixel point.
[0062] In this formula, The larger the value, the higher the gray value. The more likely a pixel is a noise pixel, the greater its noise probability will be. The larger the The greater the possibility that the local area of the pixel belongs to the uneven area, the The more the local area of the pixel point conforms to the ripple characteristics of the uneven area, the The more likely the pixel is to belong to an uneven area, the greater the probability that the The smaller the probability that a pixel is a noise pixel, the smaller the probability that the pixel is a noise pixel, and vice versa.
[0063] 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.
[0064] 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.
[0065] 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.
[0066] 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).
[0067] 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.
[0068] 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.
[0069] In one embodiment, the distance between any group of sub-blocks of each block is calculated based on the following formula:
[0070] In this formula, For the The first The distance between the group 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 a natural exponential function.
[0071] This calculation method can more reasonably reflect the actual difference between the two sub-blocks, because it not only takes into account the grayscale difference of pixels, but also combines the possibility that the pixels are noise pixels, avoiding excessive interference of noise on distance calculation, making the distance calculation more focused on the real image feature differences, and the calculated distance between sub-blocks is more accurate and reliable.
[0072] S24: Determine the fuzzy membership between the sub-blocks according to the distance between the sub-blocks.
[0073] Fuzzy membership is used to measure the similarity between two sub-blocks. The smaller the distance, the more similar the two sub-blocks are in terms of grayscale features, and the higher the fuzzy membership. Conversely, the larger the distance, the lower the fuzzy membership. Generally, the fuzzy membership between sub-blocks is calculated based on a specific algorithm formula combined with the distance between sub-blocks.
[0074] In one embodiment, the fuzzy membership between each group of sub-blocks is determined based on the following formula:
[0075] In this formula, For the The first The fuzzy membership between the group sub-blocks, For the The first The distance between the group sub-blocks, is the standard deviation of the Gaussian function, is a natural exponential function.
[0076] The essence of this formula is to define the fuzzy membership based on the form of Gaussian function. It can determine the membership according to the distance between sub-blocks in a smooth and reasonable way, and utilizes the characteristics of Gaussian function to realize the nonlinear mapping between distance and membership. It conforms to the general law that the fuzzy membership changes with distance, that is, when the distance changes within a certain range, the change of membership is gradual and continuous, and has certain symmetry and other characteristics.
[0077] in, The determination method is: first set an initial value of 0.1 (experience value), use the current , calculate the fuzzy membership between all sub-blocks, get the fuzzy membership set, and calculate the current The information entropy of the corresponding fuzzy membership set; Adopt iterative algorithm to adjust , so as to minimize the information entropy. Information entropy is an important indicator to measure the uncertainty of the system. The information entropy of the fuzzy membership set reflects the degree of disorder of the membership distribution. By minimizing the information entropy, the distribution of the fuzzy membership can be made more centralized and orderly, thus more accurately reflecting the similarity relationship between sub-blocks.
[0078] Specifically, the gradient descent method is used to calculate the information entropy The partial derivative of is then updated according to the gradient direction , the update formula is:
[0079] In this formula, It is The iteration , is the learning rate, which is used to control the step size of the iteration and usually takes a smaller value, such as A smaller learning rate can ensure the stability of the iterative process and avoid the algorithm from failing to converge or skipping the optimal solution due to a large step size. At the same time, it can also prevent the algorithm from falling into a local optimal solution to a certain extent. represents the number of iterations, It is The iteration , It is At iteration The information entropy of the corresponding fuzzy membership set. is the information entropy about The partial derivative function of The partial derivative function describes the information entropy as The rate of change in In the iteration, the current Substituting into the partial derivative function, the obtained value is used to determine The update direction and step size.
[0080] Set a convergence threshold , after two consecutive iterations, Change in | |Less than When , the iteration is considered to have converged. The value of is determined The value of .
[0081] In summary, the fuzzy membership is defined based on the Gaussian function, which has good mathematical properties such as smoothness, continuity and symmetry, and the fuzzy membership is defined based on the Gaussian function. To optimize the membership, these characteristics of the Gaussian function are fully utilized to make the mapping between distance and fuzzy membership more scientific and reasonable.
[0082] S25: Obtain the fuzzy entropy of each block.
[0083] For blocks, including Each group of sub-blocks corresponds to a fuzzy membership. First calculate this The average value of the fuzzy membership of the group sub-blocks before expansion ; Then, for this After the expansion, the size of the sub-block increases, and the number of sub-blocks will be appropriately reduced. The number of sub-blocks included after the expansion operation is obtained again. Suppose that after the expansion, Group sub-blocks, and finally, calculate this The average value of the fuzzy membership of the group sub-blocks Finally, calculate the Fuzzy entropy of blocks , is the absolute value symbol.
[0084] In one embodiment, the method for performing the expansion operation on all sub-blocks in each block is: A preset fixed length is added to the side length of each sub-block to implement the sub-block expansion operation. Specifically, in each block, 5 The side length of the sub-blocks of size 5 is increased by 2, and the size of each sub-block is increased from 5 5 to 7 7. Complete the expansion operation of the sub-block.
[0085] The purpose of expanding the sub-block size is to observe the relationship between sub-blocks from different scales. Assuming that there are a certain number of sub-block pairs before the sub-block expansion, their fuzzy memberships are calculated and averaged. After the expansion, the fuzzy memberships are calculated and averaged. 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.
[0086] S3: Flatness detection of composite panels is performed based on accurate fuzzy entropy.
[0087] Fuzzy entropy reflects the degree of confusion of fuzzy membership between sub-blocks within a block. Generally speaking, if the changes in fuzzy membership between sub-blocks within a block are complex and the uncertainty is high, that is, the larger the fuzzy entropy of the block, it means that the situation within the block is more complicated. Intuitively, the block is less likely to be flat, so the flatness of the block should be lower, and vice versa.
[0088] In one embodiment, the flatness of each block is determined based on the following formula according to the fuzzy entropy of each block:
[0089] In this formula, For the The flatness of each block, is the natural exponential function, For the The fuzzy entropy of the blocks.
[0090] Through the mathematical transformation in the formula, the fuzzy entropy is linked to the flatness, so that the larger the fuzzy entropy, the smaller the calculated flatness, which conforms to the characteristics of the relationship between the flatness and fuzzy entropy of the block. Finally, the fuzzy entropy is converted into a quantifiable flatness index, which provides a basis for the detection of flatness.
[0091] In one embodiment, the method for detecting the flatness of the composite sheet is: The preset flatness threshold is 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 composite board in the area of the block is unqualified, and the flatness of the area of the block fails to meet the preset quality standards. At this time, the staff will be notified to handle it. The staff will conduct further inspection and analysis of the area of the block based on the actual situation, which may involve adjusting the production process parameters, troubleshooting equipment failures, or reviewing raw materials to ensure that the final product quality meets the requirements; if the flatness of the block is not less than 0.8, it is determined that the flatness of the composite board in the area of the block is qualified, and the flatness of the area of the block meets the preset quality standards, which means that the area of the block meets the production process and quality requirements and can enter the next production link.
[0092] This block detection method based on threshold judgment not only has high accuracy and reliability, and can effectively identify flatness defects on the surface of composite panels, but is also easy and efficient to operate, and is suitable for large-scale industrial production detection processes.
[0093] Although this specification has shown and described a number of 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. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
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 group 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 in the mean value 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 according to the fuzzy entropy of each block to perform flatness detection on the composite board.
2. The method for detecting the flatness of a composite sheet material based on image processing according to claim 1, characterized in that: The noise probability of each pixel in 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.
3. The method for detecting the flatness of a composite sheet material based on image processing according to claim 2, 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.
4. The method for detecting the flatness of a composite sheet material based on image processing according to claim 2, 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.
5. 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.
6. 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.
7. 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 group sub-blocks, is the standard deviation of the Gaussian function, is a natural exponential function.
8. 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.
9. The method for detecting the flatness of a composite sheet material based on image processing according to claim 4, characterized in that: The local area is each pixel and its surrounding The area formed by pixels is regarded as the local area of the pixel. The preset quantity.
10. The composite plate flatness detection method based on image processing according to claim 8, 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
Smart wearable watch screen display super-resolution method based on double-chip alternate processing
CN117274065A
Smart watch hardware quality detection method
CN117495829A
Titanium plate welding spot defect detection method based on image processing
CN118052823A
Image-based power generation equipment part production detection method
CN118552522A
Cited By
Micro-fluidic chip flatness detection device and method based on optical system
CN120445110A
A device and method for detecting flatness of a microfluidic chip based on an optical system
CN120445110B
Concrete distribution uniformity detection method and system based on machine vision
CN121458710A