A product quality detection method and system based on image recognition

Through image recognition-based methods, the detection images of products are obtained, the target model is constructed, and the positional relationship between virtual targets and actual targets is compared, the problems of poor detection consistency and accuracy in traditional detection methods are solved, and fast and accurate product quality detection is achieved.

CN119274045BActive Publication Date: 2025-02-28SHENZHEN LIDIAN CONNECTION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411798240.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-02-28
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

Due to its subjectivity and fatigue-prone nature, traditional product quality testing methods are difficult to ensure the consistency and accuracy of the inspection. Especially when the product shape is uncertain, it is difficult to conduct quality testing quickly and accurately.

Method used

采用基于图像识别的产品质量检测方法,通过视觉传感器获取多张检测图像,获取模型特征并构建目标模型,确定虚拟靶点和实际靶点之间的位置关系,通过比对结果判断产品是否合格。

Benefits of technology

It realizes the rapid establishment of product models without detailed dimension measurement, fast detection speed, and can accurately determine whether the product meets quality standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a product quality inspection method and system based on image recognition, which relates to the field of image processing technology. For the products produced on the production line, a model can be quickly established, and according to the established model, when a certain product has a shape defect, its model shape is greatly different from other products. Therefore, there is a large difference between the actual target point position on the product and the virtual target point position in the model. Whether the product is qualified can be judged by the size of the difference. The product model is established relatively quickly, and there is no need to perform detailed dimensional measurement on each product, so the inspection speed is fast.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a product quality detection method and system based on image recognition. Background Art

[0002] In the traditional quality inspection process, manual inspection methods are often difficult to ensure the consistency and accuracy of inspection due to their subjectivity and fatigue. With the development of automation technology, machine vision systems have begun to be widely used in product quality inspection.

[0003] For products with non-defined shapes, their specific product shapes can only be obtained after the production line starts production. Therefore, it is often difficult to use the previously established inspection standards in the process of quality inspection of the same batch of products. Usually, after a batch of products is produced, products with large size differences from the batch of products are judged as unqualified products. The inspection method usually adopts actual measurement of each product, and after obtaining the average size, products with large size differences from the average size are eliminated. The inspection speed is slow and the labor cost is high. Summary of the invention

[0004] The embodiments of the present application provide a product quality detection method and system based on image recognition to improve the above-mentioned problems.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In the first aspect, the embodiment of the present application proposes a product quality detection method based on image recognition, which is applicable to a product quality detection system based on image recognition. The system includes a controller, a detection plane, a conveying device, and a visual sensor. The conveying device is used to sequentially send j products to be detected to the detection plane, where j is a natural number and j≥2. The method includes:

[0007] The controller obtains the 1st, 2nd, ...jth detection images based on the visual sensor, and each detection image corresponds to a product to be detected;

[0008] The controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected;

[0009] The controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains a positional relationship between the plurality of virtual target points;

[0010] The controller obtains the i-th detection image, and obtains the target area image based on the i-th detection image, where the target area image is the actual image of the product to be detected in the i-th detection image, where i is a natural number and i≥1;

[0011] The controller determines a plurality of actual target points located on the plurality of target area images based on the target area images, wherein one actual target point corresponds to one virtual target point one by one;

[0012] The controller obtains the positional relationship between multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified based on the comparison result.

[0013] In combination with the first aspect, in some embodiments, the controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected, including:

[0014] The controller obtains the model features based on the kth detection image and fills the model features into the original model, where k is a natural number and k≥1;

[0015] The controller determines whether the original model is filled. If the original model still has unfilled features, the controller selects another detection image that is not the kth one from the j detection images, obtains model features based on the detection image, and fills the model features into the original model.

[0016] In combination with the first aspect, in some embodiments, the controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected, including:

[0017] The controller determines whether the original model is filled or not. If the original model has become a virtual model with complete model features, the original model is determined to be the target model.

[0018] In combination with the first aspect, in some embodiments, the controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected, including:

[0019] The controller divides the n detection images into n first detection images and n second detection images, wherein the first detection image is a direct image of the product to be detected directly obtained by the visual sensor, and the second detection image is a reflection image of the product to be detected formed on the detection plane obtained by the visual sensor;

[0020] The controller obtains a plurality of model features according to the n first detection images and the n second detection images.

[0021] In combination with the first aspect, in some implementations, the controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains a positional relationship between the plurality of virtual target points, including:

[0022] The controller obtains edge features of the target model, and the edge features include the position of the model vertices and the edge position of each face on the model;

[0023] The controller uses each model vertex as a virtual target;

[0024] The controller selects at least one point at each edge position as a virtual target point.

[0025] In combination with the first aspect, in some implementations, the controller determines, based on the target area image, a plurality of actual target points located on the plurality of target area images, wherein one actual target point corresponds to one virtual target point one by one, including:

[0026] The controller determines a feature image contained in the target area image, the feature image including a vertex image;

[0027] The controller marks the location of the vertex image as the actual target point, matches the feature image with the edge feature, and determines the corresponding relationship between the actual target point and the virtual target point based on the matching result.

[0028] In combination with the first aspect, in some implementations, the controller determines, based on the target area image, a plurality of actual target points located on the plurality of target area images, wherein one actual target point corresponds to one virtual target point one by one, including:

[0029] The controller determines a feature image included in the target area image, wherein the feature image includes an edge image;

[0030] The controller matches the edge image with the edge feature, and determines the corresponding relationship between the edge image and the edge feature according to the matching result;

[0031] The controller determines the actual target point corresponding to the virtual target point in the edge image according to the corresponding relationship between the edge image and the edge feature.

[0032] In combination with the first aspect, in some implementations, the controller obtains the positional relationship between multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified according to the comparison result, including:

[0033] The controller obtains the positional relationship between the multiple actual target points, where the positional relationship includes the distance between each of the actual target points;

[0034] The controller obtains the positional relationship between the multiple virtual target points, where the positional relationship includes the distance between each virtual target point;

[0035] Based on the correspondence between the virtual target points and the actual target points, the controller compares the distance between each actual target point with the distance between each virtual target point, and determines whether the mth product to be tested is qualified according to the comparison result.

[0036] In the second aspect, the embodiment of the present application proposes a product quality inspection system based on image recognition, the system includes a controller, a detection plane, a conveying device and a visual sensor, the conveying device is used to sequentially send j products to be inspected to the detection plane, where j is a natural number and j≥2, and the system is configured as follows:

[0037] The controller obtains the 1st, 2nd, ...jth detection images based on the visual sensor, and each detection image corresponds to a product to be detected;

[0038] The controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected;

[0039] The controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains a positional relationship between the plurality of virtual target points;

[0040] The controller obtains the i-th detection image, and obtains the target area image based on the i-th detection image, where the target area image is the actual image of the product to be detected in the i-th detection image, where i is a natural number and i≥1;

[0041] The controller determines a plurality of actual target points located on the plurality of target area images based on the target area images, wherein one actual target point corresponds to one virtual target point one by one;

[0042] The controller obtains the positional relationship between multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified based on the comparison result.

[0043] In conjunction with the second aspect, in some embodiments, the system is configured as follows:

[0044] The controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features. The target model is a virtual model of the product to be detected, including:

[0045] The controller obtains the model features based on the kth detection image and fills the model features into the original model, where k is a natural number and k≥1;

[0046] The controller determines whether the original model is filled. If the original model still has unfilled features, the controller selects another detection image that is not the kth one from the j detection images, obtains model features based on the detection image, and fills the model features into the original model.

[0047] In conjunction with the second aspect, in some embodiments, the controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected, including:

[0048] The controller determines whether the original model is filled or not. If the original model has become a virtual model with complete model features, the original model is determined to be the target model.

[0049] In conjunction with the second aspect, in some embodiments, the system is configured as follows:

[0050] The controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features. The target model is a virtual model of the product to be detected, including:

[0051] The controller divides the n detection images into n first detection images and n second detection images, wherein the first detection image is a direct image of the product to be detected directly obtained by the visual sensor, and the second detection image is a reflection image of the product to be detected formed on the detection plane obtained by the visual sensor;

[0052] The controller obtains a plurality of model features according to the n first detection images and the n second detection images.

[0053] In conjunction with the second aspect, in some embodiments, the system is configured as follows:

[0054] The controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains the positional relationship between the plurality of virtual target points, including:

[0055] The controller obtains edge features of the target model, and the edge features include the position of the model vertices and the edge position of each face on the model;

[0056] The controller uses each model vertex as a virtual target;

[0057] The controller selects at least one point at each edge position as a virtual target point.

[0058] In conjunction with the second aspect, in some embodiments, the system is configured as follows:

[0059] The controller determines a plurality of actual target points located on the plurality of target area images based on the target area images, wherein one actual target point corresponds to one virtual target point one by one, including:

[0060] The controller determines a feature image contained in the target area image, the feature image including a vertex image;

[0061] The controller marks the location of the vertex image as the actual target point, matches the feature image with the edge feature, and determines the corresponding relationship between the actual target point and the virtual target point based on the matching result.

[0062] In conjunction with the second aspect, in some embodiments, the system is configured as follows:

[0063] The controller determines a plurality of actual target points located on the plurality of target area images based on the target area images, wherein one actual target point corresponds to one virtual target point one by one, including:

[0064] The controller determines a feature image included in the target area image, wherein the feature image includes an edge image;

[0065] The controller matches the edge image with the edge feature, and determines the corresponding relationship between the edge image and the edge feature according to the matching result;

[0066] The controller determines the actual target point corresponding to the virtual target point in the edge image according to the corresponding relationship between the edge image and the edge feature.

[0067] In conjunction with the second aspect, in some embodiments, the system is configured as follows:

[0068] The controller obtains the positional relationship between multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified according to the comparison result, including:

[0069] The controller obtains the positional relationship between the multiple actual target points, where the positional relationship includes the distance between each of the actual target points;

[0070] The controller obtains the positional relationship between the multiple virtual target points, where the positional relationship includes the distance between each virtual target point;

[0071] Based on the correspondence between the virtual target points and the actual target points, the controller compares the distance between each actual target point with the distance between each virtual target point, and determines whether the mth product to be tested is qualified according to the comparison result.

[0072] A third aspect of an embodiment of the present invention provides an electronic device, the electronic device comprising:

[0073] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method proposed in the first aspect of the embodiment of the present invention.

[0074] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect of the embodiment of the present invention.

[0075] In summary, the above method and system have the following technical effects:

[0076] The embodiment of the present application proposes a product quality inspection method and system based on image recognition. The controller obtains multiple inspection images based on a visual sensor, then obtains multiple model features from the multiple inspection images, and builds a target model based on the model features. Then, the controller determines multiple virtual target points fixed on the target model on the target model, and obtains the positional relationship between the multiple virtual target points. Then, the inspection image of the product to be inspected needs to be inspected, and the target area image is obtained based on the i-th inspection image. Then, the controller determines multiple actual target points located on the multiple target area images based on the target area image, and one actual target point corresponds to one virtual target point one by one. Finally, the controller obtains the positional relationship between the multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between the multiple virtual targets corresponding to the actual target points. According to the comparison result, it is determined whether the first product to be inspected is qualified. A product quality inspection method based on image recognition proposed in an embodiment of the present application can quickly establish a model for the products produced on the production line. According to the established model, when a product has a shape defect, its model shape is significantly different from that of other products. Therefore, there is a significant difference between the actual target position on the product and the virtual target position in the model. The size of the difference can be used to determine whether the product is qualified. The product model can be established relatively quickly, and there is no need to perform detailed dimensional measurements on each product, so the inspection speed is relatively fast. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 A flowchart of a product quality detection method based on image recognition proposed in this application. DETAILED DESCRIPTION

[0078] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 are within the scope of protection of the present invention.

[0079] This application proposes a product quality detection method based on image recognition, please refer to Figure 1 , applicable to a product quality inspection system based on image recognition, the system includes a controller, a detection plane, a conveying device and a visual sensor, the conveying device is used to send j products to be inspected to the detection plane in sequence, wherein j is a natural number and j≥2, the products to be inspected in this embodiment are products produced under the same production index, the conveying device can be an automatic clamping device, such as a manipulator or some other conveying equipment, which is not limited in this application, and the conveying device can place a product on the detection plane in any direction. The detection plane is a placement plane, and the setting direction of the visual sensor is at a certain angle to the detection plane. In some other embodiments, the detection plane can also be a mirror surface for obtaining a reflected image. In this embodiment, the method includes the following steps:

[0080] S101: The controller obtains the 1st, 2nd, ...jth detection images based on the visual sensor, and each detection image corresponds to a product to be detected.

[0081] It can be understood that in this embodiment, the controller can control the visual sensor to obtain the detection image. During the detection process, the products to be detected are sent to the detection plane in sequence through the conveying device and the image is acquired by the visual sensor. In this embodiment, there are j products to be detected, that is, there are j images to be detected.

[0082] S102: The controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected.

[0083] It is understandable that after acquiring multiple detection images, the controller can use the acquired detection images to model the product. Since a single detection image cannot establish a complete product model, in this embodiment, the controller is based on n detection images and uses different features in the n detection images to establish a model. How to establish a virtual model through images has been disclosed in relevant patents and is not limited here.

[0084] In some other embodiments, the detection plane is a mirror, so in the process of acquiring images and building models, it is not only constructed from data acquired from direct images, but also possible to segment n detection images so that the n detection images are divided into n first detection images and n second detection images, wherein the first detection image is a direct image of the product to be detected directly acquired by the visual sensor, and the second detection image is a reflection image of the product to be detected acquired by the visual sensor on the detection plane, and then the controller acquires multiple model features based on the n first detection images and the n second detection images. In the above manner, more features can be acquired from a single image for building or filling a virtual model.

[0085] Specifically, in this embodiment, the controller may first obtain the model features based on the kth detection image, and fill the model features into the original model, where k is a natural number and k≥1. In this embodiment, the model features may be the length of a certain edge, the angle of a certain inflection point, or the curvature of a certain arc surface, which is not limited in this application.

[0086] Afterwards, the controller determines whether the original model is filled.

[0087] It is understandable that the original model can be directly input or built from a simple structural model such as a sphere. If the original model still has unfilled features, it can be identified in a variety of ways, such as whether the model is closed after filling multiple features.

[0088] It can be understood that after the model is filled with data obtained through a detection image, if the model still has unfilled features, the controller selects another detection image that is not the kth one from the j detection images, obtains the model features based on the detection image, and fills the model features into the original model.

[0089] It is understandable that the model is tested multiple times and the above steps are repeated until the model is complete. If the original model has become a virtual model with complete model features, the original model is determined to be the target model.

[0090] It should be noted that in this embodiment, more than one virtual model may be generated, and models may also be generated by multiple groups of products. The models obtained by fitting are closer to the standard model size because they are generated using a large amount of product data.

[0091] S103: The controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains the positional relationship between the plurality of virtual target points.

[0092] It can be understood that in this embodiment, after the target model is determined, the target model can be used to perform shape detection on each product to be detected. In this embodiment, each product can be detected by using point mapping.

[0093] Therefore, in this embodiment, it is first necessary to obtain the reference point position on the model, that is, the virtual target point proposed in this embodiment. Then, the positional relationship between the virtual target points is obtained. As an implementation method, the positional relationship can be the distance relationship between the target points. In other embodiments, it can also be the angle of the line between the target points, etc., which is not limited in this embodiment.

[0094] Specifically, in this embodiment, the controller obtains edge features of the target model, where the edge features include the model vertex positions and the edge position of each face on the model. Then, the controller uses each model vertex as a virtual target point.

[0095] For the edge of the model, the controller selects at least one point at each edge position as a virtual target point.

[0096] S104: The controller obtains the i-th detection image, and obtains the target area image based on the i-th detection image, where the target area image is the actual image of the product to be detected in the i-th detection image, where i is a natural number and i≥1.

[0097] It can be understood that in this embodiment, the i-th detection image is the detection image corresponding to the product to be detected. The target area image is obtained based on the i-th detection image, and the target area image is the actual image of the product to be detected in the i-th detection image, that is, the area where the product exists in the image. In some other embodiments, it also includes a reflection area on the detection plane.

[0098] S105: The controller determines a plurality of actual target points located on the plurality of target area images based on the target area images, wherein one actual target point corresponds to one virtual target point one by one.

[0099] It can be immediately clear that the position corresponding to the actual target is also the actual position of the product. Since there is a corresponding relationship between the virtual target and the actual target, for example, a vertex of the product is the actual target, that is, it is also the actual target in the target area image, and a virtual target on the model is also this vertex, that is, there is a corresponding relationship between this virtual target and the actual target.

[0100] It can be understood that as an implementation method, the controller determines the feature image contained in the target area image, the feature image includes a vertex image, and then the controller marks the location of the vertex image as the actual target point, and matches the feature image with the edge feature, and determines the correspondence between the actual target point and the virtual target point based on the matching result.

[0101] In some other embodiments, the feature image may also include an edge image. The controller matches the edge image with the edge feature, determines the corresponding relationship between the edge image and the edge feature according to the matching result, and then determines the actual target point corresponding to the virtual target point in the edge image according to the corresponding relationship between the edge image and the edge feature.

[0102] S106: The controller obtains the positional relationship between multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified based on the comparison result.

[0103] As an implementation method, the controller can obtain the positional relationship between multiple actual target points, the positional relationship includes the distance between each actual target point, and then the controller obtains the positional relationship between multiple virtual target points, the positional relationship includes the distance between each virtual target point, and finally the controller compares the distance between each actual target point with the distance between each virtual target point based on the correspondence between the virtual target point and the actual target point, and determines whether the mth product to be tested is qualified based on the comparison result.

[0104] The embodiment of the present application proposes a product quality inspection method based on image recognition, wherein the controller obtains multiple inspection images based on a visual sensor, then obtains multiple model features from the multiple inspection images, and constructs a target model based on the model features, then the controller determines multiple virtual target points fixed on the target model on the target model, and obtains the positional relationship between the multiple virtual target points, then the inspection image of the product to be inspected is required to be inspected, and a target area image is obtained based on the i-th inspection image, then the controller determines multiple actual target points located on the multiple target area images based on the target area image, one actual target point corresponds to one virtual target point one by one, finally, the controller obtains the positional relationship between the multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between the multiple virtual targets corresponding to the actual target points, and determines whether the first product to be inspected is qualified according to the comparison result. A product quality inspection method based on image recognition proposed in an embodiment of the present application can quickly establish a model for the products produced on the production line. According to the established model, when a product has a shape defect, its model shape is significantly different from that of other products. Therefore, there is a significant difference between the actual target position on the product and the virtual target position in the model. The size of the difference can be used to determine whether the product is qualified. The product model can be established relatively quickly, and there is no need to perform detailed dimensional measurements on each product, so the inspection speed is relatively fast.

[0105] Based on the same inventive concept, the embodiment of the present application proposes a product quality inspection system based on image recognition, the system includes a controller, a detection plane, a conveying device and a visual sensor, the conveying device is used to sequentially send j products to be inspected to the detection plane, wherein j is a natural number and j≥2, and the system is configured as follows:

[0106] The controller obtains the 1st, 2nd, ...jth detection images based on the visual sensor, and each detection image corresponds to a product to be detected;

[0107] The controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected;

[0108] The controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains a positional relationship between the plurality of virtual target points;

[0109] The controller obtains the i-th detection image, and obtains the target area image based on the i-th detection image, where the target area image is the actual image of the product to be detected in the i-th detection image, where i is a natural number and i≥1;

[0110] The controller determines a plurality of actual target points located on the plurality of target area images based on the target area images, wherein one actual target point corresponds to one virtual target point one by one;

[0111] The controller obtains the positional relationship between multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified based on the comparison result.

[0112] In some embodiments, the system is configured to:

[0113] The controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features. The target model is a virtual model of the product to be detected, including:

[0114] The controller obtains the model features based on the kth detection image and fills the model features into the original model, where k is a natural number and k≥1;

[0115] The controller determines whether the original model is filled. If the original model still has unfilled features, the controller selects another detection image that is not the kth one from the j detection images, obtains model features based on the detection image, and fills the model features into the original model.

[0116] In some embodiments, the controller obtains a plurality of model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected, including:

[0117] The controller determines whether the original model is filled or not. If the original model has become a virtual model with complete model features, the original model is determined to be the target model.

[0118] In some embodiments, the system is configured to:

[0119] The controller obtains multiple model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features. The target model is a virtual model of the product to be detected, including:

[0120] The controller divides the n detection images into n first detection images and n second detection images, wherein the first detection image is a direct image of the product to be detected directly obtained by the visual sensor, and the second detection image is a reflection image of the product to be detected formed on the detection plane obtained by the visual sensor;

[0121] The controller obtains a plurality of model features according to the n first detection images and the n second detection images.

[0122] In some embodiments, the system is configured to:

[0123] The controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains the positional relationship between the plurality of virtual target points, including:

[0124] The controller obtains edge features of the target model, and the edge features include the position of the model vertices and the edge position of each face on the model;

[0125] The controller uses each model vertex as a virtual target;

[0126] The controller selects at least one point at each edge position as a virtual target point.

[0127] In some embodiments, the system is configured to:

[0128] The controller determines a plurality of actual target points located on the plurality of target area images based on the target area images, wherein one actual target point corresponds to one virtual target point one by one, including:

[0129] The controller determines a feature image contained in the target area image, the feature image including a vertex image;

[0130] The controller marks the location of the vertex image as the actual target point, matches the feature image with the edge feature, and determines the corresponding relationship between the actual target point and the virtual target point based on the matching result.

[0131] In some embodiments, the system is configured to:

[0132] The controller determines a plurality of actual target points located on the plurality of target area images based on the target area images, wherein one actual target point corresponds to one virtual target point one by one, including:

[0133] The controller determines a feature image included in the target area image, wherein the feature image includes an edge image;

[0134] The controller matches the edge image with the edge feature, and determines the corresponding relationship between the edge image and the edge feature according to the matching result;

[0135] The controller determines the actual target point corresponding to the virtual target point in the edge image according to the corresponding relationship between the edge image and the edge feature.

[0136] In some embodiments, the system is configured to:

[0137] The controller obtains the positional relationship between multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified according to the comparison result, including:

[0138] The controller obtains the positional relationship between the multiple actual target points, where the positional relationship includes the distance between each of the actual target points;

[0139] The controller obtains the positional relationship between the multiple virtual target points, where the positional relationship includes the distance between each virtual target point;

[0140] Based on the correspondence between the virtual target points and the actual target points, the controller compares the distance between each actual target point with the distance between each virtual target point, and determines whether the mth product to be tested is qualified according to the comparison result.

[0141] The embodiment of the present application proposes a product quality inspection system based on image recognition, wherein the controller obtains multiple inspection images based on a visual sensor, then obtains multiple model features from the multiple inspection images, and constructs a target model based on the model features, then the controller determines multiple virtual target points fixed on the target model on the target model, and obtains the positional relationship between the multiple virtual target points, then the inspection image of the product to be inspected is required to be inspected, and a target area image is obtained based on the i-th inspection image, then the controller determines multiple actual target points located on the multiple target area images based on the target area image, one actual target point corresponds to one virtual target point one by one, finally, the controller obtains the positional relationship between the multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between the multiple virtual targets corresponding to the actual target points, and determines whether the first product to be inspected is qualified according to the comparison result. A product quality inspection method based on image recognition proposed in an embodiment of the present application can quickly establish a model for the products produced on the production line. According to the established model, when a product has a shape defect, its model shape is significantly different from that of other products. Therefore, there is a significant difference between the actual target position on the product and the virtual target position in the model. The size of the difference can be used to determine whether the product is qualified. The product model can be established relatively quickly, and there is no need to perform detailed dimensional measurements on each product, so the inspection speed is relatively fast.

[0142] Based on the same inventive concept, an embodiment of the present application further proposes an electronic device, the electronic device comprising:

[0143] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the product quality inspection method based on image recognition according to an embodiment of the present application.

[0144] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the product quality detection method based on image recognition of the embodiment of the present application is implemented.

[0145] The following is a detailed introduction to the various components of electronic equipment:

[0146] The processor is the control center of the electronic device, which can be a processor or a general term for multiple processing elements. For example, the processor is one or more central processing units (CPUs), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).

[0147] Optionally, the processor can perform various functions of the electronic device by running or executing a software program stored in the memory, and calling data stored in the memory.

[0148] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment and will not be repeated here.

[0149] Optionally, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be integrated with the processor, or may exist independently and be coupled to the processor through an interface circuit of the electronic device, which is not specifically limited in the embodiments of the present invention.

[0150] A transceiver is used to communicate with a network device or a terminal device.

[0151] Optionally, the transceiver may include a receiver and a transmitter, wherein the receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0152] Optionally, the transceiver may be integrated with the processor, or may exist independently and be coupled to the processor via an interface circuit of the router, which is not specifically limited in the embodiment of the present invention.

[0153] In addition, the technical effects of the electronic device can refer to the technical effects of the data transmission method in the above method embodiment, which will not be repeated here.

[0154] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0155] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0156] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When a computer instruction or computer program is loaded or executed on a computer, a process or function according to an embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0157] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0158] In the present invention, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0159] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0160] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

Claims

1. A product quality detection method based on image recognition, characterized in that: Applicable to a product quality inspection system based on image recognition, the system comprises a controller, an inspection plane, a conveying device and a visual sensor, the conveying device is used to sequentially convey j products to be inspected to the inspection plane, wherein j is a natural number and j≥2, the method comprises: The controller acquires the first, second, ...jth detection images based on the visual sensor, and each detection image corresponds to one of the products to be detected; The controller acquires a plurality of model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected; The controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains the positional relationship between the plurality of virtual target points, wherein the controller obtains edge features of the target model, the edge features including the model vertex positions and the edge position of each face on the model; The controller uses each vertex of the model as the virtual target point; The controller selects at least one point at each edge position as the virtual target point; The controller obtains the i-th detection image, and obtains a target area image based on the i-th detection image, wherein the target area image is an actual image of the product to be detected in the i-th detection image, where i is a natural number and i≥1; The controller determines, based on the target area image, a plurality of actual target points located on the plurality of target area images, wherein one actual target point corresponds to one virtual target point in a one-to-one manner; The controller obtains the positional relationship between the multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between the multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified based on the comparison result.

2. The product quality detection method based on image recognition according to claim 1 is characterized in that: The controller obtains a plurality of model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected, including: The controller obtains the model features based on the k-th detection image and fills the model features into the original model, where k is a natural number and k≥1; The controller determines whether the original model is filled. If the original model still has unfilled features, the controller selects another detection image that is not the kth one from the j detection images, obtains the model features based on the detection image, and fills the model features into the original model.

3. A product quality detection method based on image recognition according to claim 2, characterized in that: The controller obtains a plurality of model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected, including: The controller determines whether the original model is filled or not, and if the original model has become a virtual model with complete model features, determines that the original model is the target model.

4. The product quality detection method based on image recognition according to claim 1 is characterized in that: The detection plane is a mirror surface, and the controller obtains a plurality of model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, wherein the target model is a virtual model of the product to be detected, and includes: The controller divides the n detection images into n first detection images and n second detection images, wherein the first detection image is a direct image of the product to be detected directly acquired by the visual sensor, and the second detection image is a reflection image of the product to be detected formed on the detection plane acquired by the visual sensor; The controller obtains a plurality of the model features according to n first detection images and n second detection images.

5. The product quality detection method based on image recognition according to claim 4 is characterized in that: The controller determines, based on the target area image, a plurality of actual target points located on the plurality of target area images, wherein one actual target point corresponds to one virtual target point in a one-to-one manner, including: The controller determines a feature image included in the target area image, wherein the feature image includes a vertex image; The controller marks the location of the vertex image as the actual target point, matches the feature image with the edge feature, and determines the corresponding relationship between the actual target point and the virtual target point according to the matching result.

6. A product quality detection method based on image recognition according to claim 5, characterized in that: The controller determines, based on the target area image, a plurality of actual target points located on the plurality of target area images, wherein one actual target point corresponds to one virtual target point in a one-to-one manner, including: The controller determines a feature image included in the target area image, wherein the feature image includes an edge image; The controller matches the edge image with the edge feature, and determines a corresponding relationship between the edge image and the edge feature according to a matching result; The controller determines the actual target point corresponding to the virtual target point in the edge image according to the corresponding relationship between the edge image and the edge feature.

7. The product quality detection method based on image recognition according to claim 1 is characterized in that: The controller obtains the positional relationship between the multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between the multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified according to the comparison result, including: The controller acquires the positional relationship between the plurality of actual target points, wherein the positional relationship includes the distance between each of the actual target points; The controller acquires the positional relationship between the plurality of virtual target points, wherein the positional relationship includes the distance between each of the virtual target points; The controller compares the distance between each of the actual target points with the distance between each of the virtual target points based on the corresponding relationship between the virtual target points and the actual target points, and determines whether the mth product to be tested is qualified according to the comparison result.

8. A product quality inspection system based on image recognition, characterized in that: The system includes a controller, a detection plane, a conveying device and a visual sensor, wherein the conveying device is used to sequentially convey j products to be detected to the detection plane, wherein j is a natural number and j≥2, and the system is configured as follows: The controller acquires the first, second, ...jth detection images based on the visual sensor, and each detection image corresponds to one of the products to be detected; The controller acquires a plurality of model features based on n detection images, where n is a natural number and n≥1, and constructs a target model based on the model features, where the target model is a virtual model of the product to be detected; The controller determines a plurality of virtual target points fixed on the target model on the target model, and obtains the positional relationship between the plurality of virtual target points, wherein the controller obtains edge features of the target model, the edge features including the model vertex positions and the edge position of each face on the model; The controller uses each vertex of the model as the virtual target point; The controller selects at least one point at each edge position as the virtual target point; The controller obtains the i-th detection image, and obtains a target area image based on the i-th detection image, wherein the target area image is an actual image of the product to be detected in the i-th detection image, where i is a natural number and i≥1; The controller determines, based on the target area image, a plurality of actual target points located on the plurality of target area images, wherein one actual target point corresponds to one virtual target point in a one-to-one manner; The controller obtains the positional relationship between the multiple actual target points, and compares the positional relationship between the multiple actual target points with the positional relationship between the multiple virtual target points corresponding to the actual target points, and determines whether the mth product to be tested is qualified based on the comparison result.

Citation Information

Patent Citations

  • Product quality defect intelligent detection method and system based on AI image recognition

    CN115564707A

  • PCB detection method and system based on visual neural network algorithm

    CN117893513A