Method and apparatus for detecting a punch-through state

CN116503322BActive Publication Date: 2026-08-18BEIJING LUSTER LIGHTTECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310259973.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2026-08-18
Estimated Expiration
2043-03-13

AI Technical Summary

Technical Problem

在常用的孔打穿状态的检测方法中,基于反射光源的成像检测孔状态,在背板上存在缺陷的情况下还需通过透射成像完成检测,增加一个反射光源成像,检测成本较高,且增加了图像传输和处理的算力以及软件实现上的负担;而只基于透射光源成像检测孔状态,区分度较小,难以保证成像的一致性和检测的稳定性

Benefits of technology

[0036] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the hole penetration detection method as described in the first aspect above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116503322B_ABST
    Figure CN116503322B_ABST
Patent Text Reader

Abstract

The application discloses a hole punching state detection method and device, and belongs to the technical field of industrial detection. The hole punching state detection method comprises the following steps: performing affine transformation on an initial image corresponding to a to-be-detected hole based on a positioning core in a template image, and obtaining a registration image aligned with the template image; the template image comprises a hole detection area; processing the registration image based on the hole detection area, and obtaining a first target hole image; the first target hole image comprises at least one vertical stripe; and determining the punching state of the to-be-detected hole based on the texture of the stripe. The hole punching state detection method provided by the application can complete detection only by using a transmission light source, has low detection cost, high detection efficiency, and high robustness, and can still determine the hole punching state in the case that the initial image brightness changes, the image rotates and scales, the image definition changes and the hole edge weakens, so that batch detection of equipment is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of industrial testing technology, and in particular relates to a method and apparatus for detecting the state of hole penetration. Background Technology

[0002] In the production process of solar photovoltaic modules, it is necessary to inspect the perforation status of the patterned backsheet glass on the modules for subsequent installation of other components. Among commonly used methods for detecting perforation status, imaging based on reflected light sources requires additional transmission imaging when defects exist on the backsheet. This adds a reflected light source, increasing inspection costs and the computational burden on image transmission and processing, as well as software implementation. Conversely, imaging based solely on transmission light sources offers lower discrimination and struggles to guarantee image consistency and inspection stability. Summary of the Invention

[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method and apparatus for detecting the state of hole penetration, which can complete the detection with only a transmitted light source, has low detection cost and high detection efficiency, and can still determine the hole penetration state under conditions of changes in initial image brightness, image rotation and scaling, changes in sharpness, and weakening of hole edges, exhibiting extremely strong robustness, thereby enabling batch detection of the equipment.

[0004] Firstly, this application provides a method for detecting the hole penetration state, the method comprising:

[0005] Based on the positioning kernel within the template image, an affine transformation is performed on the initial image corresponding to the hole to be tested to obtain a registration image aligned with the template image; the template image includes a hole detection region;

[0006] The registered image is processed based on the hole detection region to obtain a first target hole image, wherein the first target hole image includes at least one vertical stripe;

[0007] Based on the texture of the stripes, the penetration status of the hole to be tested is determined.

[0008] According to the hole penetration detection method provided in the embodiments of this application, an affine transformation is performed on the initial image corresponding to the hole to be tested based on the positioning kernel in the template image to obtain a registration image aligned with the template image. Then, the registration image is processed based on the hole detection area to obtain the first target hole image. Finally, the penetration status of the hole to be tested is determined based on the texture of the stripes. The detection can be completed with only a transmitted light source, which has low detection cost and high detection efficiency. It can still determine the hole penetration status even when the brightness of the initial image changes, the image is rotated and scaled, the clarity changes, and the hole edge is weakened. It has extremely strong robustness, thereby realizing the batch detection of the equipment.

[0009] A method for detecting hole penetration state according to an embodiment of this application, wherein processing the registered image based on the hole detection region to obtain a first target hole image includes:

[0010] Edge features are extracted from the hole detection area to obtain a second target hole image;

[0011] The first target hole image is obtained by performing an inverse affine transformation on the second target hole image.

[0012] A method for detecting hole penetration state according to an embodiment of this application, wherein edge feature extraction is performed on the hole detection area to obtain a second target hole image, includes:

[0013] An irregular Sobel calculation is performed on the hole detection area to obtain a third target hole image; the third target hole image includes a first contour and a second contour.

[0014] The third target hole image is subjected to at least one of threshold segmentation, opening operation processing, and connected component processing to obtain a fourth target hole image; the fourth target hole image includes the center of the hole to be measured and the second contour.

[0015] Iterative circle fitting is performed based on the second contour to obtain the image of the second target hole.

[0016] One embodiment of this application describes a method for detecting the hole penetration state, wherein performing irregular Sobel calculations on the hole detection area to obtain a third target hole image includes:

[0017] The hole detection region is processed using the Sobel operator to obtain a partial derivative image;

[0018] The third target hole image is obtained based on the partial derivative image and the superposition coefficient.

[0019] One embodiment of the method for detecting the hole penetration state according to this application, wherein determining the penetration state of the hole to be tested based on the texture of the stripes includes:

[0020] If the texture degree is not greater than the target threshold, the hole to be tested is determined to be in a puncture state;

[0021] If the texture density is greater than the target threshold, the hole to be tested is determined to be in an un-penetrated state.

[0022] One embodiment of the method for detecting the hole penetration state according to this application, wherein determining the penetration state of the hole to be tested based on the texture of the stripes includes:

[0023] Perform planar correction on the first target hole image to obtain a planar image;

[0024] Variance calculation is performed on the flat-field image to obtain the texture degree corresponding to the flat-field image;

[0025] Based on the texture, the penetration status of the hole to be tested is determined.

[0026] One embodiment of the method for detecting hole penetration state according to this application includes performing an affine transformation on an initial image corresponding to the hole to be tested based on a positioning kernel within a template image to obtain a registration image aligned with the template image, comprising:

[0027] Based on the first position information of the positioning kernel in the template image on the template image, the NCC algorithm is used to obtain the second position information of the positioning kernel on the initial image;

[0028] Based on the first position information and the second position information, obtain the affine transformation matrix between the initial image and the template image;

[0029] Based on the affine transformation matrix, the initial image is aligned with the template image to obtain the registered image.

[0030] Secondly, this application provides a device for detecting the state of hole penetration, the device comprising:

[0031] The first processing module is used to perform an affine transformation on the initial image corresponding to the hole to be tested based on the positioning kernel in the template image, so as to obtain a registration image aligned with the template image; the template image includes a hole detection area;

[0032] The second processing module is used to process the registration image based on the hole detection area to obtain a first target hole image, wherein the first target hole image includes at least one vertical stripe.

[0033] The third processing module is used to determine the penetration status of the hole to be tested based on the texture of the stripes.

[0034] The hole penetration detection device provided in the embodiments of this application performs an affine transformation on the initial image corresponding to the hole to be tested based on the positioning kernel in the template image to obtain a registration image aligned with the template image. Then, the registration image is processed based on the hole detection area to obtain the first target hole image. Finally, the penetration status of the hole to be tested is determined based on the texture of the stripes. The detection can be completed with only a transmitted light source, which has low detection cost and high detection efficiency. It can still determine the hole penetration status even when the brightness of the initial image changes, the image is rotated and scaled, the clarity changes, and the hole edge is weakened. It has extremely strong robustness, thereby realizing the batch detection of the device.

[0035] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the hole penetration detection method as described in the first aspect above.

[0036] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the hole penetration detection method as described in the first aspect above.

[0037] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the hole penetration detection method as described in the first aspect above.

[0038] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects:

[0039] By performing an affine transformation on the initial image corresponding to the hole to be tested based on the positioning kernel within the template image, a registration image aligned with the template image is obtained. Then, the registration image is processed based on the hole detection area to obtain the first target hole image. Finally, the penetration state of the hole to be tested is determined based on the texture of the stripes. Detection can be completed with only a transmitted light source, resulting in low detection cost and high detection efficiency. It can still determine the hole penetration state even when the brightness of the initial image changes, the image is rotated and scaled, the sharpness changes, and the hole edge is weakened, demonstrating extremely strong robustness. This enables batch detection of the equipment.

[0040] Furthermore, the hole detection region is processed based on the Sobel operator to obtain a partial derivative image. Then, based on the partial derivative image and the superposition coefficient, a third target hole image is obtained. Introducing the superposition coefficient can effectively reduce the interference of vertical lines in the background, while preserving the edge intensity of the obtained third target hole image, thereby improving the final detection accuracy.

[0041] Furthermore, by performing irregular Sobel calculation on the hole detection region, a third target hole image including a first contour and a second contour is obtained. Then, at least one of threshold segmentation, opening operation processing, and connected component processing is performed on the third target hole image to obtain a fourth target hole image including the center of the hole to be tested and the second contour. Then, iterative circle fitting is performed based on the second contour to obtain the second target hole image. Based on at least one of irregular Sobel, threshold segmentation, opening operation processing, connected component processing, and iterative circle fitting, edge features can be extracted from the hole detection region to obtain the second target hole image, which improves the accuracy and robustness of the final detection result.

[0042] Furthermore, by performing flat-field correction on the first target hole image to obtain a flat-field image, and then calculating the variance of the flat-field image to obtain the texture degree corresponding to the flat-field image, the penetration state of the hole to be tested can be determined based on the texture degree. It can effectively distinguish the penetration state of the hole to be tested based on the texture degree. In practical applications, even when the brightness of the initial image changes or there are differences such as rotation and scaling of the initial image, the texture degree can still be accurately calculated, which improves the stability and accuracy of detection. The detection is more stable and has higher accuracy, which broadens the detection range and enables batch detection of the equipment.

[0043] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0044] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0045] Figure 1 This is one of the flowcharts illustrating the hole penetration detection method provided in the embodiments of this application;

[0046] Figure 2 This is one of the schematic diagrams illustrating the principle of the hole penetration detection method provided in the embodiments of this application;

[0047] Figure 3 This is a second schematic diagram illustrating the principle of the hole penetration detection method provided in the embodiments of this application;

[0048] Figure 4 This is the third schematic diagram illustrating the principle of the hole penetration detection method provided in the embodiments of this application;

[0049] Figure 5 This is the fourth schematic diagram of the principle of the hole penetration detection method provided in the embodiments of this application;

[0050] Figure 6This is the fifth schematic diagram of the principle of the hole penetration detection method provided in the embodiments of this application;

[0051] Figure 7 This is the sixth schematic diagram illustrating the principle of the hole penetration detection method provided in the embodiments of this application;

[0052] Figure 8 This is a second schematic flowchart of the hole penetration detection method provided in the embodiments of this application;

[0053] Figure 9 This is the third flowchart of the hole penetration detection method provided in the embodiments of this application;

[0054] Figure 10 This is the fourth flowchart of the hole penetration detection method provided in the embodiments of this application;

[0055] Figure 11 This is the fifth flowchart of the hole penetration detection method provided in the embodiments of this application;

[0056] Figure 12 This is a schematic diagram of the structure of the hole penetration detection device provided in the embodiments of this application;

[0057] Figure 13 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0059] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0060] The following is combined Figures 1 to 11 This application describes a method for detecting the hole penetration state according to an embodiment of the present application.

[0061] It should be noted that the execution entity of the hole penetration detection method can be a server, a hole penetration detection device, or a user's terminal, including but not limited to mobile terminals and non-mobile terminals.

[0062] For example, mobile terminals include, but are not limited to, mobile phones, PDA smart terminals, tablets, and in-vehicle smart terminals; non-mobile terminals include, but are not limited to, PCs.

[0063] like Figure 1 As shown, the method for detecting the hole penetration state includes steps 110, 120 and 130.

[0064] Step 110: Based on the positioning kernel in the template image, perform an affine transformation on the initial image corresponding to the hole to be tested to obtain a registration image aligned with the template image; the template image includes the hole detection area.

[0065] In this step, the template image is pre-created and used to provide preliminary information for subsequent detection processes.

[0066] The template image includes: the localization kernel and the hole detection area.

[0067] The positioning kernel is pre-set and can be located at any position on the template image.

[0068] There can be multiple positioning cores. In this application, the number of positioning cores is greater than or equal to 3, and at most 2 positioning cores are located on the same straight line.

[0069] The hole detection area is pre-defined and includes the hole to be detected corresponding to the hole on the template image. There can be multiple hole detection areas.

[0070] like Figure 2 As shown, the rectangular frames at the four corners of the template image are multiple positioning kernels, and the rectangular frame in the middle of the template image is the hole detection area.

[0071] like Figure 8 As shown, during the modeling process, a positioning kernel and a hole detection area can be set on the template image.

[0072] The hole to be tested can be a round hole or a runway hole; this application does not impose any restrictions.

[0073] The initial image corresponding to the hole to be tested is an initial image acquired by an image sensor based on transmitted light source imaging, such as... Figure 5 As shown in (a).

[0074] The registration image is obtained after aligning the initial image and the template image.

[0075] An affine transformation is performed on the initial image to align it with the template image. In some embodiments, step 110 may include:

[0076] Based on the first position information of the localization kernel in the template image, the NCC algorithm is used to obtain the second position information of the localization kernel in the initial image;

[0077] Based on the first and second position information, obtain the affine transformation matrix between the initial image and the template image;

[0078] Based on the affine transformation matrix, the initial image is aligned with the template image to obtain the registered image.

[0079] In this embodiment, the first location information is the location information of the positioning kernel on the template image.

[0080] The second location information is the location information of the localization kernel on the initial image.

[0081] The NCC (normalized cross correlation) algorithm is a grayscale matching algorithm used to obtain second position information.

[0082] In actual implementation, the NCC algorithm can be represented by the following formula:

[0083]

[0084] Where NCC(x,y) is the similarity between the localization kernels of the initial image and the template image, I is the initial image, T is the template image, M is the width or height of the template image, N is the height or width of the template image, (x,y) is the pixel coordinates on the initial image, and (i,j) is the pixel coordinates on the template image.

[0085] Based on the first location information, the NCC algorithm is used to obtain the second location information of the localization kernel on the initial image, such as... Figure 9 As shown.

[0086] Based on the first and second position information, the affine transformation matrix between the initial image and the template image is obtained. The formula for calculating the affine transformation matrix is ​​as follows:

[0087]

[0088]

[0089]

[0090] Where W is the affine transformation matrix between the initial image and the template image, A is the matrix corresponding to the template image, and B is the matrix corresponding to the initial image.T Let A be the transpose matrix, (x,y) be the coordinates on the template image, (u,v) be the coordinates on the initial image, and n be the number of localization kernels.

[0091] Based on the affine transformation matrix, the initial image is aligned with the template image to obtain the registered image. The affine transformation can be implemented by the following formula:

[0092]

[0093] Where W is the affine transformation matrix between the initial image and the template image, (x,y) are the coordinates on the template image, and (u,v) are the coordinates on the initial image.

[0094] The hole penetration detection method provided in this application uses the NCC algorithm to obtain the second position information of the positioning kernel on the initial image based on the first position information of the positioning kernel in the template image. Then, based on the first and second position information, the affine transformation matrix between the initial image and the template image is obtained. Based on the affine transformation matrix, the initial image is aligned to the template image to obtain a registered image. Even when there is translation, rotation, or different scaling deformation in the horizontal and vertical directions between the initial image and the template image, the scaling affine transformation matrix can be calculated based on the position information of the positioning kernel to align the initial image and the template image and obtain a registered image between them. This method is applicable to different scenarios, is less likely to cause missed detection, facilitates subsequent hole penetration detection, and has strong robustness and universality, making it applicable to high-speed industrial inspection fields.

[0095] In some embodiments, when the coordinates are non-integer, the coordinates on the initial image can be obtained based on the bilinear interpolation method, which can be implemented by the following formula:

[0096] P(u,v)=A×d2×d4+B×d1×d4+C×d2×d3+D×d1×d3

[0097] Among them, such as Figure 3 As shown, P(u,v) is the coordinate on the initial image, and A, B, C and D are the pixel values ​​of the nearest integer coordinates to point P.

[0098] Step 120: Process the registered image based on the hole detection region to obtain a first target hole image, which includes at least one vertical stripe.

[0099] In this step, the registration image is obtained after aligning the initial image and the template image.

[0100] The hole detection area on the registered image is processed to obtain the first target hole image.

[0101] like Figure 4 As shown in (b), the first target hole image includes at least one vertical stripe.

[0102] In actual execution, after performing an affine transformation on the initial image, the stripes in the hole detection area may not be vertical, such as... Figure 4 As shown in (a), the stripes in the hole detection area need to be processed to make them vertical in order to improve the accuracy of detection.

[0103] In some embodiments, step 120 may include:

[0104] Edge features are extracted from the hole detection area to obtain the image of the second target hole;

[0105] The first target hole image is obtained by performing an inverse affine transformation on the second target hole image.

[0106] In this embodiment, edge feature extraction is used to extract edge features of the hole detection region.

[0107] Edge feature extraction can be performed based on conventional Sobel computation or pre-trained neural network models, or it can be performed in any feasible way, which is not limited here.

[0108] The image of the second target hole is as follows: Figure 5 (e) and / or Figure 4 The image shown in (a)

[0109] It is understandable that the stripes in the second target hole image are not vertical.

[0110] like Figure 4 and Figure 9 As shown, an inverse affine transformation is performed on the second target hole image to obtain the first target hole image, in which the stripes are vertical.

[0111] According to the hole penetration detection method provided in the embodiments of this application, the second target hole image is obtained by extracting edge features from the hole detection area, and then the second target hole image is subjected to inverse affine transformation to obtain the first target hole image. This method can obtain the edge image corresponding to the hole detection area and ensure that the stripes in the obtained hole image are vertical, which facilitates subsequent calculation and detection and improves the final detection effect and accuracy.

[0112] like Figure 10 As shown, in some embodiments, edge feature extraction of the hole detection region to obtain a second target hole image may include:

[0113] An irregular Sobel calculation is performed on the hole detection area to obtain a third target hole image; the third target hole image includes a first contour and a second contour.

[0114] The third target hole image is processed by at least one of threshold segmentation, opening operation, and connected component processing to obtain the fourth target hole image; the fourth target hole image includes the center and second contour of the hole to be measured.

[0115] Iterative circle fitting is performed based on the second contour to obtain the image of the second target hole.

[0116] In this embodiment, irregular Sobel computation is used to reduce vertical line interference on the background to obtain a clearer edge image.

[0117] like Figure 5 (b) shows the image of the third target hole, where, Figure 5 In (b), the larger circle is the first contour and the smaller circle is the second contour.

[0118] In some embodiments, performing irregular Sobel calculations on the hole detection region to obtain a third target hole image may include:

[0119] The partial derivative image is obtained by processing the hole detection region using the Sobel operator.

[0120] The third target hole image is obtained based on the partial derivative image and the superposition coefficient.

[0121] In this embodiment, the Sobel operator is a discrete differential operator used to calculate the approximate gradient of the image grayscale to obtain the partial derivative image.

[0122] The superposition factor is used to reduce the interference of vertical lines on the background while preserving the strength of image edges.

[0123] A superposition coefficient is introduced before the partial derivative image to obtain the third target hole image.

[0124] In actual implementation, the computation method for irregular Sobel shapes is as follows:

[0125]

[0126]

[0127] Where S is the gray value of a point on the third target hole image, and D x D represents the grayscale value of the partial derivative image after lateral detection. y Let I be the grayscale value of the partial derivative image obtained through longitudinal detection, and let I be the hole detection area. and The Sobel operator is used, and k is the superposition coefficient. For example, k can be 2, 3, or 4, etc. It can be user-defined and is not limited in this application. In this embodiment, k can be 2.

[0128] According to the hole penetration detection method provided in the embodiments of this application, the hole detection area is processed based on the Sobel operator to obtain a partial derivative image. Then, based on the partial derivative image and the superposition coefficient, a third target hole image is obtained. The introduction of the superposition coefficient can effectively reduce the interference of vertical lines in the background, while preserving the edge intensity of the obtained third target hole image, thereby improving the final detection accuracy.

[0129] Thresholding segmentation is used to separate the circular hole image and the background image in the third target hole image.

[0130] Opening operations are used to break up adhesion between regions caused by weak edges, such as... Figure 5 As shown in (c).

[0131] The second contour is obtained based on connected component processing.

[0132] The connected region includes the center of the hole to be measured.

[0133] By performing connected component processing on the third target hole image, the fourth target hole image can be obtained.

[0134] By performing iterative circle fitting based on points on the second contour, the center and diameter of the circle of the hole to be tested can be obtained.

[0135] In actual implementation, based on such Figure 6 The irregular hole (runway hole) shown, and the minimum bounding rectangle of the connected region, can be used to obtain the center, lateral diameter and longitudinal diameter of the hole to be measured.

[0136] According to the hole penetration detection method provided in the embodiments of this application, a third target hole image including a first contour and a second contour is obtained by performing irregular Sobel calculation on the hole detection area. Then, at least one of threshold segmentation, opening operation processing and connected component processing is performed on the third target hole image to obtain a fourth target hole image including the center of the hole to be tested and the second contour. Then, iterative circle fitting is performed based on the second contour to obtain a second target hole image. Based on at least one of irregular Sobel, threshold segmentation, opening operation processing, connected component processing and iterative circle fitting, edge features can be extracted from the hole detection area to obtain the second target hole image, which improves the accuracy and robustness of the final detection result.

[0137] Step 130: Determine the penetration status of the hole to be tested based on the texture of the stripes.

[0138] In this step, the hole to be tested can be either fully penetrated or not penetrated.

[0139] The image shows the result when the hole to be tested is in a punctured state. Figure 7 As shown in (a), the image shows the test hole in an un-penetrated state. Figure 7 As shown in (b), the penetration status of the hole to be tested can be determined based on the texture of the stripes.

[0140] During the research and development process, the inventors discovered that the following detection methods mainly exist in related technologies:

[0141] 1) Based on the condition of the manually inspected holes, this method is prone to missed detections or false detections, resulting in low detection accuracy;

[0142] 2) When detecting hole status based on reflected light sources, if there are defects on the backplate, it is also necessary to complete the detection through transmission imaging. Adding a reflected light source increases the detection cost and increases the computing power and software implementation burden of image transmission and processing. On the other hand, detecting hole status based solely on transmission light source imaging has low discrimination and makes it difficult to ensure the consistency of imaging and the stability of detection.

[0143] 3) Hole state detection based on deep learning methods relies on the quality of data annotation. When encountering new hole shapes, new data needs to be annotated and the model needs to be retrained. The detection process is cumbersome and time-consuming, making it unsuitable for high-speed industrial inspection.

[0144] In this application, any defect on the back plate can be detected based on imaging with a transmitted light source without the need for additional light sources, resulting in lower detection costs. Furthermore, the false detection rate and false negative rate of the detection method in this application are both less than 0.05%, demonstrating good detection accuracy and effectiveness.

[0145] In addition, this application can directly perform detection based on pre-trained template images without the need for data annotation. When encountering new hole shapes, there is no need to retrain the template. It has a high tolerance for device consistency, the detection process is simple, no additional graphics card is required, reducing the burden on software implementation, and it can be applied to the field of high-speed industrial inspection.

[0146] According to the hole penetration detection method provided in the embodiments of this application, an affine transformation is performed on the initial image corresponding to the hole to be tested based on the positioning kernel in the template image to obtain a registration image aligned with the template image. Then, the registration image is processed based on the hole detection area to obtain the first target hole image. Finally, the penetration status of the hole to be tested is determined based on the texture of the stripes. The detection can be completed with only a transmitted light source, which has low detection cost and high detection efficiency. It can still determine the hole penetration status even when the brightness of the initial image changes, the image is rotated and scaled, the clarity changes, and the hole edge is weakened. It has extremely strong robustness, thereby realizing the batch detection of the equipment.

[0147] like Figure 11 As shown, in some embodiments, step 130 may include:

[0148] Flat-field correction is performed on the first target hole image to obtain a flat-field image;

[0149] Variance calculation is performed on the flat field image to obtain the texture degree corresponding to the flat field image;

[0150] Based on texture, the penetration status of the hole under test is determined.

[0151] In this embodiment, the flat field image is obtained after flat field correction of the first target hole image.

[0152] The texture of a flat-field image is equal to the variance of that image.

[0153] In actual execution, the image shows the situation where the hole to be tested is in a punctured state, as shown in the image. Figure 7 As shown in (a), the image shows the test hole in an un-penetrated state. Figure 7 As shown in (b);

[0154] In a flat-field image, the image of the hole under test when it is in a punctured state is as follows: Figure 7 As shown in (c), the image shows the hole under test in an unbroken state. Figure 7 As shown in (d).

[0155] The average column value of the first target hole image, based on its width and height, can be obtained using the following formula:

[0156]

[0157] Where I is the first target hole image, w is the width of the first target hole image, h is the height of the first target hole image, and R is the height of the first target hole image. i It is the column average of the i-th column of the first target hole image.

[0158] Then, planar correction is performed on the first target hole image, which can be achieved by the following formula:

[0159] N(i,j)=(I(i,j)-R j )+est

[0160] Where N is the flat-field image, I is the first target hole image, and R j The mean value of the j-th row of the first target hole image is denoted as ...

[0161] The variance of the flat-field image is calculated using the following formula:

[0162]

[0163] Where D is the variance (i.e., texture) of the flat image, w is the width of the flat image, h is the height of the flat image, and N is the flat image.

[0164] Based on the texture corresponding to the flat field image, the penetration state of the hole to be tested is determined.

[0165] According to the hole penetration detection method provided in the embodiments of this application, a flat field image is obtained by performing flat field correction on the first target hole image, and then the variance of the flat field image is calculated to obtain the texture degree corresponding to the flat field image. Based on the texture degree, the penetration state of the hole to be tested is determined. The penetration state of the hole to be tested can be effectively distinguished based on the texture degree. In practical applications, even when the brightness of the initial image changes or there are differences such as rotation and scaling of the initial image, the texture degree can still be accurately calculated, which improves the stability and accuracy of detection, expands the detection range, and thus realizes batch detection of the equipment.

[0166] In some embodiments, step 130 may further include:

[0167] If the texture degree is not greater than the target threshold, the hole to be tested is determined to be in a puncture state;

[0168] If the texture is greater than the target threshold, the hole to be tested is determined to be in an unpenetrated state.

[0169] In this embodiment, the target threshold is used to determine whether the texture degree meets the target condition.

[0170] The target threshold can be 2.4, 2.5, or 2.6, etc., and can be user-defined; this application does not impose any restrictions.

[0171] In actual execution, the target threshold can be set to 2.5. If the texture density is no greater than 2.5, the hole to be tested is determined to be in a puncture state. Figure 7 As shown in (c);

[0172] When the texture density is greater than 2.5, the hole to be tested is defined as not penetrated. Figure 7 As shown in (d).

[0173] According to the hole penetration detection method provided in the embodiments of this application, the hole to be tested is determined to be in a penetrated state when the texture degree is not greater than the target threshold; and the hole to be tested is determined to be in a non-penetrated state when the texture degree is greater than the target threshold. The hole penetration state of the hole to be tested can be effectively distinguished based on the texture degree. The distinction method is convenient and fast, thereby improving the detection efficiency.

[0174] The hole penetration detection device provided in this application is described below. The hole penetration detection device described below can be referred to in correspondence with the hole penetration detection method described above.

[0175] The hole penetration detection method provided in this application can be executed by a hole penetration detection device. This application uses an example of a hole penetration detection device executing the hole penetration detection method to illustrate the hole penetration detection device provided in this application.

[0176] This application also provides a device for detecting the state of hole penetration.

[0177] like Figure 12 As shown, the detection device for the hole penetration state includes: a first processing module 1210, a second processing module 1220 and a third processing module 1230.

[0178] The first processing module 1210 is used to perform an affine transformation on the initial image corresponding to the hole to be tested based on the positioning kernel in the template image, and obtain a registration image aligned with the template image; the template image includes a hole detection area;

[0179] The second processing module 1220 is used to process the registration image based on the hole detection area to obtain a first target hole image, wherein the first target hole image includes at least one vertical stripe.

[0180] The third processing module 1230 is used to determine the penetration status of the hole to be tested based on the texture of the stripes.

[0181] The hole penetration detection device provided in the embodiments of this application performs an affine transformation on the initial image corresponding to the hole to be tested based on the positioning kernel in the template image to obtain a registration image aligned with the template image. Then, the registration image is processed based on the hole detection area to obtain the first target hole image. Finally, the penetration status of the hole to be tested is determined based on the texture of the stripes. The detection can be completed with only a transmitted light source, which has low detection cost and high detection efficiency. It can still determine the hole penetration status even when the brightness of the initial image changes, the image is rotated and scaled, the clarity changes, and the hole edge is weakened. It has extremely strong robustness, thereby realizing the batch detection of the device.

[0182] In some embodiments, the second processing module 1220 can also be used to extract edge features from the hole detection area to obtain a second target hole image;

[0183] The first target hole image is obtained by performing an inverse affine transformation on the second target hole image.

[0184] In some embodiments, the detection device for the hole penetration state may further include a fourth processing module for performing irregular Sobel calculation on the hole detection area to obtain a third target hole image; the third target hole image includes a first contour and a second contour.

[0185] The third target hole image is processed by at least one of threshold segmentation, opening operation, and connected component processing to obtain the fourth target hole image; the fourth target hole image includes the center and second contour of the hole to be measured.

[0186] Iterative circle fitting is performed based on the second contour to obtain the image of the second target hole.

[0187] In some embodiments, the detection device for the hole penetration state may further include a fifth processing module for processing the hole detection area based on the Sobel operator to obtain a partial derivative image;

[0188] The third target hole image is obtained based on the partial derivative image and the superposition coefficient.

[0189] In some embodiments, the third processing module 1230 can also be used to determine that the hole to be tested is in a puncture state when the texture degree is not greater than the target threshold.

[0190] If the texture is greater than the target threshold, the hole to be tested is determined to be in an unpenetrated state.

[0191] In some embodiments, the third processing module 1230 can also be used to perform flat field correction on the first target hole image to obtain a flat field image;

[0192] Variance calculation is performed on the flat field image to obtain the texture degree corresponding to the flat field image;

[0193] Based on texture, the penetration status of the hole under test is determined.

[0194] In some embodiments, the first processing module 1210 can also be used to obtain the second position information of the positioning kernel on the initial image based on the first position information of the positioning kernel in the template image on the template image and using the NCC algorithm;

[0195] Based on the first and second position information, obtain the affine transformation matrix between the initial image and the template image;

[0196] Based on the affine transformation matrix, the initial image is aligned with the template image to obtain the registered image.

[0197] The device for detecting the hole penetration state in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.

[0198] The hole penetration detection device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0199] The hole penetration detection device provided in this application embodiment can achieve Figures 1 to 11 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0200] In some embodiments, such as Figure 13 As shown, this application embodiment also provides an electronic device 1300, including a processor 1301, a memory 1302, and a computer program stored in the memory 1302 and executable on the processor 1301. When the program is executed by the processor 1301, it implements the various processes of the above-described method embodiment for detecting the hole penetration state and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0201] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0202] On the other hand, this application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the various processes of the above-described method embodiment for detecting the hole penetration state and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0203] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the various processes of the above-described method embodiment for detecting the hole penetration state and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0204] On another note, this application also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-described method embodiment for detecting the hole penetration state, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0205] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0206] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0207] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0208] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for detecting the state of hole penetration, characterized in that, include: Based on the positioning kernel in the template image, an affine transformation is performed on the initial image corresponding to the hole to be tested to obtain a registration image aligned with the template image; The template image includes a hole detection area; The registered image is processed based on the hole detection region to obtain a first target hole image, wherein the first target hole image includes at least one vertical stripe; Based on the texture of the stripes, the penetration status of the hole to be tested is determined; The step of processing the registered image based on the hole detection region to obtain a first target hole image includes: Edge features are extracted from the hole detection area to obtain a second target hole image; Perform an inverse affine transformation on the second target hole image to obtain the first target hole image; Determining the penetration status of the hole to be tested based on the texture of the stripes includes: If the texture degree is not greater than the target threshold, the hole to be tested is determined to be in a puncture state; If the texture density is greater than the target threshold, the hole to be tested is determined to be in an un-penetrated state.

2. The method for detecting the hole penetration state according to claim 1, characterized in that, The step of extracting edge features from the hole detection region to obtain a second target hole image includes: An irregular Sobel calculation is performed on the hole detection area to obtain a third target hole image; the third target hole image includes a first contour and a second contour. The third target hole image is subjected to at least one of threshold segmentation, opening operation processing, and connected component processing to obtain a fourth target hole image; the fourth target hole image includes the center of the hole to be measured and the second contour. Iterative circle fitting is performed based on the second contour to obtain the image of the second target hole.

3. The method for detecting the hole penetration state according to claim 2, characterized in that, The step of performing irregular Sobel calculation on the hole detection region to obtain a third target hole image includes: The hole detection region is processed using the Sobel operator to obtain a partial derivative image; The third target hole image is obtained based on the partial derivative image and the superposition coefficient.

4. The method for detecting the hole penetration state according to any one of claims 1-3, characterized in that, Determining the penetration status of the hole to be tested based on the texture of the stripes includes: Perform planar correction on the first target hole image to obtain a planar image; Variance calculation is performed on the flat-field image to obtain the texture degree corresponding to the flat-field image; Based on the texture, the penetration status of the hole to be tested is determined.

5. The method for detecting the hole penetration state according to any one of claims 1-3, characterized in that, The step of performing an affine transformation on the initial image corresponding to the hole to be tested, based on the positioning kernel within the template image, to obtain a registration image aligned with the template image includes: Based on the first position information of the positioning kernel in the template image on the template image, the NCC algorithm is used to obtain the second position information of the positioning kernel on the initial image; Based on the first position information and the second position information, obtain the affine transformation matrix between the initial image and the template image; Based on the affine transformation matrix, the initial image is aligned with the template image to obtain the registered image.

6. A device for detecting the state of a hole being drilled through, characterized in that, include: The first processing module is used to perform an affine transformation on the initial image corresponding to the hole to be tested based on the positioning kernel in the template image, so as to obtain a registration image aligned with the template image. The template image includes a hole detection area; The second processing module is used to process the registration image based on the hole detection area to obtain a first target hole image, wherein the first target hole image includes at least one vertical stripe. The third processing module is used to determine the penetration status of the hole to be tested based on the texture of the stripes. The second processing module is used to: extract edge features from the hole detection area to obtain a second target hole image; and perform an inverse affine transformation on the second target hole image to obtain the first target hole image. The third processing module is specifically used to: determine that the hole to be tested is in a punctured state when the texture degree is not greater than the target threshold; and determine that the hole to be tested is in a non-punctured state when the texture degree is greater than the target threshold.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the hole penetration detection method as described in any one of claims 1-5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method for detecting the hole penetration state as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Seam hole detection method by means of stratum pre-stack texture attribute value

    CN105158795A

  • Binocular vision different-plane round hole detection method based on cross laser

    CN114119553A