Machine vision-based edge banding detection method and system for plate processing
Through the machine vision-based image processing method, the edge-sealing area of the sheet is identified by gradient and clustering and merging coefficients, and the problem of inaccurate boundary identification of edge-sealing area and non-sealing area is solved, achieving higher defect detection accuracy.
Patent Information
- Application Number
- CN202411644613.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2044-11-18
AI Technical Summary
In the prior art, the edge seal detection of sheet materials has the problem of inaccurate identification of the edge seal area and the non-edge area, especially when the upper and lower edges of the edge seal are damaged, which affects the accuracy of defect detection.
Using a detection method based on machine vision, the image is acquired and gradient processing is performed to perform clustering, the merge coefficient is calculated and similar regions are merged, and the edge-sealed area is expressed using the minimum external rectangle of the lossless area, and the defect region is identified through XOR operation.
The identification accuracy of the boundary between the edge-sealed area and the non-edged area is improved, especially the identification accuracy of boundary damage, and the accuracy of defect detection is improved.
Smart Images

Figure CN119379661B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a machine vision-based edge banding detection method and system for plate processing. Background Art
[0002] Edge banding is a common process in furniture manufacturing and woodworking. It involves treating the edges of a board to protect it from moisture, dust, and other intrusions, while also improving its aesthetics and durability. Edge banding is typically done with edge banding strips, which are elongated strips of material that match the board's material and are adhered to the edge using hot melt adhesive or a specialized edge banding adhesive.
[0003] Due to operational problems with the edge banding machine, the edge of the board may break, the edge may be short, or the end may be too long. In addition, due to the instability of the glue used in the edge banding, problems such as bulging glue and debonding of the edge banding may also occur. Therefore, it is necessary to detect the edge banding effect. For example, the Chinese patent application document with publication number CN114820594A discloses a method, related equipment, and storage medium for detecting edge banding defects of board materials based on an image. The method comprises: dividing the image to be detected when the grayscale information of a specified area of the image to be detected meets a preset grayscale condition; equalizing each divided sub-image using an adaptive histogram equalization algorithm and performing bilinear interpolation on the edges of any two sub-images in adjacent positions; detecting the boundary information of the board in the target image to be detected; obtaining the position of the edge banding based on the board boundary information; obtaining the actual grayscale information of the edge banding according to the position of the edge banding; obtaining the ideal grayscale information of the edge banding based on the actual grayscale information of the edge banding; identifying whether there is an abnormal grayscale area based on the actual grayscale information and the ideal grayscale information of the edge banding; and determining whether there is an edge banding defect based on the identification result of whether there is an abnormal grayscale area.
[0004] Existing edge detection methods detect the upper and lower board boundaries in a target image, and use the upper, lower, and target boundaries as board boundary information. However, if the upper and lower edges of the edge banding are damaged, this boundary information can be inaccurate, affecting the determination of the edge banding area and subsequent defect detection. Summary of the Invention
[0005] In order to solve the technical problem of how to improve the accuracy of boundary recognition between edge-banded areas and non-edge-banded areas, the present application provides a machine vision-based plate processing edge-banding detection method and system.
[0006] In the first aspect, the present application provides a machine vision-based plate processing edge banding detection method, which adopts the following technical solutions:
[0007] A machine vision-based plate processing edge banding detection method includes the following steps: acquiring and processing a captured image to obtain a gradient map, clustering the gradient map to obtain multiple clusters, wherein a connected domain composed of pixels contained in each cluster is an initial region; calculating a merging coefficient of two clusters, and when the merging coefficient is greater than a preset merging threshold, merging the two clusters to obtain a region to be tested; calculating a ratio of a mean pixel value of pixels in the region to be tested to a mean pixel value of pixels in a preset standard edge banding region, taking the absolute value of the difference between the ratio and 1 as a classification coefficient, and marking a region to be tested with a classification coefficient less than a preset coefficient threshold as a non-destructive region; making the minimum circumscribed rectangle of the non-destructive region the edge banding region, outputting 0 in response to the pixel values of pixels between the edge banding region and the non-destructive region being the same, and outputting 1 otherwise, thereby obtaining a defective region.
[0008] The beneficial effects are as follows: an initial area is delineated, similar initial areas are merged according to a merging coefficient to obtain the area to be tested, the area to be tested is classified, the intact area on the seal is found, and the minimum outer rectangle of the intact area is used to express the area where the seal is located, i.e., the edge-sealed area. The edge-sealed area includes both the intact area and the defective area. The defective area is obtained by performing an XOR operation on the pixel values in the edge-sealed area and the intact area. Compared with directly using edge calculation to determine the edge of the edge-sealed area, this method makes the boundary between the edge-sealed area and the non-edge-sealed area more precise, thereby improving the accuracy of subsequent defect recognition, especially for damage on the boundary.
[0009] Optionally, the calculation formula for the merging coefficient is: ,in, is the merging coefficient, is the number of pixel values of the first cluster, is the number of pixel values of the second cluster, The pixel value in the first cluster is The ratio of the pixel point to all the pixels of the first cluster, The pixel value in the second cluster is The ratio of the pixel of to all pixels of the second cluster. represents the hyperbolic tangent function.
[0010] The beneficial effects are: It represents the difference in the number of pixel values in the cluster. It is used to measure the similarity of two clusters in pixel value distribution. Combining the difference and similarity, the merging coefficient is obtained, and the possibility of merging two clusters is quantified by the merging coefficient.
[0011] Optionally, the captured image is taken and processed to obtain a gradient map, including the steps of: grayscale processing the acquired captured image to obtain a grayscale map; calculating the maximum value of the pixel value ratio between each pixel point and the pixel points in the eight neighborhoods, and taking the maximum value as the maximum gradient value; replacing the pixel value of each pixel point with the maximum gradient value to obtain a gradient image.
[0012] The beneficial effect is that in the gradient image, the pixel value of the edge area is higher, and the pixel value of the non-edge area is lower, thereby highlighting the edge features of the image.
[0013] Optionally, the gradient graph is clustered to obtain multiple clusters, and the clustering algorithm used is DBSCAN.
[0014] Optionally, the method for calculating the neighborhood radius in the cluster is: calculate the similarity evaluation of each grayscale value and the standard grayscale value; traverse the similarity evaluation of all grayscale values, take the pixel point corresponding to the maximum similarity evaluation value as the target pixel point, take the absolute value of the difference between the gradient value of the target pixel point and the gradient value of any pixel point and 1 as the distance value, and take the minimum value of the distance value as the neighborhood radius.
[0015] The beneficial effect is that the neighborhood radius is set appropriately based on the pixel values within the edge-sealed area, that is, the neighborhood radius is adaptively adjusted according to the image content. Compared with using a fixed neighborhood threshold, the recognition accuracy is improved.
[0016] Optionally, the similarity rating calculation formula is: ,in, Grayscale value Similarity evaluation with standard grayscale values, is the standard grayscale value, which is the pixel value of the pixel point in the standard edge banding area. The gray value is The ratio of the number of pixels to the total number of pixels in the gradient image.
[0017] The beneficial effect is: identifying the area in the image that is most similar to the standard grayscale value, determining the area in the edge banding area that is more similar to the standard edge banding area (defect-free edge banding area), and finding the non-damaged area in the edge banding area in the image.
[0018] Optionally, the calculation formula for the merging coefficient is: ,in, is the merging coefficient, The pixel value in the first cluster is The ratio of the pixel point to all the pixels of the first cluster, The pixel value in the second cluster is The ratio of the pixel point to all pixels of the second cluster, represents the hyperbolic tangent function.
[0019] Secondly, this application provides a machine vision-based plate processing edge banding detection system, which adopts the following technical solutions:
[0020] A plate processing edge banding detection system based on machine vision includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the plate processing edge banding detection method based on machine vision is implemented.
[0021] The beneficial effect is that the above-mentioned machine vision-based plate processing edge banding detection method is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a system based on the memory and the processor convenient to use.
[0022] This application has the following technical effects:
[0023] 1. Define the initial area, then merge similar initial areas based on the merging coefficient to obtain the area to be tested. Classify the area to be tested and find the intact area on the seal. Use the minimum bounding rectangle of the intact area to express the area where the seal is located, i.e., the edge-sealed area. The edge-sealed area includes both the intact area and the defective area. Perform an XOR operation on the pixel values in the edge-sealed and intact areas to obtain the defective area. Compared with directly using edge calculation to determine the edge of the edge-sealed area, this method makes the boundary between the edge-sealed and non-edge-sealed areas more precise, thereby improving the accuracy of subsequent defect recognition, especially for damage on the boundary.
[0024] 2. Set an appropriate neighborhood radius based on the pixel values within the edge-sealed area. This adaptively adjusts the neighborhood radius based on the image content. This improves recognition accuracy compared to using a fixed neighborhood threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] By reading the detailed description below with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding numbers represent the same or corresponding parts.
[0026] Figure 1 This is a method flow chart of a plate processing edge banding detection method based on machine vision in an embodiment of the present application.
[0027] Figure 2 It is a diagram showing the plate structure of the seal.
[0028] Figure 3 This is a flowchart of a method for obtaining a gradient map in a plate processing edge banding detection method based on machine vision in an embodiment of the present application.
[0029] Description of the accompanying drawings: 1. Seal. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0031] It should be understood that when the terms "first," "second," etc. are used in the claims, specification, and drawings of this application, they are only used to distinguish different objects, rather than to describe a specific order. The terms "comprise" and "comprising" used in the specification and claims of this application indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or combinations thereof.
[0032] The embodiment of the present application discloses a plate processing edge banding detection method based on machine vision, which is used to detect whether there are defects such as damage in the edge banding area of the plate. Figure 1 , including steps S1 to S4, specifically as follows:
[0033] S1: Acquire and process the collected image to obtain a gradient map, cluster the gradient map to obtain multiple clusters, and the connected domain composed of the pixels contained in each cluster is an initial region.
[0034] The camera captures the image containing the edge banding area, refer to Figure 2 The area where the seal 1 is located is the edge sealing area.
[0035] Reference Figure 3 , the acquisition of the gradient map includes steps S10 to S12, which are specifically as follows:
[0036] S10: grayscale processing is performed on the acquired captured image to obtain a grayscale image.
[0037] The captured image is a color image, or RGB (Red, Green, Blue) image. Grayscaling is an image processing technique that converts color images into grayscale images. In a grayscale image, the color value of each pixel is converted into a single brightness value, typically ranging from 0 to 255, where 0 represents black, 255 represents white, and values in between represent varying shades of gray. Grayscaling is an existing technique and will not be described in detail here.
[0038] S11: Calculate the maximum value of the ratio of the pixel value between each pixel point and the pixel points in the eight neighborhoods, and use the maximum value as the maximum gradient value.
[0039] In an image, each pixel has a neighboring set of pixels besides its own location. These are called its eight-neighborhood pixels. The eight-neighborhood pixels are the pixels centered around the current pixel and include the pixels above, below, left, right, and four diagonals.
[0040] For each pixel in the image, calculate the ratio of its pixel value to that of each pixel in its eight-neighborhood. This is done by dividing the current pixel's value by the pixel value of each neighboring pixel. The original pixel value of each pixel is replaced with the calculated maximum gradient value. This way, each pixel in the original image represents the strength of its edge, rather than its original brightness or color information.
[0041] S12: Replace the pixel value of each pixel with the maximum gradient value to obtain a gradient image.
[0042] After completing the above steps, a gradient image is obtained. In the gradient image, the pixel values in the edge area are higher and the pixel values in the non-edge area are lower, thus highlighting the edge features of the image.
[0043] The gradient map is clustered to obtain multiple clusters. The clustering algorithm used is DBSCAN (Density-Based Spatial Clustering of Applications with Noise). DBSCAN is an existing technology and will not be described in detail here.
[0044] The neighborhood radius is a parameter in the DBSCAN algorithm that determines the spatial range and density of clustering. A fixed neighborhood radius can be used. However, when the pixel values in the edge-sealed area do not change significantly (for example, the color of the edge-sealed area is lighter), using a fixed neighborhood threshold may result in failure to identify damage within the edge-sealed area. Therefore, it is necessary to set an appropriate neighborhood radius based on the pixel values of the pixels in the edge-sealed area. In other words, the value of the neighborhood radius needs to be adaptively adjusted according to the image content.
[0045] The neighborhood radius is set as follows:
[0046] Calculate the similarity evaluation between each grayscale value and the standard grayscale value. The calculation formula for similarity evaluation is: ,in, Grayscale value Similarity evaluation with standard grayscale values, is the standard grayscale value, which is the pixel value of the pixel point in the standard edge banding area. The gray value is The ratio of the number of pixels to the total number of pixels in the gradient image.
[0047] The standard grayscale value refers to the grayscale value of the pixels in the preset standard edge banding area. The standard edge banding area is the defect-free edge banding area.
[0048] Traverse the similarity evaluation of all grayscale values, take the pixel corresponding to the maximum similarity evaluation value as the target pixel, take the absolute value of the difference between the gradient value of the target pixel and the gradient value of any pixel and 1 as the distance value, and take the minimum distance value as the neighborhood radius.
[0049] The distance value is expressed mathematically as: ,in, Indicates the distance value, Represents the gradient value of the target pixel, Represents the grayscale value of any pixel.
[0050] In other embodiments, the calculation formula for similarity evaluation may also be: ,in, Grayscale value Similarity evaluation with standard grayscale values, is the standard grayscale value, which is the pixel value of the pixel point in the standard edge banding area. The gray value is The ratio of the number of pixels to the total number of pixels in the gradient image.
[0051] S2: Calculate the merging coefficient of the two clusters. When the merging coefficient is greater than the preset merging threshold, merge the two clusters to obtain the area to be measured.
[0052] After the above clustering step, multiple clusters are obtained, and the merging coefficient of any two clusters is calculated. When the merging coefficient is greater than a preset merging threshold, the clusters are merged.
[0053] In one embodiment, the merging process may be as follows: merging adjacent clusters to obtain a new cluster each time the cluster is merged, and clustering is repeated again after the merging, and the above operation is repeated until there is no merging coefficient greater than a preset merging threshold, at which point the merging of clusters is stopped to obtain the area to be measured. For example, the merging threshold may be 0.75.
[0054] In one embodiment, the calculation formula of the merging coefficient is:
[0055] ,in, is the merging coefficient, is the number of pixel values of the first cluster, is the number of pixel values of the second cluster, The pixel value in the first cluster is The ratio of the pixel point to all the pixels of the first cluster, The pixel value in the second cluster is The ratio of the pixel of to all pixels of the second cluster. represents the hyperbolic tangent function.
[0056] Indicates the difference in the number of pixel values in the clusters. If the difference in the number of pixels between the two clusters is small, The value will be close to 1, indicating that the two clusters are similar in size. If the difference is large, The value of will be close to 0, indicating that the two clusters are different in size.
[0057] Used to measure the similarity between two clusters in pixel value distribution. Expressed and The difference between them, namely KL divergence, is used to measure the similarity between two clusters in pixel value distribution. The larger it is, the smaller the difference between the two distributions is. The value of is close to 1.
[0058] Merger coefficient The larger the value of , the more similar the two clusters are in the number and distribution of pixel values, so the greater the possibility of merging. Conversely, the smaller the possibility of merging.
[0059] In other embodiments, without considering the difference in the number of pixel values in the clusters, only The merging coefficient will not be described in detail here.
[0060] S3: Calculate the ratio of the mean pixel value of the pixel points in the test area to the mean pixel value in the preset standard edge sealing area, use the absolute value of the difference between the ratio and 1 as the classification coefficient, and mark the test area with a classification coefficient less than the preset coefficient threshold as a lossless area.
[0061] For example, the coefficient threshold is 0.2, one region to be tested corresponds to one classification coefficient, and the region to be tested with a classification coefficient less than 0.2 is marked as a lossless region.
[0062] S4: The minimum circumscribed rectangle of the intact area is set as the edge-sealed area, and 0 is outputted in response to the pixel values of the pixel points between the edge-sealed area and the intact area being the same, and 1 is outputted otherwise, thereby obtaining the defective area.
[0063] Since the seal 1 is roughly a standard rectangular area in the image, the minimum circumscribed rectangle of the intact area is the edge-sealed area. When the pixel values between the edge-sealed area and the intact area are the same, 0 is output; otherwise, 1 is output. In other words, the pixel values corresponding to the edge-sealed area and the intact area are XORed to find the defective area.
[0064] An embodiment of the present application also discloses a plate processing edge banding detection system based on machine vision, including a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, the plate processing edge banding detection method based on machine vision according to the present application is implemented.
[0065] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. The configuration and functions of these components are known in the art and will not be described in detail here.
[0066] In this application, the aforementioned memory can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic storage medium or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc., or any other medium that can be used to store the required information and can be accessed by an application, module, or both. Any such computer storage medium can be part of, accessible to, or connected to the device.
[0067] Although this specification has shown and described a number of embodiments of the present application, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, variations, and alternatives without departing from the spirit and scope of the present application. It should be understood that in practicing the present application, various alternatives to the embodiments of the present application described herein may be employed.
[0068] The above are all preferred embodiments of the present application, and are not intended to limit the scope of protection of the present application. Therefore, any equivalent changes made based on the structure, shape, and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A machine vision-based plate processing edge banding detection method, characterized in that: Including steps: After acquiring and processing the collected image, a gradient map is obtained, and the gradient map is clustered to obtain multiple clusters. The connected domain composed of the pixels contained in each cluster is an initial region; Calculate the merging coefficient of the two clusters. When the merging coefficient is greater than the preset merging threshold, merge the two clusters to obtain the area to be tested. Calculate the ratio of the mean pixel value of the pixels in the test area to the mean pixel value in the preset standard edge-sealed area, use the absolute value of the difference between the ratio and 1 as the classification coefficient, and mark the test area with a classification coefficient less than the preset coefficient threshold as a lossless area; The minimum circumscribed rectangle of the intact area is made into the edge-sealed area. When the pixel values of the pixels between the edge-sealed area and the intact area are the same, 0 is output, otherwise 1 is output, thereby obtaining the defective area.
2. The machine vision-based plate processing edge banding detection method according to claim 1, characterized in that: The calculation formula of the merger coefficient is: ,in, is the merging coefficient, is the number of pixel values of the first cluster, is the number of pixel values of the second cluster, The pixel value in the first cluster is The ratio of the pixel point to all the pixels of the first cluster, The pixel value in the second cluster is The ratio of the pixel point to all pixels of the second cluster, represents the hyperbolic tangent function.
3. The machine vision-based plate processing edge banding detection method according to claim 1, characterized in that: The gradient map is obtained by acquiring the collected image and processing it, including the following steps: Grayscale processing is performed on the acquired captured image to obtain a grayscale image; Calculate the maximum value of the ratio of the pixel value between each pixel and the pixels in the eight neighborhoods, and take the maximum value as the maximum gradient value; The pixel value of each pixel is replaced by the maximum gradient value to obtain a gradient image.
4. The machine vision-based plate processing edge banding detection method according to claim 1, characterized in that: The gradient graph is clustered to obtain multiple clusters, and the clustering algorithm used is DBSCAN.
5. The machine vision-based plate processing edge banding detection method according to claim 4, characterized in that: The calculation method of the neighborhood radius in clustering is: Calculate the similarity evaluation between each gray value and the standard gray value; Traverse the similarity evaluation of all grayscale values, take the pixel corresponding to the maximum similarity evaluation value as the target pixel, take the absolute value of the difference between the gradient value of the target pixel and the gradient value of any pixel and 1 as the distance value, and take the minimum distance value as the neighborhood radius.
6. The machine vision-based plate processing edge banding detection method according to claim 5, characterized in that: The calculation formula for similarity evaluation is: ,in, Grayscale value Similarity evaluation with standard grayscale values, is the standard grayscale value, which is the pixel value of the pixel point in the standard edge banding area. The gray value is The ratio of the number of pixels to the total number of pixels in the gradient image.
7. The machine vision-based plate processing edge banding detection method according to claim 1, characterized in that: The calculation formula of the merger coefficient is: ,in, is the merging coefficient, The pixel value in the first cluster is The ratio of the pixel point to all the pixels of the first cluster, The pixel value in the second cluster is The ratio of the pixel point to all pixels of the second cluster, represents the hyperbolic tangent function.
8. The machine vision-based plate processing edge banding detection system is characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the plate processing edge banding detection method based on machine vision according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for detecting edge sealing defect of plate based on image, related equipment and storage medium
CN114820594A
Plate edge sealing defect detection method, device and equipment and storage medium
CN116128867A