Quality inspection method and system for roadbed reinforcement wood material
By performing threshold iterative segmentation and comprehensive analysis of wood surface images, the wood texture characteristics are quantified, and the problem of misjudging the wood surface texture as a crack defect is solved, and the accuracy of crack defect detection is improved.
Patent Information
- Application Number
- CN202510828445.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-20
AI Technical Summary
The existing iterative threshold segmentation algorithm easily misjudged the wood surface texture as a crack defect in the detection of wood crack defects, resulting in low detection accuracy.
By acquiring the wood surface image for threshold iterative segmentation, combining gradient distribution analysis, similar edge set screening, and texture grayscale change analysis, wood texture index and differential characteristics are quantified, and the edges of crack defects are screened out.
It improves the accuracy of wood crack defect detection, accurately screens out the edges of crack defects, reduces misjudgment, and enhances the reliability of detection.
Smart Images

Figure CN120339288A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image threshold segmentation, and particularly to a quality inspection method and system for subgrade reinforcement wood materials. Background Art
[0002] As a commonly used material in civil engineering, subgrade reinforcement wood materials are widely used in the construction of infrastructure such as roads and bridges, and their quality is directly related to the safety and durability of the project. Due to its natural renewability and good mechanical properties, wood is often used as a subgrade reinforcement material. However, various defects are likely to occur during the growth and processing of wood, and cracks are one of the most common defects that have the greatest impact on the strength of wood. The existence of cracks will significantly reduce the load-bearing capacity of wood, shorten its service life, and may even lead to the failure of subgrade reinforcement and cause engineering accidents.
[0003] Therefore, effective crack defect detection of subgrade reinforcement wood materials is a key link in ensuring project quality. At present, visual inspection technology has become an important means for wood defect detection, and iterative threshold segmentation is a commonly used image processing method. This method obtains the optimal threshold through iterative calculation, divides the image into foreground and background, and thus realizes the identification of defect areas.
[0004] However, in practical applications, when directly performing iterative threshold segmentation on the collected wood images, the following technical problems are often encountered: There is often a certain overlap between the gray-scale distribution of the natural texture on the wood surface and the gray-scale distribution of crack defects. This gray-scale similarity causes the iterative threshold segmentation algorithm to easily misjudge the texture area on the wood surface as the crack defect area, thereby reducing the accuracy of crack defect detection.
[0005] In order to improve the accuracy and reliability of crack defect detection of subgrade reinforcement wood materials, it is necessary to develop a new quality inspection method and system. This method should be able to effectively distinguish the texture and crack defects on the wood surface, overcome the limitations of the existing iterative threshold segmentation algorithm, realize the accurate identification and positioning of crack defects in subgrade reinforcement wood materials, and provide reliable technical support for project quality control. Summary of the Invention
[0006] This section of the present invention is used to briefly introduce concepts, which will be described in detail in the following detailed implementation section. This section of the present invention is not intended to identify the key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0007] In order to solve the technical problem of poor accuracy in crack defect detection of wood, the present invention proposes a quality inspection method and system for subgrade reinforcement wood materials.
[0008] In a first aspect, the present invention provides a quality inspection method for subgrade reinforcement wood materials, the method comprising: Obtain a target surface image corresponding to the wood to be detected, perform threshold iterative segmentation on the target surface image to obtain the edges to be detected, and determine each threshold in the threshold iterative segmentation process as a target threshold; Perform gradient distribution analysis processing on each edge to be detected under each target threshold to obtain the target gradient features of each edge to be detected under each target threshold; Screen out the target similar edge set corresponding to each edge to be detected from all the edges to be detected; According to the distances between each edge to be detected and all the target similar edges in its corresponding target similar edge set, and the target gradient features of all the target similar edges in its corresponding target similar edge set under each target threshold, determine the wood texture index of each edge to be detected under each target threshold; Perform texture gray-scale change analysis processing on each edge to be detected under all the target thresholds to obtain the texture gray-scale change features corresponding to each edge to be detected; According to the wood texture indexes of each edge to be detected under all the target thresholds, determine the texture change difference index corresponding to each edge to be detected; According to the texture change difference indexes and texture gray-scale change features corresponding to all the edges to be detected, screen out the crack defect edges from all the edges to be detected.
[0009] Optionally, the performing gradient distribution analysis processing on each edge to be detected under each target threshold to obtain the target gradient features of each edge to be detected under each target threshold includes: Determine any one edge to be detected as a marked edge, and determine any one target threshold as a marked threshold. According to the marked threshold, perform threshold segmentation on the marked edge, and determine the pixel points within the foreground area in this threshold segmentation of the marked edge as reference pixel points, to obtain the set of reference pixel points of the marked edge under the marked threshold; According to the number of pixel points on the marked edge, the number of reference pixel points in the set of reference pixel points of the marked edge under the marked threshold, and the gradient directions corresponding to the reference pixel points in the set of reference pixel points of the marked edge under the marked threshold, determine the target gradient features of the marked edge under the marked threshold.
[0010] Optionally, the formula corresponding to the target gradient features of the edge to be detected under the target threshold is: ; where is the target gradient feature of the i-th edge to be detected under the j-th target threshold; i is the serial number of the edge to be detected; j is the serial number of the target threshold; is the number of pixel points on the i-th edge to be detected; is the number of reference pixel points in the reference pixel point set of the i-th edge to be detected under the j-th target threshold; a is the serial number of the reference pixel point in the reference pixel point set of the i-th edge to be detected under the j-th target threshold; is the absolute value function; is the gradient direction corresponding to the a-th reference pixel point in the reference pixel point set of the i-th edge to be detected under the j-th target threshold; is the gradient direction corresponding to the (a + 1)-th reference pixel point in the reference pixel point set of the i-th edge to be detected under the j-th target threshold; is a preset factor greater than 0.
[0011] Optionally, the screening of the target similar edge set corresponding to each edge to be detected from all edges to be detected includes: Determine any one edge to be detected as the marked edge, and screen out a preset number of edges to be detected from all edges to be detected whose fitting line directions are the same as the fitting line direction of the marked edge and are the closest to the marked edge as the target similar edges, so as to obtain the target similar edge set corresponding to the marked edge.
[0012] Optionally, the formula for the wood texture index of the edge to be detected under the target threshold is: ; where is the wood texture index of the i-th edge to be detected under the j-th target threshold; i is the serial number of the edge to be detected; j is the serial number of the target threshold; is the target gradient feature of the i-th edge to be detected under the j-th target threshold; is the number of target similar edges in the target similar edge set corresponding to the i-th edge to be detected; b is the serial number of the target similar edge in the target similar edge set corresponding to the i-th edge to be detected; is the target gradient feature of the b-th target similar edge in the target similar edge set corresponding to the i-th edge to be detected under the j-th target threshold; is the distance between the i-th edge to be detected and the b-th target similar edge in its corresponding target similar edge set.
[0013] Optionally, the texture gray-scale change analysis and processing of each edge to be detected under all target thresholds to obtain the texture gray-scale change feature corresponding to each edge to be detected includes: Determine any edge to be detected as a marked edge, and determine the texture gray - level change feature corresponding to the marked edge according to the gray - level values of all pixel points within the circumscribed rectangle of the marked edge and their gray - level values under all target thresholds, where the gray - level value corresponding to a pixel point is the gray - level value of the pixel point in the target surface image; if the gray - level value corresponding to a pixel point is greater than the target threshold, take the first preset gray - level value as the gray - level value of the pixel point under the target threshold; if the gray - level value corresponding to a pixel point is less than or equal to the target threshold, take the second preset gray - level value as the gray - level value of the pixel point under the target threshold.
[0014] Optionally, the formula for the texture gray - level change feature corresponding to the edge to be detected is: ; ; where, is the texture gray - level change feature corresponding to the i - th edge to be detected; i is the serial number of the edge to be detected; N is the number of target thresholds; j is the serial number of the target threshold; is the absolute - value function; is the gray - level difference index of the i - th edge to be detected under the j - th target threshold; is the gray - level difference index of the i - th edge to be detected under the (j + 1) - th target threshold; is the number of pixel points within the circumscribed rectangle of the i - th edge to be detected; c is the serial number of the pixel point within the circumscribed rectangle of the i - th edge to be detected; is the gray - level value corresponding to the c - th pixel point within the circumscribed rectangle of the i - th edge to be detected; is the gray - level value of the c - th pixel point within the circumscribed rectangle of the i - th edge to be detected under the j - th target threshold.
[0015] Optionally, determining the texture change difference index corresponding to each edge to be detected according to the wood texture indexes of each edge to be detected under all target thresholds includes: Determine any edge to be detected as a marked edge, and determine the absolute value of the difference between the wood texture indexes of the marked edge under every two adjacent target thresholds as the texture difference factor, obtaining the texture difference factor set corresponding to the marked edge; Determine the sum of all texture difference factors in the texture difference factor set corresponding to the marked edge as the texture change difference index corresponding to the marked edge.
[0016] Optionally, screening out the crack defect edges from all edges to be detected according to the texture change difference indexes and texture gray - level change features corresponding to all edges to be detected includes: According to the texture change difference index and texture gray-scale change characteristics corresponding to each edge to be detected, determine the wood possibility index corresponding to each edge to be detected, wherein the texture gray-scale change characteristics are positively correlated with the wood possibility index, and the texture change difference index is negatively correlated with the wood possibility index; If the wood possibility index corresponding to the edge to be detected is less than or equal to the preset possibility threshold, then determine the edge to be detected as a crack defect edge.
[0017] In a second aspect, the present invention provides a quality inspection system for subgrade-reinforced wood materials, including a processor and a memory. The processor is configured to process instructions stored in the memory to implement the above-mentioned quality inspection method for subgrade-reinforced wood materials.
[0018] The present invention has the following beneficial effects: The quality inspection method for the wood material used in subgrade reinforcement of the present invention realizes the detection of wood surface defects by performing image processing on the target surface image, solves the technical problem of poor accuracy in detecting crack defects in wood, and improves the accuracy of detecting crack defects in wood. First, perform threshold iteration segmentation on the obtained target surface image, and the edges to be detected are often the edges of wood surface texture or crack defects. Then, since the gradient distributions of the edges of wood surface texture and crack defects are often different, analyze and process the gradient distribution of each edge to be detected under each target threshold. The quantified target gradient features of each edge to be detected under each target threshold can, to a certain extent, distinguish the edges of wood surface texture and crack defects. Next, comprehensively consider the distances between each edge to be detected and all the target similar edges in its corresponding target similar edge set, as well as the target gradient features of each edge to be detected and all the target similar edges in its corresponding target similar edge set under each target threshold. The larger the wood texture index of the edge to be detected under each target threshold, the more likely it indicates that the edge to be detected is the edge of wood surface texture. After that, since the texture gray-scale changes and texture change differences between the edges of wood surface texture and crack defects are often different, the quantified texture gray-scale change features and texture change difference indexes corresponding to the edges to be detected can, to a certain extent, distinguish the edges of wood surface texture and crack defects. Finally, comprehensively consider the texture change difference indexes and texture gray-scale change features corresponding to all the edges to be detected. The crack defect edges selected from all the edges to be detected can be the edges of the crack defect area, realizing the detection of crack defects. And compared with directly taking the edges to be detected obtained by threshold iteration segmentation as the crack defect edges, the present invention comprehensively considers multiple distinguishing features of wood surface texture and crack defects, such as target gradient features, wood texture indexes, texture gray-scale change features, and texture change difference indexes, etc., and relatively accurately selects the crack defect edges from the edges to be detected obtained by threshold iteration segmentation, thereby improving the accuracy of detecting crack defects in the wood to be detected. Description of the Drawings
[0019] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0020] Figure 1 It is a flowchart of the quality inspection method for the wood material used in subgrade reinforcement of the present invention. Detailed Embodiments
[0021] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following specifically describes the specific implementation manners, structures, features, and effects of the technical solutions proposed according to the present invention in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0023] The present invention provides a quality inspection method for subgrade reinforcement wood materials, and the method includes the following steps: Obtain the target surface image corresponding to the wood to be detected, perform threshold iterative segmentation on the target surface image to obtain the edges to be detected, and determine each threshold in the threshold iterative segmentation process as the target threshold; Perform gradient distribution analysis processing on each edge to be detected under each target threshold to obtain the target gradient features of each edge to be detected under each target threshold; Select the target similar edge set corresponding to each edge to be detected from all the edges to be detected; According to the distances between each edge to be detected and all the target similar edges in its corresponding target similar edge set, and the target gradient features of each edge to be detected and all the target similar edges in its corresponding target similar edge set under each target threshold, determine the wood texture index of each edge to be detected under each target threshold; Perform texture gray-scale change analysis processing on each edge to be detected under all the target thresholds to obtain the texture gray-scale change features corresponding to each edge to be detected; According to the wood texture indexes of each edge to be detected under all the target thresholds, determine the texture change difference index corresponding to each edge to be detected; According to the texture change difference indexes and texture gray-scale change features corresponding to all the edges to be detected, select the crack defect edges from all the edges to be detected.
[0024] The following details each of the above steps: Refer to Figure 1 , which shows the flow of some embodiments of the quality inspection method for subgrade reinforcement wood materials of the present invention. The quality inspection method for subgrade reinforcement wood materials includes the following steps: Step S1, obtain the target surface image corresponding to the wood to be detected, perform threshold iterative segmentation on the target surface image to obtain the edges to be detected, and determine each threshold in the threshold iterative segmentation process as the target threshold.
[0025] In some embodiments, a target surface image corresponding to the subgrade reinforcement wood to be detected can be obtained, the above target surface image can be subjected to threshold iterative segmentation to obtain the edge to be detected, and each threshold in the threshold iterative segmentation process can be determined as the target threshold.
[0026] Among them, the wood to be detected can be the subgrade reinforcement wood to be subjected to crack defect detection. The target surface image can be the surface image of the wood to be detected after grayscale processing.
[0027] It should be noted that when the obtained target surface image is subjected to threshold iterative segmentation to obtain the edge to be detected, it is often the edge of the wood surface texture or the crack defect edge.
[0028] As an example, this step may include the following steps: The first step is to obtain the surface image of the wood to be detected as the initial image.
[0029] For example, the surface image of the wood to be detected can be collected through a camera as the initial image.
[0030] The second step is to grayscale the initial image and use the obtained grayscale image as the target surface image.
[0031] The third step is to perform threshold iterative segmentation on the target surface image, and use each edge in the foreground region segmented at the end of the final threshold iterative segmentation as the edge to be detected.
[0032] Among them, the foreground region segmented at the end of the final threshold iterative segmentation can be the region where the pixel points with gray values less than or equal to the final threshold are located in the target surface image. At this time, the foreground region is often the region where the wood texture and cracks are located.
[0033] It should be noted that generally, the gray levels corresponding to the wood texture and cracks are often lower than those of other regions of the wood. Therefore, the foreground region in the embodiments of the present invention can be the region composed of pixel points with gray values less than or equal to the corresponding threshold.
[0034] The fourth step is to use each threshold in the threshold iterative segmentation process as the target threshold.
[0035] Step S2: Perform gradient distribution analysis processing on each edge to be detected under each target threshold to obtain the target gradient feature of each edge to be detected under each target threshold.
[0036] In some embodiments, gradient distribution analysis processing can be performed on each edge to be detected under each target threshold to obtain the target gradient feature of each edge to be detected under each target threshold.
[0037] It should be noted that since the gradient distributions of the edges of the wood surface texture and the edges of crack defects often differ, the gradient distribution of each edge to be detected is analyzed and processed at each target threshold. The target gradient features of each edge to be detected quantified at each target threshold can, to a certain extent, distinguish the edges of the wood surface texture from the edges of crack defects.
[0038] As an example, this step may include the following steps: First, determine any edge to be detected as a marked edge and any target threshold as a marked threshold. According to the above-mentioned marked threshold, perform threshold segmentation on the above-mentioned marked edge, and determine the pixel points of the above-mentioned marked edge that are within the foreground area in this threshold segmentation as reference pixel points, thereby obtaining the set of reference pixel points of the above-mentioned marked edge under the above-mentioned marked threshold.
[0039] For example, performing threshold segmentation on the marked edge according to the marked threshold may include: taking the pixel points on the marked edge whose gray values are less than or equal to the marked threshold as reference pixel points, and combining all the reference pixel points on the marked edge obtained by the threshold segmentation at this time into a set of reference pixel points. The pixel points on the marked edge whose gray values are less than or equal to the marked threshold are, in fact, the pixel points of the marked edge that are within the foreground area in the threshold segmentation of the marked edge according to the marked threshold. The foreground area at this time may be an area composed of pixel points whose gray values are less than or equal to the marked threshold.
[0040] Second, determine the target gradient feature of the above-mentioned marked edge under the above-mentioned marked threshold according to the number of pixel points on the above-mentioned marked edge, the number of reference pixel points in the set of reference pixel points of the above-mentioned marked edge under the above-mentioned marked threshold, and the gradient directions corresponding to the reference pixel points in the set of reference pixel points of the above-mentioned marked edge under the above-mentioned marked threshold.
[0041] Among them, the value range of the gradient direction can be [0°, 360°].
[0042] For example, the formula corresponding to the target gradient feature of the edge to be detected under the target threshold may be: ; where is the target gradient feature of the i-th edge to be detected under the j-th target threshold. i is the serial number of the edge to be detected. j is the serial number of the target threshold. is the number of pixel points on the i-th edge to be detected. is the number of reference pixel points in the set of reference pixel points of the i-th edge to be detected under the j-th target threshold. a is the serial number of the reference pixel point in the set of reference pixel points of the i-th edge to be detected under the j-th target threshold. is the absolute value function. is the gradient direction corresponding to the a-th reference pixel point in the set of reference pixel points of the i-th edge to be detected under the j-th target threshold. is the gradient direction corresponding to the (a + 1)-th reference pixel point in the set of reference pixel points of the i-th edge to be detected under the j-th target threshold. is a preset factor greater than 0, mainly used to prevent the denominator from being 0. For example, can be 0.001.
[0043] It should be noted that the surface texture of wood is often greatly affected by different thresholds. For example, the pixel points within the wood surface texture may be shown as pixel points in the foreground area under a certain target threshold, or may be shown as pixel points in the background area under other target thresholds. Relatively speaking, the pixel points within the crack defects are less affected by different thresholds. Therefore, when is larger, it often indicates that relatively more pixel points of the i-th edge to be detected change to the background under the j-th target threshold, often indicates that the i-th edge to be detected is relatively more affected by different thresholds, and often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture. Since the wood surface texture often presents as smooth thin lines, the gradient directions of the pixel points on the wood surface texture edge are often relatively similar. Since cracks often have a certain width and irregular shapes and may have bifurcations, the gradient directions of the pixel points on the crack edge are often relatively chaotic. When is larger, it often indicates that the gradient distribution of the i-th edge to be detected under the j-th target threshold is relatively more chaotic, and often indicates that the i-th edge to be detected is more likely to be the crack edge. Therefore, when is larger, it often indicates that the i-th edge to be detected under the j-th target threshold more conforms to the characteristics of the wood surface texture edge, and often indicates that the i-th edge to be detected is more likely to be the wood surface texture edge.
[0044] Step S3, screen out the set of target similar edges corresponding to each edge to be detected from all the edges to be detected.
[0045] In some embodiments, the set of target similar edges corresponding to each edge to be detected can be screened out from all the edges to be detected.
[0046] As an example, any edge to be detected can be determined as a marked edge. From all the edges to be detected, a preset number of edges to be detected with the same fitting line direction as the fitting line direction of the above-mentioned marked edge and the closest distance to the above-mentioned marked edge are selected as target similar edges, and a target similar edge set corresponding to the above-mentioned marked edge is obtained. Among them, the preset number can be a non-zero number set in advance. For example, the preset number can be 2. The target similar edge set corresponding to the marked edge may include: a preset number of edges to be detected with the same fitting line direction as the fitting line direction of the marked edge and the closest distance to the marked edge. The same fitting line direction may mean the same slope of the fitting line. The slope of the fitting line corresponding to the marked edge may be equal to the slope of the fitting line corresponding to the target similar edge of the marked edge. The fitting line corresponding to the marked edge is the fitting line of the marked edge. The fitting line corresponding to the target similar edge is the fitting line of the target similar edge.
[0047] It should be noted that the surface texture of wood is often smooth fine lines, and the texture directions on the surface of the same wooden board are often the same. Therefore, there are often multiple texture edges with the same direction as the texture edge on the wood surface. Therefore, the number of target similar edges in the target similar edge set corresponding to the wood surface texture edge is often the preset number. Cracks often have a certain width and irregular shapes. Therefore, there may be no or few edges with the same direction as the crack, so the number of target similar edges in the target similar edge set corresponding to the crack edge may be 0.
[0048] Step S4: Determine the wood texture index of each edge to be detected at each target threshold according to the distance between each edge to be detected and all the target similar edges in its corresponding target similar edge set, and the target gradient features of each edge to be detected and all the target similar edges in its corresponding target similar edge set at each target threshold.
[0049] In some embodiments, the wood texture index of each edge to be detected at each target threshold can be determined according to the distance between each edge to be detected and all the target similar edges in its corresponding target similar edge set, and the target gradient features of each edge to be detected and all the target similar edges in its corresponding target similar edge set at each target threshold.
[0050] Among them, the distance between the edge to be detected and the target similar edge can be: the distance between the fitting line corresponding to the edge to be detected and the fitting line corresponding to the target similar edge.
[0051] It should be noted that by comprehensively considering the distances between each edge to be detected and all the target similar edges in its corresponding set of target similar edges, as well as the target gradient features of all the target similar edges in the corresponding set of target similar edges for each edge to be detected under each target threshold, the larger the wood texture index of the edge to be detected under each target threshold, the more likely it indicates that the edge to be detected is the edge of the wood surface texture.
[0052] As an example, the formula corresponding to the wood texture index of the edge to be detected under the target threshold can be: ; where is the wood texture index of the i-th edge to be detected under the j-th target threshold. i is the serial number of the edge to be detected. j is the serial number of the target threshold. is the target gradient feature of the i-th edge to be detected under the j-th target threshold. is the number of target similar edges in the set of target similar edges corresponding to the i-th edge to be detected. b is the serial number of the target similar edge in the set of target similar edges corresponding to the i-th edge to be detected. is the target gradient feature of the b-th target similar edge in the set of target similar edges corresponding to the i-th edge to be detected under the j-th target threshold. is the distance between the i-th edge to be detected and the b-th target similar edge in its corresponding set of target similar edges.
[0053] It should be noted that can characterize the possibility that the i-th edge to be detected is the edge of the wood surface texture. The larger its value, the more likely it indicates that the i-th edge to be detected is the edge of the wood surface texture. Since the number of target similar edges in the set of target similar edges corresponding to the crack edge may be 0, so when , it often indicates that the i-th edge to be detected may be the crack edge, and it often indicates that there is less need to increase the possibility that the i-th edge to be detected is the edge of the wood surface texture. Since the number of target similar edges in the set of target similar edges corresponding to the edge of the wood surface texture is often greater than 0, so when , it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture, and it often indicates that there is a greater need to increase the possibility that the i-th edge to be detected is the edge of the wood surface texture. Since the distance between adjacent edges of the wood surface texture is often relatively close, so when is smaller, it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture. When is larger, it often indicates that the i-th edge to be detected better conforms to the characteristics of the edge of the wood surface texture under the j-th target threshold, and it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture. So when The larger it is, it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture. Therefore, when When is used as the weight of, it increases the possibility that the i-th edge to be detected is the edge of the wood surface texture.
[0054] Step S5: Perform texture gray-scale change analysis and processing on each edge to be detected under all target thresholds, and obtain the texture gray-scale change characteristics corresponding to each edge to be detected.
[0055] In some embodiments, texture gray-scale change analysis and processing can be performed on each edge to be detected under all target thresholds to obtain the texture gray-scale change characteristics corresponding to each edge to be detected.
[0056] It should be noted that since the texture gray-scale changes of the wood surface texture edge and the crack defect edge are often different, texture gray-scale change analysis and processing are performed on the edge to be detected under all target thresholds, and the quantified texture gray-scale change characteristics corresponding to the edge to be detected can, to a certain extent, distinguish the wood surface texture edge and the crack defect edge.
[0057] As an example, any edge to be detected can be determined as the marked edge. According to the gray-scale values of all pixel points within the circumscribed rectangle of the above-mentioned marked edge and its gray-scale values under all target thresholds, the texture gray-scale change characteristics corresponding to the above-mentioned marked edge are determined, where the gray-scale value corresponding to the pixel point is the gray-scale value of the pixel point in the target surface image. If the gray-scale value corresponding to the pixel point is greater than the target threshold, the first preset gray-scale value is used as the gray-scale value of the pixel point under the target threshold. If the gray-scale value corresponding to the pixel point is less than or equal to the target threshold, the second preset gray-scale value is used as the gray-scale value of the pixel point under the target threshold. The first preset gray-scale value and the second preset gray-scale value can be different gray-scale values set in advance. For example, the first preset gray-scale value can be 255. The second preset gray-scale value can be 0.
[0058] For example, the formula corresponding to the texture gray-scale change characteristics of the edge to be detected can be: ; ; where is the texture gray-scale change characteristic corresponding to the i-th edge to be detected. i is the serial number of the edge to be detected. N is the number of target thresholds. j is the serial number of the target threshold. is the absolute value function. is the gray-scale difference index of the i-th edge to be detected under the j-th target threshold. is the gray-scale difference index of the i-th edge to be detected under the (j + 1)-th target threshold. is the number of pixel points within the circumscribed rectangle of the i-th edge to be detected. c is the serial number of the pixel point within the circumscribed rectangle of the i-th edge to be detected. is the gray value corresponding to the c-th pixel point within the circumscribed rectangle of the i-th edge to be detected. is the gray value of the c-th pixel point within the circumscribed rectangle of the i-th edge to be detected under the j-th target threshold.
[0059] It should be noted that when is larger, it often indicates that the gray change difference of the circumscribed rectangle area of the i-th edge to be detected under the j-th target threshold is larger, and it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture. When is larger, it often indicates that the gray change degree of the circumscribed rectangle area of the i-th edge to be detected under two different target thresholds is larger, and it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture. Therefore, when is larger, it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture.
[0060] Step S6: Determine the texture change difference index corresponding to each edge to be detected according to the wood texture indexes of each edge to be detected under all target thresholds.
[0061] In some embodiments, the texture change difference index corresponding to each edge to be detected can be determined according to the wood texture indexes of each edge to be detected under all target thresholds.
[0062] It should be noted that since the texture change differences between the edges of the wood surface texture and the edges of crack defects are often different, the quantified texture change difference index corresponding to the edge to be detected can, to a certain extent, distinguish the edges of the wood surface texture and the edges of crack defects.
[0063] As an example, this step may include the following steps: First step: Determine any edge to be detected as the marked edge, and determine the absolute value of the difference between the wood texture indexes of the above marked edge under every two adjacent target thresholds as the texture difference factor, and obtain the set of texture difference factors corresponding to the above marked edge.
[0064] Second step: Determine the sum of all texture difference factors in the set of texture difference factors corresponding to the above marked edge as the texture change difference index corresponding to the above marked edge.
[0065] For example, the formula for determining the texture change difference index corresponding to the edge to be detected can be: ; where is the texture change difference index corresponding to the i-th edge to be detected. i is the serial number of the edge to be detected. N is the number of target thresholds. j is the serial number of the target threshold. is the absolute value function. is the wood texture index of the i-th edge to be detected under the j-th target threshold, which can characterize the smoothness of the i-th edge to be detected under the j-th target threshold. is the wood texture index of the i-th edge to be detected under the (j + 1)-th target threshold. is the texture difference factor, which can characterize the smoothness of the i-th edge to be detected under the (j + 1)-th target threshold.
[0066] It should be noted that during the process of foreground region change, that is, during the iterative threshold segmentation process, its smoothness often also changes. Due to the periodicity and growth cycle of the wood texture of the wooden board itself, it remains basically unchanged during the threshold change process, while the cracks often change significantly. During the calculation of threshold update, the smaller the change amplitude of the texture smoothness, the greater the possibility that the edge represents the texture of the wooden board itself. When is smaller, it often indicates that the change in the smoothness of the i-th edge to be detected under different target thresholds is relatively smaller, and it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture.
[0067] Step S7, according to the texture change difference indexes and texture gray-scale change characteristics corresponding to all edges to be detected, screen out the crack defect edges from all edges to be detected.
[0068] In some embodiments, the crack defect edges can be screened out from all edges to be detected according to the texture change difference indexes and texture gray-scale change characteristics corresponding to all edges to be detected.
[0069] It should be noted that by comprehensively considering the texture change difference indexes and texture gray-scale change characteristics corresponding to all edges to be detected, the crack defect edges screened out from all edges to be detected can be the edges of the crack defect area, realizing the detection of crack defects.
[0070] As an example, this step may include the following steps: The first step is to determine the wood possibility index corresponding to each edge to be detected according to the texture change difference index and texture gray-scale change characteristic corresponding to each edge to be detected.
[0071] Among them, the texture gray-scale change characteristic is positively correlated with the wood possibility index. The texture change difference index is negatively correlated with the wood possibility index.
[0072] For example, the formula for determining the wood possibility index corresponding to the edge to be detected can be: ; wherein, is the wood possibility index corresponding to the i-th edge to be detected. i is the serial number of the edge to be detected. is a normalization function. is the texture gray-scale change feature corresponding to the i-th edge to be detected. is the texture change difference index corresponding to the i-th edge to be detected. is a preset factor greater than 0, mainly used to prevent the denominator from being 0. For example, can be 0.001.
[0073] It should be noted that when is smaller, it often indicates that the change in the smoothness of the i-th edge to be detected under different target thresholds is relatively smaller, and it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture. When is larger, it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture. Therefore, when is larger, it often indicates that the i-th edge to be detected is more likely to be the edge of the wood surface texture, and it often indicates that the i-th edge to be detected should be less likely to be detected as a crack defect.
[0074] Second step, if the wood possibility index corresponding to the edge to be detected is less than or equal to the preset possibility threshold, then determine the edge to be detected as the crack defect edge.
[0075] Among them, the preset possibility threshold can be a preset threshold. For example, the preset possibility threshold can be 0.7.
[0076] It should be noted that if the wood possibility index corresponding to the edge to be detected is greater than the preset possibility threshold, it indicates that the edge to be detected is often the edge of the wood surface texture and should be less likely to be shown during crack defect detection.
[0077] Optionally, in order to improve the accuracy of crack defect detection, the area surrounded by the screened crack defect edges can be used as the target surface image, and steps S1 - S7 are repeatedly executed. Further screened crack defect edges can be repeated multiple times. For example, it can be repeated 10 times, and the latest screened crack defect edges are used as the finally screened crack defect edges, or it can be repeated until there are no wood surface texture edges.
[0078] Based on the same inventive concept as the above method embodiment, the present invention provides a quality inspection system for subgrade reinforcement wood materials. The system includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the above computer program is executed by the processor, it implements the steps of the quality inspection method for subgrade reinforcement wood materials.
[0079] In summary, compared with directly using the edges to be detected obtained by threshold iteration segmentation as the crack defect edges, the present invention comprehensively considers the distinguishing features of multiple wood surface textures and crack defects. For example, target gradient features, wood texture indexes, texture gray-scale change features, texture change difference indexes, etc. The crack defect edges are relatively accurately screened out from the edges to be detected obtained by threshold iteration segmentation, thereby improving the accuracy of crack defect detection for the wood to be detected.
[0080] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A quality inspection method for wood materials used in subgrade reinforcement, characterized in that, Including the following steps: Obtain the target surface image corresponding to the wood to be detected, perform threshold iterative segmentation on the target surface image to obtain the edges to be detected, and determine each threshold in the threshold iterative segmentation process as the target threshold; Perform gradient distribution analysis processing on each edge to be detected under each target threshold to obtain the target gradient feature of each edge to be detected under each target threshold; Screen out the target similar edge set corresponding to each edge to be detected from all the edges to be detected; Determine the wood texture index of each edge to be detected under each target threshold according to the distance between each edge to be detected and all the target similar edges in its corresponding target similar edge set, and the target gradient features of all the target similar edges in its corresponding target similar edge set under each target threshold; Perform texture gray change analysis processing on each edge to be detected under all the target thresholds to obtain the texture gray change feature corresponding to each edge to be detected; Determine the texture change difference index corresponding to each edge to be detected according to the wood texture indexes of each edge to be detected under all the target thresholds; Screen out the crack defect edges from all the edges to be detected according to the texture change difference indexes and texture gray change features corresponding to all the edges to be detected; 2. The quality inspection method for the roadbed reinforcement wood material according to claim 1, characterized in that The performing gradient distribution analysis processing on each edge to be detected under each target threshold to obtain the target gradient feature of each edge to be detected under each target threshold includes: Determine any edge to be detected as the marked edge and any target threshold as the marked threshold. According to the marked threshold, perform threshold segmentation on the marked edge, and determine the pixel points within the foreground area in this threshold segmentation of the marked edge as the reference pixel points to obtain the reference pixel point set of the marked edge under the marked threshold; Determine the target gradient feature of the marked edge under the marked threshold according to the number of pixel points on the marked edge, the number of reference pixel points in the reference pixel point set of the marked edge under the marked threshold, and the gradient directions corresponding to the reference pixel points in the reference pixel point set of the marked edge under the marked threshold; 3. The quality inspection method for the roadbed reinforcement wood material according to claim 2, characterized in that, The formula for the target gradient feature of the edge to be detected under the target threshold is: ; wherein, is the target gradient feature of the i-th edge to be detected under the j-th target threshold; i is the serial number of the edge to be detected; j is the serial number of the target threshold; is the number of pixel points on the i-th edge to be detected; is the number of reference pixel points in the reference pixel point set of the i-th edge to be detected under the j-th target threshold; a is the serial number of the reference pixel point in the reference pixel point set of the i-th edge to be detected under the j-th target threshold; is the absolute value function; is the gradient direction corresponding to the a-th reference pixel point in the reference pixel point set of the i-th edge to be detected under the j-th target threshold; is the gradient direction corresponding to the (a + 1)-th reference pixel point in the reference pixel point set of the i-th edge to be detected under the j-th target threshold; is a preset factor greater than 0.
4. The quality inspection method for the roadbed reinforcement wood material according to claim 1, characterized in that, The screening out the target similar edge set corresponding to each edge to be detected from all the edges to be detected includes: Determine any edge to be detected as the marked edge, and screen out a preset number of edges to be detected with the same fitting line direction as the marked edge and the closest distance to the marked edge from all the edges to be detected as the target similar edges to obtain the target similar edge set corresponding to the marked edge; 5. The quality inspection method for the roadbed reinforcement wood material according to claim 1, characterized in that, The formula for the wood texture index of the edge to be detected under the target threshold is: ; wherein, is the wood texture index of the i-th edge to be detected under the j-th target threshold; i is the serial number of the edge to be detected; j is the serial number of the target threshold; is the target gradient feature of the i-th edge to be detected under the j-th target threshold; is the number of target similar edges in the target similar edge set corresponding to the i-th edge to be detected; b is the serial number of the target similar edge in the target similar edge set corresponding to the i-th edge to be detected; is the target gradient feature of the b-th target similar edge in the target similar edge set corresponding to the i-th edge to be detected under the j-th target threshold; is the distance between the i-th edge to be detected and the b-th target similar edge in its corresponding target similar edge set.
6. The quality inspection method for the subgrade reinforcement wood material according to claim 1, characterized in that, The performing texture gray change analysis processing on each edge to be detected under all the target thresholds to obtain the texture gray change feature corresponding to each edge to be detected includes: Determine any edge to be detected as a marked edge, and determine the texture gray-scale change feature corresponding to the marked edge according to the gray-scale values corresponding to all pixel points within the circumscribed rectangle of the marked edge and their gray-scale values under all target thresholds, where the gray-scale value corresponding to a pixel point is the gray-scale value of the pixel point in the target surface image; if the gray-scale value corresponding to a pixel point is greater than the target threshold, use the first preset gray-scale value as the gray-scale value of the pixel point under the target threshold; if the gray-scale value corresponding to a pixel point is less than or equal to the target threshold, use the second preset gray-scale value as the gray-scale value of the pixel point under the target threshold.
7. The quality inspection method for the subgrade reinforcement wood material according to claim 6, characterized in that, The formula corresponding to the texture gray-scale change feature corresponding to the edge to be detected is: ; ; where, is the texture gray-scale change feature corresponding to the i-th edge to be detected; i is the serial number of the edge to be detected; N is the number of target thresholds; j is the serial number of the target threshold; is the absolute value function; is the gray-scale difference index of the i-th edge to be detected under the j-th target threshold; is the gray-scale difference index of the i-th edge to be detected under the (j + 1)-th target threshold; is the number of pixel points within the circumscribed rectangle of the i-th edge to be detected; c is the serial number of the pixel point within the circumscribed rectangle of the i-th edge to be detected; is the gray-scale value corresponding to the c-th pixel point within the circumscribed rectangle of the i-th edge to be detected; is the gray-scale value of the c-th pixel point within the circumscribed rectangle of the i-th edge to be detected under the j-th target threshold.
8. The quality inspection method for the subgrade reinforcement wood material according to claim 1, characterized in that, Determining the texture change difference index corresponding to each edge to be detected according to the wood texture indexes of each edge to be detected under all target thresholds includes: Determine any edge to be detected as a marked edge, and determine the absolute value of the difference between the wood texture indexes of the marked edge under every two adjacent target thresholds as the texture difference factor, and obtain the set of texture difference factors corresponding to the marked edge; Determine the cumulative sum of all texture difference factors in the set of texture difference factors corresponding to the marked edge as the texture change difference index corresponding to the marked edge.
9. The quality inspection method for the roadbed reinforcement wood material according to claim 1, characterized in that Screening out the crack defect edges from all the edges to be detected according to the texture change difference indexes and texture gray-scale change features corresponding to all the edges to be detected includes: Determine the wood possibility index corresponding to each edge to be detected according to the texture change difference index and texture gray-scale change feature corresponding to each edge to be detected, where the texture gray-scale change feature is positively correlated with the wood possibility index, and the texture change difference index is negatively correlated with the wood possibility index; If the wood possibility index corresponding to the edge to be detected is less than or equal to the preset possibility threshold, determine the edge to be detected as a crack defect edge.
10. A quality inspection system for subgrade reinforcement wood materials, characterized in that, It includes a processor and a memory, and the processor is used to process the instructions stored in the memory to implement the quality inspection method for subgrade-reinforcing wood materials described in any one of claims 1-9.
Citation Information
Patent Citations
Visual inspection system for polishing effect of aluminum alloy surface
CN117173189A
Electroplated product surface flaw detection method based on image features
CN117314924A
Visual inspection method for surface defects of injection mold
CN118071753A
Building structure steel plate defect detection method based on machine vision
CN118587161A
A stepwise refinement detection method for pavement cracks
US20180137612A1