Two-color injection molding appearance inspection method and system based on image recognition
Through the two-color injection molding appearance detection method based on image recognition, using sliding window technology and Pearson correlation coefficient analysis, the problem of difficult to guarantee detection efficiency and accuracy in the existing detection methods is solved, and efficient and accurate quality detection of the appearance of two-color injection molding parts is achieved.
Patent Information
- Application Number
- CN202411344288.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The existing two-color injection molding appearance detection methods rely on manual inspection, making it difficult to ensure detection efficiency and accuracy, especially in the case of complex backgrounds, lighting changes and image noise.
The two-color injection molding appearance detection method based on image recognition is adopted. By obtaining the image of the two-color injection molding part to be detected, the two-color injection molding area is identified and the axis of symmetry is determined, the pixel feature value is calculated using sliding window technology, and the feature sequence similarity on both sides of the axis of symmetry is analyzed based on the Pearson correlation coefficient to determine the quality of the two-color injection molding part.
It improves the accuracy and efficiency of the appearance inspection of two-color injection molded parts, enhances the robustness and adaptability of the inspection, and can accurately identify quality defects under complex backgrounds and light changes.
Smart Images

Figure CN119251184B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and more specifically, to a two-color injection molding appearance detection method and system based on image recognition. Background Art
[0002] In modern manufacturing, injection molding technology is widely used in the production of various products. This technology is favored for its efficient and precise molding capabilities, especially in the production of complex geometries and large-scale products. Two-color injection molding is an advanced technology in the injection molding process. It injects two different colors of materials into the same mold through two injection molding processes to form a two-color effect on the same workpiece. This technology not only improves the appearance quality of the product, but also enhances its functionality, such as increasing the visual appeal of the product. With the increasing market demand for high-quality and personalized products, the application areas of two-color injection molding are also expanding. The appearance quality inspection of two-color injection molded products has always been an important challenge in the production process.
[0003] However, the two-color injection molding process has extremely high requirements for the appearance quality of the product during the production process. Due to the involvement of two different colors of materials and a complex molding process, the two-color injection molded parts produced may have various appearance defects, such as uneven color, blurred color boundaries, bubbles or impurities. These defects not only affect the appearance of the product, but may also cause functional problems of the product, which in turn affects the consumer's experience and brand reputation. Therefore, the appearance inspection of two-color injection molded parts is particularly important. Although image recognition technology has broad application prospects in appearance inspection, it still faces some technical problems. For example, how to accurately handle complex backgrounds, lighting changes and image noise to improve the robustness and accuracy of detection is still a hot topic of current research. Therefore, the research and development of image recognition methods for two-color injection molding appearance inspection will provide important support for promoting technological progress and improving production efficiency in related industries.
[0004] The traditional two-color injection molding appearance inspection method mainly relies on manual inspection. Although this method can find obvious defects to a certain extent, since manual inspection only relies on the inspector's experience and subjective judgment, it is easily affected by fatigue and distraction, making it difficult to ensure inspection efficiency and accuracy. In addition, with the increasing complexity of products, manual inspection has been unable to meet the requirements of high efficiency and high precision. Therefore, an efficient and reliable automated inspection solution is needed. Summary of the invention
[0005] In order to solve the problem that it is difficult to ensure detection efficiency and accuracy mentioned in the above background technology, the present invention provides solutions in the following aspects.
[0006] In a first aspect, the present invention provides a two-color injection molding appearance inspection method based on image recognition, comprising: acquiring an image of a two-color injection molded part to be inspected; identifying a two-color injection molding area in the image, and determining the symmetry axis of the area; setting an initial sliding window, and sliding it step by step in the area along a direction parallel to the symmetry axis, and calculating the characteristic value of the pixel in the sliding window at each sliding:
[0007] ;
[0008] In the formula, Indicates The characteristic value of the pixel in the sliding window during the sliding, Indicates Pixels in the sliding window for each slide The probability of occurrence, represents the total number of different pixel values in the sliding window, Representing a logarithmic function; establishing a feature sequence corresponding to each column of pixels in the area, wherein the feature sequence is composed of feature values corresponding to each column of pixels; calculating the Pearson correlation coefficient between the feature sequences of symmetrical columns on both sides of the symmetry axis; in response to the Pearson correlation coefficient being greater than or equal to a set threshold, determining that the two-color injection molded part to be inspected is of normal quality; and when the Pearson correlation coefficient is less than the set threshold, determining that the two-color injection molded part to be inspected is of quality defect.
[0009] The above technical solution establishes a feature sequence related to the symmetry axis by identifying the area of the injection molded part and calculating the feature values of the pixels in the sliding window. By analyzing the Pearson correlation coefficient between the feature sequences of the symmetric columns, the solution can effectively judge the quality of the two-color injection molded parts and ensure that quality defects can be accurately identified during the inspection process.
[0010] Furthermore, a multispectral camera is used to acquire an image of the two-color injection molded part to be inspected.
[0011] Furthermore, the two-color injection molding area in the identification image adopts a threshold segmentation algorithm or a deep learning algorithm.
[0012] The above technical solution uses a threshold segmentation algorithm or a deep learning algorithm to identify the two-color injection molding area in the image, effectively solving the problem that traditional image processing methods are difficult to accurately separate the target area under complex backgrounds. This method not only improves the recognition accuracy of the two-color injection molding area and reduces the impact of noise interference, but also enhances the adaptability of the algorithm under different lighting and material conditions, thereby improving the reliability and efficiency of the entire appearance inspection process.
[0013] Furthermore, the threshold segmentation algorithm is: RGB color threshold operator, HSV color threshold operator or Lab color threshold operator; the deep learning algorithm is: semantic segmentation network or U-type neural network.
[0014] Furthermore, the method further includes performing grayscale conversion and Gaussian filtering on the image of the two-color injection molded part to be inspected.
[0015] The above technical solution effectively solves the problem of image interference under noise and light changes by graying and Gaussian filtering the image of the two-color injection molded parts to be inspected. Image graying simplifies image data and facilitates subsequent processing, while Gaussian filtering smoothes the image and reduces the impact of random noise. This processing step enhances the quality of the image and improves the accuracy of subsequent feature extraction and region recognition, thereby ensuring the reliability of the quality inspection of two-color injection molded parts.
[0016] Furthermore, the Hough transform algorithm is used to determine the symmetry axis of the area, specifically: edge detection is performed on the area to be detected to extract the edge contour of the area; the Hough transform is used to detect the straight line in the area to be detected; the symmetry score of the straight line relative to the edge of the area is calculated, and the straight line with the largest symmetry score is selected as the symmetry axis of the area to be detected.
[0017] The above technical solution uses the Hough transform algorithm to determine the symmetry axis of the area to be detected, effectively solving the challenge of accurately identifying symmetry under the influence of complex shapes and noise. First, the edge contour of the area is extracted through edge detection, and then the Hough transform is used to detect straight lines, thereby systematically analyzing the geometric features in the area. By calculating the symmetry score of the straight line and the edge, the straight line with the highest symmetry can be accurately identified as the symmetry axis. This process improves the accuracy and reliability of symmetry detection and provides a solid foundation for subsequent quality assessment.
[0018] Furthermore, it also includes performing maximum absolute value normalization processing on the feature sequence.
[0019] The above technical solution effectively solves the problem of inaccurate comparison caused by the difference in the scale of characteristic values by normalizing the characteristic sequences by the maximum absolute value. The normalization process unifies the characteristic values into the same range, making the contributions of different characteristics comparable, thereby improving the accuracy of the calculation of the Pearson correlation coefficient. This processing step ensures that when evaluating the symmetry of two-color injection molded parts, the influence of each characteristic sequence on the final judgment is more reasonable, which helps to improve the reliability and consistency of quality inspection.
[0020] In a second aspect, the present invention provides a two-color injection molding appearance inspection system based on image recognition, comprising a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, any one of the above-described two-color injection molding appearance inspection methods based on image recognition is implemented.
[0021] The beneficial effects of the present invention are:
[0022] The present invention uses sliding window technology to calculate eigenvalues, and analyzes the pixel relationship on both sides of the symmetry axis based on the eigenvalues, which effectively solves the complexity of symmetry judgment in the appearance inspection process of two-color injection molded parts. In traditional detection methods, judging symmetry often relies on manual visual inspection, which is easily affected by subjective factors and has low processing efficiency. The introduction of the present invention can systematically obtain and calculate the pixel eigenvalues in each sliding window through the sliding window, and this process makes the feature extraction more comprehensive and objective. By introducing the Pearson correlation coefficient, the similarity of the feature sequences on both sides can be quantified, so as to accurately identify potential quality defects. In addition, the application of the Pearson correlation coefficient can effectively eliminate misjudgments caused by factors such as lighting and background clutter, further enhancing the accuracy of detection. This method not only improves the accuracy of detection, but also enhances the adaptability to complex geometric features of injection molded parts, providing a more reliable basis for the quality inspection of two-color injection molded parts. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0024] Figure 1 is a flowchart schematically showing a two-color injection molding appearance detection method based on image recognition according to an embodiment of the present invention;
[0025] Figure 2 Schematically shows a structural block diagram of a two-color injection molding appearance inspection system based on image recognition according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0027] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0028] An embodiment of a two-color injection molding appearance detection method based on image recognition.
[0029] like Figure 1 As shown, the flow chart of the two-color injection molding appearance detection method based on image recognition in an embodiment of the present invention includes the following steps:
[0030] S1: Acquire an image of a two-color injection molded part to be inspected; identify a two-color injection molded area in the image, and determine a symmetry axis of the area.
[0031] In one embodiment, a multispectral camera may be used to acquire an image of the two-color injection molded part to be inspected. Of course, a multifunctional camera such as an area array camera may also be used to acquire an image of the two-color injection molded part to be inspected.
[0032] In another embodiment, a threshold segmentation algorithm may be used to identify the area of two-color injection molding in the image of the two-color injection molded part to be detected; wherein the threshold segmentation algorithm includes: an RGB color threshold operator, an HSV color threshold operator, or a Lab color threshold operator; of course, a deep learning algorithm may also be used to identify the area of two-color injection molding in the image of the two-color injection molded part to be detected; wherein the deep learning algorithm includes: a semantic segmentation network or a U-shaped neural network;
[0033] For example, taking the semantic segmentation network in the deep learning algorithm as an example, the specific steps are as follows: first, the collected images of the two-color injection molded parts to be detected are preprocessed, including image normalization, resizing, and color space conversion to meet the input requirements of the deep learning model; then, the image data is annotated to generate annotated data of the two-color area, thereby forming a training set; finally, a semantic segmentation network is constructed, and the training set is input into the semantic segmentation network for training, and finally a trained semantic segmentation network is obtained. The above semantic segmentation network can output the classification results of the two-color area in the image to be detected. Through the above operations, accurate recognition and classification of two-color injection molded parts are ensured.
[0034] In another embodiment, the Hough transform algorithm may be used to determine the symmetry axis of the region, specifically:
[0035] Perform edge detection on the area to be detected and extract the edge contour of the area; use Hough transform to detect straight lines in the area to be detected, and calculate the symmetry score of the straight lines relative to the edge of the area, and select the straight line with the largest symmetry score as the symmetry axis of the area to be detected.
[0036] S2: Set an initial sliding window, and slide it step by step in the region along a direction parallel to the axis of symmetry, and calculate the characteristic values of the pixels in the sliding window at each sliding.
[0037] In one embodiment, the size of the initial sliding window may be Of course, it can also be adjusted according to the specific features of the injection molded parts and the required detection accuracy; the step size of the sliding window can be the size of the sliding window, and it slides gradually in the region along the direction parallel to the above-mentioned symmetry axis until the entire two-color injection molding area is covered, and the number of occurrences of each pixel value in the sliding window at each sliding is counted, and the probability of each pixel value appearing in the sliding window is calculated, and the probability is the ratio of the number of occurrences of each pixel value to the total number of pixels in the sliding window; finally, the characteristic value of the pixel in the sliding window at each sliding is calculated:
[0038] ;
[0039] In the formula, Indicates The characteristic value of the pixel in the sliding window during the sliding, Indicates Pixels in the sliding window for each slide The probability of occurrence, represents the total number of different pixel values in the sliding window, represents the logarithmic function;
[0040] For example: the initial sliding window size is , and slides gradually in the region along the direction parallel to the above-mentioned symmetry axis. If the pixel block in the sliding window is , then calculate the probability of each pixel appearing in the sliding window during the first sliding, and substitute it into the above formula to get is -1.34; the above technical solution can effectively extract the pixel features of the two-color injection molding area.
[0041] S3: establishing a feature sequence corresponding to each column of pixels in the region based on the feature value, and calculating the Pearson correlation coefficient between the feature sequences of symmetrical columns on both sides of the symmetry axis.
[0042] In one embodiment, the Pearson correlation coefficient for:
[0043] ;
[0044] In the formula, Represents a feature sequence and feature sequence The covariance between Represents a feature sequence The standard deviation of Represents a feature sequence The standard deviation of .
[0045] The calculated Pearson correlation coefficient can be used to evaluate the similarity of the regions. The value range of the Pearson correlation coefficient is between -1 and 1. If the Pearson correlation coefficient is close to 1, it means that the feature sequence and feature sequence The similarity between them is high. If the Pearson correlation coefficient is close to -1, it means that the characteristic sequence and feature sequence The similarity between them is low; if the Pearson correlation coefficient is close to 0, it means that the feature sequence and feature sequence There are no similar features between them.
[0046] In another embodiment, cosine similarity can also be used to evaluate the similarity between feature sequences of symmetrical columns on both sides of the symmetry axis. Cosine similarity is a commonly used similarity measure, which quantifies the similarity between two feature vectors by calculating the cosine value of the angle between them. In this solution, it is first necessary to extract feature sequences from the symmetrical columns, express them in vector form, and then calculate the cosine similarity between these feature vectors;
[0047] Specifically, when the cosine similarity between the two feature sequences is close to 1, it means that the similarity between the two feature sequences is high, indicating that their pixel distributions have strong similarity, that is, the appearance quality of the two-color injection molded parts is good and meets the expected design standards. On the contrary, when the cosine similarity is close to 0, it means that the similarity between the two groups of feature sequences is low and there are significant differences, which may mean that the injection molded parts have potential quality defects in terms of color distribution, shape symmetry, etc. By introducing cosine similarity as an evaluation indicator, this embodiment not only provides an intuitive and effective way to analyze the similarity between the feature sequences of symmetrical columns, but also enhances the flexibility and accuracy of the detection system. This method complements the above-mentioned Pearson correlation coefficient analysis, providing a multi-dimensional basis for quality judgment, thereby making the quality control of two-color injection molded parts more comprehensive and detailed.
[0048] S4: In response to the Pearson correlation coefficient being greater than or equal to a set threshold, determining that the two-color injection molded part to be inspected is of normal quality; and in response to the Pearson correlation coefficient being less than the set threshold, determining that the two-color injection molded part to be inspected is of quality defect.
[0049] The above threshold value may be set to 0.8, and of course, it may be determined according to actual conditions.
[0050] In this embodiment, the threshold is set to , assuming that the calculated Pearson correlation coefficient is ,like ≥ , then the two-color injection molded part to be tested is judged to be of normal quality, indicating that there is a high degree of similarity between the feature sequences, that is, the appearance of the injection molded part has no obvious quality defects; if < , then the two-color injection molded part to be tested is judged to be a quality defect, indicating that the similarity between the feature sequences is low, that is, there may be color difference, shape asymmetry or other appearance defects.
[0051] In this embodiment, after the inspection result of the two-color injection molded parts is determined, a reminder may be given, such as a reminder to the relevant management personnel in the form of an alarm or a text message, and the two-color injection molded parts with quality defects may be processed in a timely manner.
[0052] The solution of the present invention calculates pixel feature values through sliding window technology and analyzes the Pearson correlation coefficient of the feature sequence between symmetric columns, thereby effectively solving the problem of inaccurate symmetry evaluation in traditional two-color injection molded parts inspection. The solution can systematically quantify and compare the similarity of features on both sides of the symmetry axis, making it more accurate in judging the quality of two-color injection molded parts. This quantitative analysis not only takes into account the distribution of pixels, but also deeply explores the importance of symmetry in appearance inspection, ensuring the scientificity and objectivity of the test results. In addition, the mechanism of setting thresholds further enhances the objectivity and accuracy of defect determination. When the correlation coefficient of the feature sequence between symmetric columns exceeds the preset threshold, it can be accurately judged as normal quality; otherwise, it is marked as a potential quality defect. This innovative solution not only optimizes the inspection process and improves the reliability of overall quality control, but also provides a more scientific basis for industrial quality management, which helps to promote the manufacturing industry to a higher level of automation and intelligence.
[0053] Example of two-color injection molding appearance inspection system based on image recognition:
[0054] like Figure 2 As shown, a structural block diagram of a two-color injection molding appearance inspection system based on image recognition according to an embodiment of the present invention includes a processor and a memory.
[0055] The present invention also provides a two-color injection molding appearance detection system based on image recognition. Figure 2 As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the two-color injection molding appearance detection method based on image recognition described above according to the present invention is implemented.
[0056] The two-color injection molding appearance inspection system based on image recognition also includes other components well known to those skilled in the art, such as a communication interface, and its settings and functions are known in the art, so they will not be described in detail here.
[0057] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0058] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0059] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A two-color injection molding appearance detection method based on image recognition, characterized in that: include: Acquire an image of a two-color injection molded part to be inspected; Identifying a two-color injection molding region in the image and determining an axis of symmetry of the region; Set the initial sliding window and slide it step by step in the region along the direction parallel to the symmetry axis, and calculate the characteristic values of the pixels in the sliding window at each slide: ; In the formula, Indicates The characteristic value of the pixel in the sliding window during the sliding, Indicates The pixel value in the sliding window at the time of sliding The probability of occurrence, represents the total number of different pixel values in the sliding window, represents the logarithmic function; Establishing a feature sequence corresponding to each column of pixels in the region, wherein the feature sequence is composed of feature values corresponding to each column of pixels; calculating the Pearson correlation coefficient between the feature sequences of symmetrical columns on both sides of the symmetry axis; In response to the Pearson correlation coefficient being greater than or equal to a set threshold, the two-color injection molded part to be inspected is determined to be of normal quality; when the Pearson correlation coefficient is less than the set threshold, the two-color injection molded part to be inspected is determined to be of defective quality.
2. The two-color injection molding appearance detection method based on image recognition according to claim 1 is characterized in that: Use a multispectral camera to acquire images of the two-color injection molded parts to be inspected.
3. The two-color injection molding appearance detection method based on image recognition according to claim 1 is characterized in that: The two-color injection molding area in the identification image is identified by using a threshold segmentation algorithm or a deep learning algorithm.
4. The two-color injection molding appearance detection method based on image recognition according to claim 3 is characterized in that: The threshold segmentation algorithm is: RGB color threshold operator, HSV color threshold operator or Lab color threshold operator; The deep learning algorithm is: semantic segmentation network or U-type neural network.
5. The two-color injection molding appearance detection method based on image recognition according to claim 1, characterized in that: The method also includes performing grayscale conversion and Gaussian filtering on the image of the two-color injection molded part to be inspected.
6. The two-color injection molding appearance detection method based on image recognition according to claim 1, characterized in that: The Hough transform algorithm is used to determine the symmetry axis of the region, specifically: Perform edge detection on the area to be detected and extract the edge contour of the area; Use Hough transform to detect straight lines in the area to be detected; The symmetry score of the straight line relative to the edge of the region is calculated, and the straight line with the largest symmetry score is selected as the symmetry axis of the region to be detected.
7. The two-color injection molding appearance detection method based on image recognition according to claim 1, characterized in that: The method also includes performing maximum absolute value normalization processing on the feature sequence.
8. The two-color injection molding appearance inspection system based on image recognition is characterized by: The invention comprises a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the two-color injection molding appearance detection method based on image recognition as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and system for monitoring plastic deformation process and defects
CN102520672A
Method for detecting face symmetry and anomaly based on real-time face detection
CN106250819A