A method for detecting surface quality of fiber cloth gypsum board
In the surface quality detection of fiber cloth gypsum board surface quality, the molecular regions are divided according to the local characteristics of pixel points and the number of scales of the MSR algorithm is adaptively adjusted, and the uneven image enhancement caused by the unified scale is solved, which improves the detection Accuracy and efficiency.
Patent Information
- Application Number
- CN202411422640.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-10-12
AI Technical Summary
In the surface quality detection of fiber cloth gypsum board, the existing MSR algorithm causes excessive or under-enhancement of certain areas due to the unified number of scales, which affects the accuracy and efficiency of the detection.
By analyzing the uniformity, particle size and detail richness of the local range of pixel points, it is divided into multiple sub-regions, and the number of scales of the MSR algorithm is adaptively adjusted according to the characteristics of each sub-region to perform image enhancement.
The effect and efficiency of image enhancement are improved, and the problems of excessive or under-enhancement are avoided. The enhanced image can better highlight the detailed characteristics of the gypsum board surface and improve the accuracy of detection.
Smart Images

Figure CN118967665B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image data processing, and in particular to a method for detecting the surface quality of a fiber cloth-faced gypsum board. Background Art
[0002] As a commonly used building material, the surface quality of fiber cloth gypsum board directly affects the aesthetics and functionality of the building. Therefore, it is particularly important to inspect its surface quality. The traditional manual inspection method of fiber cloth gypsum board wastes resources, and it is difficult to distinguish the surface of fiber cloth gypsum board from defects. The manual inspection method may have errors. Therefore, the automated quality inspection using image processing can greatly improve the efficiency of subsequent monitoring and reduce production costs. When using image processing technology to inspect the surface quality of fiber cloth gypsum board, in order to improve the inspection efficiency, it is necessary to perform image enhancement processing to improve the contrast and detail visibility of the image, so as to more accurately detect the quality of the gypsum board surface. The Multi-Scale Retinex (MSR) algorithm is an image enhancement algorithm based on the Retinex theory, which is mainly used to improve the contrast of the image and enhance the detail information of the image.
[0003] The patent document with announcement number CN111242872B discloses a real-time RGB image enhancement method based on MSR. The method can implement the MSR color image enhancement algorithm on the FPGA hardware platform to perform high-quality image enhancement on real-time color images. The method includes the following steps: step 1, establish a lookup table; step 2, input the data to be processed; step 3, image enhancement; step 4, image data mapping; step 5, image data output. The method implements the real-time image enhancement algorithm on the FPGA through the Retinex algorithm of two scales. When implementing, the small scale σ=1 is used to reduce the number of Gaussian templates and cached data, and the large scale σ=300 is used to optimize the algorithm; the correlation between the images between frames is used for approximation to avoid repeated iterations of the same image, thereby further simplifying the algorithm.
[0004] However, the above patent document is not aimed at fiber-covered gypsum board, and does not solve the problem that the existing MSR algorithm has different characteristics and detail richness in different areas of the image on the surface of the fiber-covered gypsum board. If a uniform number of MSR scales is used on the entire image, some areas may be over-enhanced or under-enhanced, and the number of MSR scales greatly affects the calculation efficiency. For some unimportant areas, a large number of scales will cause a waste of computing resources. In summary, if a uniform number of MSR scales is used, it will affect the enhancement effect of the image on the surface of the fiber-covered gypsum board, and thus affect the accuracy and efficiency of surface quality detection. Summary of the invention
[0005] In order to solve the problem that the number of uniform MSR scales will affect the image enhancement effect of the fiber cloth gypsum board surface, and thus affect the accuracy and efficiency of surface quality detection, the present invention proposes a fiber cloth gypsum board surface quality detection method, which includes the following steps:
[0006] Obtain a grayscale image of the surface of the fiber cloth gypsum board; determine the uniformity of the local range of each pixel point, the uniformity is positively correlated with the number of grayscale value types of the pixel point in the local range of the pixel point, and negatively correlated with the grayscale value extreme difference of the pixel point in the local range of the pixel point, and the grayscale value extreme difference is the difference between the maximum and minimum values of the grayscale value of the pixel point in the local range of the pixel point; divide the pixel points in the local range of each pixel point into two categories with the largest inter-class variance, and determine the granularity of the local range of each pixel point, the granularity is positively correlated with the shortest path length containing all the pixels in the category in the two categories, and negatively correlated with the number of pixels in the two categories; determine the detail richness of each pixel point, and the detail richness is related to the pixel point. The uniformity and granularity of the local range are negatively correlated; the distance between each pixel and the remaining pixels is determined, and the distance is positively correlated with the difference in detail richness between the pixel and the remaining pixels, a preset detail richness compensation factor, and the Euclidean distance between the target pixel and the remaining pixels; based on the distance, the pixels of the grayscale image are clustered to obtain multiple clusters, and the minimum circumscribed rectangle of each cluster is used as the sub-region of the cluster, and the scale number of the MSR algorithm of each sub-region is determined, and the scale number is positively correlated with the initial scale number and the mean value of the detail richness of each pixel in the sub-region; the grayscale image is enhanced by the MSR algorithm based on the scale number, so as to complete the surface quality detection of the fiber cloth gypsum board.
[0007] The beneficial effects are: the uniformity within the local range of pixels reflects the change of local grayscale values, the granularity within the local range of pixels reflects the distribution density of pixels of different categories, the richness of details is obtained through uniformity and granularity, and the quality characteristics of the grayscale image on the surface of the gypsum board are comprehensively analyzed from different angles; the distance metric is used to cluster pixels, the surface image is divided into multiple clusters, and the minimum circumscribed rectangle is used as the sub-region, so that different regions can be analyzed and processed more specifically, and each sub-region can adaptively adjust the number of scales of the MSR algorithm according to its own characteristics, which can enhance the grayscale image while avoiding the problem of over-enhancement or under-enhancement, better highlight the detailed features of the gypsum board surface, improve the clarity and contrast of the image, and enhance the effect and efficiency of image enhancement.
[0008] Furthermore, the uniformity satisfies the following relationship:
[0009] ; In the formula, For the The uniformity of the local range of pixels, , Respectively The maximum and minimum grayscale values of pixels in the local range of pixels. For the The number of grayscale value types of pixels in the local range of pixels, are the preset hyperparameters.
[0010] The beneficial effects are: by calculating the uniformity by combining the number of grayscale value types in the local range of the pixel with the difference between the maximum and minimum grayscale values, the uniformity characteristics of the local range of the pixel can be more accurately reflected; for different image areas, adaptive adjustments can be made according to the specific grayscale value distribution. In areas where the grayscale value changes greatly, the uniformity will be reduced accordingly, and in areas where the grayscale values are relatively close, the uniformity will be higher, which will help to more finely analyze the quality differences on the surface of the fiber cloth gypsum board and accurately detect potential quality problems.
[0011] Furthermore, the particle size satisfies the following relationship:
[0012] ; In the formula, For the The granularity within the local range of pixels, , Respectively The shortest path length of all pixels in the first and second categories within the local range of pixels, , Respectively The number of pixels in the first category and the second category within the local range of the pixel.
[0013] The beneficial effects are: by calculating the particle size value of each pixel, the particle size distribution of the entire grayscale image can be obtained, providing specific data support for subsequent quality analysis and processing; through statistical analysis of the particle size value, the quality standard and control range can be determined, abnormal conditions in the production process can be discovered in time, and corresponding improvement measures can be taken to improve the stability and consistency of product quality.
[0014] Furthermore, the shortest path length including all pixels of the category is obtained by using the Dijkstra algorithm.
[0015] Furthermore, the detail richness satisfies the following relationship:
[0016] ; In the formula, For the The detail richness of each pixel, For the The uniformity of the local range of pixels, For the The granularity within the local range of pixels, is a natural exponential function.
[0017] The beneficial effect is that by combining the uniformity and granularity of the pixel points, processing is performed in the form of a natural exponential function, and the change of the grayscale value and the particle distribution characteristics in the local range are comprehensively considered to more comprehensively reflect the detailed information of the pixel points.
[0018] Furthermore, the distance satisfies the following relationship:
[0019] ; In the formula, For the pixels and The distance between pixels, , Respectively pixels and The detail richness of each pixel, for pixels and The Euclidean distance between pixels, It is the preset detail richness compensation factor.
[0020] The beneficial effect is that by combining the difference in detail richness of pixels and the Euclidean distance, the actual difference between two pixels can be more comprehensively reflected. The detail richness reflects the complexity of the local image features of the pixels, while the Euclidean distance reflects the distance in spatial position. The combination of the two measures the relationship between pixels from both the image content and spatial position, thereby improving the effect of subsequent image enhancement.
[0021] Furthermore, the clustering adopts a DBSCAN clustering algorithm.
[0022] Furthermore, the number of scales satisfies the following relationship:
[0023] ; In the formula, For the The number of scales of the sub-region MSR algorithm, is the number of initial scales, Indicates The mean value of the detail richness of each pixel in the sub-region, Is the rounding symbol.
[0024] The beneficial effect is that by combining the initial scale number and the detailed characteristics of the sub-region to determine the scale number of the MSR algorithm of the sub-region, it is possible to perform image enhancement on different sub-regions in a more targeted manner, while enhancing the image, better retaining the details and structure of the image, and improving the image quality and clarity; different sub-regions may have different quality characteristics and requirements, and through the adaptive scale number, it can be optimized according to the specific situation, so that the enhanced image is more in line with the requirements of actual detection and analysis.
[0025] Furthermore, the method for completing the surface quality inspection of the fiber cloth faced gypsum board includes: performing threshold segmentation on the enhanced grayscale image to obtain a defective area, and taking the ratio of the area of the defective area to the total area of the grayscale image as the tolerance of the defective area; in response to the tolerance being greater than a preset threshold, determining that the surface quality of the fiber cloth faced gypsum board is unqualified, and completing the surface quality inspection of the fiber cloth faced gypsum board.
[0026] The present invention has the following beneficial effects:
[0027] Using a uniform number of MSR scales on a grayscale image may cause over-enhancement or under-enhancement of some areas, affecting the image enhancement effect. Using a larger number of scales for some unimportant areas or areas with less detail information will waste computing resources and affect computing efficiency. This method comprehensively analyzes the quality characteristics of the gypsum board surface from different angles by considering multiple indicators such as uniformity, granularity, and detail richness within the local range of pixels, clusters pixels using distance metrics, divides the grayscale image into multiple clusters, and uses the minimum circumscribed rectangle as a sub-area, which can more specifically analyze and process different areas. Then, the number of MSR scales is adaptively adjusted in different sub-areas to better adapt to the local characteristics of the image, improve the enhancement effect and efficiency, and thus improve the accuracy of surface quality detection of fiber cloth gypsum boards. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0029] Figure 1 The present invention is a flowchart of the steps of a method for detecting the surface quality of a fiber cloth-faced gypsum board according to an embodiment of the present invention.
[0030] Figure 2 It is a schematic diagram of a grayscale image of a fiber cloth-faced gypsum board surface in a fiber cloth-faced gypsum board surface quality detection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0032] When the present invention uses the MSR algorithm to enhance the grayscale image of the surface of the fiber cloth gypsum board, since different areas of the grayscale image may have different characteristics and detail richness (i.e., the degree of defect expression), and the number of scales in the MSR algorithm determines the enhancement effect, and the larger the number of scales, the greater the computational complexity. If a uniform number of MSR scales is used on the entire image, it may cause a waste of resources in areas with low detail richness, and under-enhancement or over-enhancement problems may occur in locations with high detail richness, thereby affecting the image enhancement effect. Therefore, by combining the uniformity and granularity of the local range of the pixel point, the detail richness of the pixel point is obtained, and then the image is divided into several sub-areas according to the detail richness, and then different numbers of MSR scales are used in different sub-areas to improve the enhancement effect and efficiency of the grayscale image of the surface of the fiber cloth gypsum board.
[0033] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0034] See also Figure 1 , which shows a flow chart of the steps of a method for detecting the surface quality of a fiber cloth gypsum board provided by an embodiment of the present invention, the method comprising the following steps:
[0035] S1: Get a grayscale image of the surface of the fiber cloth gypsum board.
[0036] like Figure 2 As shown, the image of the surface of the fiber cloth gypsum board is collected by a high-resolution camera and grayscaled to obtain a grayscale image.
[0037] S2: Determine the uniformity of the local range of each pixel.
[0038] It should be noted that the uniformity of the local range of pixels can be represented by the number of types of grayscale values of the pixels in the local range and the grayscale value range (the difference between the maximum and minimum grayscale values).
[0039] Specifically, the uniformity satisfies the following relationship:
[0040] ;
[0041] In the formula, For the The uniformity of the local range of pixels, , Respectively The maximum and minimum grayscale values of pixels in the local range of pixels. For the The number of grayscale value types of pixels in the local range of pixels, are the preset hyperparameters.
[0042] Implementers can set the size and hyperparameters of the local range according to the specific implementation. For example, the local range is centered on the current pixel. The window size is 0.01.
[0043] in, The larger the ratio, the better the uniformity, because under a certain gray value width, the more gray value types there are, the smoother the gray value changes, rather than the situation where the gray value has obvious polarization, and the more uniform the gray value is in the local range of the pixel; and when the gray value type is determined, the smaller the gray value width, the more similar the gray value is, and the more uniform the gray value is.
[0044] S3: Divide the pixels in the local range of each pixel into two categories with the largest inter-class variance, and determine the granularity of the local range of each pixel.
[0045] It should be noted that the granularity of pixels in a local range can be divided into two categories by maximizing the inter-class variance, and then the discreteness of the two categories of pixels is calculated separately. The discreteness can be expressed by the average path distance of the pixels in the two categories when the inter-class variance is maximum. The larger the average distance, the better the discreteness. The mean of the discreteness of the two categories can represent the granularity.
[0046] Specifically, the particle size satisfies the following relationship:
[0047] ;
[0048] In the formula, For the The granularity within the local range of pixels, , Respectively The shortest path length of all pixels in the first and second categories within the local range of pixels, , Respectively The number of pixels in the first category and the second category within the local range of the pixel.
[0049] in, , Respectively represent The discreteness of the first category and the second category within the local range of pixels. The higher the discreteness, the stronger the granularity.
[0050] Specifically, the shortest path including all pixels of the category is obtained by using the Dijkstra algorithm.
[0051] S4: Determine the detail richness of each pixel.
[0052] It should be noted that the present invention aims to perform quality inspection on the surface of fiber cloth gypsum board, that is, to detect defects, so it is necessary to determine the richness of details, where the details are the details of the defects (which can be understood as the degree of defect surface), because of the surface characteristics of fiber cloth gypsum board, the grayscale image of its surface has a relatively uniform grayscale value in the local range of the pixel point in the defect-free area, but there are some tiny particles (that is, the grayscale value is relatively uniform, but there is a small grayscale change); and the appearance of defects (such as cracks, bubbles, etc.) will cause the grayscale value of the pixel point in the defect area to change greatly in its local range, and the originally tiny particles will disappear due to scratches or shadows (caused by bubbles). Therefore, the uniformity of the local range of the pixel point and the sense of grain can be used to calculate its richness of details, where the lower the uniformity and the lower the sense of grain, the higher the richness of details.
[0053] Specifically, the detail richness satisfies the following relationship:
[0054] ;
[0055] In the formula, For the The detail richness of each pixel, For the The uniformity of the local range of pixels, For the The granularity within the local range of pixels, is a natural exponential function.
[0056] in, , Respectively represent The uniformity and granularity of the local range of each pixel are negatively correlated with the detail richness, so the sum of their negative exponential powers is the detail richness. The final value of half is taken to limit the value of detail richness to 0-1.
[0057] S5: Determine the distance between each pixel and the remaining pixels.
[0058] It should be noted that after obtaining the detail richness of each pixel in the grayscale image of the surface of the fiber cloth gypsum board, the clustering algorithm can be used to cluster the data points to obtain multiple clusters.
[0059] Specifically, the distance satisfies the following relationship:
[0060] ;
[0061] In the formula, For the pixels and The distance between pixels, , Respectively pixels and The detail richness of each pixel, for pixels and The Euclidean distance between pixels, It is the preset detail richness compensation factor.
[0062] Implementers can set the detail richness compensation factor according to specific implementation conditions, for example, 10. Since the value range of detail richness is limited to 0-1, and the Euclidean distance must be a value greater than 1, the detail richness compensation factor is set.
[0063] S6: Obtain each sub-region and the number of scales of the MSR algorithm of each sub-region according to the distance.
[0064] According to the distance, the pixels of the grayscale image are clustered to obtain a plurality of clusters, the minimum bounding rectangle of each cluster is used as a sub-region of the cluster, and the number of scales of the MSR algorithm for each sub-region is determined.
[0065] Specifically, the clustering adopts the DBSCAN clustering algorithm.
[0066] Implementers can set the clustering radius of the DBSCAN clustering algorithm according to specific implementation conditions, for example, 2.5.
[0067] It should be noted that after the grayscale image is divided, the number of scales of the adaptive MSR algorithm is performed on each sub-region. Because the more scales, the better the image can be enhanced, but at the same time it will bring a larger amount of calculation. Therefore, the present invention sets more scales for areas with higher detail richness; and sets smaller scales for areas with lower detail richness, so as to save computing resources while enhancing the image.
[0068] Specifically, the number of scales satisfies the following relationship:
[0069] ;
[0070] In the formula, For the The number of scales of the sub-region MSR algorithm, is the number of initial scales, Indicates The mean value of the detail richness of each pixel in the sub-region, Is the rounding symbol.
[0071] Implementers can set the number of initial scales according to specific implementation conditions, for example, 2.
[0072] S7: enhancing the grayscale image by using the MSR algorithm according to the number of scales, so as to complete the surface quality detection of the fiber cloth gypsum board.
[0073] Specifically, the surface quality inspection of the fiber cloth gypsum board includes:
[0074] Perform threshold segmentation on the enhanced grayscale image to obtain the defect area, and take the ratio of the area of the defect area to the total area of the grayscale image as the tolerance of the defect area;
[0075] In response to the tolerance being greater than a preset threshold, the surface quality of the fiber cloth faced gypsum board is determined to be unqualified, and the surface quality inspection of the fiber cloth faced gypsum board is completed.
[0076] Implementers can set the threshold, for example, 3%, based on their specific implementation.
[0077] By means of the above detection method, the surface quality of each fiber cloth-faced gypsum board is detected in real time on the production line, and the detection result is combined with the production line control system to timely discover and remove unqualified fiber cloth-faced gypsum boards.
[0078] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting the surface quality of a fiber cloth gypsum board, characterized in that: include: Get a grayscale image of the surface of the fiber cloth gypsum board; Determine the uniformity of the local range of each pixel point. The uniformity is positively correlated with the number of grayscale value types of the pixel point in the local range of the pixel point, and negatively correlated with the grayscale value extreme difference of the pixel point in the local range of the pixel point. The grayscale value extreme difference is the difference between the maximum and minimum grayscale values of the pixel point in the local range of the pixel point. Divide the pixel points in the local range of each pixel point into two categories with the largest inter-class variance, and determine the granularity of the local range of each pixel point. The granularity is positively correlated with the shortest path length containing all the pixels in the two categories, and negatively correlated with the number of pixels in the two categories. Determine the detail richness of each pixel point. Richness, detail richness is negatively correlated with the uniformity and granularity of the local range of the pixel; determine the distance between each pixel and the remaining pixels, the distance is positively correlated with the difference in detail richness between the pixel and the remaining pixels, the preset detail richness compensation factor, and the Euclidean distance between the target pixel and the remaining pixels; based on the distance, cluster the pixels of the grayscale image to obtain multiple clusters, use the minimum circumscribed rectangle of each cluster as the sub-region of the cluster, determine the scale number of the MSR algorithm of each sub-region, and the scale number is positively correlated with the initial scale number and the mean value of the detail richness of each pixel in the sub-region; The grayscale image is enhanced by using the MSR algorithm according to the number of scales, so as to complete the surface quality detection of the fiber cloth gypsum board.
2. A method for detecting the surface quality of a fiber cloth-faced gypsum board according to claim 1, characterized in that: The uniformity satisfies the following relationship: ; In the formula, For the The uniformity of the local range of pixels, , Respectively The maximum and minimum grayscale values of pixels in the local range of pixels. For the The number of grayscale value types of pixels in the local range of pixels, are the preset hyperparameters.
3. A method for detecting the surface quality of a fiber cloth-faced gypsum board according to claim 1, characterized in that: The particle size satisfies the following relationship: ; In the formula, For the The granularity within the local range of pixels, , Respectively The shortest path length of all pixels in the first and second categories within the local range of pixels, , Respectively The number of pixels in the first category and the second category within the local range of the pixel.
4. A method for detecting the surface quality of a fiber cloth-faced gypsum board according to claim 1 or 3, characterized in that: The shortest path length including all pixels of the category is obtained by using the Dijkstra algorithm.
5. The method for detecting the surface quality of a fiber cloth-faced gypsum board according to claim 1, characterized in that: The detail richness satisfies the following relationship: ; In the formula, For the The detail richness of each pixel, For the The uniformity of the local range of pixels, For the The granularity within the local range of pixels, is a natural exponential function.
6. A method for detecting the surface quality of a fiber cloth-faced gypsum board according to claim 1, characterized in that: The distance satisfies the following relationship: ; In the formula, For the pixels and The distance between pixels, , Respectively pixels and The detail richness of each pixel, for pixels and The Euclidean distance between pixels, It is the preset detail richness compensation factor.
7. A method for detecting the surface quality of a fiber cloth-faced gypsum board according to claim 1, characterized in that: The clustering adopts the DBSCAN clustering algorithm.
8. A method for detecting the surface quality of a fiber cloth-faced gypsum board according to claim 1, characterized in that: The number of scales satisfies the following relationship: ; In the formula, For the The number of scales of the sub-region MSR algorithm, is the number of initial scales, Indicates The mean value of the detail richness of each pixel in the sub-region, Is the rounding symbol.
9. A method for detecting the surface quality of a fiber cloth-faced gypsum board according to claim 1, characterized in that: The method for completing the surface quality inspection of fiber cloth gypsum board includes: Perform threshold segmentation on the enhanced grayscale image to obtain the defect area, and take the ratio of the area of the defect area to the total area of the grayscale image as the tolerance of the defect area; In response to the tolerance being greater than a preset threshold, the surface quality of the fiber cloth faced gypsum board is determined to be unqualified, and the surface quality inspection of the fiber cloth faced gypsum board is completed.
Citation Information
Patent Citations
A Real-Time RGB Image Enhancement Method Based on MSR
CN111242872B
Image enhancement method, terminal device and storage medium
CN110706174A
Memory bank damage rapid detection method based on machine vision
CN116664559A