Method, system and readable storage medium for measuring glue width of wood board

Through the segmented projection and non-maximum simulation technology of image data processing, the problems of manual instability and low equipment accuracy in the measurement of wood board glue width are solved, and high-accuracy and high-efficiency measurement is achieved, which is suitable for different environments. Wood board glue width detection.

CN118154664BActive Publication Date: 2024-09-20HANGZHOU HUICUI INTELLIGENT TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202410584819.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-09-20
Estimated Expiration
2044-05-13

AI Technical Summary

Technical Problem

The existing wood board glue width measurement method has problems such as unstable manual measurement, low equipment accuracy, and high requirements on the surface conditions of the wood board, resulting in inaccurate measurement results and low efficiency.

Method used

The segmented projection method based on image data is used to calculate the maximum, minimum and average distances of the wood board glue width by extracting projection curves, edge point sets and non-maximum value simulation processing, thereby reducing external interference and improving the robustness of the measurement.

Benefits of technology

It improves the accuracy and stability of wood board glue width measurement, reduces labor and material costs, adapts to measurement needs in different environments, and improves production efficiency and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118154664B
    Figure CN118154664B
Patent Text Reader

Abstract

The present invention discloses a method, system and readable storage medium for measuring the glue width of a wooden board, wherein the method comprises: acquiring image data of the wooden board; performing segmented projection based on the image data to obtain projection curves of each segment; extracting edge point sets of the edges of each segment based on the projection curve to obtain a target curve, wherein the target curve includes an upper curve and a lower curve; obtaining target edge points by screening based on the target curve, and calculating a target distance based on the target edge points, wherein the target distance includes a maximum distance, a minimum distance and an average distance. The present invention effectively reduces the influence of external interference on the measurement results by precisely controlling the measurement parameters, thereby ensuring the reliability of the measurement data. At the same time, its high robustness enables the method to adapt to changes in the glue width of wooden boards under different environments, thereby improving production efficiency and product quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of measurement technology, and more specifically, to a method, system and readable storage medium for measuring the glue width of a wood board. Background Art

[0002] The existing methods for measuring the glue width of wooden boards have some significant disadvantages, which limit their efficiency and accuracy in practical applications.

[0003] First, traditional measurement methods usually rely on manual measurement, which is easily affected by the operator's technical level and subjective factors, resulting in instability and low reliability of the measurement results. Manual measurement also requires a lot of human resources and time costs, and is inefficient.

[0004] Secondly, some existing technologies use equipment with low precision, which is difficult to meet the requirements for high-precision measurement. These devices may be affected by environmental factors, wear and tear, or inaccurate calibration, resulting in large deviations in measurement results.

[0005] In addition, some existing methods have high requirements on the surface conditions of the wood board, such as surface flatness and cleanliness, which limits the applicability of the method in real production environments. Especially in industrial production sites such as wood processing plants, there may be various defects and contamination on the surface of the wood board, which affects the accuracy and stability of the measurement. Summary of the invention

[0006] The purpose of the present invention is to provide a method, system and readable storage medium for measuring the glue width of a wooden board, which improves the accuracy and stability of the measurement, and is simple to operate and easy to implement, thus saving a lot of manpower and material costs for enterprises.

[0007] A first aspect of the present invention provides a method for measuring the glue width of a wood board, comprising the following steps:

[0008] Get the image data of the wooden board;

[0009] Performing segmented projection based on the image data to obtain projection curves of each segment;

[0010] Extracting edge point sets of each edge segment based on the projection curve to obtain a target curve, wherein the target curve includes an upper curve and a lower curve;

[0011] Target edge points are obtained by screening based on the target curve, and target distances are calculated based on the target edge points, wherein the target distances include a maximum distance, a minimum distance, and an average distance.

[0012] In this solution, the segmented projection based on the image data is performed to obtain projection curves of each segment, specifically including:

[0013] Acquire segmentation parameters specified by the user end, wherein the segmentation parameters include segment parameters and step length;

[0014] Segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;

[0015] Traversing the target segment row by row to obtain an average value of pixels in each row, and performing differential processing based on a pixel sequence corresponding to each row of pixels to obtain a horizontal projection corresponding to each target segment;

[0016] The projection curve is obtained by connecting the horizontal projections corresponding to the target segments in a segmented order.

[0017] In this solution, performing differential processing on the pixel sequence to obtain the horizontal projection specifically includes:

[0018] The pixel sequence is filtered using a preset kernel, wherein the preset kernel includes:

[0019] ;

[0020] Wherein, K is the preset kernel, n is the number of peak points of the projection curve, and n≥2.

[0021] In this solution, extracting edge point sets of each edge segment based on the projection curve to obtain a target curve specifically includes:

[0022] Determine the direction of grayscale change based on the grayscale mutation at the edge of the image;

[0023] The curve edge is determined based on the grayscale change direction, wherein:

[0024] The upper curve is obtained based on the first grayscale change direction, and the lower curve is obtained based on the second grayscale change direction;

[0025] The target curve is obtained based on the upper curve and the lower curve, wherein noise points have been removed from the target curve.

[0026] In this solution, the target edge points are obtained by screening based on the target curve, and the target distance is calculated based on the target edge points, which specifically includes:

[0027] Performing non-maximum simulation processing based on the target curve to obtain a peak point set;

[0028] After removing the peak point set from the edge point set, performing straight line fitting on the remaining edge points and calculating the distance between the fitting curve and each point of the edge point set to remove the noise points;

[0029] Obtaining the target edge point based on the peak point set combined with the grayscale transition direction of the target curve;

[0030] The maximum distance, the minimum distance and the average distance are calculated based on the target edge points to obtain the target distance.

[0031] In this solution, the non-maximum simulation processing based on the target curve to obtain the peak point set specifically includes:

[0032] Putting the edge point set into a preset first set;

[0033] Remove points in the first set that are smaller than a specified threshold value, and obtain a maximum value point from the first set, wherein all points in the specified range corresponding to the maximum value point in the first set are removed;

[0034] The maximum value point is taken out and put into a preset second set until the first set is an empty set, and the peak point set is obtained based on the points in the second set.

[0035] The second aspect of the present invention further provides a system for measuring the glue width of a wooden board, comprising a memory and a processor, wherein the memory comprises a program for measuring the glue width of a wooden board, and when the program for measuring the glue width of a wooden board is executed by the processor, the following steps are implemented:

[0036] Get the image data of the wooden board;

[0037] Performing segmented projection based on the image data to obtain projection curves of each segment;

[0038] Extracting edge point sets of each edge segment based on the projection curve to obtain a target curve, wherein the target curve includes an upper curve and a lower curve;

[0039] Target edge points are obtained by screening based on the target curve, and target distances are calculated based on the target edge points, wherein the target distances include a maximum distance, a minimum distance, and an average distance.

[0040] In this solution, the segmented projection based on the image data is performed to obtain projection curves of each segment, specifically including:

[0041] Acquire segmentation parameters specified by the user end, wherein the segmentation parameters include segment parameters and step length;

[0042] Segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;

[0043] Traversing the target segment row by row to obtain an average value of pixels in each row, and performing differential processing based on a pixel sequence corresponding to each row of pixels to obtain a horizontal projection corresponding to each target segment;

[0044] The projection curve is obtained by connecting the horizontal projections corresponding to the target segments in a segmented order.

[0045] In this solution, performing differential processing on the pixel sequence to obtain the horizontal projection specifically includes:

[0046] The pixel sequence is filtered using a preset kernel, wherein the preset kernel includes:

[0047] ;

[0048] Wherein, K is the preset kernel, n is the number of peak points of the projection curve, and n≥2.

[0049] In this solution, extracting edge point sets of each edge segment based on the projection curve to obtain a target curve specifically includes:

[0050] Determine the direction of grayscale change based on the grayscale mutation at the edge of the image;

[0051] The curve edge is determined based on the grayscale change direction, wherein:

[0052] The upper curve is obtained based on the first grayscale change direction, and the lower curve is obtained based on the second grayscale change direction;

[0053] The target curve is obtained based on the upper curve and the lower curve, wherein noise points have been removed from the target curve.

[0054] In this solution, the target edge points are obtained by screening based on the target curve, and the target distance is calculated based on the target edge points, which specifically includes:

[0055] Performing non-maximum simulation processing based on the target curve to obtain a peak point set;

[0056] After removing the peak point set from the edge point set, performing straight line fitting on the remaining edge points and calculating the distance between the fitting curve and each point of the edge point set to remove the noise points;

[0057] Obtaining the target edge point based on the peak point set combined with the grayscale transition direction of the target curve;

[0058] The maximum distance, the minimum distance and the average distance are calculated based on the target edge points to obtain the target distance.

[0059] In this solution, the non-maximum simulation processing based on the target curve to obtain the peak point set specifically includes:

[0060] Putting the edge point set into a preset first set;

[0061] Remove points in the first set that are smaller than a specified threshold value, and obtain a maximum value point from the first set, wherein all points in the specified range corresponding to the maximum value point in the first set are removed;

[0062] The maximum value point is taken out and put into a preset second set until the first set is an empty set, and the peak point set is obtained based on the points in the second set.

[0063] The third aspect of the present invention provides a computer-readable storage medium, which includes a machine-readable program for a method for measuring the glue width of a wooden board. When the program for measuring the glue width of a wooden board is executed by a processor, the steps of a method for measuring the glue width of a wooden board as described in any one of the above items are implemented.

[0064] The present invention discloses a method, system and readable storage medium for measuring the glue width of a wooden board, which effectively reduces the influence of external interference on the measurement results by accurately controlling the measurement parameters, thereby ensuring the reliability of the measurement data. At the same time, its high robustness enables the method to adapt to the changes in the glue width of wooden boards under different environments, thereby improving production efficiency and product quality.

[0065] In addition, the method is simple to operate and easy to implement, saving a lot of manpower and material costs for the enterprise. In summary, this highly robust method for measuring the glue width of wooden boards has significant beneficial effects and is of great significance for improving the accuracy and efficiency of measuring the glue width of wooden boards. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1A A schematic diagram showing the measurement of the glue width of a wood board with a bad glue joint;

[0067] Figure 1B A schematic diagram showing the measurement of the glue width of a wood board with uneven edge banding;

[0068] Figure 2 A flow chart showing a method for measuring the glue width of a wood board according to the present invention is shown;

[0069] Figure 3 A schematic diagram of segmented projection of a method for measuring the glue width of a wood board according to the present invention is shown;

[0070] Figure 4 A schematic diagram showing the correspondence between the peak value and the edge of a curve of a method for measuring the glue width of a wood board according to the present invention is shown;

[0071] Figure 5 A schematic diagram of a segmented image of a double-sided edge of a method for measuring the glue width of a wood board according to the present invention is shown;

[0072] Fig. 6A A schematic diagram of a curve before the suppression algorithm of a method for measuring the glue width of a wooden board of the present invention is shown;

[0073] Figure 6B A curve schematic diagram showing a method for measuring the glue width of a wood board according to the present invention after suppressing the algorithm;

[0074] Figure 7 A block diagram of a system for measuring the glue width of a wood board according to the present invention is shown. DETAILED DESCRIPTION

[0075] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0076] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0077] In the wood board industry, gluing and edge banding are required when producing wood boards. Poor gluing and edge banding operations lead to poor quality of finished wood boards (such as wood veneer), which has a negative impact on the subsequent customer construction. Therefore, it is necessary to test the quality of finished wood boards during the production process, and glue width measurement is an important project.

[0078] Glue width measurement can be used to detect problems such as poor glue joints and uneven edge banding. Due to the variety of wood material types and complex production environments, poor glue joints and uneven edge banding will present various edge shapes, which will seriously affect the edge detection of the glue and thus affect the measurement of glue width. Figure 1A As shown in the figure, it shows the situation of poor glue joint, such as Figure 1B The picture shows the uneven edge banding. The two pictures of the wood board glue width that need to be measured in the listed two cases, the double horizontal lines in the figure represent the edge to be detected, and the double arrow vertical line represents the maximum width. It can be seen that the glue path edges that need to be detected in different cases are different.

[0079] According to the disclosed prior art, the existing wood board glue width measurement method has the disadvantages of unstable manual measurement, low equipment accuracy, and high requirements on the surface conditions of the wood board. Therefore, there is an urgent need for a highly robust measurement method to overcome these problems and improve the accuracy and efficiency of wood board glue width measurement.

[0080] In this regard, the present application proposes a method for measuring the glue width of a wooden board, wherein: Figure 2 A flow chart of a method for measuring the glue width of a wooden board of the present application is shown.

[0081] Specifically, Figure 2As shown, the present application discloses a method for measuring the glue width of a wooden board, comprising the following steps:

[0082] S202, obtaining image data of the wooden board;

[0083] S204, performing segmented projection based on the image data to obtain projection curves of each segment;

[0084] S206, extracting edge point sets of each edge segment based on the projection curve to obtain a target curve, wherein the target curve includes an upper curve and a lower curve;

[0085] S208, obtaining target edge points based on the target curve, and calculating target distances based on the target edge points, wherein the target distances include a maximum distance, a minimum distance, and an average distance.

[0086] It should be noted that, in this embodiment, the image data corresponding to the wooden board after gluing must first be obtained, and then the graphics must be preprocessed, such as using Gaussian filtering to remove noise, and then the image must be segmented and horizontally projected to obtain the projection curves at each segment, and the edge point set of each segment edge is extracted based on the projection curve to perform straight line fitting to obtain the target curve, wherein the target curve includes an upper curve and a lower curve, and then the noise edge points are removed, and the target edge points are screened out based on the target curve, which can be obtained by performing non-maximum simulation processing on the target curve, and finally the maximum distance, minimum distance and average distance are calculated based on the target edge points to obtain the target distance, wherein the target edge points correspond to the edge points in the upper and lower curves.

[0087] According to an embodiment of the present invention, performing segmented projection based on the image data to obtain projection curves of each segment specifically includes:

[0088] Acquire segmentation parameters specified by the user end, wherein the segmentation parameters include segment parameters and step length;

[0089] Segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;

[0090] Traversing the target segment row by row to obtain an average value of pixels in each row, and performing differential processing based on a pixel sequence corresponding to each row of pixels to obtain a horizontal projection corresponding to each target segment;

[0091] The projection curve is obtained by connecting the horizontal projections corresponding to the target segments in a segmented order.

[0092] It should be noted that, in this embodiment, Figure 3As shown, it is a schematic diagram of segmented projection. Specifically, the segmentation method cannot extract complex edges. According to the horizontal characteristics of the edge of the rubber road, the horizontal projection method can be used to extract the edge. Considering that the edge is not completely horizontal, the horizontal projection of the entire image is not effective. Therefore, the segmented projection method is used. The segment size and step size can be specified when segmenting. Therefore, the segmentation parameters specified by the user end are obtained. The segmentation parameters include segment parameters and step size. The smaller the segment size, the finer the edge points obtained, but they are easily affected by noise. On the contrary, the larger the segment size, the more noise-resistant it is, and the extracted edge is a coarse edge. The step size has a similar effect and can play a noise-resistant role. At the same time, when the step size increases, the speed of edge extraction can be improved.

[0093] Furthermore, to extract edge points in a segment, it is necessary to first project the extraction curve. The horizontal projection method is to traverse from top to bottom by row, obtain the average value of each row of pixels, and perform differential processing based on the pixel sequence corresponding to each row of pixels to obtain the horizontal projection corresponding to each target segment, such as Figure 4 As shown, it is a schematic diagram showing the correspondence between the curve peak and the edge of the segmented horizontal projection, and then the projection curve is obtained by connecting the horizontal projections corresponding to each target segment in the segment order.

[0094] According to an embodiment of the present invention, performing differential processing on a pixel sequence to obtain the horizontal projection specifically includes:

[0095] The pixel sequence is filtered using a preset kernel, wherein the preset kernel includes:

[0096] ;

[0097] Wherein, K is the preset kernel, and n is the number of peak points of the projection curve.

[0098] It should be noted that in this embodiment, the curve obtained by difference is easier to judge the edge position through the peak point. When performing difference processing, the curve is first smoothed to avoid the influence of noise. The specific method is to use the kernel [-1,-,2,-3,3,2,1] to filter the point set. The larger the kernel, the better the noise resistance. The kernel form is as follows: , where K is the preset kernel, n is the number of peak points of the projection curve, and n≥“2”.

[0099] According to an embodiment of the present invention, extracting edge point sets of each edge segment based on the projection curve to obtain a target curve specifically includes:

[0100] Determine the direction of grayscale change based on the grayscale mutation at the edge of the image;

[0101] The curve edge is determined based on the grayscale change direction, wherein:

[0102] The upper curve is obtained based on the first grayscale change direction, and the lower curve is obtained based on the second grayscale change direction;

[0103] The target curve is obtained based on the upper curve and the lower curve, wherein noise points have been removed from the target curve.

[0104] It should be noted that, in this embodiment, there are grayscale mutations at the edges of the image, which can be divided into light to dark and dark to light. Therefore, the grayscale change direction can be determined based on the grayscale mutation of the image edge, and the curve edge can be determined based on the grayscale change direction. When it is light to dark, the point value on the curve is less than "0", and when it is dark to light, the point value on the curve is greater than "0". Therefore, the grayscale change direction can be specified when detecting the edge, so that some double edges can be excluded, such as Figure 5 As shown, a segmented image with double-sided edges is displayed, and one of the edges can be determined specifically according to the grayscale change direction, wherein the upper curve is obtained based on the first grayscale change direction, and the lower curve is obtained based on the second grayscale change direction, thereby obtaining the target curve based on the upper curve and the lower curve, wherein noise points have been removed from the target curve.

[0105] According to an embodiment of the present invention, the step of obtaining target edge points based on the target curve and calculating the target distance based on the target edge points specifically includes:

[0106] Performing non-maximum simulation processing based on the target curve to obtain a peak point set;

[0107] After removing the peak point set from the edge point set, performing straight line fitting on the remaining edge points and calculating the distance between the fitting curve and each point of the edge point set to remove the noise points;

[0108] Obtaining the target edge point based on the peak point set combined with the grayscale transition direction of the target curve;

[0109] The maximum distance, the minimum distance and the average distance are calculated based on the target edge points to obtain the target distance.

[0110] It should be noted that, in this embodiment, according to Figure 4 From the projection curve shown, we can see that there are multiple peak points on the curve. According to common sense, the two points with the largest peaks should be taken as edge points. However, due to the influence of noise, there may be multiple large peaks near the peak edge, and they should belong to the same edge in the image. Therefore, it is necessary to simulate the projection curve as a non-maximum value and exclude noise points with a threshold value less than a certain value.

[0111] Further, Figure 4 The projection curve shown has only "3" peak points after non-maximum suppression processing. According to the direction of grayscale change, it can be known that the upper edge is dark to light and the lower edge is light to dark, so two edge points are obtained. The edge point set is obtained by segmented horizontal projection. Due to the influence of noise, noisy edge points may be extracted, so they need to be excluded. Among them, the edge points are fitted with a straight line, and then the distance from each edge point to the straight line is traversed. When the distance is greater than a certain value, it is considered to be noise and removed. Finally, the edge points excluded are the final peak point set. Based on the peak point set combined with the grayscale transition direction of the target curve, the target edge point is obtained, and the maximum distance, minimum distance and average distance are calculated based on the target edge point to obtain the target distance.

[0112] According to an embodiment of the present invention, performing non-maximum simulation processing based on the target curve to obtain a peak point set specifically includes:

[0113] Putting the edge point set into a preset first set;

[0114] Remove points in the first set that are smaller than a specified threshold value, and obtain a maximum value point from the first set, wherein all points in the specified range corresponding to the maximum value point in the first set are removed;

[0115] The maximum value point is taken out and put into a preset second set until the first set is an empty set, and the peak point set is obtained based on the points in the second set.

[0116] It should be noted that, in this embodiment, Figure 6A-6B As shown, it is a comparison diagram of non-maximum suppression of the projection curve, where Fig. 6A Shown is a graph before the suppression algorithm, Figure 6B The curve graph after the suppression algorithm is shown. The specific steps are as follows: (1) Put the edge point set into set A; (2) Exclude the points in set A whose values ​​are less than the specified threshold (noise points), where the specified threshold corresponds to the exclusion threshold of noise points. The specific technical means of denoising are conventional and will not be described here; (3) Get the maximum value point p from set A and pop it into set B, where set A excludes all points within the specified range of point p; (4) If A is not empty, perform operations (2) to (3), otherwise the points in set B are used as the peak point set.

[0117] Figure 7 A block diagram of a system for measuring the glue width of a wood board according to the present invention is shown.

[0118] like Figure 7As shown, the present invention discloses a system for measuring the glue width of a wooden board, comprising a memory and a processor, wherein the memory comprises a program for measuring the glue width of a wooden board, and when the program for measuring the glue width of a wooden board is executed by the processor, the following steps are implemented:

[0119] Get the image data of the wooden board;

[0120] Performing segmented projection based on the image data to obtain projection curves of each segment;

[0121] Extracting edge point sets of each edge segment based on the projection curve to obtain a target curve, wherein the target curve includes an upper curve and a lower curve;

[0122] Target edge points are obtained by screening based on the target curve, and target distances are calculated based on the target edge points, wherein the target distances include a maximum distance, a minimum distance, and an average distance.

[0123] It should be noted that, in this embodiment, the image data corresponding to the wooden board after gluing must first be obtained, and then the graphics must be preprocessed, such as using Gaussian filtering to remove noise, and then the image must be segmented and horizontally projected to obtain the projection curves at each segment, and the edge point set of each segment edge is extracted based on the projection curve to perform straight line fitting to obtain the target curve, wherein the target curve includes an upper curve and a lower curve, and then the noise edge points are removed, and the target edge points are screened out based on the target curve, which can be obtained by performing non-maximum simulation processing on the target curve, and finally the maximum distance, minimum distance and average distance are calculated based on the target edge points to obtain the target distance, wherein the target edge points correspond to the edge points in the upper and lower curves.

[0124] According to an embodiment of the present invention, performing segmented projection based on the image data to obtain projection curves of each segment specifically includes:

[0125] Acquire segmentation parameters specified by the user end, wherein the segmentation parameters include segment parameters and step length;

[0126] Segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;

[0127] Traversing the target segment row by row to obtain an average value of pixels in each row, and performing differential processing based on a pixel sequence corresponding to each row of pixels to obtain a horizontal projection corresponding to each target segment;

[0128] The projection curve is obtained by connecting the horizontal projections corresponding to the target segments in a segmented order.

[0129] It should be noted that, in this embodiment, Figure 3As shown, it is a schematic diagram of segmented projection. Specifically, the segmentation method cannot extract complex edges. According to the horizontal characteristics of the edge of the rubber road, the horizontal projection method can be used to extract the edge. Considering that the edge is not completely horizontal, the horizontal projection of the entire image is not effective. Therefore, the segmented projection method is used. The segment size and step size can be specified when segmenting. Therefore, the segmentation parameters specified by the user end are obtained. The segmentation parameters include segment parameters and step size. The smaller the segment size, the finer the edge points obtained, but they are easily affected by noise. On the contrary, the larger the segment size, the more noise-resistant it is, and the extracted edge is a coarse edge. The step size has a similar effect and can play a noise-resistant role. At the same time, when the step size increases, the speed of edge extraction can be improved.

[0130] Furthermore, to extract edge points in a segment, it is necessary to first project the extraction curve. The horizontal projection method is to traverse from top to bottom by row, obtain the average value of each row of pixels, and perform differential processing based on the pixel sequence corresponding to each row of pixels to obtain the horizontal projection corresponding to each target segment, such as Figure 4 As shown, it is a schematic diagram showing the correspondence between the curve peak and the edge of the segmented horizontal projection, and then the projection curve is obtained by connecting the horizontal projections corresponding to each target segment in the segment order.

[0131] According to an embodiment of the present invention, performing differential processing on a pixel sequence to obtain the horizontal projection specifically includes:

[0132] The pixel sequence is filtered using a preset kernel, wherein the preset kernel includes:

[0133] ;

[0134] Wherein, K is the preset kernel, and n is the number of peak points of the projection curve.

[0135] It should be noted that in this embodiment, the curve obtained by difference is easier to judge the edge position through the peak point. When performing difference processing, the curve is first smoothed to avoid the influence of noise. The specific method is to use the kernel [-1,-,2,-3,3,2,1] to filter the point set. The larger the kernel, the better the noise resistance. The kernel form is as follows: , where K is the preset kernel, n is the number of peak points of the projection curve, and n≥“2”.

[0136] According to an embodiment of the present invention, extracting edge point sets of each edge segment based on the projection curve to obtain a target curve specifically includes:

[0137] Determine the direction of grayscale change based on the grayscale mutation at the edge of the image;

[0138] The curve edge is determined based on the grayscale change direction, wherein:

[0139] The upper curve is obtained based on the first grayscale change direction, and the lower curve is obtained based on the second grayscale change direction;

[0140] The target curve is obtained based on the upper curve and the lower curve, wherein noise points have been removed from the target curve.

[0141] It should be noted that, in this embodiment, there are grayscale mutations at the edges of the image, which can be divided into light to dark and dark to light. Therefore, the grayscale change direction can be determined based on the grayscale mutation of the image edge, and the curve edge can be determined based on the grayscale change direction. When it is light to dark, the point value on the curve is less than "0", and when it is dark to light, the point value on the curve is greater than "0". Therefore, the grayscale change direction can be specified when detecting the edge, so that some double edges can be excluded, such as Figure 5 As shown, a segmented image with double-sided edges is displayed, and one of the edges can be determined specifically according to the grayscale change direction, wherein the upper curve is obtained based on the first grayscale change direction, and the lower curve is obtained based on the second grayscale change direction, thereby obtaining the target curve based on the upper curve and the lower curve, wherein noise points have been removed from the target curve.

[0142] According to an embodiment of the present invention, the step of obtaining target edge points based on the target curve and calculating the target distance based on the target edge points specifically includes:

[0143] Performing non-maximum simulation processing based on the target curve to obtain a peak point set;

[0144] After removing the peak point set from the edge point set, performing straight line fitting on the remaining edge points and calculating the distance between the fitting curve and each point of the edge point set to remove the noise points;

[0145] Obtaining the target edge point based on the peak point set combined with the grayscale transition direction of the target curve;

[0146] The maximum distance, the minimum distance and the average distance are calculated based on the target edge points to obtain the target distance.

[0147] It should be noted that, in this embodiment, according to Figure 4 From the projection curve shown, we can see that there are multiple peak points on the curve. According to common sense, the two points with the largest peaks should be taken as edge points. However, due to the influence of noise, there may be multiple large peaks near the peak edge, and they should belong to the same edge in the image. Therefore, it is necessary to simulate the projection curve as a non-maximum value and exclude noise points with a threshold value less than a certain value.

[0148] Further, Figure 4 The projection curve shown has only "3" peak points after non-maximum suppression processing. According to the direction of grayscale change, it can be known that the upper edge is dark to light and the lower edge is light to dark, so two edge points are obtained. The edge point set is obtained by segmented horizontal projection. Due to the influence of noise, noisy edge points may be extracted, so they need to be excluded. Among them, the edge points are fitted with a straight line, and then the distance from each edge point to the straight line is traversed. When the distance is greater than a certain value, it is considered to be noise and removed. Finally, the edge points excluded are the final peak point set. Based on the peak point set combined with the grayscale transition direction of the target curve, the target edge point is obtained, and the maximum distance, minimum distance and average distance are calculated based on the target edge point to obtain the target distance.

[0149] According to an embodiment of the present invention, performing non-maximum simulation processing based on the target curve to obtain a peak point set specifically includes:

[0150] Putting the edge point set into a preset first set;

[0151] Remove points in the first set that are smaller than a specified threshold value, and obtain a maximum value point from the first set, wherein all points in the specified range corresponding to the maximum value point in the first set are removed;

[0152] The maximum value point is taken out and put into a preset second set until the first set is an empty set, and the peak point set is obtained based on the points in the second set.

[0153] It should be noted that, in this embodiment, Figure 6A-6B As shown, it is a comparison diagram of non-maximum suppression of the projection curve, where Fig. 6A Shown is a graph before the suppression algorithm, Figure 6B The curve graph after the suppression algorithm is shown. The specific steps are as follows: (1) Put the edge point set into set A; (2) Exclude the points in set A whose values ​​are less than the specified threshold (noise points), where the specified threshold corresponds to the exclusion threshold of noise points. The specific technical means of denoising are conventional and will not be described here; (3) Get the maximum value point p from set A and pop it into set B, where set A excludes all points within the specified range of point p; (4) If A is not empty, perform operations (2) to (3), otherwise the points in set B are used as the peak point set.

[0154] The third aspect of the present invention provides a computer-readable storage medium, which includes a program for a method for measuring the glue width of a wooden board. When the program for measuring the glue width of a wooden board is executed by a processor, the steps of a method for measuring the glue width of a wooden board as described in any one of the above items are implemented.

[0155] The present invention discloses a method, system and readable storage medium for measuring the glue width of a wooden board, which effectively reduces the influence of external interference on the measurement results by accurately controlling the measurement parameters, thereby ensuring the reliability of the measurement data. At the same time, its high robustness enables the method to adapt to the changes in the glue width of wooden boards under different environments, thereby improving production efficiency and product quality.

[0156] In addition, the method is simple to operate and easy to implement, saving a lot of manpower and material costs for the enterprise. In summary, this highly robust method for measuring the glue width of wooden boards has significant beneficial effects and is of great significance for improving the accuracy and efficiency of measuring the glue width of wooden boards.

[0157] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0158] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0159] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0160] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0161] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A method for measuring the glue width of a wooden board, characterized in that: The following steps are involved: Get the image data of the wooden board; Performing segmented projection based on the image data to obtain projection curves of each segment; Extracting edge point sets of each edge segment based on the projection curve to obtain a target curve, wherein the target curve includes an upper curve and a lower curve; Filtering target edge points based on the target curve, and calculating target distances based on the target edge points, wherein the target distances include maximum distances, minimum distances, and average distances; The step of performing segmented projection based on the image data to obtain projection curves of each segment specifically includes: Acquire segmentation parameters specified by the user end, wherein the segmentation parameters include segment parameters and step length; Segmenting the image data based on the segmentation parameters to obtain a plurality of target segments; Traversing the target segment row by row to obtain an average value of pixels in each row, and performing differential processing based on a pixel sequence corresponding to each row of pixels to obtain a horizontal projection corresponding to each target segment; The projection curve is obtained by connecting the horizontal projections corresponding to the target segments in a segmented order; The step of extracting edge point sets of each edge segment based on the projection curve to obtain a target curve specifically includes: Determine the direction of grayscale change based on the grayscale mutation at the edge of the image; The curve edge is determined based on the grayscale change direction, wherein: The upper curve is obtained based on the first grayscale change direction, and the lower curve is obtained based on the second grayscale change direction; The target curve is obtained based on the upper curve and the lower curve, wherein noise points have been removed from the target curve.

2. The method for measuring the glue width of a wood board according to claim 1, characterized in that: Performing differential processing on the pixel sequence to obtain the horizontal projection specifically includes: The pixel sequence is filtered using a preset kernel, wherein the preset kernel includes: ; Wherein, K is the preset kernel, n is the number of peak points of the projection curve, and n≥2.

3. The method for measuring the glue width of a wood board according to claim 1, characterized in that: The step of obtaining a target edge point based on the target curve and calculating a target distance based on the target edge point specifically includes: Performing non-maximum simulation processing based on the target curve to obtain a peak point set; After removing the peak point set from the edge point set, performing straight line fitting on the remaining edge points and calculating the distance between the fitting curve and each point of the edge point set to remove the noise points; Obtaining the target edge point based on the peak point set combined with the grayscale transition direction of the target curve; The maximum distance, the minimum distance and the average distance are calculated based on the target edge points to obtain the target distance.

4. A method for measuring the glue width of a wood board according to claim 3, characterized in that: The non-maximum simulation processing based on the target curve to obtain the peak point set specifically includes: Putting the edge point set into a preset first set; Remove points in the first set that are smaller than a specified threshold value, and obtain a maximum value point from the first set, wherein all points in the specified range corresponding to the maximum value point in the first set are removed; The maximum value point is taken out and put into a preset second set until the first set is an empty set, and the peak point set is obtained based on the points in the second set.

5. A system for measuring the glue width of a wooden board, characterized in that: The invention comprises a memory and a processor, wherein the memory comprises a method program for measuring the glue width of a wooden board, and when the method program for measuring the glue width of a wooden board is executed by the processor, the following steps are implemented: Get the image data of the wooden board; Performing segmented projection based on the image data to obtain projection curves of each segment; Extracting edge point sets of each edge segment based on the projection curve to obtain a target curve, wherein the target curve includes an upper curve and a lower curve; Filtering target edge points based on the target curve, and calculating target distances based on the target edge points, wherein the target distances include maximum distances, minimum distances, and average distances; The step of performing segmented projection based on the image data to obtain projection curves of each segment specifically includes: Acquire segmentation parameters specified by the user end, wherein the segmentation parameters include segment parameters and step length; Segmenting the image data based on the segmentation parameters to obtain a plurality of target segments; Traversing the target segment row by row to obtain an average value of pixels in each row, and performing differential processing based on a pixel sequence corresponding to each row of pixels to obtain a horizontal projection corresponding to each target segment; The projection curve is obtained by connecting the horizontal projections corresponding to the target segments in a segmented order; The step of extracting edge point sets of each edge segment based on the projection curve to obtain a target curve specifically includes: Determine the direction of grayscale change based on the grayscale mutation at the edge of the image; The curve edge is determined based on the grayscale change direction, wherein: The upper curve is obtained based on the first grayscale change direction, and the lower curve is obtained based on the second grayscale change direction; The target curve is obtained based on the upper curve and the lower curve.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a method program for measuring the glue width of a wooden board. When the method program for measuring the glue width of a wooden board is executed by a processor, the steps of a method for measuring the glue width of a wooden board as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Tobacco shred width measurement method based on image processing

    CN102679883A

  • Fast lane line detection method based on parameter space voting and Bessel fitting

    CN111563412A

  • Carotid artery intima-media thickness measuring method and device and storage medium

    CN111986139A

  • Edge defect detection method and device of target object, and storage medium

    CN113077467A

  • Heat exchanger fin pitch measuring method and device based on machine vision and medium

    CN114199148A