A defect detection method based on image detection

By acquiring monocular view images from different perspectives and performing region segmentation and feature fusion, the problem of insufficient detection of workpiece edge regions was solved, achieving comprehensive detection of workpiece defects and improving the detection effect.

CN120107194BActive Publication Date: 2025-11-14JIANGXI YIYUAN MULTIMEDIA TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510169852.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-11-14
Estimated Expiration
2045-02-17

AI Technical Summary

Technical Problem

Existing technologies often neglect or have poor detection performance in edge areas during workpiece defect detection, resulting in unsatisfactory defect detection results.

Method used

By setting the light and shadow parameters and angle parameters of the image acquisition device, monocular view images of the workpiece from different perspectives are acquired. Region segmentation and edge feature fusion are performed to obtain the defect detection area of ​​the workpiece, and defect feature encoding and edge feature comparison are performed to generate a defect data form.

Benefits of technology

By comprehensively considering the defect detection of both the main body and edge areas of the workpiece, the effectiveness of defect detection is improved, ensuring that workpiece defects are fully detected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107194B_ABST
    Figure CN120107194B_ABST
Patent Text Reader

Abstract

This invention discloses an image-based defect detection method, relating to the field of defect detection technology. It involves setting up image acquisition devices with different lighting and angle parameters to acquire monocular view images of several workpieces from different perspectives. For each workpiece, all monocular view images are segmented to locate the first defect detection area corresponding to each monocular view image. Edge image regions corresponding to all monocular view images of each workpiece are extracted and fused with edge features to obtain the second defect detection area corresponding to each workpiece. Defect features are encoded in the first defect detection area to obtain the main defect information of each workpiece. Edge features are compared in the second defect detection area to obtain the edge defect information of each workpiece. The main defect information and edge defect information of each workpiece are integrated to generate a defect data form for each workpiece.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, specifically a defect detection method based on image detection. Background Technology

[0002] In industrial production, the surface quality of workpieces has a significant impact on the overall quality and performance of products. Traditional defect detection methods rely heavily on manual inspection or simple mechanical testing equipment. These methods are not only inefficient but also easily affected by human factors.

[0003] In recent years, image processing technology has been widely used in the field of automated inspection. However, when processing defect detection of workpieces, existing technologies often only consider the main body of the workpiece and ignore the detection of the edge area of ​​the workpiece, or the detection effect is poor and rough. This results in the detection effect of workpiece defects being usually not ideal, with a large number of defects and flaws going undetected. How to solve this problem is a problem and challenge currently facing the field of defect detection. Summary of the Invention

[0004] To address the aforementioned problems, the present invention aims to provide a defect detection method based on image detection.

[0005] The objective of this invention can be achieved through the following technical solution: a defect detection method based on image detection, comprising the following steps:

[0006] Step S1: Set up the image acquisition device, set different lighting and angle parameters for the image acquisition device, and then acquire monocular view images of several workpieces from different perspectives through the image acquisition device.

[0007] Step S2: Perform region segmentation on all monocular view images corresponding to each workpiece, thereby locating the first defect detection area corresponding to each workpiece's monocular view image, extracting the edge image areas of all monocular view images corresponding to each workpiece, and performing edge feature fusion on the edge image areas of all monocular view images to obtain the second defect detection area corresponding to each workpiece.

[0008] Step S3: Encode the defect features of the first defect detection area of ​​each workpiece to obtain the main defect information of each workpiece; compare the edge features of the second defect detection area of ​​each workpiece to obtain the edge defect information of each workpiece.

[0009] Step S4: Integrate the main body defect information and edge defect information of each workpiece, and generate a defect data form for each workpiece.

[0010] Furthermore, the process of setting up an image acquisition device, configuring different lighting and angle parameters for the device, and then acquiring monocular view images of several workpieces from different perspectives using the image acquisition device includes:

[0011] The lighting parameters set for the image acquisition device include different light source types, light source brightness, and lighting angles. The light source types include ring light sources, backlight sources, and uniform light sources. The angle parameters set for the image acquisition device are: taking the workpiece photographed by the camera lens of the image acquisition device as the center object, taking pictures around the center object at an angle of 0-360°, and taking pictures of the center object from a downward angle.

[0012] Then, the image acquisition device acquires monocular view images of each workpiece from different perspectives according to the light and shadow parameters and angle parameters. The perspectives of the monocular view images include the top-down perspective, which is to take pictures of the workpiece from top to bottom to obtain the monocular view image of the top of the workpiece, and the 360° perspective, which is to take pictures of the workpiece from the front, side and rear of the workpiece to obtain the corresponding monocular view images.

[0013] Furthermore, the process of performing region segmentation on all monocular view images corresponding to each workpiece, and then locating the first defect detection area corresponding to each workpiece's monocular view image, includes:

[0014] The monocular view image corresponding to each workpiece is segmented into regions, and then the monocular view image of each workpiece is divided into several pixel set regions of equal area size. Each pixel set region consists of p×q pixel cells, where p and q are both natural numbers greater than 0.

[0015] Obtain the cell parameters corresponding to each pixel cell. These parameters include the pixel texture gradient, RGB value, grayscale value, and depth value. Set the corresponding defect annotation intervals for each, and denote them as Ω1, Ω2, Ω3, and Ω4 respectively. Denote the pixel texture gradient, RGB value, grayscale value, and depth value as D. 纹理梯度 D RGB D 灰度 and D 深度 ;

[0016] Determine whether there is a defect in each pixel cell, and then integrate all the pixel cells with defects in each pixel set region to locate the first defect detection area corresponding to the monocular view image of each workpiece under different perspectives;

[0017] When the pixel cell corresponds to D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D深度 If at least one of the conditions in ∈Ω4 is true, then the pixel cell is determined to have a defect; otherwise, the pixel cell is determined not to have a defect.

[0018] Furthermore, the process of extracting the edge image regions of all monocular view images corresponding to each workpiece, and performing edge feature fusion on the edge image regions of all monocular view images to obtain the second defect detection region corresponding to each workpiece includes:

[0019] Edge image processing technology is used to extract the edge image regions of each workpiece in the corresponding monocular view image under different perspectives. The edge image regions include a first edge region and a second edge region. The first edge region is the edge region formed by the connection between the monocular view image of the top of the workpiece obtained from the top-down perspective and the corresponding monocular view images of the front, side and rear of the workpiece obtained from the surround perspective. The second edge region is the edge region formed by the connection between the front and side of the workpiece and the edge region formed by the connection between the rear and side of the workpiece in the corresponding monocular view images of the front, side and rear of the workpiece obtained from the surround perspective.

[0020] In the first edge region, the edge regions formed by the connection between the top of the workpiece and the front of the workpiece, the edge regions formed by the connection between the top of the workpiece and the side of the workpiece, and the edge regions formed by the connection between the top of the workpiece and the rear of the workpiece are respectively fused to form the corresponding top edge region to be detected, the top edge region to be detected, and the top edge region to be detected.

[0021] In the second edge region, the edge region formed by the connection between the front and side of the workpiece and the edge region formed by the connection between the rear and side of the workpiece are respectively fused to construct the corresponding front edge region and back edge region to be detected.

[0022] The top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region corresponding to each workpiece are integrated into the second defect detection region corresponding to each workpiece.

[0023] Furthermore, the edge feature fusion process includes:

[0024] The monocular view image corresponding to the top of the workpiece in the first edge region is used as the main layer, and the monocular view images corresponding to the front, side and rear of the workpiece in the first edge region are used as registration layers. The layer features of the corresponding registration layers of the front, side and rear of the workpiece are merged with the main layer corresponding to the top of the workpiece, and the number of layer channels is unified. Then, the corresponding top edge region to be detected, the top edge region to be detected, and the top edge region to be detected are constructed.

[0025] The unified content for layer channel count is as follows: Set up an edge layer, and denote the channel count of this edge layer as TD. 基准 The number of channels in the main layer is denoted as TD. 主体 The number of channels in the registration layer is denoted as TD. 配准 When TD 主体 ≠TD 基准 At that time, the number of channels in the main layer is increased or decreased until TD. 主体 =TD 基准 When TD 配准 ≠TD 基准 At that time, the number of channels in the registration layer is increased or decreased until TD. 配准 =TD 基准 When TD 主体 =TD 基准 =TD 配准 At this time, the number of layer channels of the main layer and the registration layer are unified;

[0026] The content of layer feature merging is as follows: obtain the edge direction, edge intensity, edge width, and edge curvature of the pixel cells of the main layer and the registration layer at different layer coordinates, merge the edge direction, edge intensity, edge width, and edge curvature of the main layer and the registration layer at the same layer coordinates, and then generate the cumulative edge direction, cumulative edge intensity, cumulative edge width, and cumulative edge curvature. The newly generated cumulative edge direction, cumulative edge intensity, cumulative edge width, and cumulative edge curvature are used as the edge feature information of the edge layer.

[0027] The edge features of the first edge region are fused to the edge features of the second edge region to obtain the front edge region to be detected and the back edge region to be detected included in the second edge region.

[0028] Furthermore, the process of encoding the defect feature of the first defect detection area of ​​each workpiece, and then obtaining the corresponding workpiece main defect information, includes:

[0029] The first defect detection area of ​​each workpiece is divided into different detection areas to be encoded according to different viewpoints of the workpiece. Each detection area to be encoded consists of several pixel cells with defects. The feature codes of the defect feature encoding include QX1, QX2, QX3 and QX4. Different feature codes are associated with each pixel cell with defects.

[0030] When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only one of ∈Ω4 is true, then it is the associated feature code QX1 of the defective pixel cell;

[0031] When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only two of ∈Ω4 are true, then the associated feature code QX2 is the defective pixel cell.

[0032] When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only three of ∈Ω4 are true, then the associated feature code QX3 is the defective pixel cell.

[0033] When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If all values ​​in ∈Ω4 are true, then the associated feature code of the defective pixel cell is QX4.

[0034] After encoding the defect features of each detection area, all corresponding feature codes are summarized as the area encoding set corresponding to the detection area. All area encoding sets of each workpiece are summarized as the main defect information of the workpiece.

[0035] Furthermore, the process of comparing the edge features of the second defect detection area of ​​each workpiece to obtain the corresponding workpiece edge defect information includes:

[0036] Set the edge standard information for the top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region included in the second defect detection area;

[0037] Perform edge feature comparison between edge feature information and edge standard information;

[0038] The parts of the top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region that do not conform to the edge standard information are taken as the workpiece edge defect information, and then the workpiece edge defect information corresponding to each workpiece is obtained.

[0039] Furthermore, the process of integrating the main body defect information and edge defect information of each workpiece and generating a corresponding defect data form for each workpiece includes:

[0040] The main body defect information and edge defect information of each workpiece are integrated to form the workpiece defect information for each workpiece. Several blank data forms are set up, and the workpiece defect information of each workpiece is entered into the corresponding blank data forms. Then, the blank data forms are converted into corresponding defect data forms, and the workpiece number corresponding to each workpiece is obtained. The workpiece number is a unique identification identifier for each workpiece. The workpiece number of each workpiece is used as the lookup index for the corresponding defect data form. All defect data forms corresponding to all workpieces are stored in the set database.

[0041] Compared with the prior art, the beneficial effects of the present invention are as follows: A monocular view image of several workpieces from different perspectives is acquired using an image acquisition device. The monocular view image of each workpiece is segmented to locate the first defect detection area corresponding to each workpiece's monocular view image. Edge image areas of all monocular view images corresponding to each workpiece are extracted and fused with edge features to obtain the second defect detection area corresponding to each workpiece. The first defect detection area is processed to obtain the main body defect information of each workpiece, and the second defect detection area is processed to obtain the edge defect information of each workpiece. By comprehensively considering the defect detection of both the main body area and the edge area of ​​the workpiece, the defects and flaws of the workpiece are fully detected, thus improving the defect detection effect to a certain extent. Attached Figure Description

[0042] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0043] like Figure 1 As shown, an image-based defect detection method includes the following steps:

[0044] Step S1: Set up the image acquisition device, set different lighting and angle parameters for the image acquisition device, and then acquire monocular view images of several workpieces from different perspectives through the image acquisition device.

[0045] Step S2: Perform region segmentation on all monocular view images corresponding to each workpiece, thereby locating the first defect detection area corresponding to each workpiece's monocular view image, extracting the edge image areas of all monocular view images corresponding to each workpiece, and performing edge feature fusion on the edge image areas of all monocular view images to obtain the second defect detection area corresponding to each workpiece.

[0046] Step S3: Encode the defect features of the first defect detection area of ​​each workpiece to obtain the main defect information of each workpiece; compare the edge features of the second defect detection area of ​​each workpiece to obtain the edge defect information of each workpiece.

[0047] Step S4: Integrate the main body defect information and edge defect information of each workpiece, and generate a defect data form for each workpiece.

[0048] It should be further explained that, in the specific implementation, the process of setting up an image acquisition device, setting different lighting and angle parameters for the image acquisition device, and then acquiring monocular view images of several workpieces from different perspectives through the image acquisition device includes:

[0049] The image acquisition device is used to take pictures of each workpiece. The resolution, frame rate and focal length of the camera lens of the image acquisition device are adjusted when taking pictures of the workpiece so that the image acquisition device can perform clear imaging operation on the workpiece. The image acquisition device performs N test shots to obtain N test images. The number of test images whose resolution, frame rate and focal length meet their respective preset expected value ranges is denoted as M, where 0 < M < N, and M and N are integers.

[0050] Set the debugging threshold, denoted as γ, where 0 < γ < 1;

[0051] When M / N≥γ, the image acquisition device is successfully set up;

[0052] When M / N < γ, continue to adjust the resolution, frame rate, and focal length of the camera lens corresponding to the image acquisition device until the image acquisition device is successfully set up.

[0053] The lighting parameters set for the image acquisition device include different light source types, light source brightness, and illumination angles. The light source types include ring light sources, backlight sources, and uniform light sources. The angle parameters set for the image acquisition device are: taking the workpiece photographed by the camera lens of the image acquisition device as the central object, taking pictures around the central object at an angle of 0-360°, and taking pictures of the central object from a downward angle.

[0054] Then, the image acquisition device acquires monocular view images of each workpiece from different perspectives according to the set light and shadow parameters and angle parameters. The perspectives of the monocular view images include the top-down perspective, that is, shooting the workpiece from top to bottom to obtain the monocular view image of the top of the workpiece, and also the surround perspective, that is, shooting the workpiece in 360° to obtain the monocular view images corresponding to the front, side and rear of the workpiece.

[0055] The side includes the left side and the right side.

[0056] It should be further explained that, in the specific implementation, the process of performing region segmentation on all monocular view images corresponding to each workpiece, and then locating the first defect detection area corresponding to each monocular view image of each workpiece, includes:

[0057] The monocular view image corresponding to each workpiece is segmented into regions, and then the monocular view image of each workpiece is divided into several pixel set regions of equal area size. Each pixel set region consists of p×q pixel cells, where p and q are both natural numbers greater than 0.

[0058] Obtain the cell parameters corresponding to each pixel cell. These parameters include the pixel texture gradient, RGB value, grayscale value, and depth value. Set the defect annotation intervals corresponding to each pixel texture gradient, RGB value, grayscale value, and depth value, and denote these intervals as Ω1, Ω2, Ω3, and Ω4 respectively. Denote the pixel texture gradient, RGB value, grayscale value, and depth value as D. 纹理梯度 D RGB D 灰度 and D 深度 ;

[0059] Determine whether there is a defect in each pixel cell, and then integrate all the defective pixel cells in each pixel set region to locate the first defect detection area corresponding to the monocular view image of each workpiece under different perspectives. The first defect detection area represents the defect area formed by all the defective pixel cells of different parts of the workpiece represented by the monocular view image under different perspectives.

[0060] The following is the content used to determine whether each pixel cell has a defect:

[0061] When the pixel cell corresponds to D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度If at least one of the conditions in ∈Ω4 is true, then the pixel cell is determined to have a defect; otherwise, the pixel cell is determined not to have a defect.

[0062] It should be further explained that, in the specific implementation, the process of extracting the edge image regions of all monocular view images corresponding to each workpiece, and performing edge feature fusion on the edge image regions of all monocular view images to obtain the second defect detection region corresponding to each workpiece includes:

[0063] Edge image processing technology is used to extract the edge image regions of each workpiece corresponding to the monocular view image under different perspectives. The edge image regions include a first edge region and a second edge region.

[0064] The first edge region is the edge region formed by the connection between the monocular view image of the top of the workpiece obtained from the top-down view and the monocular view images of the front, side and rear of the workpiece obtained from the surround view.

[0065] The second edge region is: the edge region formed by the connection between the front and side of the workpiece and the edge region formed by the connection between the rear and side of the workpiece in the monocular view images of the front, side and rear of the workpiece obtained by the surround view.

[0066] Specifically, for the first edge region, the edge features of the edge region formed by the connection between the top of the workpiece and the front of the workpiece are fused to construct the first top edge region to be detected. Similarly, the edge features of the edge region formed by the connection between the top of the workpiece and the side of the workpiece are fused to construct the second top edge region to be detected. The edge features of the edge region formed by the connection between the top of the workpiece and the rear of the workpiece are fused to construct the third top edge region to be detected.

[0067] For the second edge region, the edge features of the edge region formed by the connection between the front and side of the workpiece are fused to construct the front edge region to be detected. Similarly, the edge features of the edge region formed by the connection between the rear and side of the workpiece are fused to construct the back edge region to be detected.

[0068] The edge feature fusion process involves: using the monocular view image corresponding to the top of the workpiece in the first edge region as the main layer, and using the monocular view images corresponding to the front, side, and rear of the workpiece in the first edge region as registration layers. The layer features of the corresponding registration layers for the front, side, and rear of the workpiece are merged with the main layer corresponding to the top of the workpiece, and the number of layer channels is unified. This results in the construction of the corresponding top edge region to be detected, the top edge region to be detected, and the top edge region to be detected.

[0069] The unified content regarding the number of channels in the layers is as follows: An edge layer is set up, and the number of channels in this edge layer is denoted as TD. 基准 The number of channels in the main layer is denoted as TD. 主体 The number of channels in the registration layer is denoted as TD. 配准 When TD 主体 ≠TD 基准 At that time, the number of channels in the main layer is increased or decreased until TD. 主体 =TD 基准 When TD 配准 ≠TD 基准 At that time, the number of channels in the registration layer is increased or decreased until TD. 配准 =TD 基准 When TD 主体 =TD 基准 =TD 配准 At this time, the number of layer channels of the main layer and the registration layer are unified;

[0070] The layer feature merging process involves: obtaining the edge direction, edge intensity, edge width, and edge curvature of pixel cells in the main layer and the registration layer at different layer coordinates; merging the edge direction, edge intensity, edge width, and edge curvature of the main layer and the registration layer at the same layer coordinates; generating accumulated edge direction, accumulated edge intensity, accumulated edge width, and accumulated edge curvature; and using the newly generated accumulated edge direction, accumulated edge intensity, accumulated edge width, and accumulated edge curvature as the edge feature information of the edge layer.

[0071] The edge feature fusion method for the first edge region described above is used to perform edge feature fusion on the second edge region to obtain the front edge region to be detected and the back edge region to be detected included in the second edge region;

[0072] The top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region corresponding to each workpiece are integrated into the second defect detection region corresponding to each workpiece.

[0073] It should be further explained that, in the specific implementation, the process of encoding the defect feature of the first defect detection area of ​​each workpiece, and then obtaining the corresponding workpiece body defect information, includes:

[0074] The first defect detection area of ​​each workpiece is divided into different detection areas to be encoded according to different perspectives of the workpiece. Specifically, it is divided into the detection area to be encoded at the corresponding position at the top of the workpiece, and the detection areas to be encoded at the corresponding positions at the front, side and rear of the workpiece.

[0075] Each detection region to be encoded consists of several defective pixel cells. The defect feature codes include QX1, QX2, QX3, and QX4. Different feature codes are associated with each defective pixel cell, as follows:

[0076] For defective pixel cells;

[0077] When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only one of ∈Ω4 is true, then it is the associated feature code QX1 of the defective pixel cell;

[0078] When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only two of ∈Ω4 are true, then the associated feature code QX2 is the defective pixel cell.

[0079] When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only three of ∈Ω4 are true, then the associated feature code QX3 is the defective pixel cell.

[0080] When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If all values ​​in ∈Ω4 are true, then the associated feature code of the defective pixel cell is QX4.

[0081] Among them, the feature codes QX1, QX2, QX3 and QX4 corresponding to the defect feature encoding are used to correspond to different defect levels of the workpiece. QX1 to QX4, the defect level of the workpiece increases sequentially, and the number of defect types corresponding to the workpiece increases accordingly. The defect types of the workpiece include defects in pixel texture gradient, defects in RGB values, defects in grayscale values ​​and defects in depth values.

[0082] After encoding the defect features of each detection area, all corresponding feature codes are summarized as the area encoding set corresponding to the detection area. All area encoding sets of each workpiece are summarized as the main defect information of the workpiece.

[0083] It should be further explained that, in the specific implementation, the process of comparing the edge features of the second defect detection area of ​​each workpiece to obtain the workpiece edge defect information corresponding to each workpiece includes:

[0084] The second defect detection area includes the top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region, each with corresponding edge standard information. The edge standard information includes standard edge direction, standard edge strength, standard edge width, and standard edge curvature.

[0085] Perform edge feature comparison between edge feature information and edge standard information;

[0086] The parts of the top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region that do not conform to the edge standard information are taken as the workpiece edge defect information, and then the workpiece edge defect information corresponding to each workpiece is obtained.

[0087] It should be noted that if any of the following conditions are true: the direction of the accumulated edge is inconsistent with the direction of the standard edge, the intensity of the accumulated edge is inconsistent with the intensity of the standard edge, the width of the accumulated edge is inconsistent with the width of the standard edge, or the curvature of the accumulated edge is inconsistent with the curvature of the standard edge, then the corresponding edge feature information does not conform to the edge standard information. Otherwise, the edge feature information conforms to the edge standard information.

[0088] It should be further explained that, in the specific implementation, the process of integrating the main body defect information and edge defect information of each workpiece and generating a defect data form corresponding to each workpiece includes:

[0089] The main defect information and edge defect information of each workpiece are integrated to form the workpiece defect information for each workpiece. Several blank data forms are set up, and the workpiece defect information for each workpiece is entered into the corresponding blank data forms. The blank data forms are then converted into the corresponding defect data forms.

[0090] Obtain the workpiece number corresponding to each workpiece. The workpiece number is a unique identification identifier for each workpiece. Use the workpiece number of each workpiece as the lookup index for the corresponding defect data form. Store the defect data forms corresponding to all workpieces in the set database.

[0091] It should be noted that the lookup index of the defect data form for each workpiece is used for subsequent searches of the workpiece.

[0092] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. A defect detection method based on image detection, characterized in that, Includes the following steps: Step S1: Set up the image acquisition device, set different lighting and angle parameters for the image acquisition device, and then acquire monocular view images of several workpieces from different perspectives through the image acquisition device. Step S2: Perform region segmentation on all monocular view images corresponding to each workpiece, thereby locating the first defect detection area corresponding to each workpiece's monocular view image, extracting the edge image areas of all monocular view images corresponding to each workpiece, and performing edge feature fusion on the edge image areas of all monocular view images to obtain the second defect detection area corresponding to each workpiece. Step S3: Encode the defect features of the first defect detection area of ​​each workpiece to obtain the main defect information of each workpiece; perform edge feature comparison on the second defect detection area of ​​each workpiece to obtain the edge defect information of each workpiece. Step S4: Integrate the main body defect information and edge defect information of each workpiece, and generate a defect data form for each workpiece. The process of segmenting all monocular view images corresponding to each workpiece to locate the first defect detection area corresponding to each workpiece's monocular view image includes: The monocular view image corresponding to each workpiece is segmented into regions, and then the monocular view image of each workpiece is divided into several pixel set regions of equal area size. Each pixel set region consists of p×q pixel cells, where p and q are both natural numbers greater than 0. Obtain the cell parameters corresponding to each pixel cell. These parameters include the pixel texture gradient, RGB value, grayscale value, and depth value. Set the corresponding defect annotation intervals for each, and denote them as Ω1, Ω2, Ω3, and Ω4 respectively. Denote the pixel texture gradient, RGB value, grayscale value, and depth value as D. 纹理梯度 D RGB D 灰度 and D 深度 ; Determine whether there is a defect in each pixel cell, and then integrate all the pixel cells with defects in each pixel set region to locate the first defect detection area corresponding to the monocular view image of each workpiece under different perspectives; When the pixel cell corresponds to D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If at least one of the conditions in ∈Ω4 is true, then the pixel cell is determined to have a defect; otherwise, the pixel cell is determined not to have a defect.

2. The defect detection method based on image detection according to claim 1, characterized in that, The process of setting up an image acquisition device, configuring different lighting and angle parameters for the image acquisition device, and then acquiring monocular view images of several workpieces from different perspectives using the image acquisition device includes: The lighting parameters set for the image acquisition device include different light source types, light source brightness, and lighting angles. The light source types include ring light sources, backlight sources, and uniform light sources. The angle parameters set for the image acquisition device are: taking the workpiece photographed by the camera lens of the image acquisition device as the center object, taking pictures around the center object at an angle of 0-360°, and taking pictures of the center object from a downward angle. Then, the image acquisition device acquires monocular view images of each workpiece from different perspectives according to the light and shadow parameters and angle parameters. The perspectives of the monocular view images include the top-down perspective, which is to take pictures of the workpiece from top to bottom to obtain the monocular view image of the top of the workpiece, and the 360° perspective, which is to take pictures of the workpiece from the front, side and rear of the workpiece to obtain the corresponding monocular view images.

3. The defect detection method based on image detection according to claim 2, characterized in that, The process of extracting the edge image regions of all monocular view images corresponding to each workpiece, and then fusing the edge feature regions of all monocular view images to obtain the second defect detection region corresponding to each workpiece includes: Edge image processing technology is used to extract the edge image regions of each workpiece in the corresponding monocular view image under different perspectives. The edge image regions include a first edge region and a second edge region. The first edge region is the edge region formed by the connection between the monocular view image of the top of the workpiece obtained from the top-down perspective and the corresponding monocular view images of the front, side and rear of the workpiece obtained from the surround perspective. The second edge region is the edge region formed by the connection between the front and side of the workpiece and the edge region formed by the connection between the rear and side of the workpiece in the corresponding monocular view images of the front, side and rear of the workpiece obtained from the surround perspective. In the first edge region, the edge regions formed by the connection between the top of the workpiece and the front of the workpiece, the edge regions formed by the connection between the top of the workpiece and the side of the workpiece, and the edge regions formed by the connection between the top of the workpiece and the rear of the workpiece are respectively fused to form the corresponding top edge region to be detected, the top edge region to be detected, and the top edge region to be detected. In the second edge region, the edge region formed by the connection between the front and side of the workpiece and the edge region formed by the connection between the rear and side of the workpiece are respectively fused to construct the corresponding front edge region and back edge region to be detected. The top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region corresponding to each workpiece are integrated into the second defect detection region corresponding to each workpiece.

4. The defect detection method based on image detection according to claim 3, characterized in that, The edge feature fusion process includes: The monocular view image corresponding to the top of the workpiece in the first edge region is used as the main layer, and the monocular view images corresponding to the front, side and rear of the workpiece in the first edge region are used as registration layers. The layer features of the corresponding registration layers of the front, side and rear of the workpiece are merged with the main layer corresponding to the top of the workpiece, and the number of layer channels is unified. Then, the corresponding top edge region to be detected, the top edge region to be detected, and the top edge region to be detected are constructed. The unified content for layer channel count is as follows: Set up an edge layer, and denote the channel count of this edge layer as TD. 基准 The number of channels in the main layer is denoted as TD. 主体 The number of channels in the registration layer is denoted as TD. 配准 When TD 主体 ≠TD 基准 At that time, the number of channels in the main layer is increased or decreased until TD. 主体 =TD 基准 When TD 配准 ≠TD 基准 At that time, the number of channels in the registration layer is increased or decreased until TD. 配准 =TD 基准 When TD 主体 =TD 基准 =TD 配准 At this time, the number of layer channels of the main layer and the registration layer are unified; The content of layer feature merging is as follows: obtain the edge direction, edge intensity, edge width, and edge curvature of the pixel cells of the main layer and the registration layer at different layer coordinates, merge the edge direction, edge intensity, edge width, and edge curvature of the main layer and the registration layer at the same layer coordinates, and then generate the cumulative edge direction, cumulative edge intensity, cumulative edge width, and cumulative edge curvature. The newly generated cumulative edge direction, cumulative edge intensity, cumulative edge width, and cumulative edge curvature are used as the edge feature information of the edge layer. The edge features of the first edge region are fused to the edge features of the second edge region to obtain the front edge region to be detected and the back edge region to be detected included in the second edge region.

5. The defect detection method based on image detection according to claim 4, characterized in that, The process of encoding the defect feature of the first defect detection area of ​​each workpiece, and then obtaining the corresponding workpiece main defect information, includes: The first defect detection area of ​​each workpiece is divided into different detection areas to be encoded according to different viewpoints of the workpiece. Each detection area to be encoded consists of several pixel cells with defects. The feature codes of the defect feature encoding include QX1, QX2, QX3 and QX4. Different feature codes are associated with each pixel cell with defects. When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only one of ∈Ω4 is true, then it is the associated feature code QX1 of the defective pixel cell; When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only two of ∈Ω4 are true, then the defective pixel cell is associated with the feature code QX2. When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If only three of ∈Ω4 are true, then the associated feature code QX3 is the defective pixel cell. When its D 纹理梯度 ∈Ω1,D RGB ∈Ω2,D 灰度 ∈Ω3 and D 深度 If all values ​​in ∈Ω4 are true, then the associated feature code of the defective pixel cell is QX4. After encoding the defect features of each detection area, all corresponding feature codes are summarized as the area encoding set corresponding to the detection area. All area encoding sets of each workpiece are summarized as the main defect information of the workpiece.

6. The defect detection method based on image detection according to claim 5, characterized in that, The process of comparing the edge features of the second defect detection area of ​​each workpiece to obtain the corresponding workpiece edge defect information includes: Set the edge standard information for the top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region included in the second defect detection area; Perform edge feature comparison between edge feature information and edge standard information; The parts of the top edge region 1, top edge region 2, top edge region 3, front edge region, and back edge region that do not conform to the edge standard information are taken as the workpiece edge defect information, and then the workpiece edge defect information corresponding to each workpiece is obtained.

7. The defect detection method based on image detection according to claim 6, characterized in that, The process of integrating the main body defect information and edge defect information of each workpiece and generating a corresponding defect data form for each workpiece includes: The main body defect information and edge defect information of each workpiece are integrated to form the workpiece defect information for each workpiece. Several blank data forms are set up, and the workpiece defect information of each workpiece is entered into the corresponding blank data forms. Then, the blank data forms are converted into corresponding defect data forms, and the workpiece number corresponding to each workpiece is obtained. The workpiece number is a unique identification identifier for each workpiece. The workpiece number of each workpiece is used as the lookup index for the corresponding defect data form. All defect data forms corresponding to all workpieces are stored in the set database.

Citation Information

Patent Citations

  • Defect detection method and device of circuit board, storage medium and electronic equipment

    CN118710586A