Product detection method and device, electronic equipment and storage medium

By using a comparison method between a target template image and the image to be inspected in product inspection, the reliability and accuracy of product inspection are improved, the problem of manual inspection being easily affected by personal factors is solved, and higher inspection accuracy and stability are achieved.

CN115631169BActive Publication Date: 2026-04-24EVOC SMART IOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
EVOC SMART IOT TECH CO LTD
Filing Date
2022-10-27
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

The reliability of product testing results in existing technologies is poor, mainly because manual testing is easily affected by personal factors, resulting in unstable and unreliable test results.

Method used

The target element in the target template image is compared with the element to be detected in the image to be detected. By acquiring the image to be detected and comparing the target element in the target template image with the element to be detected in the image to be detected, the target detection result is obtained.

Benefits of technology

It improves the accuracy and reliability of product testing results, solves the problem of poor reliability of product testing results, and achieves higher testing accuracy and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115631169B_ABST
    Figure CN115631169B_ABST
Patent Text Reader

Abstract

The application is suitable for the product detection technical field, and provides a product detection method and device, electronic equipment and storage medium, wherein the method comprises: acquiring a to-be-detected image, wherein the to-be-detected image is an image corresponding to a to-be-detected product, and the to-be-detected image comprises a to-be-detected element; comparing a target element of a target template image with the to-be-detected element of the to-be-detected image to obtain a target detection result, wherein the target template image comprises the target element, and the target element corresponds to the to-be-detected element. Through the embodiment, the problem that the product detection result has poor reliability in the product detection method in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of product testing technology, and in particular to a product testing method, apparatus, electronic device and storage medium. Background Technology

[0002] In reality, with the continuous rise in labor costs and the gradual emergence of new processes and technologies, the transformation and upgrading of production for domestic manufacturing enterprises is becoming increasingly urgent. For labor-intensive enterprises, the most crucial transformation at present is to achieve automation and intelligence; replacing manual production with automated equipment and intelligent factories is the fundamental way to transform and upgrade. Currently, in the assembly process of product manufacturing (e.g., television sets), the defect detection of components (e.g., screws, clips, tapes) still requires manual visual inspection to control product quality.

[0003] However, manual testing results are not highly reliable and stable because each person has different evaluation criteria and human sensory judgment is easily affected by subjective factors such as personal state and emotions.

[0004] This shows that the product testing methods in the relevant technologies have the problem of poor reliability of product testing results. Summary of the Invention

[0005] In view of this, the embodiments of this application provide a product testing method, apparatus, electronic device and storage medium, which can solve the problem of poor reliability of product testing results in related technologies.

[0006] A first aspect of this application provides a method comprising: acquiring an image to be detected, wherein the image to be detected is an image corresponding to a product to be detected, and the image to be detected includes a component to be detected; comparing a target component of a target template image with the component to be detected in the image to be detected to obtain a target detection result, wherein the target template image includes a target component, and the target component corresponds to the component to be detected.

[0007] A second aspect of this application provides an apparatus comprising: an acquisition unit for acquiring an image to be detected, wherein the image to be detected is an image corresponding to a product to be detected, and the image to be detected includes an element to be detected; and a comparison unit for comparing a target element of a target template image with the element to be detected in the image to be detected to obtain a target detection result, wherein the target template image includes a target element, and the target element corresponds to the element to be detected.

[0008] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect above.

[0009] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect above.

[0010] A fifth aspect of this application provides a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in any one of the first aspects.

[0011] The beneficial effects of this application embodiment compared with the prior art are as follows: It employs a method of comparing the target element in the target template image with the element to be detected in the image to be detected, thereby detecting the element to be detected. This involves acquiring the image to be detected, which is an image corresponding to the product to be detected and includes the element to be detected; comparing the target element in the target template image with the element to be detected in the image to obtain the target detection result, where the target template image includes the target element, and the target element corresponds to the element to be detected; and displaying the target detection result. Because the detection result is obtained by comparing the target element in the target template image with the element to be detected, the accuracy and reliability of the determined detection result can be improved, thus solving the problem of poor reliability of product detection results in related technologies. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0013] Figure 1 This is a schematic diagram of the hardware environment of an optional product testing method according to an embodiment of this application;

[0014] Figure 2 This is a flowchart illustrating an optional product testing method according to an embodiment of this application;

[0015] Figure 3 This is a schematic diagram of a product testing method according to an embodiment of this application;

[0016] Figure 4 This is a schematic diagram of obtaining the component frame corresponding to the component to be detected according to an embodiment of this application;

[0017] Figure 5 This is a flowchart illustrating another optional product testing method according to an embodiment of this application;

[0018] Figure 6 This is a flowchart illustrating another optional product testing method according to an embodiment of this application;

[0019] Figure 7 This is a structural block diagram of an optional product testing device according to an embodiment of this application;

[0020] Figure 8 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0021] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0022] To illustrate the technical solution described in this application, specific embodiments are provided below.

[0023] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0024] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0025] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0026] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0027] Furthermore, in the description of this application, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0028] According to one aspect of the embodiments of this application, a product testing method is provided. Optionally, in this embodiment, the above-described product testing method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, terminal device 102 is connected to server 104 via a network and can be used to provide services (such as application services) to terminal device 102 or clients installed on terminal device 102. A database can be set up on the server or independently of the server to provide data storage services to server 104.

[0029] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wireless Fidelity (WIFI), Bluetooth. The terminal device 102 may be, but is not limited to, devices such as smartphones, smart computers, and smart tablets.

[0030] The product testing method of this embodiment can be executed by server 104, by terminal device 102, or by both server 104 and terminal device 102. Taking the execution of the product testing method of this embodiment by terminal device 102 as an example... Figure 2 This is a schematic flowchart of an optional product testing method according to an embodiment of this application, such as... Figure 2 As shown, the process of this method may include the following steps:

[0031] Step S202: Obtain the image to be detected, wherein the image to be detected is the image corresponding to the product to be detected, and the image to be detected includes the component to be detected.

[0032] The product testing method in this embodiment can be applied to scenarios where components in a product are inspected. These components can be electronic or physical components, and this embodiment does not limit the scope of the inspection. For example, when the product is a television set, the components can be clips or other fasteners (an example of electronic components) or adhesive tape, screws, or other physical components (an example of physical components).

[0033] Optionally, the process of acquiring the image to be inspected described above can be as follows: when the product to be inspected passes through the sensor, the sensor sends an image acquisition command to the image acquisition unit, and the image acquisition unit acquires the image to be inspected to obtain the image to be inspected. For example, such as Figure 3 As shown, where, Figure 3 (1) A television set; Figure 3 (2) It is a bar light source; Figure 3 (3) For camera; Figure 3 (4) It is an industrial control computer; Figure 3 (5) It is a photoelectric sensor, which can be used to push the TV into position by a cylinder after the TV arrives at the positioning mechanism through the assembly line. Figure 3 The testing equipment shown tests the television. If the test result is NG (NOT GOOD), an alarm will be triggered by a three-color alarm light.

[0034] Optionally, the aforementioned sensor can be a photoelectric sensor; the aforementioned image acquisition command can be a trigger signal sent by the photoelectric sensor, or it can be a voltage change generated by the photoelectric sensor; this embodiment does not limit this. For example, such as Figure 3 As shown, three cameras can be fixedly mounted directly above the inspection station along the vertical direction of the production line, and five photoelectric sensors can be mounted along the edge of the production line. When no television is passing by, the photoelectric sensors generate a high-level signal; when a television passes by, the photoelectric sensors generate a low-level signal. Each photoelectric sensor generates a trigger signal when it transitions from a high to a low level. After the photoelectric sensor sends the trigger signal to the industrial control computer, the industrial control computer can output a control signal through the IO (Input / Output) board to turn on the light source located directly above the television's back panel, and then send a soft trigger signal to the camera to capture a digital image of the television's back panel. Each time the television passes a photoelectric sensor, the photoelectric sensor triggers three cameras to take a picture. That is, during the process of the television passing through the five photoelectric sensors in sequence, 15 images will be captured (i.e., 3 x 5 = 15).

[0035] Optionally, the acquisition range of the image to be detected can be greater than or equal to the size of the television. When there are multiple images to be detected, the acquisition range of the image to be detected refers to the sum of the acquisition ranges corresponding to the multiple images. For example, when the field of view of each camera is 400x330 mm and the distance between each pair of cameras is 300 mm, the three cameras can cover a width of (300x2+330)=930 mm in the longitudinal direction; when the installation interval between each pair of photoelectric sensors is 330 mm, the coverage length of the five photoelectric sensors is (330x4+400)=1720 mm. One photoelectric sensor triggers three cameras to take pictures once, generating three images. The five photoelectric sensors can take a total of 15 images, which can detect televisions up to 75 inches, thereby realizing the large field of view detection of televisions.

[0036] Optionally, when the image to be detected does not contain the element to be detected, the image to be detected can be discarded directly and no detection is performed on it.

[0037] Step S204: Compare the target element in the target template image with the element to be detected in the image to obtain the target detection result. The target template image includes the target element, and the target element corresponds to the element to be detected.

[0038] Since most defects in components under test occur during the installation process, and these defects are usually due to incorrect placement or omission, these issues can generally be identified through image recognition. Therefore, the installation status of the component under test can be determined by inspecting the image.

[0039] Optionally, the above process of determining whether the component to be detected is installed correctly by detecting the image to be detected can be as follows: the target component in the target template image is compared with the component to be detected in the image to be detected to obtain the target detection result. The target template image includes the target component, and the target component corresponds to the component to be detected.

[0040] Optionally, the process of comparing the target element in the target template image with the element to be detected in the image to obtain the target detection result can be as follows: first, determine the position of the element to be detected in the image to be detected; then, compare the first region corresponding to the element to be detected with the second region corresponding to the target element to determine the similarity between the first and second regions. When the determined similarity is greater than or equal to a preset similarity, the element to be detected can be considered to be consistent with the target element (i.e., the element to be detected is correctly installed in the product to be detected, or the element to be detected passes the detection); when the determined similarity is less than the preset similarity, the element to be detected can be considered to be inconsistent with the target element (i.e., the element to be detected is incorrectly installed in the product to be detected, or the element to be detected fails the detection).

[0041] It should be noted that the first position of the target element in the target template image and the second position of the element to be detected in the image to be detected are not completely consistent. Therefore, determining the region corresponding to the element to be detected based on the first position in the image to be detected may result in the determined region not including the element to be detected. For example, when the target element is located at (2,2) in the target template image and the element to be detected is located at (2,4) in the image to be detected, directly determining the region at (2,2) in the image to be detected as the region corresponding to the element to be detected may result in the determined region including the element to be detected, or the included element to be detected may be incomplete, thus making it impossible to compare the element to be detected and determine the detection result. Therefore, it is advisable to first determine a positioning point in the target template image and the relative position of the target element with respect to the positioning point, then determine the position of the positioning point in the image to be detected, and finally determine the position of the element to be detected from the image to be detected based on the relative position of the target element with respect to the positioning point, thereby enabling accurate comparison of the element to be detected and determining the detection result.

[0042] Optionally, the process of determining the location of the positioning point in the image to be detected can be as follows: based on the image features of the positioning point, perform image recognition in the image to be detected, and determine the location of the positioning point as the location of the positioning point in the image to be detected that has the same image features as the positioning point in the target template image.

[0043] Through the above steps S202 to S204, by acquiring the image to be detected, wherein the image to be detected is the image corresponding to the product to be detected, and the image to be detected includes the component to be detected; by comparing the target component of the target template image with the component to be detected in the image to be detected, the target detection result is obtained, wherein the target template image includes the target component, and the target component corresponds to the component to be detected, thereby solving the problem of poor reliability of product detection results in related technologies and improving the reliability of product detection results.

[0044] In one exemplary embodiment, acquiring an image to be detected includes: detecting the product to be detected using a photoelectric sensor to obtain a detection signal; and, if the signal type of the detection signal is a target signal type, controlling an image acquisition component to perform an image acquisition operation on the product to be detected to obtain the image to be detected.

[0045] When the product to be detected is transmitted to the photoelectric sensor, it blocks the amount of light received by the sensor. Since the voltage of the photoelectric sensor is related to the amount of light received, the sensor will output a high level when the amount of light received is high, and a low level when the amount of light received is low. Therefore, an image can be acquired using the photoelectric sensor and the image acquisition component.

[0046] Optionally, the process of acquiring the image to be acquired using the photoelectric sensor and the image acquisition component can be as follows: first, the photoelectric sensor detects the product to be inspected to obtain a detection signal; then, if the signal type of the detection signal is the target signal type, the image acquisition component is controlled to perform an image acquisition operation on the product to be inspected to obtain the image to be inspected. The target signal type refers to the signal output by the photoelectric sensor changing from a high level to a low level. That is, the image acquisition component is controlled to perform an image acquisition operation on the product to be inspected to obtain the image to be inspected only when the signal output by the photoelectric sensor changes from a high level to a low level.

[0047] Optionally, the image acquisition component can be a camera or a webcam. In this embodiment, the type of image acquisition component is not limited.

[0048] It should be noted that the aforementioned photoelectric sensor can be multiple sensors, and the aforementioned image acquisition component can also be multiple. For example, when the detection signal type sent by the photoelectric sensor is the target signal type, multiple image acquisition devices can be controlled to simultaneously perform image acquisition operations on the product to be detected, resulting in multiple acquired images. Optionally, to better distinguish between the multiple acquired images, different image identifiers can be set for the multiple acquired images. For example, the image identifier corresponding to image 1 can be 1-1 (i.e., image 1 is an image triggered by sensor 1 and acquired by camera 1), the image identifier corresponding to image 2 can be 2-1 (i.e., image 2 is an image triggered by sensor 2 and acquired by camera 1), and so on, setting a corresponding image identifier for each of the multiple acquired images.

[0049] In this embodiment, the product to be tested is first detected by a photoelectric sensor to obtain a detection signal. When the signal type of the detection signal is the target signal type, the image acquisition component is controlled to perform an image acquisition operation on the product to be tested to obtain the image to be tested. This can improve the accuracy of the acquired image and thus improve the detection accuracy of the product to be tested.

[0050] In an exemplary embodiment, the method of obtaining a target detection result by comparing the target element of the target template image with the element to be detected in the image to be detected includes: determining the first element to be detected frame corresponding to the element to be detected from the image to be detected based on the first position information of the first positioning point in the target template image and the first element frame information corresponding to the first reference element, wherein the first reference element is a reference element in the target template image corresponding to the element to be detected, the first element frame includes the first reference element, the first element frame information includes the second position information of the first element frame and the first size information of the first element frame, and the target element includes the first reference element; cropping the first element to be detected frame from the image to be detected to obtain a first region of interest image; inputting the first region of interest image into a target recognition model to obtain a first confidence factor corresponding to the element to be detected, wherein the first confidence factor is used to indicate the target detection result, and the target recognition model is used to identify whether the element to be detected in the first region of interest meets a preset standard.

[0051] Since the position of the target element in the target template image may not be consistent with the position of the element to be detected in the image to be detected, for example, the position of the target element in the target template image may be (2,2). If the element at position (2,2) in the image to be detected is directly regarded as the element to be detected, errors may occur.

[0052] Since the relative position of the target element and the specified location is fixed, the position of the element to be detected can be determined from the image to be detected using a fixed position. Optionally, the first element frame corresponding to the element to be detected can be determined from the image to be detected based on the first position information of the first positioning point in the target template image and the first element frame information corresponding to the first reference element. The first reference element is a reference element in the target template image that corresponds to the element to be detected. The first element frame includes the first reference element, and the first element frame information includes the second position information and the first size information of the first element frame. The target element includes the first reference element.

[0053] Optionally, the first element frame may be the smallest element frame including the first reference element, that is, each edge of the first element frame is tangent to the first reference element.

[0054] Optionally, the first position information can be the position coordinates of the first positioning point in the coordinate system corresponding to the target template image, and the second position information can be the position coordinates of the first specified point on the first component frame in the target template image. The first specified point can be the center point of the first component frame, one of the four intersection points of the first component frame, or other points; this embodiment does not limit this. The first size information can be the length and width information of the first component frame (i.e., the length and width of the first component frame). The coordinate system corresponding to the target template image can be a coordinate system established with the second specified point in the target template image as the origin. The second specified point can be the center point of the target template image, one of the four intersection points of the target template image, or other points; this embodiment does not limit this.

[0055] For example, such as Figure 4 As shown, Figure 4 (a) is the first element frame corresponding to the target element, and point 1 is the location of the positioning point. Figure 4 (b) is the first detection element bounding box corresponding to the element to be detected. Since the relative position of point 1 in the target template image and the first element bounding box is fixed, after point 1 is determined in the image to be detected, the first detection element bounding box can be determined from the image to be detected based on the relative position of point 1 and the first element bounding box.

[0056] Optionally, after determining the first detection element bounding box corresponding to the detection element in the image to be detected, the first detection element bounding box can be cropped from the image to be detected to obtain a first region of interest image. When the image to be detected includes multiple detection elements, the aforementioned first region of interest image can be multiple region of interest images.

[0057] After determining the first region of interest (ROI) image, it can be input into the target recognition model to obtain a first confidence factor corresponding to the element to be detected. This first confidence factor indicates the target detection result, and the target recognition model is used to identify whether the element to be detected in the first ROI meets the preset criteria. For example, the determined ROI can be corrected by the affine transformation operator vector_angle_to_rigid in Halcon (a machine vision algorithm) and then recognized by the trained snap-fit ​​model. After recognition, the model will generate a confidence factor score, which ranges from 0 to 1. The closer to 1, the more accurate the recognition. If the confidence factor score is above 0.9 (set manually), it means the snap-fit ​​passes the test (i.e., the snap-fit ​​installation is unqualified); otherwise, it means the snap-fit ​​fails the test (i.e., the snap-fit ​​installation is unqualified).

[0058] In this embodiment, the first detection element bounding box corresponding to the detection element is first determined from the detection image by positioning points, then the first detection element bounding box is cropped from the detection image to obtain the first region of interest image, and finally the first region of interest image is detected to determine the first confidence factor corresponding to the detection element, which can improve the reliability of the determined detection results.

[0059] In an exemplary embodiment, before inputting the first region of interest image into the target recognition model to obtain the target detection result, the method further includes: acquiring a target sample image, wherein the target sample image includes multiple sample images; dividing the target sample image into a first sample image and a second sample image, wherein the position of the element to be detected in the first sample image in the product to be detected conforms to preset parameters, and the position of the element to be detected in the second sample image in the product to be detected does not conform to preset parameters; inputting the first sample image and the second sample image into a deep learning model, and learning according to a preset learning factor and a preset number of iterations to obtain a target recognition model.

[0060] In this embodiment, before inputting the first region of interest image into the target recognition model to obtain the target detection result, a deep learning model can be used to generate the target recognition model. Deep learning refers to a collection of algorithms that use various machine learning algorithms on multi-layered neural networks to solve various problems such as images and text. While deep learning can be broadly categorized as a neural network, its specific implementation varies considerably. The core of deep learning is feature learning, which aims to acquire hierarchical feature information through layered networks, thereby solving the significant challenge of manually designing features in the past.

[0061] Optionally, the process of using a deep learning model to generate an object recognition model can be as follows: First, acquire target sample images, which include multiple sample images. For example, the buckle frame can be manually extracted, and the x and y coordinates of the top-left corner of the frame, the length L and width W of the frame, a total of four parameters, can be output to a specified configuration file for storage. Then, the buckle samples can be labeled as NG samples and OK samples.

[0062] Optionally, after acquiring the target sample image, it can be divided into a first sample image and a second sample image. The position of the component to be tested in the product under test in the first sample image conforms to preset parameters, while the position of the component to be tested in the product under test in the second sample image does not conform to the preset parameters. For example, if the preset parameter is that the straight-line distance between the actual installation position of the component to be tested in the product under test and the pre-set installation position should not exceed 2mm, and the straight-line distance between the actual installation position of the component to be tested in the product under test and the pre-set installation position is 3mm, then it can be determined that the component to be tested is installed incorrectly, and the sample image corresponding to this component is the second sample image.

[0063] After determining the first and second sample images, they can be input into a deep learning model and trained according to a preset learning factor and a preset number of iterations to obtain a target recognition model. For example, after marking the buckle (screw / tape) samples, the model's learning factor (set to 0.05) and number of iterations (set to 100) parameters can be set. Finally, the deep learning model is trained, and the buckle (screw / tape) deep learning model is automatically saved after training.

[0064] In this embodiment, by iterating the deep learning model based on image samples, the accuracy of the generated target recognition model can be improved, thereby improving the accuracy of the determined detection results.

[0065] In an exemplary embodiment, the target detection result is obtained by comparing the target element of the target template image with the element to be detected in the image to be detected. This includes: determining the second element frame corresponding to the element to be detected from the image to be detected based on the third position information of the second positioning point in the target template image and the second element frame information of the second element frame corresponding to the second reference element. The second reference element is a reference element in the target template image that corresponds to the element to be detected. The second element frame includes the second reference element. The second element frame information includes the fourth position information and the second size information of the second element frame. The target element includes the second reference element. The second element frame is cropped from the image to be detected to obtain a second region of interest image. The first and second marker lines in the element to be detected in the second region of interest image are calculated. The first and second marker lines are used to determine the position of the element to be detected in the second region of interest image. The target difference between the first and second marker lines is calculated according to an edge pairing algorithm. The second confidence factor corresponding to the element to be detected is determined based on the target difference and the preset difference corresponding to the target template image. The second confidence factor is used to indicate the target detection result.

[0066] In this embodiment, the position of the element to be detected can be determined from the image to be detected by a fixed position. Optionally, the second element frame corresponding to the element to be detected can be determined from the image to be detected based on the third position information of the second positioning point in the target template image and the second element frame information of the second element frame corresponding to the second reference element. The second reference element is a reference element in the target template image that corresponds to the element to be detected. The second element frame includes the second reference element. The second element frame information includes the fourth position information of the second element frame and the second size information of the second element frame. The target element includes the second reference element. The second positioning point and the first positioning point can be the same positioning point or different positioning points. The second reference element and the first reference element can be the same reference element or different reference elements. This embodiment does not limit this.

[0067] Optionally, the process of determining the second detection element frame corresponding to the element to be detected from the image to be detected based on the third position information of the second positioning point in the target template image and the second element frame information corresponding to the second reference element is similar to the process of determining the first detection element frame corresponding to the element to be detected from the image to be detected based on the first position information of the first positioning point in the target template image and the first element frame information corresponding to the first reference element. This will not be described in detail in this embodiment.

[0068] Optionally, after determining the second detection element frame, the second detection element frame can be cropped from the image to be detected to obtain a second region of interest image. The process of cropping the second detection element frame from the image to be detected to obtain a second region of interest image is similar to the process of cropping the first detection element frame from the image to be detected to obtain a first region of interest image. This embodiment does not limit this process.

[0069] After determining the second region of interest (ROI) image, a first marker line and a second marker line can be calculated for the element to be detected within the ROI image. These first and second marker lines are used to determine the position of the element to be detected within the ROI image. For example, the female end line (first marker line) and male end line (second marker line) of a snap-fit ​​element can be determined using an image recognition algorithm, which can be a feature-point based image recognition algorithm.

[0070] After determining the first and second marker lines, the target difference between them can be calculated using an edge pairing algorithm. The aforementioned edge pairing algorithm is an algorithm for extracting straight lines from an image. For example, it could be the Hough algorithm, whose main steps include: 1. Converting the color image to grayscale; 2. Denoising (Gaussian kernel); 3. Edge extraction (gradient operator, Laplacian operator, Canny, Sobel); 4. Binarization (to determine if a point is an edge, check if the grayscale value is equal to 255); 5. Mapping to Hough space (prepare two containers, one to display the Hough space overview, and one array `hough-space` to store voting values, because the voting process often has a maximum value exceeding the threshold, reaching thousands, which cannot be directly recorded using a grayscale image); 6. Taking local maxima, setting thresholds, and filtering out interfering lines; 7. Drawing straight lines and labeling corner points.

[0071] Optionally, after determining the target difference between the first and second marker lines, a second confidence factor corresponding to the element to be detected can be determined based on the target difference and the preset difference corresponding to the target template image. This second confidence factor is used to indicate the target detection result. For example, the extracted ROI region can be corrected by the affine transformation operator `vector_angle_to_rigid` in Halcon, and then the `find_ncc_model` operator in Halcon can be called to perform NCC matching. The marker line error is calculated, and if the error range is within 1 mm, the snap-fit ​​is considered to be in place; otherwise, the snap-fit ​​is considered NG.

[0072] In this embodiment, the second detection element bounding box corresponding to the detection element is first determined from the detection image by positioning points. Then, the second detection element bounding box is extracted from the detection image to obtain the second region of interest image. Image recognition is performed on the second region of interest image to determine the target difference between the first and second marker lines of the detection element. Finally, based on the target difference and the preset difference, the second confidence factor corresponding to the detection element is determined, which can improve the reliability of the determined detection results.

[0073] In an exemplary embodiment, before comparing the target element of the target template image with the target element of the image to be detected to obtain the target detection result, the method further includes: searching in a target mapping table based on the target identification information of the image to be detected, wherein the target mapping table stores the correspondence between multiple image identification information and multiple template images, and the multiple image identification information corresponds one-to-one with the multiple template images; and determining the template image corresponding to the image identification information that matches the target identification information among the multiple image identification information as the target template image.

[0074] Since different images to be detected may correspond to different template images, after determining the target template image corresponding to the image to be detected, the target elements of the target template image and the elements to be detected in the image to be detected are compared to obtain the target detection result.

[0075] Optionally, the process of determining the target template image corresponding to the image to be detected can be as follows: based on the target identification information of the image to be detected, a search is performed in a target mapping table. The target mapping table stores the correspondence between multiple image identification information and multiple template images, with each image identification information corresponding to a specific template image. For example, when the image identification of the image to be detected is 1-2 (i.e., image 1 is an image triggered by sensor 1 and acquired by camera 2), the template image corresponding to identification 1-2 can be searched in the target mapping table (images captured by cameras at different locations will differ).

[0076] Optionally, the template image corresponding to the image identifier information that matches the target identifier information from among the multiple image identifier information can be determined as the target template image. For example, after determining the image identifier information that matches 1-2 (i.e., the target identifier information mentioned above), the template image corresponding to that identifier information can be determined as the target template image.

[0077] Optionally, each of the above template images can carry matching configuration parameters, which can include at least one of the following: coordinate parameters of the positioning points in the template image, the number of target elements included in the template image, coordinate parameters of the target element box corresponding to the target element, and size parameters (when there are multiple target elements, there will also be multiple coordinate parameters and size parameters).

[0078] In this embodiment, the target template image is determined from multiple template images based on the identification information of the image to be detected, which can improve the accuracy of the target template image determination and thus improve the accuracy of the target detection results.

[0079] In one exemplary embodiment, after obtaining the target detection result, the method further includes displaying the target detection result.

[0080] In real-time production, products that are found to be defective need to be removed promptly.

[0081] Optionally, the process of displaying the target detection results can be as follows: displaying the target detection results through a warning light, displaying the target detection results through a display screen on a terminal device, or displaying the target detection results through an audio device. For example, when the target detection result indicates that the component to be repaired has passed the test, the warning light can be displayed as green; when the target detection result indicates that the component to be repaired has failed the test, the warning light can be displayed as red.

[0082] Optionally, when the process of displaying the target detection results involves displaying the target detection results through a display screen on a terminal device, the target detection results can be sent to the terminal device first, and then the terminal device can display the target detection results.

[0083] Displaying the target detection results includes: displaying the target detection results on the display component of the terminal device; or displaying the target detection results through indicator lights; or displaying the target detection results through a sound playback device.

[0084] In this embodiment, after obtaining the target detection result, the target detection result can be displayed. Optionally, the process of displaying the target detection result can be: displaying the target detection result on the display component of the terminal device; or displaying the target detection result through an indicator light; or displaying the target detection result through a sound playback device. This embodiment does not limit the method.

[0085] Optionally, the process of displaying the target detection results on the display component of the terminal device can be as follows: first, the target detection results are sent to the terminal device, and then the terminal device displays the target detection results on the display component.

[0086] Optionally, since there is a risk that the target detection results may be stolen during the process of sending the target detection results to the terminal device, the target detection results may be encrypted before being sent to the terminal device to reduce the risk of leakage after the target detection results are stolen. The above-mentioned encryption process of the target detection results may be: encrypting the target detection results using an image encryption algorithm, which includes, but is not limited to, at least one of the following: chaos-based encryption, permutation encryption, optical encryption, DNA (deoxyribonucleic acid)-based encryption, frequency-based encryption, hash-based encryption, evolutionary encryption, bit-plane encryption, dual (multi) image encryption, and scrambling-based image encryption.

[0087] This embodiment displays the target detection results in multiple ways, enabling users to obtain the results more promptly and improving the user experience.

[0088] The product detection method in this application embodiment is explained below with reference to optional examples. In this optional example, the first component to be detected is a snap-fit ​​box, and the target template image is an NCC (normalized crosscorrelation) template.

[0089] In related technologies, major TV brands currently outsource TV manufacturing to contract manufacturers. However, these contract manufacturers, lacking the necessary technical expertise and funding, primarily rely on manual inspection of screws, tapes, and clips. Quality inspectors must stand beside the assembly line, facing TV back panels of different sizes, checking each one for missing screws, tapes, and clips. Qualified products are released, while defective ones are repaired. This inspection method requires production line workers to maintain constant focus and concentration, and their eyes are exposed to strong lighting for extended periods. Working under such high intensity for long hours easily leads to fatigue, affecting quality control judgments and ultimately resulting in a low product pass rate. Furthermore, this method is inefficient and costly.

[0090] To address the aforementioned issues, this optional example proposes a product inspection method. For screws of different specifications, these inspection items are continuously trained, allowing for continuous model optimization and improved matching accuracy. This method features fast convergence, good real-time performance, and the ability to quickly identify the area with the highest similarity to the template, ultimately determining whether the screws, tape, and clips are correctly installed. Deep learning can continuously train and optimize the inspection model by collecting on-site images. Based on images from the back of the TV, inspection items are accurately located and identified, significantly improving the discrimination speed and recognition accuracy of screws, clips, and tape on the production line. The aforementioned "flying camera" mode refers to performing visual inspection simultaneously on the production line without stopping, effectively improving inspection efficiency.

[0091] The key feature of this optional embodiment lies in utilizing deep learning algorithms for screw, clip, and tape detection. It checks the position and quantity of tape applied to the internal wiring to ensure consistency with the specified wiring. Modeling is required based on the actual machine model, and images need to be positioned. A unique marker in each image is selected as the positioning identifier. This positioning identifier refers to a unique mark on each image, which can be text, patterns, arrows, or components, etc. Generally, only one positioning point is needed per image.

[0092] Combination Figure 5 As shown, when the component to be tested is a snap-fit, the product testing method in this optional example may include the following steps:

[0093] Step S502, Begin.

[0094] Step S504: Load the image to be tested.

[0095] Step S506: Automatically read configuration parameters.

[0096] You can manually extract the snap-fit ​​frame and output the x and y coordinates of the top left corner of the frame, the length L and width W of the frame, and save them to a specified configuration file.

[0097] Step S508: Automatically read in the NCC template.

[0098] Step S510: Automatically load the deep learning model.

[0099] The deep learning template described above can automatically determine whether the components are installed correctly based on the input component images.

[0100] Step S512: Obtain the number of buckles in the image to be tested according to the configuration parameters.

[0101] The configuration parameters mentioned above contain the number of clips in the template image corresponding to the image to be tested. Since the template image corresponds to the image to be tested, it can be regarded as the configuration parameters containing the number of clips in the image to be tested.

[0102] Step S514: Determine if the number of buckles in the image to be tested is 0. If yes, proceed to step S532; otherwise, proceed to step S516.

[0103] Step S516: NCC positioning template matching to obtain the coordinates of the positioning points in the image to be tested.

[0104] It can automatically read the configuration parameters from the configuration file and accurately locate the position of each detection target. The aforementioned detection targets can be detection elements (i.e., clips) in the image to be tested.

[0105] Step S518: When the detection mode for the buckle is the marker line mode, proceed to step S520.

[0106] Step S520: Perform affine transformation correction based on configuration parameters and positioning point coordinates, and automatically extract the snap-fit ​​ROI area.

[0107] It can automatically read the configuration parameters in the configuration file, accurately locate the position of each detection target, and then the program automatically extracts the ROI region according to the parameters in the configuration file.

[0108] Step S522: Perform NCC matching on the snap-fit ​​ROI area.

[0109] After the ROI region is corrected by the affine transformation operator vector_angle_to_rigid in Halcon, the find_ncc_model operator in Halcon is called to perform NCC matching.

[0110] Step S524: Calculate the difference between the two marker lines according to the edge pair algorithm.

[0111] The error of the marker line can be calculated based on the edge pair algorithm. If the error is within 1 mm, the buckle is considered to be in place, indicating that the buckle is PASS; otherwise, the buckle is NG.

[0112] Step S526: When the detection mode for the buckle is deep learning mode, proceed to step S528.

[0113] Step S528: Perform affine transformation correction based on configuration parameters and positioning point coordinates, and automatically extract the snap-fit ​​ROI area.

[0114] It can automatically read the configuration parameters in the configuration file, accurately locate the position of each detection target, and then the program automatically extracts the ROI region according to the parameters in the configuration file.

[0115] Step S530: Deep learning matching to obtain OK / NG and confidence factors.

[0116] After the ROI region is corrected by the affine transformation operator vector_angle_to_rigid in Halcon, it is identified by the trained snap-fit ​​model. After identification, the model will generate a confidence factor score, which ranges from 0 to 1. The closer to 1, the more accurate the identification. If the confidence factor score is above 0.9 as manually set, it means that the snap-fit ​​is PASS; otherwise, it means that the snap-fit ​​is NG.

[0117] Step S532, return to normal.

[0118] If the component to be tested (i.e., the clip) is not present in the image to be tested, it can return to normal.

[0119] Step S534: Return the test results.

[0120] The detection results of the image to be tested can be returned.

[0121] Step S536, End.

[0122] Combination Figure 6 As shown, when the component to be inspected is a screw / tape, the product inspection method in this optional example may include the following steps:

[0123] Step S602, Begin.

[0124] Step S604: Load the image to be tested.

[0125] Step S606: Automatically read configuration parameters.

[0126] You can manually extract the snap-fit ​​frame and output the x and y coordinates of the top left corner of the frame, the length L and width W of the frame, and save them to a specified configuration file.

[0127] Step S608: Automatically read in the NCC template.

[0128] The NCC template here refers to the template corresponding to the image to be tested, that is, the target template image.

[0129] Step S610: Automatically read in the tape / screw deep learning template.

[0130] The deep learning template described above can automatically determine whether the components are installed correctly based on the input component images.

[0131] Step S612: Obtain the number of tapes / screws in the image to be tested according to the configuration parameters.

[0132] The configuration parameters mentioned above contain the number of tapes / screws in the template image corresponding to the image to be tested. Since the template image corresponds to the image to be tested, it can be regarded as the configuration parameters containing the number of tapes / screws in the image to be tested.

[0133] Step S614: Determine if the number of tapes / screws in the image to be tested is 0. If yes, proceed to step S624; otherwise, proceed to step S616.

[0134] Step S616: NCC positioning template matching to obtain the coordinates of the positioning points in the image to be tested.

[0135] It can automatically read the configuration parameters from the configuration file and accurately locate the position of each detection target. The aforementioned detection targets can be detection elements (i.e., tape / screws) in the image to be tested.

[0136] Step S618: Perform affine transformation correction based on configuration parameters and positioning point coordinates, and automatically extract the snap-fit ​​ROI area.

[0137] It can automatically read the configuration parameters in the configuration file, accurately locate the position of each detection target, and then the program automatically extracts the ROI region according to the parameters in the configuration file.

[0138] It should be noted that black screws require image equalization processing. This process effectively resolves the issue of uneven lighting in the image, thereby improving the success rate of template matching. The image equalization processing method is shown in the following formula:

[0139]

[0140] The specific process is shown below, where S is the total number of pixels. is the maximum value of a pixel (255 for an 8-bit grayscale image), and h(i) is the total number of pixels in the image with a value of i and values ​​less than i. Z is a gray level of the output image, and Z is a gray level of the input image.

[0141] Step S620: Deep learning matching to obtain OK / NG and confidence factors.

[0142] After the ROI region is corrected by the affine transformation operator vector_angle_to_rigid in Halcon, it is identified by the trained snap-fit ​​model. After identification, the model will generate a confidence factor score, which ranges from 0 to 1. The closer to 1, the more accurate the identification. If the confidence factor score is above 0.9 as manually set, it means that the snap-fit ​​is PASS; otherwise, it means that the snap-fit ​​is NG.

[0143] Step S622: Return the test results.

[0144] Step S624, return to normal.

[0145] If the component under test (i.e., tape / screw) is not present in the image under test, the system can return to normal.

[0146] Step S626, End.

[0147] This optional example provides a product inspection method that processes images while they are being taken. The system outputs inspection results as the TV leaves the production station, enabling rapid inspection of fasteners, screws, tape, and clips on the TV back panel to ensure proper installation. By using machine vision to replace manual inspection, it saves labor costs, improves production efficiency, and reduces rework rates. Furthermore, for different screw specifications, these inspection items are continuously trained to optimize the model, improving matching accuracy, convergence speed, and real-time performance. It quickly identifies the area with the highest similarity to the template and ultimately determines whether the screws, tape, and clips are correctly installed. Utilizing multiple deep learning model networks for screw, clip, and tape detection, this method is effectively applied to the TV production inspection process with high accuracy.

[0148] It should be understood that the sequence number of each step in the above embodiments does not imply 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 this application.

[0149] Corresponding to the product testing method described in the above embodiments, Figure 7 A structural block diagram of the product testing device provided in the embodiments of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0150] According to another aspect of the embodiments of this application, a product testing apparatus for implementing the above-described product testing method is also provided. Figure 7 This is a structural block diagram of an optional product testing device according to an embodiment of this application, such as... Figure 7 As shown, the device may include:

[0151] The acquisition unit 702 is used to acquire an image to be detected, wherein the image to be detected is an image corresponding to the product to be detected, and the image to be detected includes the element to be detected;

[0152] The comparison unit 704, connected to the acquisition unit 702, is used to compare the target element of the target template image with the element to be detected in the image to obtain the target detection result. The target template image includes the target element, and the target element corresponds to the element to be detected.

[0153] It should be noted that the acquisition unit 702 in this embodiment can be used to perform the above step S202, and the comparison unit 704 in this embodiment can be used to perform the above step S204.

[0154] The above modules acquire an image to be detected, which is an image corresponding to the product to be detected and includes the component to be detected. The target component in the target template image is compared with the component to be detected in the image to be detected to obtain the target detection result. The target template image includes the target component, and the target component corresponds to the component to be detected. This solves the problem of poor reliability of product detection results in related technologies and improves the reliability of product detection results.

[0155] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0156] Figure 8 This is a schematic diagram of an optional electronic device according to an embodiment of this application. The electronic device may be a desktop computer, laptop, handheld computer, cloud server, or other computing device.

[0157] like Figure 8As shown, the electronic device of this embodiment includes: a processor 11, a memory 12, and a computer program 13 stored in the memory 12 and executable on the processor 11. When the processor 11 executes the computer program 13, it implements steps S202 and S204 in the above-described product testing method embodiment. Alternatively, when the processor 11 executes the computer program 13, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 7 The functions of the acquisition unit 702 and the comparison unit 704 are shown.

[0158] For example, the computer program 13 may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 11 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 13 in the electronic device.

[0159] Those skilled in the art will understand that Figure 8 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0160] The processor 11 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0161] The memory 12 can be an internal storage unit of the electronic device, such as a hard drive or RAM. The memory 12 can also be an external storage device of the electronic device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 12 can include both internal and external storage units. The memory 12 is used to store the computer program and other programs and data required by the electronic device. The memory 12 can also be used to temporarily store data that has been output or will be output.

[0162] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0163] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the above-described method embodiments.

[0164] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0165] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0166] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0167] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0168] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0169] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0170] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

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

Claims

1. A product testing method, characterized in that, The method includes: Acquire an image to be detected, wherein the image to be detected is an image corresponding to the product to be detected, and the image to be detected includes the element to be detected; Based on the target element of the target template image, the element to be detected in the image to be detected is determined, and the target element and the element to be detected are compared to obtain the target detection result. The target template image includes the target element, and the target element corresponds to the element to be detected. The step of determining the element to be detected in the image to be detected based on the target element of the target template image, and comparing the target element with the element to be detected to obtain the target detection result includes: Based on the third position information of the second positioning point in the target template image and the second element frame information of the second element frame corresponding to the second reference element, the second element frame corresponding to the element to be detected is determined from the image to be detected. The second reference element is a reference element in the target template image that corresponds to the element to be detected. The second element frame information includes the fourth position information of the second element frame and the second size information of the second element frame. The target element includes the second reference element. The second component frame to be detected is cropped from the image to be detected to obtain the second region of interest image; The first and second marker lines in the element to be detected in the second region of interest image are determined by an image recognition algorithm, wherein the first and second marker lines are used to determine the position of the element to be detected in the second region of interest image; According to the edge algorithm, the target difference between the first marker line and the second marker line is calculated. The edge algorithm is an algorithm for extracting straight lines in an image. Based on the target difference and the preset difference corresponding to the target template image, a second confidence factor corresponding to the element to be detected is determined, and the second confidence factor is used to indicate the target detection result.

2. The product testing method as described in claim 1, characterized in that, The acquisition of the image to be detected includes: The product to be tested is detected by a photoelectric sensor to obtain a detection signal; When the signal type of the detected signal is the target signal type, the image acquisition unit is controlled to perform an image acquisition operation on the product to be detected to obtain the image to be detected.

3. The product testing method as described in claim 1, characterized in that, The step of determining the element to be detected in the image to be detected based on the target element of the target template image, and comparing the target element with the element to be detected to obtain the target detection result, further includes: Based on the first position information of the first positioning point in the target template image and the first element frame information of the first element frame corresponding to the first reference element, the first element frame corresponding to the element to be detected is determined from the image to be detected. The first reference element is a reference element in the target template image that corresponds to the element to be detected. The first element frame includes the first reference element. The first element frame information includes the second position information of the first element frame and the first size information of the first element frame. The target element includes the first reference element. The first component frame to be detected is cropped from the image to be detected to obtain the first region of interest image; The first region of interest image is input into the target recognition model to obtain a first confidence factor corresponding to the element to be detected. The first confidence factor is used to indicate the target detection result, and the target recognition model is used to identify whether the element to be detected in the first region of interest meets a preset standard.

4. The product testing method as described in claim 3, characterized in that, Before inputting the first region of interest image into the target recognition model to obtain the target detection result, the method further includes: Acquire a target sample image, wherein the target sample image includes multiple sample images; The target sample image is divided into a first sample image and a second sample image, wherein the position of the component to be detected in the product to be detected in the first sample image conforms to preset parameters, and the position of the component to be detected in the product to be detected in the second sample image does not conform to preset parameters; The first sample image and the second sample image are input into the deep learning model and learned according to a preset learning factor and a preset number of iterations to obtain the target recognition model.

5. The product testing method as described in claim 1, characterized in that, The second component box includes the second reference component.

6. The product testing method as described in claim 1, characterized in that, Before determining the element to be detected in the image to be detected based on the target element of the target template image, and comparing the target element with the element to be detected to obtain the target detection result, the method further includes: Based on the target identification information of the image to be detected, a search is performed in the target mapping table, wherein the target mapping table stores the correspondence between multiple image identification information and multiple template images, and the multiple image identification information and the multiple template images correspond one-to-one; The template image corresponding to the image identifier information that matches the target identifier information among the plurality of image identifier information is determined as the target template image.

7. The product testing method as described in claim 1, characterized in that, After obtaining the target detection result, the process also includes: The target detection results are displayed; The display of the target detection results includes: The target detection results are displayed on the display component of the terminal device; or... The target detection results are displayed via indicator lights; or, The target detection results are displayed through an audio playback device.

8. A product testing apparatus for performing the product testing method according to any one of claims 1-7, characterized in that, include: An acquisition unit is used to acquire an image to be detected, wherein the image to be detected is an image corresponding to the product to be detected, and the image to be detected includes an element to be detected; The comparison unit is used to determine the element to be detected in the image to be detected based on the target element of the target template image, and to compare the target element with the element to be detected to obtain the target detection result.

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

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Mold state monitoring method and device, industrial personal computer, storage medium and system

    CN112837302A

  • Defect position determination method and device, storage medium and electronic equipment

    CN114549465A