Injection molded workpiece template matching method, electronic device, and storage medium

By using the Hu moment contour matching algorithm and the template matching method of the arbitration function, the problems of low accuracy and poor robustness caused by image distortion in the inspection of injection molded workpieces are solved, and automated and stable inspection of injection molded workpieces is realized.

CN115471684BActive Publication Date: 2026-07-07WUHAN UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN UNIV OF TECH
Filing Date
2022-08-18
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing methods for inspecting injection molded parts have low accuracy and poor robustness under image distortion, narrow application range, and rely on manual inspection, resulting in inconsistent standards and high labor costs.

Method used

A contour matching algorithm based on Hu moments and a template matching method based on arbitration functions are adopted, combined with image preprocessing, contour feature extraction and standard template establishment, to achieve multivariate stability matching of injection molded workpiece images.

Benefits of technology

It improves the accuracy and consistency of injection molded workpiece inspection, reduces manual intervention, realizes automated inspection, and enhances robustness to distortions such as translation, rotation, and scaling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115471684B_ABST
    Figure CN115471684B_ABST
Patent Text Reader

Abstract

The application discloses an injection molding workpiece template matching method, an electronic device and a storage medium, and realizes a template matching mechanism by establishing a J(ψ ij ) arbitration function. The method comprises four main steps: injection molding workpiece image data preprocessing; contour feature extraction of an image data set and establishment of a standard template; obtaining matching accuracy by using a contour matching algorithm based on Hu moments on the injection molding workpiece and determining a matching threshold and a statistical scaling value thereof; and finally, using a plastic part template matching mechanism based on the J(ψ ij ) arbitration function to match the standard template with the workpiece to be tested. The application replaces the detection based on the gray value in the traditional detection method, so that the template matching of the injection molding workpiece has stability to factors such as translation, rotation and scaling. The application realizes automatic detection of defects of the injection molding workpiece, and the detection speed, accuracy and robustness are obviously improved compared with the traditional method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection of injection molded parts, and specifically to a method, electronic device and storage medium for matching injection molded part templates with translation, rotation and scaling stability of the image of the workpiece to be tested. Background Technology

[0002] In regions with a high degree of automation, injection molding production lines have largely achieved full automation. However, quality inspection of injection molded parts still primarily relies on manual visual inspection to detect surface defects. This open-loop method is highly subjective, has weak real-time monitoring capabilities, and suffers from inconsistent and unstable inspection standards. Furthermore, from a work environment perspective, frontline workers face inherent dangers and experience high labor intensity.

[0003] Currently, image recognition is also used for surface inspection of injection molded parts. However, when the images of the plastic parts are affected by distortions such as translation, rotation, and scaling during the actual shooting process, the false alarm rate is high and the accuracy is low. The actual application effect is not ideal. It can only be used in a few stations where consistent surface defects are likely to occur, and its applicability is very narrow. Summary of the Invention

[0004] The technical problem to be solved by this invention is to provide a template matching method, electronic device and storage medium for injection molded workpieces that has multivariable stability. Even when the image of the plastic part is affected by distortions such as translation, rotation and scaling during the actual shooting process, it can still be judged as qualified or not. This solves the problems of strong subjectivity, low accuracy, poor robustness, narrow application range and high labor cost of the existing technical inspection standards, and realizes the automation of the plastic part quality inspection process.

[0005] To solve the above technical problems, the present invention adopts the following technical solution:

[0006] A method for matching injection molded workpiece templates with multivariable stability, characterized by the following steps:

[0007] S1: Acquire images of the injection molded workpiece and preprocess the acquired image data;

[0008] S2: Contour feature extraction from image datasets and establishment of standard template data;

[0009] S3: The matching accuracy is obtained by using a contour matching algorithm based on Hu moments for injection molded workpieces;

[0010] S4: Using based on The arbitration function's plastic part template matching mechanism matches the workpiece under test with a standard template.

[0011] Furthermore, the preprocessing of the injection molded workpiece image data in step S1 includes the following steps: the original image undergoes grayscale transformation, the grayscale image undergoes median filtering, and the smoothed image is then sharpened.

[0012] Furthermore, in step S2, the contour feature extraction of the image dataset uses the Canny edge detection algorithm. First, the image is preprocessed using a Gaussian first-order derivative filter, and then the direction and magnitude of the gradient are calculated. Based on the non-maximum suppression theory, the more accurate edge information of the image is determined, and the optimal contour features are obtained by setting the corresponding threshold according to the actual image. In this way, an image database of standard templates for various defective images is established.

[0013] Furthermore, in step S2, the high threshold grayscale value is set to 240, and the low threshold grayscale value is set to 200.

[0014] Furthermore, in step S3, the matching accuracy of the injection molded workpiece using the Hu moment-based contour matching algorithm includes the following steps: using the Hu moment function to establish invariant moment data for the template image and the defect image, matching the invariant moment data of the defect image with the invariant moment data of the template image to obtain the matching result, and using the value of the matching result as a measure of geometric contour similarity.

[0015] Furthermore, in step S3, the Hu moment function is composed of seven invariant moments formed by combining the second and third central moments of the image.

[0016] Furthermore, in step S3, the invariant moment data of the defect image and the invariant moment data of the template image are matched using the following formula:

[0017] (1)

[0018] in, The matching result is represented by the matching precision, and its value is inversely correlated with the degree of similarity. i Used to record the number of the workpiece to be tested. j This indicates the number of times the same workpiece image is matched. k The Hu moments of the processed image are represented in order from one to seven. A This represents a standard template. B Represents the images to be tested in previous tests; This represents the k-th Hu moment data of the standard template with image number i. This represents the k-th Hu moment data of the image under test with image number i.

[0019] Furthermore, step S4 uses a method based on... The arbitration function's plastic part template matching mechanism matches the workpiece under test with the standard template according to the following arbitration function formula:

[0020] (2)

[0021] Arbitration function middle, i Indicates the number of the workpiece to be tested. j The number of times the same workpiece image is matched is also the number of times the same workpiece is input into the arbitration function, which is usually one or two times; This represents the Hu invariant moment data of the standard template image. k The Hu moments of the processed image are represented in order from one to seven; The upper limit threshold for the matching accuracy of qualified workpieces;

[0022] If the arbitration function A value of 1 indicates that the matching accuracy is below the threshold. If so, the workpiece represented by the image is a qualified product;

[0023] If the arbitration function value is 0, meaning the matching accuracy is higher than the threshold. However, if the image is below its statistical scaling value, it will undergo secondary preprocessing to further extract feature information before matching. If the matching accuracy of the second match is still higher than the threshold, it will be classified into the defective image dataset.

[0024] If the function value is -1, that is, the matching precision Statistical scaling values ​​exceeding a threshold will directly classify the workpiece as a defect image dataset.

[0025] An electronic device includes: a memory, a processor, and a computer program on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the method described above.

[0026] A transient or non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed, implements the steps of the method described above.

[0027] Therefore, this invention discloses a novel method for matching injection molded workpiece templates with multivariable stability, as well as an electronic device and storage medium.

[0028] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:

[0029] It replaces the template matching method based on grayscale values, making the matching process robust to factors such as translation, rotation, and scaling.

[0030] Through the present invention The arbitration function performs secondary matching on some images that may be misclassified, and the new matching method with increased fault tolerance is beneficial to improving the accuracy of defect classification of injection molded parts.

[0031] The system and electronic equipment of the present invention can realize automated inspection of injection molded workpieces, improve inspection quality and ensure inspection consistency. Attached Figure Description

[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:

[0033] Figure 1 This is a flowchart of the injection molded workpiece template matching method with multivariable stability according to the present invention.

[0034] Figure 2 This is a comparison image of the original image (a) of the injection molded workpiece of the present invention and the image (b) after preprocessing.

[0035] Figure 3 The images show a comparison of the high threshold (a) and low threshold (b) of the Canny edge detection algorithm in the embodiment. In the image (a), the two thresholds are 240 and 200, respectively; and in the image (b), the two thresholds are 40 and 20, respectively.

[0036] Figure 4 This is the feature extraction result of the present invention.

[0037] Figure 5 This is a flowchart illustrating the template matching method proposed in this invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0039] The injection molded workpiece template matching method with multivariable stability according to the present invention, such as... Figure 1 and 5 As shown. The input is the acquired image of the plastic part, and the output is the result of determining whether the image is qualified. The following example demonstrates how the determination is implemented based on template matching results:

[0040] (1) Preprocessing of injection molded workpiece image data: The original image undergoes grayscale transformation, the grayscale image is then subjected to median filtering, and the smoothed image is followed by image sharpening. The grayscale transformation in this step aims to improve the recognizability of the injection molded workpiece, while the smoothing process eliminates image noise. The sharpening process eliminates the blurring caused by the smoothing process. The preprocessing results of the injection molded workpiece image data are as follows: Figure 2 .

[0041] (2) Contour feature extraction and standard template establishment for the image dataset: Contour feature extraction of the image dataset uses the Canny edge detection algorithm, and the optimal contour features are obtained by setting an appropriate threshold according to the actual image. In this embodiment, the Canny edge detection algorithm uses a high threshold, such as... Figure 3 .

[0042] This embodiment extracts contour features for eight types of defects most likely to occur in plastic parts during industrial production. These eight defects are: warping, surface black spots, dimensional instability, shrinkage depressions, streaks, flash, poor filling, and cracking. The feature extraction results are as follows: Figure 4 .

[0043] (3) The matching accuracy is obtained by using the contour matching algorithm based on Hu moments for injection molded workpieces: The invariant moment data of template image and defect image are established by using Hu moment function (Equation 3 below), the invariant moment data of defect image is matched with the invariant moment data of template image to obtain the matching result, and the value of the matching result is used as the measure of geometric contour similarity. Hu moment function is seven invariant moments composed of the second and third central moments of the image.

[0044] The HU moment data of the template image established in this embodiment is as follows:

[0045] Hu1[1]=2.02425; Hu1[2]=4.46429; Hu1[3]=8.01779; Hu1[4]=8.98081; Hu1[5]=18.0195; Hu1[6]=-11.5543; Hu1[7]=17.499.

[0046] (3)

[0047] In this embodiment, the matching accuracy of the function for a standard workpiece is between 0.0871 and 0.1517. The upper limit threshold for the matching accuracy of this qualified workpiece is denoted as... Used to establish Arbitration function, in this embodiment .

[0048] The designed standard templates were matched with images of the eight types of defects, and the matching results were output as follows.

[0049]

[0050] (4) Using based The arbitration function's plastic part template matching mechanism matches the workpiece under test with a standard template: Based on the data from the standard template, the threshold in this example... The statistical scaling value was 0.2542. Except for defects such as dimensional instability in the plastic parts, which required secondary preprocessing, the other seven types of defects were successfully detected. The images with dimensional instability were also accurately classified after secondary preprocessing.

[0051] After visualizing the novel method proposed in this invention, as follows: Figure 5 As shown.

[0052] An electronic device according to an embodiment of the present invention includes: a memory, a processor, and a computer program on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the method described above. The electronic device can be installed at a corresponding workstation and can be implemented as a camera and a memory processor.

[0053] Of course, the present invention can also be a transient or non-transient computer-readable storage medium storing a computer program thereon, characterized in that the computer program, when executed, implements the steps of the method described above.

[0054] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A method for matching templates for injection molded parts with multivariable stability, characterized in that... Includes the following steps: S1: Acquire images of the injection molded workpiece and preprocess the acquired image data; S2: Extract contour features from the image dataset and establish standard template image data; S3: The matching accuracy is obtained by using the contour matching algorithm based on Hu invariant moments for the injection molded workpiece to be tested: The invariant moment data of the standard template image and the image of the injection molded workpiece to be tested are established using the Hu invariant moment function. The invariant moment data of the image of the injection molded workpiece to be tested is matched with the invariant moment data of the standard template image to obtain the matching result. The value of the matching result is used as a measure of geometric contour similarity. The matching result is represented by the matching precision, and its value is inversely correlated with the similarity. S4: Using based on The arbitration function's plastic part template matching mechanism matches the image of the injection molded workpiece under test with a standard template image; ; in, i Indicates the part number of the injection molded part to be tested. j The number of times the images of the same injection molded workpiece under test are matched is also the number of times the images of the same injection molded workpiece under test are input into the arbitration function; This represents the Hu invariant moment data of the standard template image. k This indicates the order of Hu's invariant moments from one to seven; The upper limit threshold for the matching accuracy of qualified workpieces; If the arbitration function A value of 1 indicates that the matching accuracy is below the threshold. If the image of the injection molded workpiece to be tested represents a qualified product, then the workpiece is qualified. If the arbitration function value is 0, meaning the matching accuracy is higher than the threshold. However, if the value is lower than its statistical scaling value, the image of the injection molded workpiece to be tested will be preprocessed a second time, and feature information will be extracted before matching. If the matching accuracy of the second time is still higher than the threshold, it will be classified into the defect image dataset. If the function value is -1, that is, the matching precision Statistical scaling values ​​exceeding a threshold will directly classify the image of the injection-molded workpiece under test as a defect image dataset.

2. The injection molded workpiece template matching method with multivariable stability according to claim 1, characterized in that... Step S1, the preprocessing of the injection molded workpiece image data, includes the following steps: the original image undergoes grayscale transformation, the grayscale image undergoes median filtering, and the smoothed image is then sharpened.

3. The injection molded workpiece template matching method with multivariable stability according to claim 1, characterized in that, In step S2, contour feature extraction is performed on the images in the image dataset using the classic Canny edge detection algorithm. First, the image is preprocessed using a Gaussian first-order derivative filter, and then the direction and magnitude of the gradient are calculated. Based on the non-maximum suppression theory, more accurate edge information of the image is determined, and the optimal contour features are obtained by setting the corresponding threshold according to the actual image. In this way, a standard template image database for various defect images is established.

4. The injection molded workpiece template matching method with multivariable stability according to claim 3, characterized in that... In step S2, the Canny edge detection algorithm sets the high threshold grayscale value to 240 and the low threshold grayscale value to 200.

5. The injection molded workpiece template matching method with multivariable stability according to claim 1, characterized in that... In step S3, the Hu invariant moment function is composed of seven invariant moments formed by combining the second and third central moments of the image of the injection molded workpiece or the standard template image.

6. The injection molded workpiece template matching method with multivariable stability according to claim 1, characterized in that... In step S3, the invariant moment data of the image of the injection molded workpiece to be tested is matched with the invariant moment data of the standard template image using the following formula: in, i Used to indicate the number of the injection-molded workpiece to be tested. j This indicates the number of times images of the same injection-molded workpiece under test are matched. k This indicates the order of Hu's invariant moments from one to seven. A Represents a standard template image. B An image representing the injection-molded workpiece to be tested; The part number to be tested is... i The first standard template image k Hu invariant moment data, The part number to be tested is i The image of the first k Hu invariant moment data.

7. An electronic device, comprising: A memory, a processor, and a computer program that runs on the memory and on the processor, characterized in that, when the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-6.

8. A transient or non-transient computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it performs the steps of the method as described in any one of claims 1-6 above.