Product defect detection method and apparatus
Patent Information
- Application Number
- CN202611181576.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-23
AI Technical Summary
对于产品外表面的缺陷检测多采用单一采集设备完成,线阵扫描类设备可实现产品外表面全景成像,但线阵扫描的成像分辨率通常较低,难以识别尺寸微小的缺陷,若提升分辨率则一方面会提高检测硬件成本,另一方面所需处理的数据量非常大,会导致检测效率降低,无法适配产品外表面的批量检测
[0014]本申请先通过第一图像采集组件获取产品外表面的全景图像,从全景图像中筛选出存在异常的潜在缺陷区域并形成待复检列表;再将潜在缺陷区域在全景图像上的位置信息输入多参量耦合数学模型,直接计算出使目标区域对应至第二图像采集组件采集范围所需的产品补偿位置信息;随后依据补偿位置信息调整产品的位姿,由固定设置的第二图像采集组件采集目标区域的局部图像完成缺陷检测,本申请先通过第一图像采集组件对产品外表面进行粗粒度检测,识别出产品外表面所有的潜在缺陷区域,对于潜在缺陷区域再进行高精度的局部缺陷检测,在提高对产品外表面微小缺陷的识别能力和缺陷检测准确度的情况下,降低检测硬件成本及处理数据量,提高检测效率,适配产品的批量检测。
Smart Images

Figure CN122966609A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of product defect detection technology, and in particular relates to a product defect detection method and apparatus. Background Technology
[0002] Currently, when inspecting the surface quality of products, such as motor stators, the quality of the surface and insulating varnish directly affects the reliability and lifespan of the motor. Surface defect detection is often performed using a single acquisition device. Linear scanning equipment can achieve panoramic imaging of the product's surface, but its imaging resolution is typically low, making it difficult to identify minute defects. Increasing the resolution would increase hardware costs and require processing a massive amount of data, leading to reduced efficiency and making it unsuitable for batch inspection of product surfaces. Summary of the Invention
[0003] This application provides a product defect detection method that, while covering the entire outer surface of the product, improves the ability to identify minor defects on the outer surface of the product and the accuracy of defect detection, reduces the cost of detection hardware and the amount of data to be processed, improves detection efficiency, and is suitable for batch detection of products. This application also provides a product defect detection device.
[0004] This application provides a product defect detection method, the method comprising: A panoramic image of the outer surface of the product is acquired using a first image acquisition component. Based on the panoramic image, potential defect areas are identified, and a list of defects to be re-inspected is established. For the potential defect areas in the list of defects to be re-inspected, the compensation position information of the corresponding potential defect areas is calculated by using a multi-parameter coupled mathematical model and the position information of the potential defect areas on the panoramic image. The product position is adjusted according to the compensation position information, and a local image of the potential defect area is acquired based on the second image acquisition component. Defect detection is performed based on the local image to obtain the defect detection result. All potential defect areas in the defect list to be re-inspected are traversed, and the defect detection results are summarized to obtain the product defect detection result.
[0005] Optionally, the step of acquiring a panoramic image of the product's outer surface using the first image acquisition component includes: The first visible light supplement unit of the first image acquisition component is activated to control the product to rotate circumferentially. During the circumferential rotation of the product, the outer surface of the product is continuously scanned and imaged by the first image acquisition device of the first image acquisition component to obtain a multi-frame sequence of images. The multi-frame image sequence is stitched together to generate a visible light panoramic image of the product's outer surface.
[0006] Optionally, the step of acquiring a panoramic image of the product's outer surface using the first image acquisition component further includes: The first near-infrared supplementary light unit of the first image acquisition component is activated to control the product to rotate circumferentially. During the circumferential rotation of the product, the first image acquisition device of the first image acquisition component continuously scans and images the outer surface of the product to obtain multiple frames of near-infrared sequence images. The multi-frame near-infrared sequence images are stitched together to generate a near-infrared panoramic image of the outer surface of the product.
[0007] Optionally, the step of identifying potential defect areas based on the panoramic image and establishing a list of defects to be re-inspected includes: Defect detection is performed on the panoramic image, and potential defect areas in the panoramic image are marked; Extract the location information of each potential defect area in the panoramic image, associate the location information with the potential defect area, and store it in the list of defects to be re-inspected.
[0008] Optionally, the compensation position information includes the circumferential rotation compensation angle and axial translation compensation distance of the product, and the compensation position information corresponding to the product calculated through a multi-parameter coupled mathematical model includes: Based on the location information of the potential defect area, determine the deviation between the position of the potential defect area and the circumferential reference position, and calculate the circumferential arc length offset of the potential defect area on the outer surface of the product. The original rotation angle of the product is calculated based on the circumferential arc length offset and the outer radius of the product. The circumferential rotation compensation angle of the product is determined based on the original rotation angle and the preset angle compensation value. The axial translation compensation distance of the product is calculated based on the deviation between the axial position of the potential defect area and the axial reference position.
[0009] Optionally, calculating the circumferential arc length offset of the potential defect area on the outer surface of the product includes: Obtain the circumferential coordinates and preset circumferential reference coordinates of the potential defect area; Calculate the deviation between the circumferential coordinates and the circumferential reference coordinates, and calculate the circumferential arc length offset based on the pixel deviation.
[0010] Optionally, calculating the axial translation compensation distance of the product includes: Obtain the axial coordinates and preset axial reference coordinates of the potential defect region; Calculate the deviation between the axial coordinate and the axial reference coordinate, and calculate the initial axial translation amount based on the pixel deviation; The initial axial translation amount is superimposed with the preset axial installation offset compensation value to obtain the axial translation compensation distance.
[0011] Optionally, adjusting the product's position based on the compensated position information and acquiring a local image of the potential defect area based on the second image acquisition component includes: The second visible light supplement unit of the second image acquisition component is activated, and the outer surface image of the potential defect area is acquired by the second image acquisition device of the second image acquisition component. The second near-infrared supplementary light unit of the second image acquisition component is activated, and the near-infrared transmission image of the potential defect area is acquired through the second image acquisition device of the second image acquisition component.
[0012] Optionally, obtaining the defect detection result based on the local image includes: Based on the defect characteristic data of each potential defect area, the defect type and level are evaluated respectively, and the judgment result of each potential defect area is generated. The results of all potential defect areas are summarized to generate defect detection results that include defect type, defect location, defect size, and defect level.
[0013] This application also discloses a product defect detection device, the device comprising: The potential defect area acquisition module is used to acquire panoramic images of the outer surface of the product using the first image acquisition component, identify potential defect areas based on the panoramic images, and establish a list of defects to be re-inspected. The product compensation calculation module is used to calculate the compensation position information of the potential defect areas in the list of defects to be re-inspected, using a multi-parameter coupled mathematical model and the position information of the potential defect areas on the panoramic image. The image acquisition and detection module adjusts the position of the product according to the compensation position information and acquires local images of the potential defect area based on the second image acquisition component. Based on the local images, it performs defect detection to obtain defect detection results, traverses all potential defect areas in the list of defects to be re-inspected, and summarizes the defect detection results to obtain the product defect detection results.
[0014] This application first acquires a panoramic image of the product's outer surface using a first image acquisition component, then filters out potential defect areas with anomalies from the panoramic image and forms a list to be re-inspected. Next, the position information of the potential defect areas on the panoramic image is input into a multi-parameter coupled mathematical model to directly calculate the product compensation position information required to make the target area correspond to the acquisition range of the second image acquisition component. Subsequently, the product's pose is adjusted based on the compensation position information, and the fixed second image acquisition component acquires a local image of the target area to complete defect detection. This application first performs coarse-grained detection on the product's outer surface using the first image acquisition component to identify all potential defect areas on the product's outer surface, and then performs high-precision local defect detection on the potential defect areas. This improves the ability to identify minute defects on the product's outer surface and the accuracy of defect detection, while reducing the cost of detection hardware and the amount of data processed, increasing detection efficiency, and adapting to batch product detection. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the overall process of the product defect detection method provided in the embodiments of this application; Figure 2 A schematic diagram of the overall structural layout involved in the product defect detection method provided in the embodiments of this application; Figure 3 A schematic diagram illustrating the process of acquiring a panoramic image of the outer surface of a product using a first image acquisition component, as provided in an embodiment of this application. Figure 4 A schematic diagram illustrating the process of acquiring near-infrared panoramic images of the outer surface of a product using a first image acquisition component, as provided in an embodiment of this application; Figure 5 A schematic diagram illustrating the process of identifying potential defect areas and establishing a list of defects to be re-inspected based on panoramic images, as provided in an embodiment of this application. Figure 6 This is a schematic diagram of the process for calculating compensation location information using a multi-parameter coupled mathematical model, provided in an embodiment of this application. Figure 7 A flowchart illustrating the calculation of the circumferential arc length offset of a potential defect area on the outer surface of a product, provided for an embodiment of this application. Figure 8 A schematic flowchart illustrating the calculation of the axial translation compensation distance of a product, provided in an embodiment of this application; Figure 9A schematic diagram illustrating the process of adjusting the product position and acquiring local images based on compensation position information, provided in an embodiment of this application; Figure 10 A schematic diagram illustrating the process of defect detection and result aggregation based on local images, provided in an embodiment of this application; Figure 11 A block diagram of the module structure of the product defect detection device provided in the embodiments of this application.
[0017] 1. First image acquisition device; 2. First visible light supplementary lighting unit; 3. Outer surface of the product; 4. Product hinge; 5. Upper paint layer of the product; 6. Lower insulating varnish layer of the product; 7. Second visible light supplementary lighting unit; 8. Second image acquisition device; 9. Second near-infrared supplementary lighting unit. Detailed Implementation
[0018] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not limiting, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without such specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary detail.
[0019] This application discloses a product defect detection method, such as... Figure 1 As shown, the method includes: S100: The first image acquisition component is used to acquire a panoramic image of the outer surface of the product, and potential defect areas are identified based on the panoramic image to establish a list of defects to be re-inspected.
[0020] S200: For the potential defect areas in the list of defects to be re-inspected, the compensation position information of the corresponding potential defect areas is calculated by using a multi-parameter coupled mathematical model and the position information of the potential defect areas on the panoramic image.
[0021] S300: Adjust the position of the product according to the compensation position information and acquire a local image of the potential defect area based on the second image acquisition component. Perform defect detection based on the local image to obtain defect detection results. Traverse all potential defect areas in the defect list to be re-inspected and summarize the defect detection results to obtain product defect detection results.
[0022] For example, such as Figure 2As shown, the product can be a motor stator. This application first acquires a panoramic image of the outer surface 3 of the product through a first image acquisition component. The panoramic image is a two-dimensional planar image formed by unfolding the outer surface 3 of the product, capturing the surface state of the entire outer surface of the product, thus avoiding blind spots in the detection. Potential defect areas with abnormalities are screened out from the panoramic image and a list to be re-inspected is formed. Then, the position information of the potential defect areas on the panoramic image is input into a multi-parameter coupled mathematical model to directly calculate the product compensation position information required to make the target area correspond to the acquisition range of the second image acquisition component. Subsequently, the product's pose is adjusted according to the compensation position information, and the local image of the target area is acquired by the fixed second image acquisition component to complete the defect detection. This application first performs coarse-grained detection on the outer surface 3 of the product through the first image acquisition component to identify all potential defect areas on the outer surface 3 of the product. For the potential defect areas, high-precision local defect detection is then performed. While improving the ability to identify small defects on the outer surface 3 of the product and the accuracy of defect detection, the detection hardware cost and data processing volume are reduced, the detection efficiency is improved, and it is suitable for batch detection of products.
[0023] It should be noted that the first and second image acquisition components are fixedly installed, and the acquisition range covers the circumferential area of the outer surface of the product during its rotation. The top and bottom of the outer surface 3 of the product are respectively formed by an upper paint layer 5 and a lower insulating varnish layer 6. The product can be mounted on a carrier mechanism with motion adjustment capabilities. The carrier mechanism can drive the product to complete both circumferential rotation and axial translation along the product's rotation axis 4. The position adjustment of the product can be achieved by controlling the carrier mechanism to drive the product's circumferential rotation and axial translation through a servo control unit. The carrier mechanism and servo control unit can be implemented using existing technologies. Those skilled in the art can set the specific structure of the carrier mechanism and servo control unit according to actual needs, as long as the product adjustment can achieve circumferential rotation and axial translation. This is a conventional technical means in the field, and this application does not limit it.
[0024] In alternative implementations, such as Figure 3 As shown, the panoramic image of the outer surface 3 of the product acquired using the first image acquisition component includes: S110: Activate the first visible light supplement unit 2 of the first image acquisition component and control the product to rotate circumferentially.
[0025] S120: During the circumferential rotation of the product, the first image acquisition device 1 of the first image acquisition component continuously scans and images the outer surface of the product to obtain a multi-frame sequence of images.
[0026] S130: The multi-frame sequence of images is stitched together to generate a visible light panoramic image of the outer surface 3 of the product.
[0027] Specifically, the first image acquisition component may include a first visible light supplementary lighting unit 2 and a first image acquisition device 1. The first visible light supplementary lighting unit 2 may be a surface light source or a line light source, with the light source projection direction facing the outer surface 3 of the product, providing uniform visible light illumination to the product surface during the acquisition process. The first image acquisition device 1 may be a linear array imaging device, acquiring image information of the outer surface 3 of the product line by line. During the circumferential rotation of the product, the linear array device can continuously acquire multiple lines of image data, forming a multi-frame sequence image. Each frame sequence image corresponds to a narrow strip area in the outer circumference of the product. By stitching together the acquired multi-frame sequence images, a visible light panoramic image of the outer surface 3 of the product is generated.
[0028] When stitching together multiple frames of images, each frame is first corrected for distortion to eliminate image distortion caused by lens optical distortion. Then, alignment is performed to connect the corresponding positions of adjacent rows of images. Next, brightness equalization is performed to eliminate brightness differences between different rows of images. Finally, the images are stitched together to form a complete visible light panoramic image. This panoramic image is a two-dimensional unfolding of the outer surface 3 of the product. The panoramic image can completely cover the entire outer surface area of the product to avoid the existence of detection blind spots.
[0029] Optionally, during the image stitching process, after basic distortion correction, row alignment, and brightness equalization, boundary fusion processing can also be included to ensure a natural transition at the junction of adjacent rows of images, without obvious stitching marks, thus preventing stitching marks from being misidentified as defects.
[0030] In alternative implementations, such as Figure 4 As shown, the panoramic image of the outer surface 3 of the product acquired using the first image acquisition component further includes: S210: Activate the first near-infrared supplementary light unit of the first image acquisition component and control the product to rotate circumferentially.
[0031] S220: During the circumferential rotation of the product, the first image acquisition device 1 of the first image acquisition component continuously scans and images the outer surface of the product to obtain multiple frames of near-infrared sequence images.
[0032] S230: The multi-frame near-infrared sequence images are stitched together to generate a near-infrared panoramic image of the outer surface 3 of the product.
[0033] Specifically, the first image acquisition component may also be configured with a first near-infrared supplementary lighting unit. This unit emits near-infrared light of a set wavelength, which can penetrate the insulating varnish layer on the product surface and reach the structure beneath the varnish layer, thereby reflecting the internal state of the varnish layer. After activating the first near-infrared supplementary lighting unit, the product is also controlled to rotate circumferentially. The rotation speed can be consistent with or different from the speed used for visible light acquisition, and those skilled in the art can set it according to actual needs.
[0034] During the product's circumferential rotation, the first image acquisition device 1 continuously acquires images of the product under near-infrared light illumination from the first near-infrared supplementary lighting unit, obtaining multiple near-infrared image sequences. The same stitching process as for visible light image sequences is then performed on these multiple near-infrared image sequences to ultimately generate a near-infrared panoramic image of the product's outer surface 3. This near-infrared panoramic image can reveal the structural state beneath the paint layer and can be used for preliminary screening of potential defects within the paint layer.
[0035] It should be noted that near-infrared panoramic images and visible light panoramic images can be overlaid. By simultaneously referencing the features of both types of images within the panoramic image, surface anomalies and internal paint layer anomalies can be identified simultaneously, reducing the omission of latent defects. The coordinate systems of the two types of panoramic images are consistent, and the location information of potential defect areas is interchangeable, requiring no additional coordinate transformation. For products with different paint layer thicknesses, the intensity of the near-infrared supplementary light can be adjusted to ensure the clarity of the penetrating image.
[0036] In alternative implementations, such as Figure 5 As shown, the step of identifying potential defect areas based on the panoramic image and establishing a list of defects to be re-inspected includes: S310: Perform defect detection on the panoramic image and mark potential defect areas in the panoramic image.
[0037] S320: Extract the location information of each potential defect area in the panoramic image, associate the location information with the potential defect area, and store it in the list of defects to be re-inspected.
[0038] Specifically, in one optional implementation of defect detection on the panoramic image, defect detection is performed by image comparison. Multiple panoramic images of defect-free products are pre-collected as reference samples. The panoramic image to be detected is compared region by region with the reference samples. Regions with grayscale difference and texture difference exceeding a set threshold are marked as potential defect areas. A relatively lenient threshold is set during the detection process to ensure that all areas with anomalies are included in the marking range, preventing minor anomalies from being filtered out. In other optional implementations, a defect detection model capable of detecting potential defect areas can be pre-trained using machine learning techniques. This model identifies potential defect areas on the panoramic image. Of course, in other implementations, those skilled in the art can also use other feasible defect detection methods to identify potential defect areas, and this application does not limit this approach.
[0039] When marking potential defect areas, the anomaly range can be marked on the panoramic image in the form of area outlines. Simultaneously, the location information of each potential defect area can be extracted, represented by the coordinates of the area's center point. During the marking process, potential defect areas are sorted according to their axial or circumferential position to minimize the product's movement path during local defect detection, reduce the reciprocating movement of motion mechanisms, and improve overall detection efficiency.
[0040] The location information is associated with the potential defect areas and stored in a list of defects to be re-inspected. During local inspection, the potential defect areas in this list are inspected sequentially. The location information associated with each potential defect area is extracted from the list, allowing for rapid localization of the corresponding potential defect area and improving inspection efficiency. Optionally, the list of defects to be re-inspected can support manual addition or deletion of entries. If operators discover unmarked abnormal areas during a preliminary review of the panoramic image, they can manually add them to the list. If a marked area is determined to be incorrectly marked, it can be manually deleted, enhancing the flexibility of the inspection process.
[0041] It should be noted that during the detection of potential defect areas, defect detection is performed separately on the visible light panoramic image and the near-infrared panoramic image. The detection results of the two types of images are combined to mark the potential defect areas in the panoramic image. If a certain area is detected as abnormal only in one type of panoramic image, it is also included in the potential defect area marking range to avoid missed detections. The detection method for potential defect areas in the near-infrared panoramic image can be similar to that used for the visible light panoramic image, and will not be elaborated further here.
[0042] In alternative implementations, such as Figure 6 As shown, the compensation position information includes the circumferential rotation compensation angle and axial translation compensation distance of the product. The compensation position information corresponding to the product calculated by the multi-parameter coupled mathematical model includes: S410: Determine the deviation between the position of the potential defect area and the circumferential reference position based on the position information of the potential defect area, and calculate the circumferential arc length offset of the potential defect area on the outer surface 3 of the product.
[0043] S420: Calculate the original rotation angle of the product based on the circumferential arc length offset and the outer radius of the product.
[0044] S430: Determine the circumferential rotation compensation angle of the product based on the original rotation angle and the preset angle compensation value.
[0045] S440: Calculate the axial translation compensation distance of the product based on the deviation between the axial position of the potential defect area and the axial reference position.
[0046] Specifically, the compensation position information includes motion parameters in two dimensions: circumferential and axial, corresponding to the product's circumferential rotation and axial translation, respectively. When calculating the circumferential rotation compensation angle, the deviation between the potential defect area's position and the circumferential reference position is first determined. The circumferential reference position is the circumferential position corresponding to the center of the field of view of the second image acquisition component when the product is in its initial pose. Based on the position deviation, the circumferential arc length offset of the potential defect area on the product's outer surface 3 can be calculated. The arc length offset is the arc length between the defect position and the reference position on the product's outer cylindrical surface.
[0047] Based on the circumferential arc length offset and the outer radius of the product, the original rotation angle required for the product to rotate can be calculated using the geometric relationship between the arc length and the central angle. This original rotation angle is the theoretical rotation angle obtained by considering only the geometric relationship. Due to certain assembly deviations during equipment installation, there will be a certain deviation between the theoretical angle and the actual required angle. Therefore, a preset angle compensation value is introduced to correct the original rotation angle, ultimately obtaining the circumferential rotation compensation angle of the product. The angle compensation value is determined through the calibration process before leaving the factory.
[0048] When calculating the axial translation compensation distance, the axial reference position is also used as a reference. The axial reference position is the axial position of the center of the field of view of the second image acquisition component when the product is in its initial pose. Based on the deviation between the axial position of the potential defect area and the axial reference position, the distance that the product needs to move along the axial direction can be calculated, which is the axial translation compensation distance. The axial translation compensation distance can also be corrected by a preset compensation value to offset the effects of installation deviation.
[0049] After calculating the axial translation compensation distance, it is sent together with the aforementioned circumferential rotation compensation angle as motion control quantities to the servo control unit of the product carrying mechanism, so that the servo control unit drives the product to synchronously complete circumferential rotation and axial translation through the carrying mechanism, so that the potential defect area moves into the field of view of the second image acquisition component.
[0050] During the calculation of the multi-parameter coupled mathematical model, a field-of-view adaptation correction can be added to ensure that the potential defect area ultimately falls at the center of the field of view of the second image acquisition component, thereby achieving the best imaging effect. The parameters of the field-of-view adaptation correction can be set according to the field-of-view size of the second image acquisition component, ensuring that the target area is within the optimal imaging range at the center of the field of view, and preventing the defective part from falling outside the field of view due to positional deviation. The correction parameters can be determined during the calibration process and the correction is automatically completed during the calculation.
[0051] During the calculation of the multi-parameter coupled mathematical model, a field-of-view correction coefficient can be added to complete the final fine-tuning, ensuring that the potential defect area ultimately falls at the center of the field of view of the second image acquisition component, thus guaranteeing optimal imaging results. The field-of-view correction coefficient can be set according to the field-of-view size of the second image acquisition component, ensuring that the target area is within the optimal imaging range at the center of the field of view, preventing the defect from falling outside the field of view due to positional deviations. The correction coefficient can be determined during calibration and automatically corrected during calculation. After introducing the field-of-view correction coefficient, the final motion control quantity is calculated using the following formula:
[0052]
[0053] in, The final angle of circumferential rotation. This represents the final distance of axial translation. This is the field-of-view correction factor.
[0054] Therefore, the multi-parameter coupled mathematical model outputs the two-degree-of-freedom motion target parameters: the product target rotation angle. = Product target axial translation distance = This model does not require real-time image matching and iterative correction; the motion control quantities can be obtained by analyzing the coordinates on the panoramic image alone.
[0055] In alternative implementations, such as Figure 7 As shown, calculating the circumferential arc length offset of the potential defect area on the outer surface 3 of the product includes: S510: Obtain the circumferential coordinates and preset circumferential reference coordinates of the potential defect area.
[0056] S520: Calculate the deviation between the circumferential coordinates and the circumferential reference coordinates, and calculate the circumferential arc length offset based on the pixel deviation.
[0057] Specifically, the circumferential coordinates of the potential defect area are the pixel values of the center point of that area on the horizontal axis of the panoramic image. The horizontal axis of the panoramic image corresponds to the circumferential direction of the product. The leftmost pixel of the image corresponds to the starting position of the product's circumferential direction, and the rightmost pixel corresponds to the ending position. Since the product has a cylindrical structure, the positions on the left and right sides of the image are actually connected. The preset circumferential reference coordinates are the horizontal coordinates of the center of the field of view of the second image acquisition component on the panoramic image in the initial state. These coordinates can be determined during the calibration process.
[0058] Calculating the deviation between the circumferential coordinates and the circumferential reference coordinates involves subtracting the reference coordinates from the circumferential coordinates of the potential defect area, resulting in a positional deviation per pixel. The deviation can be positive or negative, corresponding to different rotation directions. Calculating the circumferential arc length offset based on the pixel deviation involves multiplying the pixel deviation value by a circumferential pixel arc length scaling factor to obtain the actual physical dimension's arc length deviation. This deviation represents the arc length between the defect location and the reference location on the product's outer surface 3. The scaling factor can be calibrated by acquiring a standard product with a known perimeter, calculated based on the ratio of the total number of pixels in the panoramic image to the actual perimeter of the product.
[0059] It should be noted that the calibration of the circumferential pixel arc length ratio coefficient uses a multi-point calibration method. Multiple evenly distributed marker points are selected on the product circumference, and the coordinates and corresponding actual angles of each marker point are collected. A more accurate ratio coefficient is obtained by fitting multiple sets of data, while also reducing calibration errors caused by individual marker points. The circumferential pixel arc length ratio coefficient will change for products with different outer diameters. Therefore, this parameter needs to be recalibrated when changing product specifications. Alternatively, the product's outer diameter parameters can be pre-entered, and the corresponding ratio coefficient can be automatically calculated through geometric relationships, reducing the workload of manual calibration.
[0060] In alternative implementations, such as Figure 8 As shown, calculating the axial translation compensation distance of the product includes: S610: Obtain the axial coordinates and preset axial reference coordinates of the potential defect area.
[0061] S620: Calculate the deviation between the axial coordinate and the axial reference coordinate, and calculate the initial axial translation amount based on the pixel deviation.
[0062] S630: The initial axial translation amount is superimposed with the preset axial installation offset compensation value to obtain the axial translation compensation distance.
[0063] Specifically, the axial coordinates of the potential defect area are the pixel values of the center point of that area on the vertical coordinate axis of the panoramic image. The vertical coordinate axis of the panoramic image corresponds to the axial direction of the product, and the top and bottom ends of the image correspond to the two axial end faces of the product, respectively. The preset axial reference coordinates are the vertical coordinates of the field of view center of the second image acquisition component on the panoramic image in the initial state. These coordinates are also determined through the calibration process.
[0064] The deviation between the axial coordinate and the axial reference coordinate is calculated by subtracting the reference coordinate from the axial coordinate of the potential defect area to obtain the longitudinal pixel deviation. The positive or negative sign of the deviation corresponds to different translation directions. The initial axial translation amount is calculated based on the pixel deviation by multiplying the pixel deviation value by an axial pixel distance scaling factor to obtain the theoretical axial translation distance. The initial axial translation amount is then superimposed with a preset axial installation offset compensation value. This means adding a fixed offset due to system installation to the theoretical translation amount to obtain the final axial translation compensation distance. The axial installation offset compensation value can be determined by calibrating a standard workpiece and is used to compensate for system errors such as axial installation position deviation of the acquisition equipment and axial zero-position deviation of the bearing mechanism.
[0065] For example, the calibration of the axial pixel distance ratio coefficient can also be completed using a standard product. The axial length of the standard product is a known parameter. After acquiring the panoramic image, the actual axial length corresponding to a single pixel can be calculated based on the ratio of the total number of vertical pixels in the image to the actual axial length of the product. If a product with a different axial length is used during the inspection process, only the corresponding axial pixel distance ratio coefficient needs to be updated; other model parameters do not need to be adjusted. The axial installation offset compensation value is a fixed system parameter and only needs to be recalibrated after the equipment is disassembled and maintained.
[0066] In a specific example, based on the deviation between the circumferential coordinates of the potential defect area and the preset circumferential reference coordinates, the circumferential arc length offset of the center of the defect area on the outer surface 3 of the product is calculated using the following formula:
[0067] in, This refers to the circumferential arc length offset of the product surface. Here are the circumferential coordinates of the potential defect area, representing its position on the panoramic image; The preset circumferential reference coordinates are the horizontal coordinates of the field of view center of the second image acquisition component on the panoramic image in the initial state. The circumferential pixel-arc length ratio coefficient represents the actual physical arc length of the outer circle of the product corresponding to a single pixel. This coefficient is determined through pre-calibration.
[0068] Subsequently, based on the geometric relationship of the product's outer circle, the circumferential arc length offset is converted into the product's original rotation angle, and the calculation formula is as follows:
[0069] in, R is the uncompensated original rotation angle; R is the effective outer radius of the product, which is a known structural parameter of the product under test.
[0070] To eliminate system deviations caused by equipment assembly errors, camera mounting angle deviations, and mechanical zero-position errors, a preset angle compensation value is introduced to correct the original rotation angle, resulting in the final circumferential rotation compensation angle. The calculation formula is as follows:
[0071] in, This refers to the circumferential rotation compensation angle; The preset angle compensation value is determined during the calibration process before the equipment leaves the factory or after the product specifications are changed, and is used to offset the system deviation in a fixed direction.
[0072] Simultaneously, based on the deviation between the axial coordinates of the potential defect area and the preset axial reference coordinates, the axial translation compensation distance of the product is calculated using the following formula:
[0073] in, This is the axial translation compensation distance; The axial coordinates of the potential defect region; The preset axial reference coordinates are the longitudinal coordinates of the field of view center of the second image acquisition component on the panoramic image in the initial state. The axial pixel-physical distance ratio coefficient represents the actual axial length of the product corresponding to a single pixel. This coefficient is determined through pre-calibration. L0 is a preset axial installation offset compensation value, used to offset the systematic errors caused by the axial installation position deviation of the acquisition equipment and the axial zero position deviation of the bearing mechanism. This compensation value is determined during the equipment calibration process.
[0074] In alternative implementations, such as Figure 9 As shown, adjusting the product's position based on the compensated position information and acquiring a local image of the potential defect area based on the second image acquisition component includes: S710: Turn on the second visible light supplement unit 7 of the second image acquisition component, and acquire the outer surface image of the potential defect area through the second image acquisition device 8 of the second image acquisition component.
[0075] S720: Turn on the second near-infrared supplementary light unit 9 of the second image acquisition component, and acquire the near-infrared transmission image of the potential defect area through the second image acquisition device 8 of the second image acquisition component.
[0076] Specifically, the second visible light supplementary lighting unit 7 is a supporting supplementary lighting component of the second image acquisition assembly. It can use a focused light source to concentrate the light within the field of view of the second image acquisition device 8, thereby improving the brightness and uniformity of local illumination. After the second visible light supplementary lighting unit 7 is turned on, the second image acquisition device 8 can acquire images of the outer surface of potential defect areas. The outer surface images can clearly show the appearance of the product surface and are used to identify visible defects such as bumps, scratches, discoloration, and paint peeling.
[0077] The second near-infrared supplementary lighting unit 9 emits directional near-infrared light, which penetrates the insulating varnish layer after illuminating the defect area, reflecting the structural state beneath the varnish layer. After the second near-infrared supplementary lighting unit 9 is turned on, the second image acquisition device 8 can acquire near-infrared transmitted images of the potential defect area. The transmitted images can reveal the internal structure of the varnish layer, which can be used to identify defects that are invisible to the naked eye, such as microcracks, pinholes, and hidden scratches beneath the varnish layer.
[0078] Only one type of supplementary lighting unit is activated at a time, acquiring images of the corresponding wavelength bands. Both types of images are acquired by the same second image acquisition device 8, with identical camera angles and object distances during acquisition. Therefore, the spatial positions of the two types of images are completely corresponding, allowing for direct superposition and comparison, facilitating simultaneous analysis of surface and internal defect states. The brightness parameters of the two types of supplementary lighting can be adjusted separately. For products with different paint layer thicknesses, the intensity of the near-infrared supplementary lighting can be adjusted to ensure optimal penetration imaging. The second image acquisition device 8 employs a high-resolution area array imaging device, paired with a fixed-magnification optical lens, achieving micron-level imaging resolution and clearly presenting the detailed morphology of minute defects.
[0079] In alternative implementations, such as Figure 10 As shown, the defect detection result obtained based on the local image includes: S810: Based on the defect characteristic data of each potential defect area, the defect type and level are evaluated respectively, and the judgment result of each potential defect area is generated.
[0080] S820: Summarize the judgment results of all potential defect areas and generate defect detection results including defect type, defect location, defect size and defect level.
[0081] Specifically, defect feature data includes parameters such as the defect's outline, size, area, aspect ratio, texture features, and grayscale difference. This data can be obtained by processing local images through edge extraction, thresholding, and texture analysis. Based on this defect feature data, the defect type can be classified according to the differences in its characteristics. For example, scratches often appear as elongated strips, pinholes as circular dots, and cracks as irregular lines. The grade can be determined based on the impact of the defect's size and depth on insulation performance, with different grades corresponding to different quality assessment standards.
[0082] The system generates judgment results for each potential defect area. Each result includes the defect type, grade, size parameters, and location information for the corresponding area. Areas that are confirmed not to be defects after re-inspection are also recorded as exclusion results. By summarizing the judgment results for all potential defect areas, the system integrates the judgment information for all areas to form a complete product defect detection result, which includes information on the defect type, location, size, and grade.
[0083] In the defect detection and assessment process, corresponding assessment rules are set for different types of defects. For example, for surface scratches, the classification is mainly based on length and width parameters. For pinhole defects, the classification is mainly based on diameter and depth characteristics. For internal cracks in the paint layer, the assessment is mainly based on length and direction. The assessment rules can be adjusted according to different product quality standards. During the assessment process, the characteristics of the external surface image and near-infrared transmission image can be combined for comprehensive analysis. Surface defects and internal defects in the same location can be correlated and recorded to facilitate the analysis of the cause of defects.
[0084] When performing defect detection on local images, defect feature data are extracted from both the outer surface image and the near-infrared transmission image. Features such as surface contour, grayscale contrast, color difference, and surface texture direction are extracted from the outer surface image to define the type and geometric size of surface defects. Internal transmission grayscale distribution, internal structural continuity, and penetration depth correlation parameters of abnormal areas are extracted from the near-infrared transmission image to determine whether there is hidden damage within the paint layer. The final type and grade assessment is derived by weighted comprehensive analysis of the aforementioned surface and internal features. Areas with abnormalities in the outer surface image but normal in the near-infrared transmission image are classified as shallow surface defects; areas with no obvious abnormalities in the outer surface image but discontinuous internal structures in the near-infrared transmission image are classified as hidden internal defects; if abnormalities are present in both types of images at the same location, the defect grade is comprehensively assessed based on the correlation between the two features. This multimodal information fusion judgment strategy can significantly reduce the false negative and false positive rates, and is particularly suitable for product inspection scenarios with thick paint layers or complex background textures.
[0085] Another aspect of this application discloses a product defect detection device, such as... Figure 11 As shown, the device includes: The potential defect area acquisition module 11 is used to acquire a panoramic image of the outer surface 3 of the product using the first image acquisition component, identify potential defect areas based on the panoramic image, and establish a list of defects to be re-inspected.
[0086] The product compensation calculation module 12 is used to calculate the compensation position information of the potential defect areas in the list of defects to be re-inspected, using a multi-parameter coupled mathematical model and the position information of the potential defect areas on the panoramic image.
[0087] The image acquisition and detection module 13 adjusts the product's position according to the compensation position information and acquires local images of the potential defect area based on the second image acquisition component. It then performs defect detection based on the local images to obtain defect detection results. Finally, it iterates through all potential defect areas in the list of defects to be re-inspected and summarizes the defect detection results to obtain the product defect detection result. Based on the same principle, the specific implementation of the device in this application can be found in the implementation of the above method, and will not be elaborated upon here.
[0088] This application uses specific embodiments to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the methods and ideas of this application. At the same time, for those skilled in the art, there may be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A product defect detection method, characterized in that, The method includes: A panoramic image of the outer surface of the product is acquired using a first image acquisition component. Based on the panoramic image, potential defect areas are identified, and a list of defects to be re-inspected is established. For the potential defect areas in the list of defects to be re-inspected, the compensation position information of the corresponding potential defect areas is calculated by using a multi-parameter coupled mathematical model and the position information of the potential defect areas on the panoramic image. The product position is adjusted according to the compensation position information, and a local image of the potential defect area is acquired based on the second image acquisition component. Defect detection is performed based on the local image to obtain the defect detection result. All potential defect areas in the defect list to be re-inspected are traversed, and the defect detection results are summarized to obtain the product defect detection result.
2. The method according to claim 1, characterized in that, The process of acquiring panoramic images of the product's outer surface using the first image acquisition component includes: The first visible light supplement unit of the first image acquisition component is activated to control the product to rotate circumferentially. During the circumferential rotation of the product, the outer surface of the product is continuously scanned and imaged by the first image acquisition device of the first image acquisition component to obtain a multi-frame sequence of images. The multi-frame image sequence is stitched together to generate a visible light panoramic image of the product's outer surface.
3. The method according to claim 2, characterized in that, The method of acquiring panoramic images of the product's outer surface using the first image acquisition component also includes: The first near-infrared supplementary light unit of the first image acquisition component is activated to control the product to rotate circumferentially. During the circumferential rotation of the product, the first image acquisition device of the first image acquisition component continuously scans and images the outer surface of the product to obtain multiple frames of near-infrared sequence images. The multi-frame near-infrared sequence images are stitched together to generate a near-infrared panoramic image of the outer surface of the product.
4. The method according to claim 1, characterized in that, The step of identifying potential defect areas based on the panoramic image and establishing a list of defects to be re-inspected includes: Defect detection is performed on the panoramic image, and potential defect areas in the panoramic image are marked; Extract the location information of each potential defect area in the panoramic image, associate the location information with the potential defect area, and store it in the list of defects to be re-inspected.
5. The method according to claim 1, characterized in that, The compensation position information includes the circumferential rotation compensation angle and axial translation compensation distance of the product. The compensation position information corresponding to the product calculated by the multi-parameter coupled mathematical model includes: Based on the location information of the potential defect area, determine the deviation between the position of the potential defect area and the circumferential reference position, and calculate the circumferential arc length offset of the potential defect area on the outer surface of the product. The original rotation angle of the product is calculated based on the circumferential arc length offset and the outer radius of the product. The circumferential rotation compensation angle of the product is determined based on the original rotation angle and the preset angle compensation value. The axial translation compensation distance of the product is calculated based on the deviation between the axial position of the potential defect area and the axial reference position.
6. The method according to claim 5, characterized in that, The calculation of the circumferential arc length offset of the potential defect area on the outer surface of the product includes: Obtain the circumferential coordinates and preset circumferential reference coordinates of the potential defect area; Calculate the deviation between the circumferential coordinates and the circumferential reference coordinates, and calculate the circumferential arc length offset based on the pixel deviation.
7. The method according to claim 5, characterized in that, The calculation of the axial translation compensation distance of the product includes: Obtain the axial coordinates and preset axial reference coordinates of the potential defect region; Calculate the deviation between the axial coordinate and the axial reference coordinate, and calculate the initial axial translation amount based on the pixel deviation; The initial axial translation amount is superimposed with the preset axial installation offset compensation value to obtain the axial translation compensation distance.
8. The method according to claim 1, characterized in that, The step of adjusting the product's position based on the compensation position information and acquiring a local image of the potential defect area based on the second image acquisition component includes: The second visible light supplement unit of the second image acquisition component is activated, and the outer surface image of the potential defect area is acquired by the second image acquisition device of the second image acquisition component. The second near-infrared supplementary light unit of the second image acquisition component is activated, and the near-infrared transmission image of the potential defect area is acquired through the second image acquisition device of the second image acquisition component.
9. The method according to claim 1, characterized in that, The defect detection result obtained based on the local image includes: Based on the defect characteristic data of each potential defect area, the defect type and level are evaluated respectively, and the judgment result of each potential defect area is generated. The results of all potential defect areas are summarized to generate defect detection results that include defect type, defect location, defect size, and defect level.
10. A product defect detection device, characterized in that, The device includes: The potential defect area acquisition module is used to acquire panoramic images of the outer surface of the product using the first image acquisition component, identify potential defect areas based on the panoramic images, and establish a list of defects to be re-inspected. The product compensation calculation module is used to calculate the compensation position information of the potential defect areas in the list of defects to be re-inspected, using a multi-parameter coupled mathematical model and the position information of the potential defect areas on the panoramic image. The image acquisition and detection module adjusts the position of the product according to the compensation position information and acquires local images of the potential defect area based on the second image acquisition component. Based on the local images, it performs defect detection to obtain defect detection results, traverses all potential defect areas in the list of defects to be re-inspected, and summarizes the defect detection results to obtain the product defect detection results.