Corrugated board type detection method

Through RGB-D image processing and feature chain code analysis of corrugated cardboard cutting surfaces, the problem of wrong direction during die cutting of corrugated cardboard is solved, accurate detection of corrugated cardboard types is achieved, and product quality is improved.

CN119006903APending Publication Date: 2024-11-22HEBEI ELECTROMECHANICAL INTEGRATION PILOT BASE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411050991.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

During the die cutting process of corrugated cardboard, the strength of the finished carton is often insufficient due to the wrong placement direction of corrugated cardboard, which affects the product yield rate. The main reason is that the operator makes the wrong judgment or the wrong direction of individual cardboards.

Method used

A corrugated cardboard type detection method is adopted to collect RGB-D images of corrugated cardboard sections, perform binarization processing, downsampling, edge contour extraction and linear detection, and use Freeman contour tracking algorithm to extract feature chain codes and calculate one-dimensional entropy Value to determine the type of corrugated cardboard to avoid wrong placement direction.

Benefits of technology

This method can accurately detect the types of corrugated cardboard, reduce quality problems caused by direction errors, improve the accuracy and processing speed of detection results, reduce the impact of noise, and ensure the reliability of the detection area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006903A_ABST
    Figure CN119006903A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of machine vision, and particularly discloses a corrugated board type detection method, which comprises the following steps: acquiring an RGB-D image of a section of a corrugated board; carrying out binarization processing on the RGB-D image; carrying out down-sampling on the binary image; extracting the edge contour of the binary image after down-sampling, and carrying out linear detection on the edge contour image; determining an upper boundary and a lower boundary of a corrugated board section, and extracting a corrugated board section detection area image; carrying out edge detection on the corrugated board section detection area image; extracting a feature chain code of the edge image; and calculating a one-dimensional entropy value of the characteristic chain code, and judging the type of the corrugated board during die cutting and feeding. The corrugated board type detection device can detect the types of corrugated boards when the corrugated boards are fed in a die cutting mode, the situation that the placing directions of the corrugated boards are wrong is avoided, and the quality problem caused by the fact that the types of the corrugated boards are placed wrongly is effectively reduced. The device is suitable for detecting the types of the corrugated boards when the corrugated boards are fed in a die cutting manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of machine vision, in particular to a method for detecting types of corrugated paperboards. Background Art

[0002] Corrugated cardboard is made of corrugated paper and flat paper layers, and is usually used for packaging, transportation and storage of various items. According to the texture direction of the corrugation, it is divided into horizontal corrugated cardboard and vertical corrugated cardboard. The corrugated texture direction of horizontal corrugated cardboard is perpendicular to the strength direction of the cardboard, and the corrugated texture direction of vertical corrugated cardboard is parallel to the strength direction of the cardboard. Vertical corrugation can provide better compressive strength and stacking ability, and is suitable for scenes that require high compressive strength and stacking performance; horizontal corrugation increases the strength of the side of the carton to a certain extent, helps to resist lateral collisions and pressure, and prevents items from sliding left and right in the box. Carton designers can choose the appropriate corrugated texture direction according to actual needs.

[0003] In the current corrugated cardboard die-cutting process, the cardboard needs to be placed according to the corrugated texture direction design requirements of the carton. However, due to the wrong placement direction of the corrugated cardboard, the finished carton strength is often insufficient, which seriously affects the product yield. The main reasons for the wrong placement direction of the board are: the direction of individual cardboards in the orderly stacked feeding cardboards is wrong, and the operator's wrong judgment leads to the direction of the whole stack of cardboards. Therefore, it is urgent to design relevant detection methods to solve such problems. Summary of the invention

[0004] The purpose of the present invention is to provide a method for detecting the type of corrugated cardboard, so as to detect the type of corrugated cardboard when the corrugated cardboard is die-cut and fed, so as to avoid the wrong placement direction of the corrugated cardboard.

[0005] In order to achieve the above-mentioned purpose, the technical methods adopted by the present invention are as follows:

[0006] A method for detecting the type of corrugated cardboard comprises the following steps performed in sequence:

[0007] S1, collect RGB-D images of the cross section of the corrugated cardboard;

[0008] S2, binarizing the RGB-D image to obtain a binary image;

[0009] S3, downsampling the binary image;

[0010] S4, extracting the edge contour of the downsampled binary image to obtain an edge contour image, and performing straight line detection on the edge contour image to obtain a straight line set;

[0011] S5, extracting straight lines based on the straight line set, determining the upper boundary and the lower boundary of the corrugated cardboard section, and extracting the detection area image of the corrugated cardboard section;

[0012] S6, performing edge detection on the image of the detection area of ​​the corrugated cardboard section to obtain an edge image of the detection area;

[0013] S7, using Freeman contour tracking algorithm to extract feature chain code of edge image;

[0014] S8. Calculate the one-dimensional entropy value of the characteristic chain code. If the one-dimensional entropy value is less than 1, it is determined that the corrugated cardboard during die-cutting is a vertical corrugated cardboard, otherwise it is a horizontal corrugated cardboard.

[0015] As a limitation: the binarization process in step S2 adopts the OSTU adaptive binarization algorithm, specifically:

[0016] S21, grouping all pixels of the RGB-D image of the corrugated cardboard cross section according to gray levels, counting the number of pixels falling in each gray level, and obtaining a grayscale histogram of the RGB-D image of the corrugated cardboard cross section;

[0017] S22, dividing the number of pixels in each gray level by the total number of pixels in the RGB-D image of the corrugated board section to obtain a normalized gray histogram, wherein each value of the normalized gray histogram is limited to between 0 and 1;

[0018] S23, set the segmentation threshold T of the foreground and background, and through the normalized grayscale histogram, count the proportion w0 of the number of foreground pixels to the total number of pixels in the image, the average grayscale of the foreground pixels u0, the proportion w1 of the number of background pixels to the total number of pixels in the image, the average grayscale of the background pixels u1, and the total average grayscale of the image u2, the foreground pixels are pixels in the grayscale level 0-T, and the background pixels are pixels in the grayscale level T-255, and calculate the inter-class variance g of the foreground and background, and the calculation formula is:

[0019] u2=w0×u0+w1×u1

[0020] g=w0(u0-u2) 2 +w1(u1-u2) 2 ;

[0021] S24. The segmentation threshold T traverses each value in the set [0, 255], calculates the corresponding inter-class variance, and selects the segmentation threshold corresponding to the maximum inter-class variance g to segment the foreground and background of the image.

[0022] As a limitation: the downsampling in step S3 is specifically as follows: the grid size and step size of the sliding window are set, the sliding window moves according to the step size, performs a maximum pooling operation on each area of ​​the binary image of the corrugated cardboard section, calculates the maximum value of the pixels in each area, and replaces all pixels in the area of ​​the binary image of the corrugated cardboard section with this maximum value to generate a downsampled binary image.

[0023] As a limitation: in step S4, an edge detection algorithm is used to extract the edge contour of the downsampled binary image; and the line detection adopts the LSD line segment detection algorithm, specifically:

[0024] S41, scaling the edge contour image by Gaussian downsampling;

[0025] S42, calculating the gradient, gradient amplitude and horizontal line angle of the row and column lines of the scaled edge contour image, the calculation formula is:

[0026]

[0027] In the formula, grad x (x, y) is the horizontal gradient of the pixel at coordinate (x, y) in the edge contour image after scaling. y (x,y) is the vertical gradient of the pixel at the coordinate (x,y), f(x,y) represents the pixel value of the pixel at the coordinate (x,y), f(x+1,y) represents the pixel value of the pixel at the coordinate (x+1,y), f(x+1,y+1) represents the pixel value of the pixel at the coordinate (x+1,y+1), f(x,y+1) represents the pixel value of the pixel at the coordinate (x,y+1), G is the gradient amplitude of the pixel at the coordinate (x,y), and θ is the horizontal line angle of the pixel at the coordinate (x,y);

[0028] S43, pseudo-sorting all pixel points of the scaled edge contour image according to the gradient amplitude, and establishing a state list;

[0029] S44, setting a gradient threshold φ, and limiting the pixels whose gradient amplitude is less than the gradient threshold φ from participating in the calculation of the support line area, marking the pixel states whose gradient amplitude is less than the gradient threshold φ as USED, and marking the remaining pixel states as UNUSED;

[0030] S45, sequentially select pixel points with the status of UNUSED as seed points in the status list, and use the horizontal line angle of the seed point as the initial angle of the support line area, then search for pixel points with the status of UNUSED and the deviation from the initial angle within the error range in the neighborhood of the seed point, add them to the support line area and update the support line area angle, traverse all pixel points in the support line area each time, and stop growing when the deviation between the horizontal line angle of the pixel points in the neighborhood of all pixel points in the support line area and the area angle is not within the error range;

[0031] S46. Define the circumscribed rectangle of the support line area, and first calculate the center of the rectangular area. The calculation formula is:

[0032]

[0033] Where (x(j), y(j)) is the coordinate of the jth pixel in the support line region, G(j) is the gradient amplitude of the jth pixel, j∈Region means the jth pixel is in the support line region, (C x , C y ) are the center coordinates of the rectangular area;

[0034] Then, according to the obtained pixel gradient amplitude, the main axis direction of the rectangular area is set to the angle of the eigenvector associated with the minimum eigenvalue of the matrix M. The matrix M is in,

[0035] Finally, we get the straight line set L0 = {(ρ i ,θ i )|i=1,...,n}, where ρ i is the distance from line i to the coordinate point (0, 0), θ i is the angle of line i, θ i When it is 0, it means a vertical line, θ i When it is π / 2, it represents a horizontal line, and n is the number of straight lines.

[0036] As a limitation: the corrugated cardboard section detection area determined in step S5 is specifically:

[0037] S51, perform initial extraction on the straight line set, the initial extraction condition is Calculate the angle and pixel length corresponding to each straight line in the straight line set, and extract the straight line that meets the initial extraction conditions, θ i is the angle of line i, S iis the pixel length of line i, w is the pixel width of the edge contour image after scaling, and the target line set L1 is obtained; when there is no line in the line set that meets the initial extraction conditions, the ICP point cloud registration algorithm is used to register the depth point cloud of the collected corrugated cardboard section RGB-D image with the point cloud of the standard model of the corrugated cardboard section detection area. If the registration is successful, the registration area is used as the corrugated cardboard section detection area. If the registration fails, it means that the corrugated cardboard is placed incorrectly, and an alarm signal is issued;

[0038] S52, perform secondary extraction on the target straight line set L1 to extract the straight line L corresponding to the upper boundary of the corrugated board section t The straight line L corresponding to the lower boundary b ;

[0039] S53, calculate straight line L t and L b In pixel width The vertical distance h k , n is a positive integer, n k Traverse each value in the set {1,2,...,n} and calculate the vertical distance h k Standard thickness of corrugated board h s The difference between k Whether it satisfies h k -h s |≤3, if it is satisfied, then the straight line L t and L b The image between the two images is used as the corrugated cardboard section detection area. If it does not meet the requirements, the ICP point cloud registration algorithm is used to register the depth point cloud of the collected corrugated cardboard section RGB-D image with the standard model point cloud of the corrugated cardboard section detection area. If the registration is successful, the registered area is used as the corrugated cardboard section detection area. If the registration fails, it means that the corrugated cardboard is placed incorrectly and an alarm signal is issued.

[0040] As a limitation: the edge detection in step S6 adopts the Canny edge detection algorithm, which is specifically:

[0041] S61, smoothing the image of the corrugated cardboard section detection area by Gaussian filtering;

[0042] S62, calculating the gradient amplitude of the smoothed corrugated paperboard section detection area image;

[0043] S63, setting a gradient amplitude threshold, and pixels above the gradient amplitude threshold are preliminarily identified as edge candidate areas;

[0044] S64, setting a high gradient amplitude threshold and a low gradient amplitude threshold to further refine the edge, where pixels above the high gradient amplitude threshold are determined as strong edges, and pixels below the low gradient amplitude threshold are suppressed;

[0045] S65. Track the edge through hysteresis, starting from the strong edge and gradually extending to the pixel points with lower gradient amplitude until the gradient amplitude is lower than the gradient amplitude low threshold, suppress the edge that is not connected to the strong edge, and complete the edge detection.

[0046] As a limitation: Step S7 uses the Freeman contour tracking algorithm to extract the feature chain code of the edge image, specifically:

[0047] S71, selecting a pixel point located on the edge contour in the edge image of the detection area as a starting point;

[0048] S72, starting from the starting point, tracing along the edge contour of the corrugated cardboard in a clockwise or counterclockwise direction, recording the direction of movement that is closest to the previous direction, and encoding this direction with a corresponding chain code number;

[0049] S73, continue to move forward and encode the next pixel point until returning to the starting point. At this time, all the pixel points of the edge contour of the corrugated cardboard have been encoded, and the characteristic chain code of the entire edge contour of the corrugated cardboard is obtained.

[0050] As a limitation: the one-dimensional entropy value H of the feature chain code in step S8 is expressed as: Among them, a r is the proportion of the rth direction in the edge image of the detection area, and R is the total number of edge contour pixels in the edge image of the detection area.

[0051] Due to the adoption of the above scheme, the present invention has the following beneficial effects compared with the prior art:

[0052] (1) The present invention provides a method for detecting the type of corrugated cardboard. The method collects and processes the image of the cross-section of the corrugated cardboard, detects the edge contour of the corrugated cardboard in the edge detection image, obtains a straight line set by using the LSD straight line segment detection algorithm, and performs primary extraction and secondary extraction on the straight lines in the straight line set. The straight lines corresponding to the upper and lower boundaries of the cross-section of the corrugated cardboard can be accurately extracted, and the image between the straight lines corresponding to the upper and lower boundaries of the cross-section of the corrugated cardboard is used as the image of the cross-section detection area of ​​the corrugated cardboard, thereby ensuring the reliability of the detection area. The edge image of the cross-section detection area of ​​the corrugated cardboard is obtained by edge detection, and the characteristic chain code of the edge image is extracted by using the Freeman contour tracking algorithm. The type of the corrugated cardboard is determined by calculating the one-dimensional entropy value of the characteristic chain code. The type of the corrugated cardboard can be detected when the corrugated cardboard is die-cut and fed, thereby avoiding the wrong placement direction of the corrugated cardboard, and effectively reducing the occurrence of quality problems caused by the wrong placement of the type of corrugated cardboard.

[0053] (2) The present invention provides a method for detecting the type of corrugated cardboard. The method reduces the complexity of image processing, reduces the amount of calculation, and improves the processing speed by downsampling the image. By collecting RGB-D images, when the straight line set does not meet the initial straight line extraction conditions or the straight lines corresponding to the upper and lower boundaries of the corrugated cardboard section do not meet the conditions for being the corrugated cardboard section detection area, the depth point cloud of the RGB-D image is aligned with the standard model point cloud of the corrugated cardboard section detection area to obtain the corrugated cardboard section detection area, thereby reducing false detection caused by image noise or occlusion and ensuring the reliability of the detection area. The LSD straight line segment detection algorithm is used for straight line detection, and the gradient amplitude and direction consistency are used to improve the accuracy of the detection result. The Freeman contour tracking algorithm is used to extract the feature chain code of the edge image, which can reduce the influence of noise on contour extraction and improve the accuracy of contour extraction.

[0054] The invention is suitable for detecting the type of corrugated paperboard when the corrugated paperboard is die-cut and fed. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0056] Figure 1 This is a flow chart of a method for detecting the type of corrugated cardboard according to an embodiment of the present invention;

[0057] Figure 2 RGB-D image of the cross section of the corrugated cardboard according to the embodiment of the present invention;

[0058] Figure 3 The image of the cross section detection area of ​​the corrugated cardboard according to the embodiment of the present invention;

[0059] Figure 4This is an edge image of the corrugated cardboard section detection area in an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The present invention is further described below in conjunction with embodiments, but those skilled in the art should understand that the present invention is not limited to the following embodiments, and any improvements and equivalent changes made based on the specific embodiments of the present invention are within the scope of protection of the claims of the present invention.

[0061] Embodiment A method for detecting the type of corrugated cardboard

[0062] A method for detecting the type of corrugated cardboard, such as Figure 1 As shown, the following steps are performed in sequence:

[0063] S1. Use an RGB-D camera to collect RGB-D images of the cross section of the corrugated cardboard. The RGB-D images of the cross section of the corrugated cardboard are as follows: Figure 2 As shown, Figure 2 (a) is a vertical corrugated cardboard. Figure 2 (b) is corrugated cardboard;

[0064] S2. Binarize the RGB-D image to obtain a binary image. In this embodiment, the binarization process adopts the OSTU adaptive binarization algorithm, which is specifically:

[0065] S21, grouping all pixels of the RGB-D image of the corrugated cardboard cross section according to gray levels of 0-255, counting the number of pixels falling in each gray level, and obtaining a grayscale histogram of the RGB-D image of the corrugated cardboard cross section;

[0066] S22, dividing the number of pixels in each gray level by the total number of pixels in the RGB-D image of the corrugated board section to obtain a normalized gray histogram, wherein each value of the normalized gray histogram is limited to between 0 and 1;

[0067] S23, set the segmentation threshold T of the foreground and background, and through the normalized grayscale histogram, count the proportion w0 of the number of foreground pixels to the total number of pixels in the image, the average grayscale of the foreground pixels u0, the proportion w1 of the number of background pixels to the total number of pixels in the image, the average grayscale of the background pixels u1, and the total average grayscale of the image u2, the foreground pixels are pixels in the grayscale level 0-T, and the background pixels are pixels in the grayscale level T-255, and calculate the inter-class variance g of the foreground and background, and the calculation formula is:

[0068] u2=w0×u0+w1×u1

[0069] g=w0(u0-u2) 2 +w1(u1-u2) 2 ;

[0070] S24. The segmentation threshold T traverses each value in the set [0, 255], calculates the corresponding inter-class variance, and selects the segmentation threshold corresponding to the maximum inter-class variance g to segment the foreground and background of the image.

[0071] S3. Set a sliding window with a grid size of 3×3 and a step size of 3. The sliding window moves according to the step size to perform a maximum pooling operation on each 3×3 area of ​​the binary image of the corrugated cardboard section, calculate the maximum value of the pixels in each 3×3 area, and use this maximum value to replace all pixels in the area of ​​the binary image of the corrugated cardboard section to generate a downsampled binary image. The downsampled binary image is reduced to 1 / 9 of the original image.

[0072] S4, using an edge detection algorithm to extract the edge contour of the downsampled binary image to obtain an edge contour image, and performing straight line detection on the edge contour image to obtain a straight line set; the straight line detection uses an LSD straight line segment detection algorithm, specifically:

[0073] S41, scaling the edge contour image to 80% of the original edge contour image by Gaussian downsampling to reduce or eliminate the aliasing effect in the image;

[0074] S42, calculating the gradient, gradient amplitude and horizontal line angle of the row and column lines of the scaled edge contour image through a 2×2 mask, and the calculation formula is:

[0075]

[0076] In the formula, grad x (x, y) is the horizontal gradient of the pixel at coordinate (x, y) in the edge contour image after scaling. y (x,y) is the vertical gradient of the pixel at the coordinate (x,y), f(x,y) represents the pixel value of the pixel at the coordinate (x,y), f(x+1,y) represents the pixel value of the pixel at the coordinate (x+1,y), f(x+1,y+1) represents the pixel value of the pixel at the coordinate (x+1,y+1), f(x,y+1) represents the pixel value of the pixel at the coordinate (x,y+1), G is the gradient amplitude of the pixel at the coordinate (x,y), and θ is the horizontal line angle of the pixel at the coordinate (x,y);

[0077] S43, pseudo-sorting all pixel points of the scaled edge contour image according to the gradient amplitude, and establishing a state list;

[0078] S44, setting a gradient threshold φ, and limiting the pixels whose gradient amplitude is less than the gradient threshold φ from participating in the calculation of the support line area, marking the pixel states whose gradient amplitude is less than the gradient threshold φ as USED, and marking the remaining pixel states as UNUSED;

[0079] S45, sequentially select pixel points with the status of UNUSED as seed points in the status list, and use the horizontal line angle of the seed point as the initial angle of the support line area, then search for pixel points with the status of UNUSED and the deviation from the initial angle within the error range in the neighborhood of the seed point, add them to the support line area and update the support line area angle, traverse all pixel points in the support line area each time, and stop growing when the deviation between the horizontal line angle of the pixel points in the neighborhood of all pixel points in the support line area and the area angle is not within the error range;

[0080] S46. Define the circumscribed rectangle of the support line area, and first calculate the center of the rectangular area. The calculation formula is:

[0081]

[0082] Where (x(j), y(j)) is the coordinate of the jth pixel in the support line region, G(j) is the gradient amplitude of the jth pixel, j∈Region means the jth pixel is in the support line region, (C x , C y ) are the center coordinates of the rectangular area;

[0083] Then, according to the obtained pixel gradient amplitude, the main axis direction of the rectangular area is set to the angle of the eigenvector associated with the minimum eigenvalue of the matrix M. The matrix M is in,

[0084] Finally, we get the straight line set L0 = {(ρ i ,θ i )|i=1,...,n}, where ρ i is the distance from line i to the coordinate point (0, 0), θ i is the angle of line i, θ i When it is 0, it means a vertical line, θ i When it is π / 2, it represents a horizontal line, and n is the number of straight lines.

[0085] S5, extracting straight lines based on the straight line set, determining the upper and lower boundaries of the corrugated cardboard section, and extracting the corrugated cardboard section detection area image, specifically:

[0086] S51, perform initial extraction on the line set L0, the initial extraction condition is Calculate the angle and pixel length corresponding to each straight line in the straight line set L0, and extract the straight lines that meet the initial extraction conditions, S iis the pixel length of line i, w is the pixel width of the edge contour image after scaling, and the target line set L1 is obtained; when there is no line that meets the initial extraction condition in the line set L0, the depth point cloud of the collected corrugated cardboard section RGB-D image is registered with the point cloud of the standard model of the corrugated cardboard section detection area using the ICP point cloud registration algorithm. If the registration is successful, the registered area is used as the corrugated cardboard section detection area. If the registration fails, it means that the corrugated cardboard is placed incorrectly, and an alarm signal is issued;

[0087] S52, perform secondary extraction on the target straight line set L1 to extract the straight line L corresponding to the upper boundary of the corrugated board section t The straight line L corresponding to the lower boundary b ;

[0088] S53, calculate straight line L t and L b In pixel width The vertical distance h k , n is a positive integer, n k Traverse each value in the set {1,2,...,n} and calculate the vertical distance h k Standard thickness of corrugated board h s The difference between k Whether it satisfies h k -h s |≤3, if it is satisfied, then the straight line L t and L b The image between the two images is used as the corrugated cardboard section detection area. If it does not meet the requirements, the ICP point cloud registration algorithm is used to register the depth point cloud of the collected corrugated cardboard section RGB-D image with the point cloud of the standard model of the corrugated cardboard section detection area. If the registration is successful, the registration area is used as the corrugated cardboard section detection area. If the registration fails, it means that the placement of the corrugated cardboard is incorrect, and an alarm signal is issued. In this embodiment, n is 5, and the vertical distance h k Satisfy h k -h s |≤3, straight line L t and L b The image between the two images is used as the corrugated cardboard section detection area, such as Figure 3 As shown, Figure 3 (a) shows the detection area of ​​the cross section of the vertical corrugated cardboard. Figure 3 (b) shows the detection area of ​​the cross-section of the corrugated cardboard.

[0089] S6. Use the Canny edge detection algorithm to perform edge detection on the image of the corrugated cardboard section detection area to obtain an edge image of the detection area; specifically:

[0090] S61, smoothing the image of the corrugated cardboard section detection area by Gaussian filtering;

[0091] S62, calculating the gradient amplitude of the smoothed corrugated paperboard section detection area image;

[0092] S63, setting a gradient amplitude threshold, and pixels above the gradient amplitude threshold are preliminarily identified as edge candidate areas;

[0093] S64, setting a high gradient amplitude threshold and a low gradient amplitude threshold to further refine the edge, where pixels above the high gradient amplitude threshold are determined as strong edges, and pixels below the low gradient amplitude threshold are suppressed;

[0094] S65, track the edge through hysteresis, starting from the strong edge, and gradually expanding to the pixel points with lower gradient amplitude until the gradient amplitude is lower than the gradient amplitude low threshold, suppress the edges that are not connected to the strong edge, and complete the edge detection; the edge image of the detection area obtained in this embodiment is as follows Figure 4 As shown, Figure 4 (a) shows the edge image of the detection area of ​​the vertical corrugated cardboard section. Figure 4 (b) shows the edge image of the detection area of ​​the corrugated cardboard section.

[0095] S7, using the Freeman contour tracking algorithm to extract the feature chain code of the edge image, specifically:

[0096] S71, selecting a pixel point located on the edge contour in the edge image of the detection area as a starting point;

[0097] S72, starting from the starting point, tracing along the edge contour of the corrugated cardboard in a clockwise or counterclockwise direction, recording the direction of movement that is closest to the previous direction, and encoding this direction with a corresponding chain code number;

[0098] S73, continue to move forward and encode the next pixel point until returning to the starting point, at which point all the pixel points of the edge contour of the corrugated board have been encoded, and the feature chain code of the entire edge contour of the corrugated board is obtained;

[0099] This embodiment Figure 4 (a) The characteristic chain code of the edge contour of the corrugated cardboard in the edge image of the vertical corrugated cardboard section detection area is:

[0100] [2,2,2,2,2,2,1,7,6,0,0,0,0,0,0,7,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,1,3,4,4,4,4,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,1,7,1,0,0,0,0,0,0,0,7];

[0101] Figure 4 (b) The feature chain code of the edge contour of the corrugated cardboard in the edge image of the cross-section detection area is: [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0, 0,0,1,0,0,7,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].

[0102] S8. Calculate the one-dimensional entropy value of the characteristic chain code. If the one-dimensional entropy value is less than 1, it is determined that the corrugated cardboard during die-cutting is a vertical corrugated cardboard, otherwise it is a horizontal corrugated cardboard. The expression of the one-dimensional entropy value H of the characteristic chain code is: Among them, a r is the proportion of the rth direction in the edge image of the detection area, and R is the total number of edge contour pixels in the edge image of the detection area;

[0103] In this embodiment Figure 4 The one-dimensional entropy value corresponding to the edge contour feature chain code of the corrugated cardboard in (a) is 1.791, which is greater than 1, and is determined to be a vertical corrugated cardboard, which is consistent with the actual situation; Figure 4 The one-dimensional entropy value corresponding to the edge contour feature chain code of the corrugated cardboard in (b) is 0.3725. 0.3725 is less than 1, so it is judged to be a horizontally corrugated cardboard, which is consistent with the actual situation.

Claims

1. A method for detecting the type of corrugated cardboard, characterized in that: The process includes the following steps: S1, collect RGB-D images of the cross section of the corrugated cardboard; S2, binarizing the RGB-D image to obtain a binary image; S3, downsampling the binary image; S4, extracting the edge contour of the downsampled binary image to obtain an edge contour image, and performing straight line detection on the edge contour image to obtain a straight line set; S5, extracting straight lines based on the straight line set, determining the upper boundary and the lower boundary of the corrugated cardboard section, and extracting the detection area image of the corrugated cardboard section; S6, performing edge detection on the image of the detection area of ​​the corrugated cardboard section to obtain an edge image of the detection area; S7, using Freeman contour tracking algorithm to extract feature chain code of edge image; S8. Calculate the one-dimensional entropy value of the characteristic chain code. If the one-dimensional entropy value is less than 1, it is determined that the corrugated cardboard during die-cutting is a vertical corrugated cardboard, otherwise it is a horizontal corrugated cardboard.

2. A method for detecting the type of corrugated cardboard according to claim 1, characterized in that: The binarization process in step S2 adopts the OSTU adaptive binarization algorithm, which is specifically: S21, grouping all pixels of the RGB-D image of the corrugated cardboard cross section according to gray levels, counting the number of pixels falling in each gray level, and obtaining a grayscale histogram of the RGB-D image of the corrugated cardboard cross section; S22, dividing the number of pixels in each gray level by the total number of pixels in the RGB-D image of the corrugated board section to obtain a normalized gray histogram, wherein each value of the normalized gray histogram is limited to between 0 and 1; S23, set the segmentation threshold T of the foreground and background, and through the normalized grayscale histogram, count the proportion w0 of the number of foreground pixels to the total number of pixels in the image, the average grayscale of the foreground pixels u0, the proportion w1 of the number of background pixels to the total number of pixels in the image, the average grayscale of the background pixels u1, and the total average grayscale of the image u2, the foreground pixels are pixels in the grayscale level 0-T, and the background pixels are pixels in the grayscale level T-255, and calculate the inter-class variance g of the foreground and background, and the calculation formula is: u2=w0×u0+w1×u1 g=w0(u0-u2) 2 +w1(u1-u2) 2 ; S24. The segmentation threshold T traverses each value in the set [0, 255], calculates the corresponding inter-class variance, and selects the segmentation threshold corresponding to the maximum inter-class variance g to segment the foreground and background of the image.

3. A method for detecting the type of corrugated cardboard according to claim 1, characterized in that: The downsampling in step S3 is specifically as follows: the grid size and step size of the sliding window are set, the sliding window moves according to the step size to perform a maximum pooling operation on each area of ​​the binary image of the corrugated cardboard section, the maximum value of the pixels in each area is calculated, and this maximum value is used to replace all pixels in the area of ​​the binary image of the corrugated cardboard section to generate a downsampled binary image.

4. A method for detecting the type of corrugated cardboard according to claim 1, characterized in that: In step S4, an edge detection algorithm is used to extract the edge contour of the downsampled binary image; and the line detection adopts the LSD line segment detection algorithm, which is specifically: S41, scaling the edge contour image by Gaussian downsampling; S42, calculating the gradient, gradient amplitude and horizontal line angle of the row and column lines of the scaled edge contour image, the calculation formula is: In the formula, grad x (x, y) is the horizontal gradient of the pixel at coordinate (x, y) in the edge contour image after scaling. y (x,y) is the vertical gradient of the pixel at the coordinate (x,y), f(x,y) represents the pixel value of the pixel at the coordinate (x,y), f(x+1,y) represents the pixel value of the pixel at the coordinate (x+1,y), f(x+1,y+1) represents the pixel value of the pixel at the coordinate (x+1,y+1), f(x,y+1) represents the pixel value of the pixel at the coordinate (x,y+1), G is the gradient amplitude of the pixel at the coordinate (x,y), and θ is the horizontal line angle of the pixel at the coordinate (x,y); S43, pseudo-sorting all pixel points of the scaled edge contour image according to the gradient amplitude, and establishing a state list; S44, setting a gradient threshold φ, and limiting the pixels whose gradient amplitude is less than the gradient threshold φ from participating in the calculation of the support line area, marking the pixel states whose gradient amplitude is less than the gradient threshold φ as USED, and marking the remaining pixel states as UNUSED; S45, sequentially selecting pixels in the state list with the state of UNUSED as seed points, and using the horizontal line angle of the seed point as the initial angle of the support line area, and then searching for pixels in the neighborhood of the seed point with the state of UNUSED and the deviation from the initial angle within the error range, adding them to the support line area and updating the support line area angle, traversing all pixels in the support line area each time, and stopping the growth when the deviation between the horizontal line angle of the pixels in the neighborhood of all pixels in the support line area and the area angle is not within the error range; S46. Define the circumscribed rectangle of the support line area, and first calculate the center of the rectangular area. The calculation formula is: Where (x(j), y(j)) is the coordinate of the jth pixel in the support line region, G(j) is the gradient amplitude of the jth pixel, j∈Region means the jth pixel is in the support line region, (C x , C y ) are the center coordinates of the rectangular area; Then, according to the obtained pixel gradient amplitude, the main axis direction of the rectangular area is set to the angle of the eigenvector associated with the minimum eigenvalue of the matrix M. The matrix M is in, Finally, we get the straight line set L0 = {(ρ i ,θ i )|i=1,...,n}, where ρ i is the distance from line i to the coordinate point (0, 0), θ i is the angle of line i, θ i When it is 0, it means a vertical line, θ i When it is π / 2, it represents a horizontal line, and n is the number of straight lines.

5. A method for detecting the type of corrugated cardboard according to claim 1, characterized in that: The corrugated cardboard section detection area determined in step S5 is specifically: S51, perform initial extraction on the straight line set, the initial extraction condition is Calculate the angle and pixel length corresponding to each straight line in the straight line set, and extract the straight line that meets the initial extraction conditions, θ i is the angle of line i, S i is the pixel length of line i, and w is the pixel width of the edge contour image after scaling, and the target line set L1 is obtained; when there is no line in the line set that meets the initial extraction conditions, the ICP point cloud registration algorithm is used to register the depth point cloud of the collected corrugated cardboard section RGB-D image with the point cloud of the standard model of the corrugated cardboard section detection area. If the registration is successful, the registration area is used as the corrugated cardboard section detection area. If the registration fails, it means that the corrugated cardboard is placed incorrectly, and an alarm signal is issued; S52, perform secondary extraction on the target straight line set L1 to extract the straight line L corresponding to the upper boundary of the corrugated board section t The straight line L corresponding to the lower boundary b ; S53, calculate straight line L t and L b In pixel width The vertical distance h k , n is a positive integer, n k Traverse each value in the set {1,2,...,n} and calculate the vertical distance h k Standard thickness of corrugated board h s The difference between k Is it satisfied? k -h s |≤3, if it is satisfied, then the straight line L t and L b The image between the two images is used as the corrugated cardboard section detection area. If it does not meet the requirements, the ICP point cloud registration algorithm is used to register the depth point cloud of the collected corrugated cardboard section RGB-D image with the standard model point cloud of the corrugated cardboard section detection area. If the registration is successful, the registered area is used as the corrugated cardboard section detection area. If the registration fails, it means that the corrugated cardboard is placed incorrectly and an alarm signal is issued.

6. A method for detecting the type of corrugated cardboard according to claim 1, characterized in that: In step S6, the edge detection adopts the Canny edge detection algorithm, which is specifically: S61, smoothing the image of the corrugated cardboard section detection area by Gaussian filtering; S62, calculating the gradient amplitude of the smoothed corrugated paperboard section detection area image; S63, setting a gradient amplitude threshold, and pixels above the gradient amplitude threshold are preliminarily identified as edge candidate areas; S64, setting a high gradient amplitude threshold and a low gradient amplitude threshold to further refine the edge, where pixels above the high gradient amplitude threshold are determined as strong edges, and pixels below the low gradient amplitude threshold are suppressed; S65. Track the edge through hysteresis, starting from the strong edge and gradually extending to the pixel points with lower gradient amplitude until the gradient amplitude is lower than the gradient amplitude low threshold, suppress the edge that is not connected to the strong edge, and complete the edge detection.

7. A method for detecting the type of corrugated cardboard according to claim 1, characterized in that: Step S7 uses the Freeman contour tracking algorithm to extract the feature chain code of the edge image, specifically: S71, selecting a pixel point located on the edge contour in the edge image of the detection area as a starting point; S72, starting from the starting point, tracing along the edge contour of the corrugated cardboard in a clockwise or counterclockwise direction, recording the direction of movement that is closest to the previous direction, and encoding this direction with a corresponding chain code number; S73, continue to move forward and encode the next pixel point until returning to the starting point. At this time, all the pixel points of the edge contour of the corrugated cardboard have been encoded, and the characteristic chain code of the entire edge contour of the corrugated cardboard is obtained.

8. A method for detecting the type of corrugated cardboard according to claim 1, characterized in that: The one-dimensional entropy value H of the feature chain code in step S8 is expressed as: Among them, a r is the proportion of the rth direction in the edge image of the detection area, and R is the total number of edge contour pixels in the edge image of the detection area.

Citation Information

Patent Citations

  • SAR image airport target detection method based on edge features

    CN106251332A

  • A corrugated board intelligent detection method based on gray level co-occurrence matrix characteristics

    CN109671079A

  • Automatic classifying and sorting system and method for recycled corrugated paper raw material detection

    CN112560821A

  • Groove cutting robot image processing method based on visual system

    CN114821114A

  • Corrugated board production line outlet paperboard classification method and system

    CN114985300A