Defect detection method and device of plate, electronic equipment and storage medium
Patent Information
- Application Number
- CN202411354053.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2044-09-26
AI Technical Summary
[0003]当前技术中,板材的缺陷检测手段主要采用人工检测的方式,由人工根据给定的封边带与板材贴合的契合度质量检规,判断板材的封边带与板材的契合度是否符合标准,这种检测手段不仅效率低,自动化程度低,而且主观性较强,难以保证检测结果的准确性
[0021]本公开实施例中提供的一个或多个技术方案,通过获取待检测的板材图像,板材图像中包括板材封边带部分和线激光器倾斜照射板材封边带部分的板材表面产生的激光线条,并获取板材图像中激光线条的边缘点集,基于边缘点集拟合得到一条激光直线,进而基于激光直线、边缘点集和质量检规值,检测板材图像对应的板材是否存在缺陷。采用本公开的方案,利用线激光器照射板材封边带部分的板材表面产生的激光线条进行板材缺陷检测,实现了板材缺陷检测的自动化和智能化,提高了检测效率,并且规避了人工检测主观性强的问题,保证了检测结果的准确性。
Smart Images

Figure CN119269525B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of industrial vision intelligent inspection technology, particularly to the field of sheet metal production quality inspection, and especially to a method, apparatus, electronic device and storage medium for defect detection of sheet metal. Background Technology
[0002] During the processing of sheet materials, defects can occur due to imperfect processes or substandard incoming materials, resulting in the edge banding tape being higher or lower than the sheet surface. These defects affect the quality of the sheet materials and the finished product. Therefore, defect detection of edge-banded sheets is essential.
[0003] Currently, the main method for detecting defects in sheet metal is manual inspection. This involves manual inspection, where personnel judge whether the fit between the edge banding and the sheet metal meets the given quality standards. This method is not only inefficient and lacks automation, but it is also highly subjective and makes it difficult to guarantee the accuracy of the test results. Summary of the Invention
[0004] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, the present disclosure provides a method, apparatus, electronic device and storage medium for detecting defects in sheet metal.
[0005] According to one aspect of this disclosure, a method for detecting defects in sheet metal is provided, comprising:
[0006] Acquire an image of the board material to be inspected, the image of which includes the edge banding of the board material and laser lines generated by a line laser obliquely irradiating the surface of the edge banding of the board material.
[0007] Obtain the edge point set of the laser line in the plate image;
[0008] A laser line is obtained by fitting the set of edge points;
[0009] Based on the laser line, the edge point set, and the quality inspection value, the presence of defects in the board material corresponding to the board material image is detected.
[0010] According to another aspect of this disclosure, a defect detection device for sheet metal is provided, comprising:
[0011] The acquisition module is used to acquire an image of the board material to be inspected, the image of which includes the edge banding of the board material and laser lines generated by a line laser obliquely irradiating the surface of the edge banding of the board material.
[0012] The extraction module is used to obtain the edge point set of the laser lines in the plate image;
[0013] A fitting module is used to fit a laser line based on the set of edge points;
[0014] The detection module is used to detect whether there are defects in the board corresponding to the board image based on the laser line, the edge point set, and the quality inspection value.
[0015] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0016] Processor; and
[0017] Stored program memory,
[0018] The program includes instructions that, when executed by the processor, cause the processor to perform the defect detection method for the sheet metal according to one aspect of the foregoing.
[0019] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to perform the defect detection method for sheet metal according to the foregoing aspect.
[0020] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program, when executed by a processor, implements the defect detection method for sheet metal described in the foregoing aspect.
[0021] One or more technical solutions provided in this disclosure acquire an image of a sheet material to be inspected. The image includes the sheet material's edge banding and laser lines generated by a line laser irradiating the sheet material's edge banding surface at an angle. The edge point set of the laser lines in the sheet material image is acquired, and a straight laser line is fitted based on the edge point set. Then, based on the laser line, the edge point set, and quality inspection values, the presence of defects in the sheet material corresponding to the image is detected. By using the solution of this disclosure, laser lines generated by a line laser irradiating the sheet material's edge banding surface are used for sheet material defect detection. This achieves automation and intelligence in sheet material defect detection, improves detection efficiency, avoids the subjectivity problem of manual inspection, and ensures the accuracy of the detection results. Attached Figure Description
[0022] Further details, features, and advantages of this disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0023] Figure 1(a) shows a schematic diagram of the actual product where the edge banding is higher than the surface of the board;
[0024] Figure 1(b) shows a schematic diagram of the actual object with the edge banding tape below the surface of the board;
[0025] Figure 2A flowchart of a defect detection method for a sheet metal according to an exemplary embodiment of the present disclosure is shown;
[0026] Figure 3(a) shows a top view of the relative positional relationship between a camera and a line laser according to an exemplary embodiment of the present disclosure;
[0027] Figure 3(b) shows a left view of the relative positional relationship between a camera and a line laser in an exemplary embodiment of the present disclosure;
[0028] Figure 4(a) shows a partial schematic diagram of a sheet material with low edge banding defects;
[0029] Figure 4(b) shows a partial schematic diagram of a sheet material with high edge banding defects;
[0030] Figure 4(c) shows a schematic diagram of a defect-free sheet metal image;
[0031] Figure 5 A flowchart of a defect detection method for a sheet metal according to another exemplary embodiment of the present disclosure is shown;
[0032] Figure 6 A flowchart of a defect detection method for a sheet metal according to yet another exemplary embodiment of the present disclosure is shown;
[0033] Figure 7 A flowchart of a defect detection method for a sheet metal according to yet another exemplary embodiment of the present disclosure is shown;
[0034] Figure 8 A flowchart of a defect detection method for a sheet metal according to another exemplary embodiment of the present disclosure is shown;
[0035] Figure 9 A schematic block diagram of a defect detection apparatus for sheet metal according to an exemplary embodiment of the present disclosure is shown;
[0036] Figure 10 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0037] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0038] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0039] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0040] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0041] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0042] As a component in product manufacturing, the quality of wood-based panels directly impacts the overall product quality. For example, wood-based panels used in furniture making include desks, cabinets, and dressing tables; their quality directly affects the quality of the finished products. During panel processing, imperfect processes or substandard materials can cause the edge banding to be either higher than (as shown in Figure 1(a)) or lower than (as shown in Figure 1(b)) the panel surface. If the edge-banded panels are not quality-tested and used as part of the finished product, the final appearance will be poor.
[0043] Currently, the automation level of defect detection in the board production process is low. Current detection methods mainly rely on manual inspection, which is inefficient. Although there are established quality standards for the fit between the edge banding and the board—for example, an edge banding that is more than 0.2mm below or above the board surface is considered a defect—relying on manual inspection is inherently subjective, as each employee's judgment criteria may differ slightly. This subjective nature makes it difficult to guarantee the accuracy of defect detection results, ultimately compromising product quality.
[0044] Current technologies utilize machine vision to detect the fit between the edge banding and the board material. However, existing methods involve capturing vertical images of the board material parallel to its surface and then using deep learning instance segmentation to detect defects. This approach requires a large number of image samples for training and can only detect defects where the edge banding is below the board surface, not above it. Furthermore, it demands significant computational resources and time. To meet the production speed requirements of board material production lines, high-performance processors (such as GPUs) are needed to accelerate the inference process of the deep learning model, increasing the cost of the detection equipment.
[0045] To address the aforementioned problems, this disclosure provides a defect detection method for sheet metal, specifically for detecting the quality of edge banding bonding during sheet metal production. This method uses a line laser to obliquely illuminate the portion of the sheet metal surface containing the edge banding, and employs an area-array industrial camera to acquire images containing the laser lines. The acquired images are then used to detect whether the sheet metal exhibits high or low edge banding defects. In the image processing algorithm, the edge point set of the laser lines is first located in the image. Then, a point set suitable for fitting a straight line is selected from this set. A straight line is fitted based on these selected point sets. The original point set is then segmented according to horizontal and vertical distances. By setting certain conditions for detecting high / low edge banding defects, the defect detection of the sheet metal is achieved. Using this solution, efficient and accurate detection of edge banding bonding defects can be achieved through simple image processing, requiring minimal computational resources and time, without increasing detection costs, and effectively improving the production efficiency and quality of sheet metal production lines.
[0046] The following description, with reference to the accompanying drawings, outlines the defect detection methods, apparatus, electronic devices, and storage media for sheet metal provided in this disclosure.
[0047] Figure 2 A flowchart of a defect detection method for sheet metal according to an exemplary embodiment of the present disclosure is shown. The method can be executed by a defect detection device for sheet metal provided in the embodiments of the present disclosure, wherein the device can be implemented by software and / or hardware, and can generally be integrated into an electronic device, including a computer, server, or other such device.
[0048] like Figure 2 As shown, the defect detection method for this sheet metal can include the following steps:
[0049] Step 101: Obtain an image of the board material to be inspected. The image includes the edge banding of the board material and laser lines generated on the surface of the board material by tilting the laser to illuminate the edge banding.
[0050] A line laser is a laser source that produces a linear beam of light. It can emit a continuous, parallel laser beam, which is typically narrow in width and long in length.
[0051] In this embodiment of the disclosure, a line laser can be used to irradiate the surface of the edge banding portion of a board material (e.g., a furniture board material), and then a camera (e.g., an area array industrial camera) can be used to capture an image of the board material that is irradiated by the line laser at an angle, so as to obtain an image of the board material. The acquired image of the board material includes the edge banding portion of the board material and the laser lines generated by the line laser.
[0052] In practical industrial applications, the positions of the image acquisition device and the line laser can be fixed for convenient inspection. In an optional embodiment of this disclosure, the camera for acquiring images of the board is mounted parallel to the plane of the board. The angle between the optical axis of the line laser and the camera is within a preset angle range (e.g., 25 degrees to 60 degrees). Furthermore, the angle between the laser line presented by the line laser on the board surface and the edge of the board is greater than a preset angle (e.g., a preset angle of 85 degrees), that is, the laser line presented by the line laser on the board surface is perpendicular or nearly perpendicular to the edge of the board.
[0053] The line laser can be mounted on the left or right side of the camera. When acquiring images of the board material, the camera and line laser can be mounted on only one side of the board to be inspected for image acquisition, or the camera and line laser can be mounted on the top and bottom sides of the board respectively to acquire images corresponding to the top and bottom surfaces of the board. For example, Figure 3(a) shows a top view of the relative positional relationship between the camera and line laser in an exemplary embodiment of this disclosure, and Figure 3(b) shows a left view of the relative positional relationship between the camera and line laser in an exemplary embodiment of this disclosure. As shown in Figures 3(a) and 3(b), the line laser is mounted on the top and bottom sides of the board to be inspected and tilted to illuminate the board surface containing the edge banding portion. An area array camera is mounted on the top and bottom sides of the board in a manner parallel to the board plane. Planar mirrors on the top and bottom sides of the board reflect the laser-illuminated areas to the cameras on both sides, respectively, to acquire images of the top and bottom surfaces of the board containing laser lines and the board edge banding portion, respectively. It is understood that the defect detection method provided in this disclosure applies to both the images of the upper and lower surfaces of the board material. That is, the board material images acquired in this disclosure can be images of either the upper or lower surface of the board. It is also understood that in this embodiment, the size of the board material image is related to the resolution of the camera used. For example, if the camera resolution is 720*540, the size of the acquired board material image will be 720 (width) * 540 (height). This disclosure does not limit the size of the board material image.
[0054] In one optional embodiment of this disclosure, after acquiring the board image, the board image can be preprocessed to improve the efficiency and accuracy of subsequent image processing. It should be noted that preprocessing can include various methods, without any limitation here. For example, preprocessing can include image denoising, image enhancement, and image segmentation.
[0055] Step 102: Obtain the edge point set of the laser lines in the board image.
[0056] In this embodiment of the disclosure, in the acquired image of the board material, the board material and background are imaged as black, while the laser lines are relatively bright and appear as white. For example, taking a line laser mounted on the right side of the camera, an image of a board material with low edge sealing defects is shown in Figure 4(a), an image of a board material with high edge sealing defects is shown in Figure 4(b), and an image of a defect-free board material is shown in Figure 4(c). It is understood that... Figures 4(a) to 4(c) Only a partial image of the board material, captured by the camera, showing the laser beam illuminating the edge banding of the board material. Therefore, based on the pixel values of different pixels in the board image, the edge point set of the laser line in the board image can be identified. This edge point set includes multiple edge points. Commonly used edge detection algorithms (such as the Sobel operator and the Prewitt operator) can be used to obtain the edge point set of the laser line in the board image; this disclosure does not impose any limitations on this method.
[0057] In one alternative embodiment of this disclosure, edge detection can be performed on the entire board image to determine the edge point set of the laser lines.
[0058] In another optional embodiment of this disclosure, a detection region including laser lines can be first determined in the board image. Edge detection is then performed on this detection region to determine the edge point set of the laser lines within the detection region. Thus, by performing edge point detection only on a portion of the image region, edge detection efficiency can be improved. The position of the detection region in the board image can be manually preset, and only needs to be set once if the installation position and angle of the camera and line laser remain unchanged, offering high convenience. Alternatively, the detection region can be automatically determined from the board image using an algorithm.
[0059] Step 103: A laser line is obtained by fitting the edge point set.
[0060] In this embodiment of the disclosure, after determining the set of edge points, a laser line can be obtained by fitting the set of edge points. Various methods can be used to obtain a laser line by fitting the set of edge points, and no limitation is made here.
[0061] As an example, a laser line can be generated by fitting a set of edge points using common fitting algorithms. For instance, the Random Sample Consensus (RANSAC) algorithm can be used to select a set of points from the edge point set that can be used to fit the line, and then a line fitting method (such as least squares or gradient descent) can be used to fit the laser line.
[0062] As another example, a set of edge points can be input into the fitted model to generate a laser line. This fitted model can be pre-trained and stored in the storage space of an electronic device for easy retrieval when needed.
[0063] Step 104: Based on the laser line, edge point set, and quality inspection value, detect whether there are defects in the board corresponding to the board image.
[0064] Among them, the quality inspection value is the critical value for determining whether the board corresponding to the board image has high / low edge sealing defects. This quality inspection value can be preset by the user according to the actual inspection requirements, or it can be calculated based on the user's preset physical inspection value. The physical inspection value can be limited by the user according to the actual design requirements or inspection requirements. The unit of the physical inspection value is usually millimeters. For example, setting the physical inspection value to 0.2mm means that the high edge sealing defect is defined as the edge sealing strip being higher than the board surface by more than 0.2mm, and the low edge sealing defect is defined as the edge sealing strip being lower than the board surface by more than 0.2mm. The quality inspection value is the pixel inspection value, and the unit is pixels. The physical inspection value can be converted into the quality inspection value by the following formula (1):
[0065]
[0066] In the above formula (1), th is the physical inspection standard, and acc is the physical inspection standard. p Let θ be the pixel resolution of the camera, and th be the angle between the laser and the camera. p This refers to the pixel inspection value obtained after converting the physical inspection value, i.e., the quality inspection value.
[0067] In one possible implementation, inspectors can set quality control values based on the type of board material or the usage scenario, thereby controlling the inspection accuracy. This makes the solution applicable to different types of boards or different usage scenarios, thus improving its practicality.
[0068] As an example, when detecting whether there are defects in a board image based on a laser line, edge point set, and quality inspection value, the edge point set can be divided into two subsets located on both sides of the laser line: a left subset and a right subset. The left and right subsets are then used to detect whether there are high or low edge sealing defects. Whether the left subset is used to detect high or low edge sealing defects depends on the relative position of the line laser to the camera. If the line laser is installed on the right side of the camera, the high edge sealing defect will bend to the left in the board image, and the left subset will be used to detect high edge sealing defects, while the right subset will be used to detect low edge sealing defects. If the line laser is installed on the left side of the camera, the high edge sealing defect will bend to the right in the board image, and the right subset will be used to detect high edge sealing defects, while the left subset will be used to detect low edge sealing defects. Assuming the left subset is used to detect high edge banding defects and the right subset is used to detect low edge banding defects, we can check if the distance from the edge point closest to the laser line in the left subset to the laser line is greater than the quality inspection value. If it is, then the board corresponding to the board image has a high edge banding defect. If the distance from the edge point farthest from the laser line in the right subset to the laser line is greater than the quality inspection value, then the board corresponding to the board image has a low edge banding defect.
[0069] The defect detection method for sheet metal according to this disclosure involves acquiring an image of the sheet metal to be inspected. The image includes the sheet metal edge banding and laser lines generated by a line laser irradiating the sheet metal surface at an angle. The method also acquires the edge point set of the laser lines in the sheet metal image, fits a laser line based on the edge point set, and then detects whether there are defects in the sheet metal corresponding to the image based on the laser line, the edge point set, and quality inspection values. This method utilizes laser lines generated by a line laser irradiating the sheet metal surface of the edge banding to perform defect detection, achieving automation and intelligence in sheet metal defect detection, improving detection efficiency, avoiding the subjectivity issues of manual inspection, and ensuring the accuracy of the detection results.
[0070] In one alternative embodiment of this disclosure, such as Figure 5 As shown, in Figure 2 Based on the illustrated embodiment, step 102 may include the following sub-steps:
[0071] Step 201: Obtain the preset ROI region location information.
[0072] A Region of Interest (ROI) in an image is a region that requires special attention or processing. In image processing and computer vision, ROIs are often used to specify a sub-image portion to be further analyzed or manipulated. ROI location information can take many forms, without any limitation here. For example, ROI location information may include the coordinates of the four vertices of the ROI, or it may include the coordinates of the center point and the region's dimensions.
[0073] As an example, the ROI region location information can be set to include the coordinates of the top left corner and the bottom right corner. The ROI region determined in the board image is a rectangle defined by the ROI region location information.
[0074] It should be noted that the ROI area location information can be changed according to the imaging position of the laser line in the board image, and there are no limitations on this adjustment. When the installation position and angle of the camera and laser line remain unchanged, the ROI area location information can remain unchanged after it is set.
[0075] Step 202: Based on the ROI region location information, determine the ROI region in the board image. The ROI region contains laser lines.
[0076] In this embodiment of the disclosure, by using the acquired ROI region location information, an ROI region can be determined in the board image, and the ROI region contains laser lines.
[0077] As an example, assuming the ROI location information includes the coordinates of the top left corner (275, 150) and the bottom right corner (365, 350), then the rectangular ROI region determined in the board image has the coordinates of the top left corner (275, 50) and the bottom right corner (365, 350) in the board image. The top left corner of the board image is the origin of the pixel coordinate system, the horizontal direction to the right is the positive x-axis, and the vertical direction downward is the positive y-axis. Therefore, each pixel in the board image has unique and fixed coordinates.
[0078] Step 203: Search within the ROI region according to the target direction to determine the edge point set of the laser line, where the target direction is related to the relative position of the line laser relative to the camera acquiring the image of the board.
[0079] It should be noted that the target direction is pre-designed and can be changed according to the actual relative position of the line laser relative to the camera acquiring the image of the board material; no limitations are imposed here. For example, the target direction can be from right to left or from left to right. If the line laser is located to the right of the camera, the target direction is from left to right; if the line laser is located to the left of the camera, the target direction is from right to left.
[0080] In this embodiment, when determining the edge points in the edge point set, the search can be performed in the ROI region according to the target direction to obtain multiple edge points that constitute the edge point set.
[0081] The defect detection method for sheet metal in this embodiment of the present disclosure obtains preset ROI (Region of Interest) location information, determines the ROI region in the sheet metal image based on the ROI region location information, and then searches within the ROI region according to the target direction to determine the edge point set of the laser line. Therefore, by searching and determining the edge point set within the determined ROI region, the range of edge point detection is narrowed, which can improve image processing efficiency and reduce background interference.
[0082] In one alternative embodiment of this disclosure, such as Figure 6 As shown, based on the foregoing embodiments, step 104 may include the following sub-steps:
[0083] Step 301: Determine the first edge point from the edge point set. The first edge point is the endpoint of the target end in the edge point set, and the target end is the starting end of the target direction.
[0084] For example, assuming the line laser is mounted on the right side of the camera, the target direction is from left to right, with the starting point of the target direction being the left end and the target end being the left end. Therefore, the first edge point is the left endpoint of the edge point set, meaning the first edge point is the point with the smallest x-coordinate value in the edge point set. Conversely, assuming the line laser is mounted on the left side of the camera, the target direction is from right to left, with the target end and the starting point of the target direction being the right end. Therefore, the first edge point is the right endpoint of the edge point set, meaning the first edge point is the point with the largest x-coordinate value in the edge point set.
[0085] Step 302: Determine whether the first distance from the first edge point to the laser line is greater than the quality inspection value.
[0086] In this embodiment of the disclosure, after determining the first edge point, the distance from the first edge point to the laser line can be calculated (for ease of description and distinction, it is referred to as the first distance).
[0087] As an example, the first distance is the perpendicular distance from the first edge point to the laser line. The first distance can be determined by the formula for the distance from a point to a line, or it can be determined by counting the number of pixels that the perpendicular line from the first edge point to the laser line passes through.
[0088] Next, it can be determined whether the first distance is greater than the quality inspection value. If it is, then step 303 is executed; if the first distance is not greater than the quality inspection value, then step 305 is executed.
[0089] Step 303: If the first distance is greater than the quality inspection value, determine the first set of points located on the target side of the laser line from the set of edge points, wherein the target side is opposite to the relative position of the line laser relative to the camera that acquires the image of the board.
[0090] For example, assuming the line laser is positioned to the right of the camera capturing the image of the board material, the target side is the left. The first set of points is formed by identifying the edge points located to the left of the laser line from the set of edge points. Conversely, assuming the line laser is positioned to the left of the camera capturing the image of the board material, the target side is the right. The first set of points is formed by identifying the edge points to the right of the laser line from the set of edge points.
[0091] In one optional embodiment of this disclosure, to reduce the number of edge points that need to be processed, when determining the first point set, the lower endpoint of the edge point set (i.e., the point with the largest y-coordinate value in the edge point set, which is the point closest to the sealing strip) can be determined based on the coordinates of each edge point in the edge point set. Then, starting from the lower endpoint, a preset number of edge points (to ensure the accuracy, stability, and speed of defect detection, the preset number can generally be any value between 40 and 80, for example, 50) are obtained upwards to form a candidate anomaly point set. In other words, the candidate anomaly point set contains a preset number of edge points with large y-coordinate values. Then, points located on the laser line target side and whose distance to the laser line is greater than the quality inspection value are determined from the candidate anomaly point set to form the first point set. Thus, the anomaly points that contribute the most to the detection of high defects in the sealing strip can be screened from the edge point set, reducing the data processing volume for high defect detection in the sealing strip.
[0092] Step 304: Based on the first point set, detect whether there is a high edge sealing defect in the board corresponding to the board image.
[0093] In this embodiment of the disclosure, after determining the first point set, the presence of edge banding defects in the board corresponding to the board image can be detected based on the first point set.
[0094] As an example, the number of pixels contained in the first set of points can be counted. If the number of pixels contained in the first set of points is greater than a preset threshold, it is determined that the board corresponding to the board image has a high edge sealing defect.
[0095] Step 305: Determine the second edge point from the edge point set. The second edge point is the endpoint of the edge point set that is opposite to the target end.
[0096] In this embodiment of the disclosure, if the first distance from the first edge point to the laser line is less than or equal to the quality inspection value, then the second edge point is determined from the edge point set, and the second edge point is the endpoint of the edge point set opposite to the target end.
[0097] For example, assuming the line laser is mounted on the right side of the camera, the target direction is from left to right. The starting point of the target direction is the left end, the target end is the left end, and the end opposite the target end is the right end. The determined second edge point is the right endpoint of the edge point set, meaning the second edge point is the point with the largest x-coordinate value in the edge point set. Conversely, assuming the line laser is mounted on the left side of the camera, the target direction is from right to left, and the target end and the starting point of the target direction are the right end. The determined second edge point is the left endpoint of the edge point set, meaning the second edge point is the point with the smallest x-coordinate value in the edge point set.
[0098] Step 306: Determine whether the second distance from the second edge point to the laser line is greater than the quality inspection value.
[0099] It should be noted that in this embodiment, the distance from the second edge point to the laser line (referred to as the second distance for ease of description and distinction) is calculated in a similar way to the first distance in the aforementioned embodiment, and will not be repeated here.
[0100] Step 307: If the second distance is greater than the quality control value, determine the second set of points on the opposite side of the laser line target from the set of edge points.
[0101] In this embodiment of the disclosure, if the second distance is not greater than the quality inspection value, it can be determined that the board corresponding to the board image does not have high or low edge sealing defects. If the second distance is greater than the quality inspection value, a second set of points located on the opposite side of the laser line target side is determined from the set of edge points.
[0102] For example, assuming the line laser is positioned relative to the camera capturing the image of the board material, with the line laser mounted to the right of the camera, then the target side is the left, and the opposite side of the target side is the right. The edge points located to the right of the laser line are determined from the set of edge points to form a second set of points. Alternatively, assuming the line laser is positioned relative to the camera capturing the image of the board material, with the line laser mounted to the left of the camera, then the target side is the right, and the opposite side of the target side is the left. The edge points located to the left of the laser line are determined from the set of edge points to form a second set of points.
[0103] In one optional embodiment of this disclosure, to reduce the number of edge points that need to be processed, when determining the second point set, the lower endpoint of the edge point set (i.e., the point with the largest y-coordinate value in the edge point set, which is the point closest to the sealing strip) can be determined based on the coordinates of each edge point in the edge point set. Then, a preset number of edge points (the preset number can be any value between 40 and 80, for example, 50) are obtained upwards from the lower endpoint to form a candidate anomaly point set. In other words, the candidate anomaly point set contains a preset number of edge points with smaller y-coordinate values. Subsequently, points located on the opposite side of the laser line target side and whose distance to the laser line is greater than the quality inspection value are determined from the candidate anomaly point set to form the second point set. This allows for the selection of anomaly points from the edge point set that contribute most to the low-defect detection of the sealing strip, reducing the data processing volume for low-defect edge sealing detection.
[0104] Step 308: Based on the second point set, detect whether the board corresponding to the board image has low edge sealing defects.
[0105] In this embodiment of the disclosure, after determining the second point set, the presence of low edge sealing defects in the board corresponding to the board image can be detected based on the second point set.
[0106] As an example, the number of pixels contained in the second point set can be counted. If the number of pixels contained in the second point set is greater than a preset threshold, it is determined that the board corresponding to the board image has a low edge sealing defect.
[0107] The defect detection method for sheet metal in this embodiment of the present disclosure determines a first edge point from a set of edge points, determines whether a first distance from the first edge point to the laser line is greater than a quality inspection value, and if the first distance is greater than the quality inspection value, determines a first set of points located on the target side of the laser line from the set of edge points for high edge sealing defect detection. If the first distance is less than or equal to the quality inspection value, determines a second edge point from the set of edge points, and if the second distance from the second edge point to the laser line is greater than the quality inspection value, determines a second set of points located on the opposite side of the target side of the laser line from the set of edge points for low edge sealing defect detection. Thus, it is possible to detect whether the sheet metal has high or low edge sealing defects, improving the comprehensiveness and flexibility of sheet metal defect detection.
[0108] In one alternative embodiment of this disclosure, such as Figure 7 As shown, in Figure 6 Based on the illustrated embodiment, step 304 may include the following sub-steps:
[0109] Step 401: Divide the first point set to obtain multiple first sub-point sets.
[0110] As an example, the smallest rectangle containing the first set of points can be divided into multiple rectangular sub-regions according to a preset number of divisions. All points contained in a rectangular sub-region constitute a first set of points, thus obtaining multiple first sets of points.
[0111] As another example, the first set of points can be divided into multiple first subsets of points using the following steps: S1, take the first point in the first set of points (the point with the smallest x-coordinate and / or y-coordinate) as the current point; S2, calculate the horizontal distance (i.e., the difference in x-coordinate values) and vertical distance (i.e., the difference in y-coordinate values) between the current point and its next adjacent point; S3, if the horizontal distance is less than or equal to a preset horizontal distance threshold and the vertical distance is less than or equal to a preset vertical distance threshold, assign the current point and the next point to the same candidate subset; S4, if the horizontal distance is greater than the horizontal distance threshold or the vertical distance is greater than the vertical distance threshold, assign the current point and the next point to different candidate subsets; S5, take the next point as the current point; S6, repeat steps S2-S5 until all points in the first set of points have been traversed, resulting in multiple candidate subsets of points as multiple first subsets of points. That is, in each first subset of points, the horizontal distance between any two adjacent points is no greater than the horizontal distance threshold and the vertical distance is no greater than the vertical distance threshold. This allows edge points that are close to each other to be grouped into the same subset, ensuring the accuracy of the segmentation results.
[0112] Step 402: Traverse each first subset of points and check whether the first subset of points meets the high defect condition of the edge banding. The high defect condition of the edge banding is that the number of edge points in the first subset of points is greater than the first threshold, and the first subset of points is located in the area where the edge banding of the board is located.
[0113] The first threshold can be set according to actual needs or obtained through extensive experimental testing.
[0114] In this embodiment, after obtaining multiple first sub-point sets, each first sub-point set can be traversed sequentially to detect whether the first sub-point set meets the preset edge sealing high defect condition. If the number of edge points contained in a first sub-point set is greater than a first threshold, and the first sub-point set is located in the area where the edge sealing strip of the board is located, then it is determined that the first sub-point set meets the edge sealing high defect condition.
[0115] It should be noted that in this embodiment, the first sub-set of points being located in the area where the edge banding of the board is located means that the coordinates of all points in the first sub-set of points fall within a preset area, which is the area where the edge banding of the board is located. After the camera and line laser are installed, the position of the edge banding of the board in the furniture board image is basically fixed, although there may be slight variations. Therefore, based on the position of the edge banding of the board in the furniture board image, a preset area can be pre-defined to represent the area where the edge banding of the board is located in the furniture board image. Then, the coordinates of each point in the first sub-set of points are compared with this preset area to determine whether the coordinates of all points in the first sub-set of points fall within this preset area. If so, it is determined that the first sub-set of points is located in the area where the edge banding of the board is located. Alternatively, it is also possible to only determine whether the point with the smallest y-coordinate and the point with the largest y-coordinate in the first sub-set of points are both located within the preset area. If so, it is determined that the first sub-set of points is located in the area where the edge banding of the board is located. This disclosure does not limit the choice of judgment method.
[0116] Step 403: If at least one of the multiple first sub-point sets satisfies the edge sealing high defect condition, it is determined that the board corresponding to the board image has an edge sealing high defect.
[0117] In this embodiment of the disclosure, by detecting whether each first subset of points satisfies the high edge sealing defect condition, it can be determined whether there is a first subset of points that satisfies the high edge sealing defect condition among multiple first subset of points. If at least one first subset of points satisfies the high edge sealing defect condition among multiple first subset of points, it is determined that the board corresponding to the board image has a high edge sealing defect. If each first subset of points does not satisfy the high edge sealing defect condition, steps 305 to 308 are executed to detect whether the board corresponding to the board image has a low edge sealing defect.
[0118] For some boards, although they do not inherently have edge banding defects, the shape of their edge banding portion in the board image closely resembles an edge banding defect, potentially leading to false detection. To ensure the accuracy of edge banding defect detection, in one optional embodiment of this disclosure, it can be preliminarily determined that the board corresponding to the board image has an edge banding defect when at least one first subset of points satisfies the edge banding defect condition. Further determination is then made on whether the first subset of points satisfying the edge banding defect condition is a genuine edge banding defect. Specifically, when at least one first subset of points satisfies the edge banding defect condition, the coordinates of each point in the target first subset of points satisfying the edge banding defect condition are obtained. Based on the coordinates of each point in the target first subset of points, the upper endpoint with the smallest ordinate value in the target first subset of points is determined. Based on the coordinates of the upper endpoint and a preset image size, a board strip bonding image is cropped from the board image. Based on the pixel values of each row in the board strip bonding image, a target pixel value for each row is determined. If the difference between the first target pixel value and the second target pixel value is greater than or equal to a preset value, it is determined that the board corresponding to the board image has an edge banding defect.
[0119] The preset image size could be, for example, 30*20 pixels. When determining the strip bonding area, extend the image 10 pixels upwards and downwards from the top endpoint, and 15 pixels to the left and right respectively. This results in the area containing the strip bonding area. Cropping this area yields a 30*20 strip bonding image. For the cropped strip bonding image, determine the target pixel value for each row based on its pixel values. For example, the sum of all pixel values in the same row (or the average pixel value in the same row) can be used as the target pixel value for that row.
[0120] In this embodiment, the selection of the first target pixel value and the second target pixel value can be preset according to actual needs. Extensive experimental testing has shown that the first target pixel value can be the second largest value among all target pixel values, and the second target pixel value can be the second smallest value among all target pixel values. This avoids the instability caused by imaging interference when using the maximum and minimum target pixel values. Using the second largest and second smallest values as the first and second target pixel values ensures data stability even with significant differences, thereby guaranteeing the stability and accuracy of the detection results. The difference between the first and second target pixel values can be represented by their difference or their ratio; this disclosure does not impose any limitation on this.
[0121] The defect detection method for sheet metal in this embodiment of the present disclosure divides a first set of points into multiple first sub-sets of points. Each first sub-set of points is traversed, and it is detected whether the first sub-set of points satisfies the edge sealing high defect condition. The edge sealing high defect condition is that the number of edge points in the first sub-set of points is greater than a first threshold and the first sub-set of points is located in the area where the edge sealing strip of the sheet metal is located. If at least one first sub-set of points satisfies the edge sealing high defect condition, it is determined that the sheet metal corresponding to the sheet metal image has an edge sealing high defect. Thus, the detection of edge sealing high defects in the sheet metal is realized.
[0122] Furthermore, in one optional embodiment of this disclosure, after determining that the board image corresponding to the board has an edge banding high defect, the maximum, minimum, maximum, and minimum values of the horizontal coordinate, vertical coordinate, and ordinate can be determined based on the coordinates of each point in the first sub-point set that satisfies the edge banding high defect condition. Based on these values, four corner points are determined in the board image, and then a bounding box for the edge banding high defect is generated in the board image based on these four corner points. This visualizes the edge banding high defect in the board image, providing a reference for defect correction.
[0123] In one alternative embodiment of this disclosure, such as Figure 8 As shown, in Figure 6 Based on the illustrated embodiment, step 308 may include the following sub-steps:
[0124] Step 501: Divide the second point set to obtain multiple second sub-point sets.
[0125] As an example, the smallest rectangle containing the second set of points can be divided into multiple rectangular sub-regions according to a preset number of divisions. All points contained in a rectangular sub-region constitute a second set of points, thus obtaining multiple sets of second sets of points.
[0126] As another example, we can start traversing from the first point in the second point set (the point with the smallest x-coordinate and / or y-coordinate), taking the first point as the current point, and using the following rules to divide the points into multiple second sub-sets: If the horizontal distance between the current point and its next adjacent point is not greater than the horizontal distance threshold (e.g., 6), and the vertical distance is not greater than the vertical distance threshold (e.g., 3), then these two points are considered to belong to the same sub-set. Then, the next point of the current point is taken as the current point, and the sub-set division continues according to the above rules. If a point p is encountered whose positional relationship with the current point does not meet the above conditions, then point p is considered not to belong to the same sub-set. The current second sub-set division is then complete, and point p is taken as the current point to continue dividing the remaining points in the second point set according to the above rules, until the current point is the last point in the second point set. After traversal, multiple second sub-sets are obtained.
[0127] Step 502: Traverse each second subset of points and check whether the second subset of points meets the low defect condition for edge sealing. The low defect condition for edge sealing is that the number of edge points in the second subset of points is greater than the second threshold, and the second subset of points is located in the area where the edge sealing strip of the board is located.
[0128] The second threshold can be set according to actual needs or obtained through extensive experimental testing.
[0129] In this embodiment, after obtaining multiple second sub-point sets, each second sub-point set can be traversed sequentially to detect whether the second sub-point set meets the preset low defect condition for edge sealing. If the number of edge points contained in a second sub-point set is greater than the second threshold, and the second sub-point set is located in the area where the edge sealing strip of the board is located, then it is determined that the second sub-point set meets the high defect condition for edge sealing.
[0130] It should be noted that in this embodiment, the second sub-set being located in the area where the edge banding of the board is located means that the coordinates of all points in the second sub-set fall within a preset area, which is the area where the edge banding of the board is located. After the camera and line laser are installed, the position of the edge banding in the furniture board image is basically fixed, though there may be slight variations. Therefore, based on the position of the edge banding in the furniture board image, a preset area can be pre-defined to represent the area where the edge banding of the board is located in the furniture board image. Then, the coordinates of each point in the second sub-set are compared with this preset area to determine whether the coordinates of all points in the second sub-set fall within this preset area. If so, the second sub-set is determined to be located in the area where the edge banding of the board is located. Alternatively, it can be determined whether the point with the smallest y-coordinate and the point with the largest y-coordinate in the second sub-set are both located within the preset area. If so, the second sub-set is determined to be located in the area where the edge banding of the board is located. This disclosure does not limit the choice of judgment method.
[0131] Step 503: If at least one of the multiple second sub-point sets satisfies the low edge sealing defect condition, determine that the board corresponding to the board image has a low edge sealing defect.
[0132] In this embodiment of the disclosure, by detecting whether each second subset of points satisfies the low edge sealing defect condition, it can be determined whether there exists a second subset of points that satisfies the low edge sealing defect condition among multiple second subset of points. If at least one second subset of points among multiple second subset of points satisfies the low edge sealing defect condition, it is determined that the board corresponding to the board image has a low edge sealing defect. If none of the second subsets in the multiple second subset of points satisfies the low edge sealing defect condition, it is determined that the board corresponding to the board image also does not have a low edge sealing defect.
[0133] Furthermore, in one optional embodiment of this disclosure, after determining that the board corresponding to the board image has low edge banding defects, the maximum, minimum, maximum, and minimum values of the horizontal coordinate, vertical coordinate, and ordinate can be determined based on the coordinates of each point in the second sub-point set that satisfies the low edge banding defect condition. Based on these values, four corner points are determined in the board image, and a low edge banding defect bounding box is generated in the board image based on these four corner points. This visualizes the low edge banding defects in the board image, providing a reference for defect correction.
[0134] The defect detection method for sheet metal in this embodiment of the present disclosure divides a second point set into multiple second sub-point sets. Each second sub-point set is traversed, and it is detected whether the second sub-point set meets the low edge sealing defect condition. The low edge sealing defect condition is that the number of edge points in the second sub-point set is greater than a second threshold and the second sub-point set is located in the area where the edge sealing strip of the sheet metal is located. If at least one second sub-point set in the multiple second sub-point sets meets the low edge sealing defect condition, it is determined that the sheet metal corresponding to the sheet metal image has a low edge sealing defect. Thus, the detection of low edge sealing defects in the sheet metal is realized.
[0135] This exemplary embodiment also provides a defect detection device for sheet metal. Figure 9 A schematic block diagram of a defect detection apparatus for sheet metal according to an exemplary embodiment of the present disclosure is shown, such as... Figure 9 As shown, the defect detection device 60 for the board material includes: an acquisition module 610, an extraction module 620, a fitting module 630, and a detection module 640.
[0136] The acquisition module 610 is used to acquire an image of the board to be inspected, the image of which includes the edge banding of the board and laser lines generated by the inclined irradiation of the edge banding of the board surface by a line laser.
[0137] Extraction module 620 is used to obtain the edge point set of the laser lines in the plate image;
[0138] The fitting module 630 is used to fit a laser line based on the set of edge points;
[0139] The detection module 640 is used to detect whether there are defects in the board corresponding to the board image based on the laser line, the edge point set, and the quality inspection value.
[0140] Optionally, the extraction module 620 is also used for:
[0141] Obtain the preset ROI region location information;
[0142] Based on the ROI region location information, an ROI region is determined in the board image, and the ROI region contains the laser lines;
[0143] The edge point set of the laser line is determined by searching along the target direction within the ROI region, wherein the target direction is related to the relative position of the line laser relative to the camera that acquires the image of the board.
[0144] Optionally, the detection module 640 includes:
[0145] The first determining unit is configured to determine a first edge point from the set of edge points, wherein the first edge point is the endpoint of the target end in the set of edge points, and the target end is the starting end of the target direction;
[0146] The first judgment unit is used to determine whether the first distance from the first edge point to the laser line is greater than the quality inspection value;
[0147] The second determining unit is used to determine a first set of points located on the laser line target side from the set of edge points when the first distance is greater than the quality inspection value, wherein the target side is opposite to the relative position of the line laser relative to the camera that acquires the image of the board material;
[0148] The edge banding high defect detection unit is used to detect whether there is an edge banding high defect in the board corresponding to the board image based on the first point set.
[0149] Optionally, the second determining unit is also used for:
[0150] Based on the coordinates of each edge point in the edge point set, determine the lower endpoint of the edge point set;
[0151] Starting from the lower endpoint, obtain a predetermined number of consecutive edge points upwards to form a candidate anomaly point set;
[0152] The first point set is formed by identifying points located on the target side of the laser line and whose distance from the laser line is greater than the quality inspection value from the candidate anomaly point set.
[0153] Optionally, the edge sealing high defect detection unit is also used for:
[0154] The first set of points is divided to obtain multiple first subsets of points;
[0155] Traverse each of the first sub-point sets and check whether the first sub-point set satisfies the high defect condition of the edge banding, wherein the high defect condition of the edge banding is that the number of edge points in the first sub-point set is greater than a first threshold, and the first sub-point set is located in the area where the edge banding of the board is located.
[0156] If at least one of the multiple first sub-point sets satisfies the edge sealing high defect condition, it is determined that the board corresponding to the board image has an edge sealing high defect.
[0157] The edge sealing high defect detection unit is also used to segment the first point set through the following steps:
[0158] S1, take the first point in the first point set as the current point;
[0159] S2, calculate the horizontal and vertical distances between the current point and its next adjacent point;
[0160] S3, if the horizontal distance is less than or equal to a preset horizontal distance threshold and the vertical distance is less than or equal to a preset vertical distance threshold, the current point and the next point are assigned to the same candidate subset.
[0161] S4, if the horizontal distance is greater than the horizontal distance threshold or the vertical distance is greater than the vertical distance threshold, divide the current point and the next point into different candidate subsets;
[0162] S5, take the next point as the current point;
[0163] S6. Repeat steps S2-S5 until all points in the first point set have been traversed, resulting in multiple candidate sub-point sets as multiple first sub-point sets.
[0164] Optionally, the edge sealing high defect detection unit is also used for:
[0165] If at least one of the multiple first sub-point sets satisfies the edge sealing high defect condition, obtain the coordinates of each point in the target first sub-point set that satisfies the edge sealing high defect condition.
[0166] Based on the coordinates of each point in the first set of target sub-points, determine the upper endpoint with the smallest ordinate value in the first set of target sub-points;
[0167] Based on the coordinates of the upper endpoint and the preset image size, the strip bonding image is cut out from the board image;
[0168] Based on the pixel values of each row of the strip bonding image, determine the target pixel value for each row;
[0169] If the difference between the first target pixel value and the second target pixel value is greater than or equal to a preset value, it is determined that the board corresponding to the board image has a high edge sealing defect.
[0170] Optionally, the defect detection device 60 for the sheet metal also includes a first marking module for:
[0171] Based on the coordinates of each point in the first sub-point set that satisfies the high defect condition of the edge sealing, determine the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate;
[0172] Based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate, four corner points are determined in the image of the board material;
[0173] Based on the four corner points, a high defect bounding box is generated in the plate image.
[0174] Optionally, the detection module 640 also includes:
[0175] The third determining unit is used to determine a second edge point from the edge point set when the first distance is less than or equal to the quality inspection value, or when none of the plurality of first sub-point sets meet the edge sealing high defect condition, wherein the second edge point is the endpoint of the edge point set opposite to the target end;
[0176] The second judgment unit is used to determine whether the second distance from the second edge point to the laser line is greater than the quality inspection value;
[0177] The fourth determining unit is used to determine a second set of points located on the opposite side of the laser line target from the set of edge points when the second distance is greater than the quality inspection value;
[0178] The edge banding low defect detection unit is used to detect whether there are edge banding low defects in the board corresponding to the board image based on the second point set.
[0179] Optionally, the edge sealing low-defect detection unit is also used for:
[0180] The second set of points is divided to obtain multiple second subsets of points;
[0181] Traverse each of the second subsets and check whether the second subset satisfies the low defect condition for edge sealing. The low defect condition for edge sealing is that the number of edge points in the second subset is greater than a second threshold, and the second subset is located in the area where the edge sealing strip of the board is located.
[0182] If at least one of the multiple second sub-point sets satisfies the low edge sealing defect condition, it is determined that the board corresponding to the board image has a low edge sealing defect.
[0183] Optionally, the defect detection device 60 for the sheet metal also includes a second marking module for:
[0184] Based on the coordinates of each point in the second sub-point set that satisfies the low defect condition for edge sealing, determine the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate.
[0185] Based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate, four corner points are determined in the image of the board material;
[0186] A low-defect edge banding bounding box is generated in the board image based on the four corner points.
[0187] Optionally, the camera used to acquire the image of the board is mounted parallel to the plane of the board, the angle between the line laser and the optical axis of the camera is within a preset angle range, and the angle between the laser line presented by the line laser on the surface of the board and the edge of the board is greater than the preset angle.
[0188] The defect detection device for sheet metal provided in this disclosure can execute any defect detection method for sheet metal applicable to electronic devices provided in this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Content not described in detail in the device embodiments of this disclosure can be referred to the description in any method embodiment of this disclosure.
[0189] Exemplary embodiments of this disclosure also provide an electronic device, including: a processor; and a memory storing a program, the program including instructions that, when executed by the processor, implement a defect detection method for a sheet metal as described in any embodiment of this disclosure.
[0190] Exemplary embodiments of this disclosure also provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions, when executed by a computer's processor, are used to cause the computer to perform a defect detection method for a sheet metal as described in any embodiment of this disclosure.
[0191] Exemplary embodiments of this disclosure also provide a computer program product, including a computer program, wherein, when executed by a computer's processor, the computer program is used to cause the computer to perform a defect detection method for sheet metal as described in any embodiment of this disclosure.
[0192] refer to Figure 10 The present invention describes a structural block diagram of an electronic device 1100 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0193] like Figure 10 As shown, the electronic device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. The RAM 1103 may also store various programs and data required for the operation of the electronic device 1100. The computing unit 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0194] Multiple components in electronic device 1100 are connected to I / O interface 1105, including: input unit 1106, output unit 1107, storage unit 1108, and communication unit 1109. Input unit 1106 can be any type of device capable of inputting information to electronic device 1100. Input unit 1106 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 1107 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 1108 may include, but is not limited to, disk and optical disk. Communication unit 1109 allows electronic device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0195] The computing unit 1101 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1101 performs the various methods and processes described above. For example, in some embodiments, the board defect detection method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 1100 via ROM 1102 and / or communication unit 1109. In some embodiments, the computing unit 1101 can be configured to perform the board defect detection method by any other suitable means (e.g., by means of firmware).
[0196] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0197] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0198] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0199] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0200] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0201] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0202] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting defects in sheet metal, characterized in that, The method includes: Acquire an image of the board material to be inspected, the image of which includes the edge banding portion of the board material and laser lines generated by a line laser obliquely irradiating the surface of the edge banding portion of the board material. Obtain the edge point set of the laser line in the plate image; A laser line is obtained by fitting the set of edge points; Based on the laser line, the edge point set, and the quality inspection value, detect whether there are defects in the board corresponding to the board image; The step of detecting whether there are defects in the board material corresponding to the board material image based on the laser line, the edge point set, and the quality inspection value includes: A first edge point is determined from the set of edge points, where the first edge point is the endpoint of the target end in the set of edge points, and the target end is the starting end of the target direction; Determine whether the first distance from the first edge point to the laser line is greater than the quality inspection value; If the first distance is greater than the quality inspection value, a first set of points located on the laser line target side is determined from the set of edge points, wherein the target side is opposite to the relative position of the line laser relative to the camera that acquires the image of the board material; Based on the first point set, detect whether the board corresponding to the board image has high edge sealing defects; The step of detecting whether the board corresponding to the board image has a high edge sealing defect based on the first point set includes: The first set of points is divided to obtain multiple first subsets of points; wherein, in each first subset of points, the horizontal distance between any two adjacent points is not greater than a horizontal distance threshold and the vertical distance is not greater than a vertical distance threshold. Traverse each of the first sub-point sets and check whether the first sub-point set satisfies the high defect condition of the edge banding, wherein the high defect condition of the edge banding is that the number of edge points in the first sub-point set is greater than a first threshold, and the first sub-point set is located in the area where the edge banding of the board is located. If at least one of the multiple first sub-point sets satisfies the edge sealing high defect condition, obtain the coordinates of each point in the target first sub-point set that satisfies the edge sealing high defect condition. Based on the coordinates of each point in the first sub-point set of the target, determine the upper endpoint with the smallest ordinate value in the first sub-point set of the target; Based on the coordinates of the upper endpoint and the preset image size, the strip bonding image is cut out from the board image; Based on the pixel values of each row of the board-strip bonding image, the target pixel value of each row is determined; the target pixel value of each row is the sum of the pixel values of all pixels in the same row or the average of the pixel values of the pixels in the same row. If the difference between the first target pixel value and the second target pixel value is greater than or equal to a preset value, it is determined that the board corresponding to the board image has a high edge sealing defect; the first target pixel value is the second largest value among the target pixel values, and the second target pixel value is the second smallest value among the target pixel values; The method further includes: If the line laser is mounted on the right side of the camera, the target direction is from left to right, and the starting point of the target direction is the left end; if the line laser is mounted on the left side of the camera, the target direction is from right to left, and the starting point of the target direction is the right end.
2. The defect detection method for sheet metal as described in claim 1, characterized in that, The step of obtaining the edge point set of the laser line in the plate image includes: Obtain the preset ROI region location information; Based on the ROI region location information, an ROI region is determined in the board image, and the ROI region contains the laser lines; The edge point set of the laser line is determined by searching along the target direction within the ROI region, wherein the target direction is related to the relative position of the line laser relative to the camera that acquires the image of the board.
3. The defect detection method for sheet metal as described in claim 1, characterized in that, Determining the first set of points located on the side of the laser line target from the set of edge points includes: Based on the coordinates of each edge point in the edge point set, determine the lower endpoint of the edge point set; Starting from the lower endpoint, a predetermined number of edge points are obtained upwards to form a candidate anomaly point set; The first point set is formed by identifying points located on the target side of the laser line and whose distance from the laser line is greater than the quality inspection value from the candidate anomaly point set.
4. The defect detection method for sheet metal as described in claim 1, characterized in that, The segmentation of the first point set to obtain multiple first subsets of points includes: S1, take the first point in the first point set as the current point; S2, calculate the horizontal and vertical distances between the current point and its next adjacent point; S3, if the horizontal distance is less than or equal to a preset horizontal distance threshold and the vertical distance is less than or equal to a preset vertical distance threshold, the current point and the next point are assigned to the same candidate subset. S4, if the horizontal distance is greater than the horizontal distance threshold or the vertical distance is greater than the vertical distance threshold, divide the current point and the next point into different candidate sub-point sets; S5, take the next point as the current point; S6. Repeat steps S2-S5 until all points in the first point set have been traversed, resulting in multiple candidate sub-point sets as multiple first sub-point sets.
5. The defect detection method for sheet metal as described in claim 1 or 4, characterized in that, After determining that the board material corresponding to the board material image has an edge banding high defect, the method further includes: Based on the coordinates of each point in the first sub-point set that satisfies the high defect condition of the edge sealing, determine the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate; Based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate, four corner points are determined in the image of the board material; Based on the four corner points, a high defect bounding box is generated in the plate image.
6. The defect detection method for sheet metal as described in claim 1 or 4, characterized in that, The method further includes: If the first distance is less than or equal to the quality inspection value, or if none of the multiple first sub-point sets meet the edge sealing high defect condition, a second edge point is determined from the edge point set, wherein the second edge point is the endpoint of the edge point set opposite to the target end; Determine whether the second distance from the second edge point to the laser line is greater than the quality inspection value; If the second distance is greater than the quality control value, a second set of points on the opposite side of the laser line target is determined from the set of edge points; Based on the second set of points, detect whether the board corresponding to the board image has low edge sealing defects.
7. The defect detection method for sheet metal as described in claim 6, characterized in that, The step of detecting whether the board corresponding to the board image has low edge sealing defects based on the second point set includes: The second set of points is divided to obtain multiple second subsets of points; Traverse each of the second subsets and check whether the second subset satisfies the low defect condition for edge sealing. The low defect condition for edge sealing is that the number of edge points in the second subset is greater than a second threshold, and the second subset is located in the area where the edge sealing strip of the board is located. If at least one of the multiple second sub-point sets satisfies the low edge sealing defect condition, it is determined that the board corresponding to the board image has a low edge sealing defect.
8. The defect detection method for sheet metal as described in claim 7, characterized in that, After determining that the board material corresponding to the board material image has low edge sealing defects, the method further includes: Based on the coordinates of each point in the second sub-point set that satisfies the low defect condition for edge sealing, determine the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate. Based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate, four corner points are determined in the image of the board material; A low-defect edge banding bounding box is generated in the board image based on the four corner points.
9. The defect detection method for sheet metal as described in claim 1, characterized in that, The camera used to acquire images of the board is mounted parallel to the plane of the board. The angle between the line laser and the optical axis of the camera is within a preset angle range. Furthermore, the angle between the laser line presented by the line laser on the surface of the board and the edge of the board is greater than the preset angle.
10. A defect detection device for sheet metal, characterized in that, The device includes: The acquisition module is used to acquire an image of the board material to be inspected, the image of which includes the edge banding of the board material and laser lines generated by a line laser obliquely irradiating the surface of the edge banding of the board material. The extraction module is used to obtain the edge point set of the laser lines in the plate image; A fitting module is used to fit a laser line based on the set of edge points; The detection module is used to detect whether there are defects in the board corresponding to the board image based on the laser line, the edge point set, and the quality inspection value. The detection module includes: The first determining unit is used to determine a first edge point from the set of edge points, wherein the first edge point is the endpoint of the target end in the set of edge points, and the target end is the starting end of the target direction; The first judgment unit is used to determine whether the first distance from the first edge point to the laser line is greater than the quality inspection value; The second determining unit is used to determine a first set of points located on the laser line target side from the set of edge points when the first distance is greater than the quality inspection value, wherein the target side is opposite to the relative position of the line laser relative to the camera that acquires the image of the board material; The edge banding high defect detection unit is used to detect whether there is an edge banding high defect in the board corresponding to the board image, based on the first point set; The edge sealing high defect detection unit is also used for: The first set of points is divided to obtain multiple first subsets of points; wherein, in each first subset of points, the horizontal distance between any two adjacent points is not greater than a horizontal distance threshold and the vertical distance is not greater than a vertical distance threshold. Traverse each of the first sub-point sets and check whether the first sub-point set satisfies the high defect condition of the edge banding, wherein the high defect condition of the edge banding is that the number of edge points in the first sub-point set is greater than a first threshold, and the first sub-point set is located in the area where the edge banding of the board is located. The edge sealing high defect detection unit is also used for: If at least one of the multiple first sub-point sets satisfies the edge sealing high defect condition, obtain the coordinates of each point in the target first sub-point set that satisfies the edge sealing high defect condition. Based on the coordinates of each point in the first sub-point set of the target, determine the upper endpoint with the smallest ordinate value in the first sub-point set of the target; Based on the coordinates of the upper endpoint and the preset image size, the strip bonding image is cut out from the board image; Based on the pixel values of each row of the board-strip bonding image, the target pixel value of each row is determined; the target pixel value of each row is the sum of the pixel values of all pixels in the same row or the average of the pixel values of the pixels in the same row. If the difference between the first target pixel value and the second target pixel value is greater than or equal to a preset value, it is determined that the board corresponding to the board image has a high edge sealing defect; the first target pixel value is the second largest value among the target pixel values, and the second target pixel value is the second smallest value among the target pixel values; The device further includes: If the line laser is mounted on the right side of the camera, the target direction is from left to right, and the starting point of the target direction is the left end; if the line laser is mounted on the left side of the camera, the target direction is from right to left, and the starting point of the target direction is the right end.
11. The defect detection device for sheet metal as described in claim 10, characterized in that, The extraction module is also used for: Obtain the preset ROI region location information; Based on the ROI region location information, an ROI region is determined in the board image, and the ROI region contains the laser lines; The edge point set of the laser line is determined by searching along the target direction within the ROI region, wherein the target direction is related to the relative position of the line laser relative to the camera that acquires the image of the board.
12. The defect detection device for sheet metal as described in claim 10, characterized in that, The second determining unit is further configured to: Based on the coordinates of each edge point in the edge point set, determine the lower endpoint of the edge point set; Starting from the lower endpoint, obtain a predetermined number of consecutive edge points upwards to form a candidate anomaly point set; The first point set is formed by identifying points located on the target side of the laser line and whose distance from the laser line is greater than the quality inspection value from the candidate anomaly point set.
13. The defect detection device for sheet metal as described in claim 10, characterized in that, The edge sealing high defect detection unit is also used to segment the first point set through the following steps: S1, take the first point in the first point set as the current point; S2, calculate the horizontal and vertical distances between the current point and its next adjacent point; S3, if the horizontal distance is less than or equal to a preset horizontal distance threshold and the vertical distance is less than or equal to a preset vertical distance threshold, the current point and the next point are assigned to the same candidate subset. S4, if the horizontal distance is greater than the horizontal distance threshold or the vertical distance is greater than the vertical distance threshold, divide the current point and the next point into different candidate sub-point sets; S5, take the next point as the current point; S6. Repeat steps S2-S5 until all points in the first point set have been traversed, resulting in multiple candidate sub-point sets as multiple first sub-point sets.
14. The defect detection device for sheet metal as described in claim 10 or 13, characterized in that, The device further includes a first annotation module for: Based on the coordinates of each point in the first sub-point set that satisfies the high defect condition of the edge sealing, determine the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate; Based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate, four corner points are determined in the image of the board material; Based on the four corner points, a high defect bounding box is generated in the plate image.
15. The defect detection device for sheet metal as described in claim 10 or 13, characterized in that, The detection module further includes: The third determining unit is used to determine a second edge point from the edge point set when the first distance is less than or equal to the quality inspection value, or when none of the plurality of first sub-point sets meet the edge sealing high defect condition, wherein the second edge point is the endpoint of the edge point set opposite to the target end; The second judgment unit is used to determine whether the second distance from the second edge point to the laser line is greater than the quality inspection value; The fourth determining unit is used to determine a second set of points located on the opposite side of the laser line target from the set of edge points when the second distance is greater than the quality inspection value; The edge banding low defect detection unit is used to detect whether there are edge banding low defects in the board corresponding to the board image based on the second point set.
16. The defect detection device for sheet metal as described in claim 15, characterized in that, The edge sealing low-defect detection unit is also used for: The second set of points is divided to obtain multiple second subsets of points; Traverse each of the second subsets and check whether the second subset satisfies the low defect condition for edge sealing. The low defect condition for edge sealing is that the number of edge points in the second subset is greater than a second threshold, and the second subset is located in the area where the edge sealing strip of the board is located. If at least one of the multiple second sub-point sets satisfies the low edge sealing defect condition, it is determined that the board corresponding to the board image has a low edge sealing defect.
17. The defect detection device for sheet metal as described in claim 16, characterized in that, The device further includes a second annotation module for: Based on the coordinates of each point in the second sub-point set that satisfies the low defect condition for edge sealing, determine the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate. Based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate, four corner points are determined in the image of the board material; A low-defect edge banding bounding box is generated in the board image based on the four corner points.
18. The defect detection device for sheet metal as described in claim 10, characterized in that, The camera used to acquire images of the board is mounted parallel to the plane of the board. The angle between the line laser and the optical axis of the camera is within a preset angle range. Furthermore, the angle between the laser line presented by the line laser on the surface of the board and the edge of the board is greater than the preset angle.
19. An electronic device comprising: processor; as well as Stored program memory, The program is characterized in that it includes instructions that, when executed by the processor, cause the processor to perform the defect detection method for the sheet metal as described in any one of claims 1-9.
20. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the defect detection method for sheet metal as described in any one of claims 1-9.
Citation Information
Patent Citations
Bamboo cane defect detection method based on line laser image and terminal
CN115908412A
Weld joint quality detection method based on structured light imaging
CN116772723A
Detection system for low defect of plate edge sealing band
CN219871071U