Perspective projection image-based defect detection method, apparatus, medium, and program

Through the transformation matrix correction transformation method in computer vision technology, the problem that industrial cameras are difficult to capture directly underneath the product is solved, the accuracy and efficiency of product defect detection are improved, and real-time and efficient detection on the logistics line is achieved.

CN118691544APending Publication Date: 2024-09-24HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410687372.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing product defect detection based on computer vision technology has low detection accuracy and efficiency. Especially during the rapid transportation of products, industrial cameras are difficult to capture the directly below the product, causing the perspective effect to affect detection accuracy.

Method used

By obtaining the real-time perspective state image of the target detection product, calculating the transformation matrix and performing corrective transformation, the corrected product image is obtained, thereby performing defect detection.

Benefits of technology

It improves the accuracy and efficiency of product defect detection, enables real-time defect detection without affecting the production rhythm, and enhances detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691544A
    Figure CN118691544A
Patent Text Reader

Abstract

The embodiment of the invention discloses a defect detection method and device based on a perspective projection image, a medium and a program, and the method comprises the steps: obtaining a real-time product collection image of a target detection product; wherein a target detection product in the real-time product acquisition image is in a perspective state; calculating a transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and a standard product image corresponding to the target detection product; performing correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a corrected and transformed product image; and performing defect detection on the target detection product according to the corrected and transformed product image. According to the technical scheme of the embodiment of the invention, the precision and efficiency of product defect detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer vision technology, and in particular to a defect detection method, device, electronic device, storage medium and program product based on perspective projection images. Background Art

[0002] As industry develops towards the information age, industrial machines are being rapidly applied to production factories. On the one hand, the rapid development of industrial machines has greatly improved productivity; on the other hand, because machines follow established rules to execute instructions and lack subjective judgment, under special circumstances, it is inevitable that some industrial defective products will be produced.

[0003] For the detection of industrial defective products, manual visual inspection by QA (Quality Assurance) can detect defects such as breakage and pits, but cannot efficiently handle defects such as precise measurement. In view of this difficulty, more and more companies are using machine vision to solve the problem of industrial defective product detection.

[0004] In the process of realizing the present invention, the inventor found that the prior art has the following defects: In actual production, products are quickly transported on the logistics line, and it is often difficult to control the industrial camera to capture the product when it passes directly below. Therefore, the captured pictures often have a perspective effect, resulting in low defect detection accuracy. If the product is stopped when it reaches directly below the camera to let the camera take pictures before continuing to transport, it will slow down the production rhythm and the defect detection efficiency will not be high. Summary of the invention

[0005] The embodiments of the present invention provide a defect detection method, device, electronic device, storage medium and program product based on perspective projection images, which can improve the accuracy and efficiency of product defect detection.

[0006] According to one aspect of the present invention, a defect detection method based on perspective projection images is provided, comprising:

[0007] Acquire a real-time product acquisition image of the target detection product; wherein the target detection product in the real-time product acquisition image is in a perspective state;

[0008] Calculating a transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and a standard product image corresponding to the target detection product;

[0009] Performing a correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a correction transformation product image;

[0010] Defect detection is performed on the target detection product according to the corrected transformed product image.

[0011] According to another aspect of the present invention, there is provided a defect detection device based on perspective projection images, comprising:

[0012] A real-time product acquisition image acquisition module is used to acquire a real-time product acquisition image of a target detection product; wherein the target detection product in the real-time product acquisition image is in a perspective state;

[0013] A transformation matrix calculation module, used to calculate the transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and the standard product image corresponding to the target detection product;

[0014] An image correction transformation module, used for performing correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a correction transformation product image;

[0015] A product defect detection module is used to perform defect detection on the target detection product according to the corrected transformed product image.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the defect detection method based on perspective projection images described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the defect detection method based on perspective projection images described in any embodiment of the present invention when executed.

[0021] According to another aspect of the present invention, a computer program product is provided, including a computer program, which, when executed by a processor, implements the defect detection method based on perspective projection images described in any embodiment of the present invention.

[0022] The embodiment of the present invention obtains a real-time product acquisition image of a target detection product in a perspective state, and calculates a transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and a standard product image corresponding to the target detection product, thereby performing a correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a correction transformation product image, and then performing defect detection on the target detection product according to the correction transformation product image. This can solve the problems of low detection accuracy and efficiency in existing product defect detection based on computer vision technology, and can improve the accuracy and efficiency of product defect detection.

[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 is a flow chart of a defect detection method based on perspective projection images provided in Embodiment 1 of the present invention;

[0026] Figure 2 This is a schematic diagram of the effect of a target detection product provided by Embodiment 1 of the present invention;

[0027] Figure 3 This is a schematic diagram of the effect of real-time product acquisition images of a target detection product provided by the first embodiment of the present invention;

[0028] Figure 4 is a flow chart of a defect detection method based on perspective projection images provided in Embodiment 2 of the present invention;

[0029] Figure 5 This is a schematic diagram of the effect of the first associated area point of a target detection product provided by the second embodiment of the present invention;

[0030] Figure 6 This is a schematic diagram of the effect of determining width and height correction parameters of a target detection product corresponding to a standard product provided by the second embodiment of the present invention;

[0031] Figure 7 This is a schematic diagram of an effect of determining a standard product image area in a real-time product acquisition image provided by the second embodiment of the present invention;

[0032] Figure 8 This is a schematic diagram of the effect of correcting and transforming a product image provided by the second embodiment of the present invention;

[0033] Fig. 9 1 is a schematic diagram of the effect of correcting and transforming an image detection area in a product image provided by Embodiment 2 of the present invention;

[0034] Fig.10 1 is a schematic diagram of the effect of performing defect detection on the image detection area of ​​the corrected transformed product image provided by the second embodiment of the present invention;

[0035] Fig.11 is a schematic diagram of a defect detection device based on perspective projection images provided in Embodiment 3 of the present invention;

[0036] Fig.12 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] Embodiment 1

[0040] Figure 1This is a flowchart of a defect detection method based on perspective projection images provided in the first embodiment of the present invention. This embodiment is applicable to the case where a transformation matrix is ​​calculated based on a standard product image and then a correction transformation is performed on the product image before defect detection. The method can be executed by a defect detection device based on perspective projection images. The device can be implemented by software and / or hardware and can generally be integrated in an electronic device. The electronic device can be a terminal device or a server device. As long as the defect detection method based on perspective projection images can be executed, the embodiment of the present invention does not limit the specific device type of the electronic device. Accordingly, Figure 1 As shown, the method includes the following operations:

[0041] S110, obtaining a real-time product acquisition image of the target detection product; wherein the target detection product in the real-time product acquisition image is in a perspective state.

[0042] The target detection product may be any type of product that needs to be industrially detected based on real-time collected images, and the embodiments of the present invention do not limit the product type and product form of the target detection product. The real-time product collected image may be an image captured by a camera in real time of the target detection product.

[0043] Optionally, the camera that captures the real-time product images may be, for example, an industrial camera configured on a product inspection assembly line, etc. The embodiment of the present invention does not limit the method for capturing the real-time product images.

[0044] In an embodiment of the present invention, when it is necessary to perform real-time detection on the target detection product, the target detection product can be captured in real time by an image acquisition device such as a camera, thereby obtaining a real-time product acquisition image of the target detection product. In a specific application scenario, the target detection product can be transmitted on a product logistics line, and the camera configured above the logistics line is responsible for capturing the target detection product. That is, the technical solution of the embodiment of the present invention can realize real-time and rapid defect detection of the image captured in real time by the camera without pausing the logistics line of the product. It can be understood that since the target detection product will not stop and wait for the photo when passing the position where the image acquisition device is located, the target detection product will present a perspective state in the real-time product acquisition image captured by the target detection product. The so-called perspective state is the visual change phenomenon of near large and far small between the same objects in the same space. That is, the near-end proportion of the target detection product is real, but the far-end of the target detection product will produce a visual reduction phenomenon.

[0045] Figure 2 is a schematic diagram of the effect of a target detection product provided by the first embodiment of the present invention, Figure 31 is a schematic diagram of the effect of real-time product acquisition images of a target detection product provided by the first embodiment of the present invention. In a specific example, Figure 2 As shown, the target detection product is in the shape of a rectangular parallelepiped, and the two ends of the top surface of the target detection product are the areas to be detected with attachments, namely, blue film areas. Optionally, the attachments in the area to be detected on the top surface of the target detection product may be, for example, a film or spray paint, etc. The embodiment of the present invention does not limit the type and shape of the attachments on the top surface of the target detection product. Optionally, the area to be detected on the top surface of the target detection product may be the areas on both sides of the edge, or may be a local area in the center, etc. The embodiment of the present invention does not limit the area position and number of areas to be detected on the top surface of the target detection product. The defect detection method based on perspective projection images provided in the embodiment of the present invention can be used to perform defect detection on the area to be detected on the top surface of the target detection product to determine whether there are various defect problems such as protrusions, depressions or inclinations on the edge of the area to be detected. As Figure 3 As shown, the target detection product presents a significant perspective state in the real-time product acquisition image captured in real time. It can be understood that Figure 3 Only one type of perspective state of the target detection product is shown. The perspective state of the target detection product can also be a near-end state on the left side, a far-end state on the right side, etc. The embodiment of the present invention does not limit the type of perspective state of the target detection product in the real-time product acquisition image.

[0046] S120: Calculate a transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and a standard product image corresponding to the target detection product.

[0047] The standard product image may be an image of a standard product corresponding to the target detection product. Optionally, the standard product image may be an image of a standard product corresponding to the target detection product captured at a standard position. Exemplarily, the standard position may be, for example, a position directly below an industrial camera of a logistics line. The transformation matrix may be used to perform a correction transformation on the real-time product acquisition image.

[0048] Since the target detection product in the real-time product acquisition image is in a perspective state, it is necessary to perform a correction transformation on the state of the target detection product presented in the real-time product acquisition image. In an embodiment of the present invention, before the real-time product acquisition image is corrected and transformed, the transformation matrix of the real-time product acquisition image can be first calculated based on the real-time product acquisition image and the standard product image corresponding to the target detection product. Exemplarily, the coordinate information of the relevant points of the target detection product in the real-time product acquisition image can be used as a known quantity, and the coordinate information of the relevant points of the standard product in the standard product image corresponding to the target detection product can be used as a known quantity, and the coordinate information of the relevant points obtained above can be used to construct the transformation matrix of the real-time product acquisition image. Optionally, the information of the standard product reflected in the standard product image corresponding to the target detection product can include, for example, but is not limited to parameter information such as the width and height of the standard product.

[0049] S130: Perform a correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a correction transformation product image.

[0050] The corrected transformed product image may be an image obtained by correcting and transforming the real-time product captured image.

[0051] Correspondingly, after obtaining the transformation matrix adapted to the real-time product acquisition image, the transformation matrix of the real-time product acquisition image can be used to perform a correction transformation on the real-time product acquisition image to correct the perspective state of the target detection product in the real-time product acquisition image, where it appears larger when near and smaller when far away, and obtain a correction transformation product image.

[0052] It can be understood that since the transformation matrix is ​​calculated through the standard product image corresponding to the target detection product, the size information of the target detection product reflected in the corrected transformed product image obtained by using the transformation matrix to perform a corrective transformation on the real-time product acquisition image can be close to the size information of the standard product corresponding to the target detection product, so as to facilitate the subsequent use of the size information of the standard product to perform defect detection on the area to be detected in the target detection product, thereby improving the accuracy of product defect detection.

[0053] S140: Perform defect detection on the target detection product according to the corrected transformed product image.

[0054] Exemplarily, defect detection of the target detection product based on the corrected transformed product image may be performed by detecting size information such as width and / or height of the target detection product based on the corrected transformed product image, such as detecting whether the width and / or height of the target detection product meets the standards. Alternatively, defect detection of the target detection product based on the corrected transformed product image may also be performed by detecting edge information of a to-be-detected area in the target detection product based on the corrected transformed product image, such as detecting whether the edge of the to-be-detected area in the target detection product has various abnormal defects such as protrusions, depressions, or tilts. The embodiments of the present invention do not limit the content of defect detection of the target detection product.

[0055] It can be seen that the above-mentioned defect detection method based on perspective projection images can realize real-time defect detection of target detection products by using real-time product acquisition images to obtain real-time product acquisition images of target detection products without affecting the production rhythm of target detection products, thereby improving the efficiency of product defect detection. At the same time, the acquired real-time product acquisition images are corrected and transformed using the transformation matrix calculated by the standard product image, so that the size information of the target detection product in the obtained corrected transformed product image can be close to the size information of the standard product, thereby improving the accuracy of product defect detection.

[0056] The embodiment of the present invention obtains a real-time product acquisition image of a target detection product in a perspective state, and calculates a transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and a standard product image corresponding to the target detection product, thereby performing a correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a correction transformation product image, and then performing defect detection on the target detection product according to the correction transformation product image. This can solve the problems of low detection accuracy and efficiency in existing product defect detection based on computer vision technology, and can improve the accuracy and efficiency of product defect detection.

[0057] Embodiment 2

[0058] Figure 4 is a flow chart of a defect detection method based on perspective projection images provided by the second embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, a plurality of specific optional implementation methods for calculating the transformation matrix of the real-time product acquisition image and performing defect detection on the target detection product according to the corrected transformed product image are provided. Figure 4 As shown, the method of this embodiment may include:

[0059] S210, obtaining a real-time product acquisition image of the target detection product; wherein the target detection product in the real-time product acquisition image is in a perspective state.

[0060] S220: Determine a first associated area point of the target detection product in the real-time product acquisition image.

[0061] Among them, the first associated area point can be a related position point of the target detection product in the real-time product acquisition image.

[0062] In an embodiment of the present invention, after acquiring a real-time product acquisition image of a target detection product, the real-time product acquisition image can be detected to locate the area to be detected in the real-time product acquisition image where defect detection is required. It can be understood that the area to be detected can be a partial area of ​​the target detection product in the real-time product acquisition image, such as the edge area of ​​the top surface, or it can also be a complete area of ​​the target detection product in the real-time product acquisition image, such as the entire top surface area, etc. The embodiment of the present invention does not limit this. Accordingly, after locating the area to be detected in the real-time product acquisition image where defect detection is required, the first associated area point of the target detection product can be further determined based on the area to be detected.

[0063] In a specific example, Figure 3 As shown in the figure, after the industrial camera configured above the logistics line collects the real-time product acquisition image of the target detection product, the actual area of ​​the target detection product in the real-time product acquisition image can be located according to the color. Assuming that the two ends of the target detection product in this example are the areas wrapped by the film, the blue area can be extracted according to the BGR (BlueGreenRed, three primary colors) color space to locate the approximate area of ​​the target detection product. Optionally, for example Figure 3 The color extraction formula of the target detection product shown in the figure can be: pixel = b>200&&g<50&&r<50. In the above formula, b, g, and r represent the component values ​​of the color channel respectively. Correspondingly, according to the above color extraction formula, the envelope area at both ends of the target detection product can be calculated as the area to be detected. Further, if Figure 5 As shown, the four corner points A, B, C, and D of the target detection product can be calculated from the envelope area as the first associated area points.

[0064] S230: Determine a standard product image area of ​​the target detection product at a set position in the real-time product acquisition image.

[0065] The set position may be a position selected as needed, such as a corner position or a central position of a real-time product acquisition image, etc., and the embodiment of the present invention does not limit this. The standard product image area may be a layout area of ​​the standard product image in the real-time product acquisition image.

[0066] In an optional embodiment of the present invention, determining the standard product image area of ​​the target detection product at the set position in the real-time product acquisition image may include: drawing a horizontal line and a vertical line based on the image center point of the real-time product acquisition image; determining a first intersection point of the horizontal line with the real-time product acquisition image, and determining a second intersection point of the vertical line with the real-time product acquisition image; using the distance between the first intersection points as the width of the standard product image, and using the distance between the second intersection points as the height of the standard product image; and determining the standard product image area of ​​the target detection product at the set position in the real-time product acquisition image based on the width and height of the standard product image.

[0067] It is understandable that since the perspective projection image is a graphic obtained by projecting an object onto a single projection plane using central projection, the center of the image is not affected by the perspective effect. Based on this, the intersection of the vertical line and horizontal line passing through the center point of the real-time product acquisition image and the edge of the target detection product can be used to obtain appropriate width and height correction parameters, and the width and height of the standard product image of the target detection product can be determined based on the obtained width and height correction parameters, and then the standard product image area is set at a set position in the real-time product acquisition image using the width and height parameters of the standard product image.

[0068] Figure 6 It is a schematic diagram of the effect of determining the width and height correction parameters of the target detection product corresponding to the standard product provided by the second embodiment of the present invention. Figure 7 1 is a schematic diagram of the effect of determining a standard product image area in a real-time product acquisition image provided by the second embodiment of the present invention. In a specific example, the above example is continued as an example. Figure 5 , Figure 6 and Figure 7 As shown, let the center of the real-time product acquisition image be point O, and the intersection points of the vertical line and horizontal line passing through point O with the edge of the target detection product are points Ot, Ob, Ol and Or respectively. Further, taking the distance |OtOb| as the height of the standard product image, and taking the distance |OlOr| as the width of the standard product image, the four vertices A', B', C' and D' of the standard product can be obtained. In order to simplify the calculation process, one of the vertices of the real-time product acquisition image, such as the vertex in the upper left corner, can be used as the vertex of the standard product image. That is, the standard product image can be translated in the real-time product acquisition image so that the vertex A' of the standard product image coincides with the vertex in the upper left corner of the real-time product acquisition image, and the following is obtained. Figure 7 A', B', C' and D' shown constitute the new standard product image area.

[0069] S240: Determine a second associated area point of the standard product image area in the real-time product captured image.

[0070] The second associated area point may be a related position point of the standard product image area in the real-time product acquisition image.

[0071] In a specific example, continuing with the above example, Figure 7 As shown, the four vertices A, B, C and D of the target detection product in the real-time product acquisition image can be used as the first associated area points, and the four vertices A', B', C' and D' of the standard product image area in the real-time product acquisition image can be used as the second associated area points.

[0072] S250: Calculate a transformation matrix of the real-time product acquisition image according to the first associated area points and the second associated area points.

[0073] Correspondingly, after determining the first associated area point and the second associated area point, the transformation matrix of the real-time product captured image can be calculated using the relevant coordinate values ​​of the first associated area point and the second associated area point, so as to use the transformation matrix to perform a correction transformation on the real-time product captured image under the perspective effect.

[0074] In an optional embodiment of the present invention, the calculation of the transformation matrix of the real-time product acquisition image based on the first associated area points and the second associated area points may include: constructing a transformation matrix to be solved based on matrix association factors; wherein the matrix association factors include scale, angle and displacement; constructing a transformation matrix expression to be solved based on the transformation matrix to be solved and reference point coordinate associated transformation variables; assigning and solving the reference point coordinate associated transformation variables based on the point coordinates of the first associated area points and the second associated area points to obtain the transformation matrix of the real-time product acquisition image.

[0075] The matrix-related factors may be related factors constituting the transformation matrix. The transformation matrix to be solved may be a transformation matrix including position variable values. The reference point coordinate-related transformation variables may be variables corresponding to the coordinate values ​​of a reference point selected from the real-time product acquisition image.

[0076] Generally speaking, the matrix elements of the transformation matrix usually involve matrix-related factors such as scale, angle, and displacement. Assume that the transformation matrix to be solved constructed based on the matrix-related factors is:

[0077]

[0078] Among them, matrix represents the transformation matrix to be solved, a 11 ……a 33is the matrix element of the transformation matrix to be solved. Then the transformation matrix to be solved is decomposed to obtain matrix correlation factors such as scale, angle and displacement, among which:

[0079]

[0080] T2=[a 13 a 23 ]

[0081] T3=[a 31 a 32 ]

[0082] In the above-split matrix association factors, each matrix element included in T1 may include relevant information about scale and angle; each matrix element included in T2 may represent relevant information about displacement in the x-axis or y-axis direction; each matrix element included in T3 may represent relevant information about displacement in the x-axis or y-axis direction. Exemplarily, when each matrix element included in T2 represents relevant information about displacement in the x-axis direction, each matrix element included in T3 may represent relevant information about displacement in the y-axis direction; when each matrix element included in T2 represents relevant information about displacement in the y-axis direction, each matrix element included in T3 may represent relevant information about displacement in the x-axis direction.

[0083] Furthermore, the transformation matrix to be solved can be converted to:

[0084]

[0085] Furthermore, by dividing the transformation matrix matrix by a33, the transformed transformation matrix m can be obtained as follows:

[0086]

[0087] According to the correction principle, assuming that a point (x, y, z) in space is transformed by the transformation matrix m to obtain the point (x', y', z'), then (x, y, z) and (x', y', z') can be used as reference point coordinates to associate transformation variables, and the transformation matrix expression to be solved is constructed based on the transformation matrix m to be solved and the reference point coordinates to associate transformation variables: [x', y', z'] = [x, y, z] * m. Since the ordinate of a point on a plane is 1, it can be further obtained that [x', y', 1] = [x, y, 1] * m.

[0088] Correspondingly, the point coordinates of the first associated area point and the second associated area point, that is, the coordinates of A', B', C', D' and A, B, C, D are substituted into the expression [x', y', 1] = [x, y, 1]*m, and the transformation matrix m can be calculated.

[0089] S260: Perform a correction transformation on the real-time product captured image according to the transformation matrix of the real-time product captured image to obtain a correction transformed product image.

[0090] Correspondingly, after obtaining the transformation matrix of the real-time product acquisition image, each pixel point in the area corresponding to the target detection product in the real-time product acquisition image is multiplied by the transformation matrix to achieve the correction transformation and obtain the correction transformation product image.

[0091] Figure 8 is a schematic diagram of the effect of correcting and transforming a product image provided by the second embodiment of the present invention. In a specific example, Figure 3 and Figure 8 As shown, using the transformation matrix Figure 3 After the real-time product acquisition image of the target detection product with perspective state shown in FIG. is corrected and transformed, the following can be obtained: Figure 8 The rectified transformed product image shown.

[0092] S270: Determine an image detection area of ​​the corrected and transformed product image according to the product type of the target detection product.

[0093] S280: Perform skeleton extraction on the image detection area of ​​the corrected and transformed product image to generate a single-pixel width detection line area corresponding to the image detection area.

[0094] The image detection area may be any partial or entire area of ​​the target detection product in the rectified transformed product image. The single pixel width detection line area may be an area composed of single pixel width detection lines, such as 1 pixel detection lines.

[0095] It is understandable that different types of target inspection products have different requirements for defect inspection, and thus the corresponding image inspection areas in the corrected transformed product image are also different.

[0096] For example, if the target product is a product with a film or other attachments on both sides, the film area or other attachment area of ​​the entire target product displayed in the corrected transformed product image can be used as the image detection area. If the defect detection is performed on the entire shape of the target product, the area displayed in the corrected transformed product image can be used as the image detection area.

[0097] Fig. 9 is a schematic diagram of the effect of correcting and transforming the image detection area in the product image provided by the second embodiment of the present invention. In a specific example, Figure 8As shown in FIG. 1 , the edges of the image detection area of ​​the rectified transformed product image may be thicker. Therefore, in order to improve the defect detection accuracy, the image detection area in the rectified transformed product image may be first subjected to skeleton extraction to generate a skeleton of the image detection area. Fig. 9 The detection line with a single pixel width is shown. Further, the apartment area in the envelope area can be determined according to the radius length R of the envelope arc area standard, and the envelope area with a height H obtained by avoiding the arc area is the final image detection area.

[0098] S290. Perform defect detection on the single-pixel width detection line area corresponding to the image detection area according to the standard product data of the target detection product.

[0099] The standard product data may be relevant data of the standard product corresponding to the target detection product, for example, relevant data of the area to be detected (such as the capsule area, etc.).

[0100] Accordingly, after determining the single-pixel width detection line area corresponding to the image detection area of ​​the corrected transformed product image, defect detection can be performed on the single-pixel width detection line area corresponding to the image detection area of ​​the corrected transformed product image in combination with the standard product data of the target detection product.

[0101] In an optional embodiment of the present invention, the image detection area can be an equidistant area; the defect detection on the single-pixel width detection line area corresponding to the image detection area according to the standard product data of the target detection product may include: determining a first reference detection point and a second reference detection point corresponding to the first reference detection point for the single-pixel width detection line area; calculating the pixel width between the first reference detection point and the corresponding second reference detection point; calculating the physical width between the first reference detection point and the corresponding second reference detection point based on the pixel width between the first reference detection point and the corresponding second reference detection point; comparing the physical width with the standard equidistant width in the standard product data to determine the defect detection result of the single-pixel width detection line area.

[0102] The equidistant area can be understood as the boundary lines in the image detection area being equidistant. The first reference detection point can be a series of related points of the target detection product in the image detection area. The second reference detection point can be a series of related points in the image detection area corresponding to the first reference detection point.

[0103] Optionally, when performing defect detection on the single-pixel width detection line area corresponding to the image detection area of ​​the corrected transformed product image according to the standard product data of the target detection product, a plurality of first reference detection points can be first determined for the single-pixel width detection line area, and for each first reference detection point, the corresponding second reference detection point can be determined respectively. Each first reference detection point and the corresponding second reference detection point can constitute a pair of point groups. Further, the pixel width between the first reference detection point and the corresponding second reference detection point in each point group can be calculated, and the pixel width between the first reference detection point and the corresponding second reference detection point can be further converted into the physical width between the first reference detection point and the corresponding second reference detection point. After calculating the physical width between the first reference detection point and the corresponding second reference detection point in each point group, the calculated physical widths can be compared with the standard equidistant widths in the standard product data, so as to determine the defect detection results of the single-pixel width detection line area according to the comparison results.

[0104] Fig.10 is a schematic diagram of the effect of performing defect detection on the image detection area of ​​the corrected transformed product image provided by the second embodiment of the present invention. In a specific example, Fig. 9 and 10 As shown, assuming that the film width of the product needs to be detected, after determining the single-pixel width detection line area, you can start from the boundary starting point of the single-pixel width detection line area, take a point Pn position at every interval Δh as a first reference detection point, and for each point Pn, look for the film boundary point Qn in the middle of the image as the second reference detection point corresponding to the first reference detection point. The pixel distance between Pn and Qn is the calculated film width Wn, which can also be called pixel width. Accordingly, a total of n film widths can be calculated. After calculating the film width at the pixel level, the film width at the pixel level needs to be converted into a physical size.

[0105] In an optional embodiment of the present invention, the calculation of the physical width between the first reference detection point and the corresponding second reference detection point based on the pixel width between the first reference detection point and the corresponding second reference detection point may include: calculating the unit conversion ratio in the lateral direction of the image center based on the product width in the standard product data and the pixel accuracy of the target detection product in the real-time product acquisition image; calculating the product value of the pixel width and the unit conversion ratio in the lateral direction of the image center to obtain the physical width between the first reference detection point and the corresponding second reference detection point.

[0106] The image center transverse direction unit conversion ratio may be a transverse pixel physical unit conversion ratio corresponding to the center of the real-time product acquisition image.

[0107] Continuing with the above example, since the pixel width between the first reference detection point and the corresponding second reference detection point is the envelope width calculated on the corrected transformed product image, and the size of the corrected transformed product image is mainly based on Figure 6 It is determined by the intersection points Ot, Ob, Ol and Or in the image, so it is necessary to calculate the physical unit conversion ratio of the horizontal pixels corresponding to the center of the image before correction as the unit conversion ratio of the horizontal direction of the image center. Among them, the unit conversion ratio of the horizontal direction of the image center can be calculated and determined based on the formula: ratio = Wstd / |OtOb|. Among them, ratio is the unit conversion ratio of the horizontal direction of the image center, Wstd is the product width in the standard product data, and |OtOb| is the pixel accuracy of the target detection product, that is, the pixel distance between the intersection of the vertical line passing through the center point of the image in the real-time product acquisition image and the edge line of the target detection product.

[0108] Correspondingly, after calculating the unit conversion ratio in the horizontal direction of the image center, we can further calculate the pixel width Wn between the first reference detection point Pn and the corresponding second reference detection point Qn according to the formula: Ln=ratio*Wn, and multiply the product of the unit conversion ratio in the horizontal direction of the image center by the ratio, so as to obtain the physical width Ln between the first reference detection point Pn and the corresponding second reference detection point Qn.

[0109] In an optional embodiment of the present invention, comparing the physical width with the standard equidistant width in the standard product data to determine the defect detection result of the single-pixel width detection line area may include: when it is determined that the physical width between a single point does not match the standard equidistant width in the standard product data, determining that there is a convex or concave abnormality in the single-pixel width detection line area of ​​the target detection product; when it is determined that the physical width of consecutive points does not match the standard equidistant width in the standard product data, calculating the data change trend of the physical width of consecutive points; when it is determined that the data change trend of the physical width of the consecutive points is increasing or decreasing, determining that there is a tilt abnormality in the single-pixel width detection line area of ​​the target detection product.

[0110] The calculated physical widths Ln can be compared with the standard equidistant widths in the standard product data. If only the physical width between a single point does not match the standard equidistant width in the standard product data, it can be determined that there is a convex or concave anomaly in the single-pixel width detection line area of ​​the target detection product. If it is determined that the physical widths of multiple consecutive points do not match the standard equidistant widths in the standard product data, the data change trend of the physical widths of the consecutive points can be further calculated. If it is determined that the data change trend of the physical widths of the consecutive points is increasing or decreasing, it can be determined that there is a tilt anomaly in the single-pixel width detection line area of ​​the target detection product.

[0111] In a specific example, Fig.10 As shown, if the physical width of the envelope between only a single point does not match the standard equidistant width of the envelope in the standard product data, it can be determined that the target detection product has an envelope abnormality. Specifically, if the detected physical width of the envelope is greater than the standard equidistant width of the envelope, it can be determined that the envelope has a convex abnormality; if the detected physical width of the envelope is less than the standard equidistant width of the envelope, it can be determined that the envelope has a concave abnormality. Correspondingly, if the physical width of the envelope between multiple consecutive points does not match the standard equidistant width of the envelope in the standard product data, the data change trend of the physical width of the consecutive points can be calculated. If the data change trend of the physical width of the consecutive points is determined to be increasing, it can be determined that the envelope has an abnormality of changing from thin to wide; if the data change trend of the physical width of the consecutive points is determined to be decreasing, it can be determined that the envelope has an abnormality of changing from wide to thin.

[0112] The above technical solution obtains real-time product acquisition images by real-time snapshot of target detection, and uses a transformation matrix to correct the perspective state of the target detection product in the real-time product acquisition image to solve the perspective problem in the real-time product acquisition image. Then, the single-pixel width detection line area corresponding to the image detection area of ​​the target detection product is calculated using the corrected image positioning to perform defect inspection on the single-pixel width detection line area, which can realize real-time defect detection of the product without pausing on the logistics line, thereby improving the efficiency and accuracy of defect detection on the product production line.

[0113] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.

[0114] Embodiment 3

[0115] Fig.11 is a schematic diagram of a defect detection device based on perspective projection images provided by Embodiment 3 of the present invention, such as Fig.11As shown, the device includes: a real-time product acquisition image acquisition module 310, a transformation matrix calculation module 320, an image correction transformation module 330 and a product defect detection module 340, wherein:

[0116] The real-time product acquisition image acquisition module 310 is used to acquire a real-time product acquisition image of the target detection product; wherein the target detection product in the real-time product acquisition image is in a perspective state;

[0117] A transformation matrix calculation module 320, configured to calculate a transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and a standard product image corresponding to the target detection product;

[0118] An image correction transformation module 330 is used to perform a correction transformation on the real-time product acquisition image according to a transformation matrix of the real-time product acquisition image to obtain a correction transformation product image;

[0119] The product defect detection module 340 is used to perform defect detection on the target detection product according to the corrected transformed product image.

[0120] The embodiment of the present invention obtains a real-time product acquisition image of a target detection product in a perspective state, and calculates a transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and a standard product image corresponding to the target detection product, thereby performing a correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a correction transformation product image, and then performing defect detection on the target detection product according to the correction transformation product image. This can solve the problems of low detection accuracy and efficiency in existing product defect detection based on computer vision technology, and can improve the accuracy and efficiency of product defect detection.

[0121] Optionally, the transformation matrix calculation module 320 is also used to: determine the first associated area point position of the target detection product in the real-time product acquisition image; determine the standard product image area of ​​the target detection product at a set position in the real-time product acquisition image; determine the second associated area point position of the standard product image area in the real-time product acquisition image; and calculate the transformation matrix of the real-time product acquisition image based on the first associated area point position and the second associated area point position.

[0122] Optionally, the transformation matrix calculation module 320 is also used to: draw horizontal lines and vertical lines based on the image center point of the real-time product acquisition image; determine the first intersection point of the horizontal line with the real-time product acquisition image, and determine the second intersection point of the vertical line with the real-time product acquisition image; use the distance between the first intersection points as the width of the standard product, and use the distance between the second intersection points as the height of the standard product; add the standard product image of the target detection product at a set position in the real-time product acquisition image according to the width and height of the standard product.

[0123] Optionally, the transformation matrix calculation module 320 is also used to: construct a transformation matrix to be solved based on matrix association factors; wherein the matrix association factors include scale, angle and displacement; construct an expression of the transformation matrix to be solved based on the transformation matrix to be solved and the reference point coordinate associated transformation variables; assign and solve the reference point coordinate associated transformation variables based on the point coordinates of the first associated area points and the second associated area points to obtain the transformation matrix of the real-time product acquisition image.

[0124] Optionally, the product defect detection module 340 is also used to: determine the image detection area of ​​the corrected transformed product image according to the product type of the target detection product; perform skeleton extraction on the image detection area of ​​the corrected transformed product image to generate a single-pixel width detection line area corresponding to the image detection area; and perform defect detection on the single-pixel width detection line area corresponding to the image detection area according to standard product data of the target detection product.

[0125] Optionally, the image detection area is an equidistant area; the product defect detection module 340 is also used to: determine a first reference detection point and a second reference detection point corresponding to the first reference detection point for the single-pixel width detection line area; calculate the pixel width between the first reference detection point and the corresponding second reference detection point; calculate the physical width between the first reference detection point and the corresponding second reference detection point based on the pixel width between the first reference detection point and the corresponding second reference detection point; compare the physical width with the standard equidistant width in the standard product data to determine the defect detection result of the single-pixel width detection line area.

[0126] Optionally, the product defect detection module 340 is also used to: calculate the unit conversion ratio in the lateral direction of the image center based on the product width in the standard product data and the pixel accuracy of the target detection product in the real-time product acquisition image; calculate the product value of the pixel width and the unit conversion ratio in the lateral direction of the image center to obtain the physical width between the first reference detection point and the corresponding second reference detection point.

[0127] Optionally, the product defect detection module 340 is also used to: when it is determined that the physical width between a single point does not match the standard equidistant width in the standard product data, determine that there is a convex or concave abnormality in the single-pixel width detection line area of ​​the target detection product; when it is determined that the physical width of continuous points does not match the standard equidistant width in the standard product data, calculate the data change trend of the physical width of the continuous points; when it is determined that the data change trend of the physical width of the continuous points is increasing or decreasing, determine that there is a tilt abnormality in the single-pixel width detection line area of ​​the target detection product.

[0128] The above-mentioned defect detection device based on perspective projection images can execute the defect detection method based on perspective projection images provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in this embodiment, please refer to the defect detection method based on perspective projection images provided by any embodiment of the present invention.

[0129] Since the defect detection device based on perspective projection images introduced above is a device that can execute the defect detection method based on perspective projection images in the embodiment of the present invention, based on the defect detection method based on perspective projection images introduced in the embodiment of the present invention, the technical personnel in this field can understand the specific implementation of the defect detection device based on perspective projection images in this embodiment and its various variations, so how the defect detection device based on perspective projection images implements the defect detection method based on perspective projection images in the embodiment of the present invention will not be introduced in detail here. As long as the technical personnel in this field implement the device adopted by the defect detection method based on perspective projection images in the embodiment of the present invention, it belongs to the scope of protection of this application.

[0130] Embodiment 4

[0131] Fig.12 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0132] like Fig.12As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0133] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0134] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a defect detection method based on perspective projection images.

[0135] Optionally, the defect detection method based on perspective projection images may include: acquiring a real-time product acquisition image of the target detection product; wherein the target detection product in the real-time product acquisition image is in a perspective state; calculating a transformation matrix of the real-time product acquisition image based on the real-time product acquisition image and a standard product image corresponding to the target detection product; performing a correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a correction transformation product image; and performing defect detection on the target detection product based on the correction transformation product image.

[0136] In some embodiments, the defect detection method based on perspective projection images may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the defect detection method based on perspective projection images described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the defect detection method based on perspective projection images in any other appropriate manner (e.g., by means of firmware).

[0137] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0138] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0139] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0140] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0141] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0142] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

Claims

1. A defect detection method based on perspective projection image, characterized in that: include: Acquire a real-time product acquisition image of the target detection product; wherein the target detection product in the real-time product acquisition image is in a perspective state; Calculating a transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and a standard product image corresponding to the target detection product; Performing a correction transformation on the real-time product acquisition image according to the transformation matrix of the real-time product acquisition image to obtain a correction transformation product image; Defect detection is performed on the target detection product according to the corrected transformed product image.

2. The method according to claim 1, characterized in that The step of calculating the transformation matrix of the real-time product acquisition image according to the real-time product acquisition image and the standard product image of the target detection product includes: Determine a first associated area point of the target detection product in the real-time product acquisition image; Determining a standard product image area of ​​the target detection product at a set position in the real-time product acquisition image; Determine a second associated area point of the standard product image area in the real-time product acquisition image; A transformation matrix of the real-time product acquisition image is calculated according to the first associated area points and the second associated area points.

3. The method according to claim 2, characterized in that The step of calculating the transformation matrix of the real-time product acquisition image according to the first associated area point and the second associated area point includes: Constructing a transformation matrix to be solved according to matrix correlation factors; wherein the matrix correlation factors include scale, angle and displacement; Constructing a transformation matrix expression to be solved according to the transformation matrix to be solved and the reference point coordinates associating transformation variables; The reference point coordinate association transformation variables are assigned and solved according to the point coordinates of the first association area point and the second association area point to obtain a transformation matrix of the real-time product acquisition image.

4. The method according to claim 1, characterized in that: The performing defect detection on the target detection product according to the corrected transformed product image comprises: Determining an image detection area of ​​the corrected transformed product image according to the product type of the target detection product; Performing skeleton extraction on the image detection area of ​​the corrected transformed product image to generate a single-pixel width detection line area corresponding to the image detection area; Defect detection is performed on the single-pixel width detection line area corresponding to the image detection area according to the standard product data of the target detection product.

5. The method according to claim 4, characterized in that The image detection area is an equidistant area; and the defect detection is performed on a single-pixel width detection line area corresponding to the image detection area according to the standard product data of the target detection product, including: Determine a first reference detection point and a second reference detection point corresponding to the first reference detection point for the single-pixel width detection line area; Calculating the pixel width between the first reference detection point and the corresponding second reference detection point; Calculating a physical width between the first reference detection point and the corresponding second reference detection point according to a pixel width between the first reference detection point and the corresponding second reference detection point; The physical width is compared with the standard equidistant width in the standard product data to determine the defect detection result of the single-pixel width detection line area.

6. The method according to claim 5, characterized in that The calculating the physical width between the first reference detection point and the corresponding second reference detection point according to the pixel width between the first reference detection point and the corresponding second reference detection point includes: Calculate the unit conversion ratio in the horizontal direction of the center of the image according to the product width in the standard product data and the pixel accuracy of the target detection product in the real-time product acquisition image; The physical width between the first reference detection point and the corresponding second reference detection point is obtained by calculating the product of the pixel width and the unit conversion ratio of the image center in the transverse direction.

7. The method according to claim 5, characterized in that The step of comparing the physical width with the standard equidistant width in the standard product data to determine the defect detection result of the single-pixel width detection line area includes: When it is determined that the physical width between the single points does not match the standard equidistant width in the standard product data, it is determined that there is a convex or concave abnormality in the single pixel width detection line area of ​​the target detection product; When it is determined that the physical width of the continuous points does not match the standard equidistant width in the standard product data, calculating the data change trend of the physical width of the continuous points; When it is determined that the data change trend of the physical width of the continuous points is increasing or decreasing, it is determined that there is a tilt abnormality in the single-pixel width detection line area of ​​the target detection product.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the defect detection method based on perspective projection images as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the defect detection method based on perspective projection images described in any one of claims 1-7 when executed.

10. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the defect detection method based on perspective projection images described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for detecting printed circuit board defect

    CN102721695A

  • Object detection method and system, computer device and storage medium

    CN108596905A

  • Image-based interval anomaly defect detection method

    CN114663420A