Method and system for detecting silver streak defects of injection molded parts based on grayscale run-length matrix
Through the detection method based on the grayscale run matrix, the surface image of the injection molded parts is analyzed, and the causes of silver wire pattern defects are accurately judged, which solves the problem of judging the causes of silver wire pattern defects of injection molded parts and improves the production pass rate of injection molded parts.
Patent Information
- Application Number
- CN202211005960.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-24
- Filing Date
- 2022-08-22
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-08-22
AI Technical Summary
Silver wire defects often occur after injection molding, resulting in reduced assembly efficiency and unqualified product quality. It is difficult for the existing technology to accurately judge the causes of defects to control the production process.
The detection method based on the grayscale run matrix is used to perform grayscale processing on the surface image of the injection molded parts, analyze the grayscale value distribution, determine whether there is a silver wire pattern defect, and determine the cause of the defect through skewness, threshold and run matrix calculation. Then take corresponding measures to adjust the production process.
It improves the pass rate of injection molded parts, accurately judges the causes of silver wire defects, helps implementers to adjust production processes, and reduces the occurrence of unqualified products.
Smart Images

Figure CN115222729B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method and system for detecting silver streak defects of injection molded parts based on a grayscale run-length matrix. Background Art
[0002] Injection molded parts will have defects after molding. These defective finished products will affect assembly efficiency or overall machine performance. Such products are somewhat different from the predetermined quality standards and may even be unusable. To fundamentally solve the defects of injection molded parts, it is necessary to determine the causes of the defects, so as to control the production process accordingly, thereby reducing the unqualified rate of products in subsequent new production processes.
[0003] Silver streak is a common defect in injection molded parts. It is usually caused by different influencing factors during pouring. According to the influencing factors, the causes of silver streak defects are mainly divided into the following three types: insufficient drying, gas mixing and thermal decomposition. Different influencing factors lead to different silver streak. Therefore, it is necessary to determine the specific cause of silver streak, so as to determine the influencing factors and then control the production process. Summary of the invention
[0004] In response to the above technical problems, an embodiment of the present invention provides a method and system for detecting silver streak defects in injection molded parts based on a grayscale run matrix. The method and system can determine whether the injection molded part has defects and whether the defects are silver streak defects by analyzing the grayscale value distribution in the grayscale image of the injection molded part to be inspected. In the case of silver streak defects, the cause of the silver streak defects can be determined, which facilitates the implementer to take corresponding measures to control the subsequent production process, thereby improving the qualified rate of injection molded parts in the subsequent production process.
[0005] In the first aspect, the embodiments of the present invention provide a method for detecting silver streak defects of injection molded parts based on a grayscale run matrix, comprising:
[0006] The surface image of the injection molded part to be inspected is obtained and grayed to obtain a grayscale image.
[0007] The grayscale value distribution in the grayscale image is compared with the grayscale value distribution in the grayscale image of a normal injection molded part to determine whether the injection molded part has defects. If the determination result is yes, the subsequent steps are executed, otherwise the subsequent steps are not executed.
[0008] The skewness is obtained by using the degree to which the grayscale value distribution in the grayscale image of the defective injection molded part is positively skewed. When the skewness is greater than 0, the defect in the defective injection molded part is judged to be a silver streak defect. The grayscale threshold is determined based on the skewness and the grayscale mean and grayscale variance of the normal injection molded part, and subsequent steps are executed, otherwise the subsequent steps are not executed.
[0009] The grayscale image judged as a silver streak defect is filled to obtain a minimum circumscribed circle image of the grayscale image, wherein the pixel value of the filled portion is the pixel value of a normal injection molded part, and the minimum circumscribed circle image is radially expanded to obtain an expanded image.
[0010] The pixel values of the pixels in the expanded image whose grayscale values are less than the grayscale threshold are set to 0 to obtain a segmented image, a grayscale run matrix in the vertical direction of the segmented image is obtained, and a long-run high-grayscale advantage measurement value and a short-run low-grayscale advantage measurement value of the grayscale run matrix are calculated.
[0011] When the long-run high grayscale dominance metric value is greater than the preset first threshold, and the short-run low grayscale dominance metric value is less than the preset second threshold, the silver streak is caused by insufficient drying. When the short-run low grayscale dominance metric value is greater than the preset first threshold, and the long-run high grayscale dominance metric value is less than the preset second threshold, the silver streak is caused by thermal decomposition. Otherwise, the silver streak is caused by gas mixing.
[0012] In a feasible embodiment, calculating the long-run high grayscale dominance metric value and the short-run low grayscale dominance metric value of the grayscale run matrix includes:
[0013]
[0014]
[0015] Among them, G 1 is the long-run high grayscale advantage measure, G 2 is the short-run low grayscale advantage measure, w st It indicates the frequency of the pixel with gray level s appearing t times in a row. represents an integer obtained by rounding down 255-Y, M is the length of the grayscale image, N is the width of the grayscale image, Y is the grayscale threshold, and e is a natural constant.
[0016] In a feasible embodiment, the skewness is obtained according to the degree to which the grayscale value distribution in the grayscale image is positively skewed, including:
[0017]
[0018] Among them, i max 、i min are the maximum and minimum grayscale values on the grayscale histogram, h(i) is the frequency of grayscale value i, μ 3 is the mean of the frequency of gray values, σ 3 is the standard deviation of the gray value frequency.
[0019] In a feasible embodiment, comparing the grayscale value distribution in the grayscale image with the grayscale value distribution in the grayscale image of a normal injection molded part to determine whether the injection molded part has defects includes:
[0020] Calculate the matching coefficient after comparing the grayscale image with the grayscale image of the normal injection molded part:
[0021]
[0022] Among them, μ 1 and σ 1 are the mean and variance of the grayscale values in the grayscale image of the injection molded part, μ 2 and σ 2 are the mean and variance of the grayscale values of the normal injection molded parts surface, respectively. When the matching coefficient Q is less than the preset third threshold, the injection molded parts have defects; otherwise, the injection molded parts do not have defects.
[0023] In a feasible embodiment, the grayscale threshold is: Among them, μ 2 and σ 2 are the mean and variance of the grayscale values in the grayscale image of a normal injection molded part, and S is the skewness.
[0024] In a feasible embodiment, the method further includes:
[0025] Spot check the injection molded parts to be tested, determine whether each injection molded part has silver streak defects, and determine the causes of the silver streak defects in the injection molded parts with silver streak defects.
[0026] When the proportion of injection-molded parts with silver streaks caused by insufficient drying in the sampled injection-molded parts is greater than a preset fourth threshold, the drying conditions need to be changed.
[0027] When the proportion of injection-molded parts with silver streaks caused by gas mixing in the sampled injection-molded parts is greater than a preset fourth threshold, the molding conditions of the injection-molded parts are reset or the materials used in production are changed.
[0028] When the proportion of injection-molded parts with silver streaks caused by thermal decomposition in the sampled injection-molded parts is greater than a preset fourth threshold, the heating strip is checked, and the nozzle position is adjusted while adjusting the temperature in the mold cavity.
[0029] In a feasible embodiment, graying the surface image of the injection molded part to obtain a grayscale image includes:
[0030] The maximum value of the pixel values of the pixel points in the surface image of the injection molded part in the three RGB channels is used as the grayscale value of the pixel points in the grayscale image.
[0031] In the second aspect, an embodiment of the present invention proposes a silver streak defect detection system for injection molded parts based on a grayscale run matrix, comprising: a memory and a processor, characterized in that the processor executes a computer program stored in the memory to implement the silver streak defect detection method for injection molded parts based on a grayscale run matrix in an embodiment of the present invention.
[0032] The embodiments of the present invention provide a method and system for detecting silver streak defects of injection molded parts based on a grayscale run matrix. Compared with the prior art, the beneficial effects of the embodiments of the present invention are that: by analyzing the grayscale value distribution in the grayscale image of the injection molded part to be inspected, it is possible to determine whether the injection molded part has a defect and whether the defect is a silver streak defect. In the case of a silver streak defect, the cause of the silver streak defect can be determined, which is convenient for the implementer to take corresponding measures to control the subsequent production process, thereby improving the qualified rate of injection molded parts in the subsequent production process. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 It is a flow chart of a method for detecting silver streak defects of injection molded parts based on a grayscale run-length matrix provided in an embodiment of the present invention.
[0035] Figure 2 Schematic diagrams of surface images of injection molded parts with three different causes of silver streak defects in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0037] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0038] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features; in the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0039] The embodiment of the present invention provides a method for detecting silver streak defects of injection molded parts based on grayscale run-length matrix, such as Figure 1 As shown, including:
[0040] Step S101, obtaining a surface image of the injection molded part to be inspected and graying it to obtain a grayscale image.
[0041] Step S102, comparing the grayscale value distribution in the grayscale image with the grayscale value distribution in the grayscale image of a normal injection molded part to determine whether the injection molded part has defects, if the determination result is yes, executing subsequent steps, otherwise not executing subsequent steps.
[0042] Step S103, obtaining the skewness by utilizing the degree to which the grayscale value distribution in the grayscale image of the defective injection molded part is positively skewed. When the skewness is greater than 0, the defect in the defective injection molded part is determined to be a silver streak defect. Determine the grayscale threshold based on the skewness and the grayscale mean and grayscale variance of the normal injection molded part, and execute subsequent steps. Otherwise, no subsequent steps are executed.
[0043] Step S104, fill the grayscale image judged as a silver streak defect to obtain a minimum circumscribed circle image of the grayscale image, wherein the pixel value of the filled portion is the pixel value of a normal injection molded part, and radially expand the minimum circumscribed circle image to obtain an expanded image.
[0044] Step S105, setting the pixel values of the pixels in the expanded image whose grayscale values are less than the grayscale threshold to 0 to obtain a segmented image, obtaining the grayscale run matrix in the vertical direction of the segmented image, and calculating the long-run high-grayscale advantage measurement value and the short-run low-grayscale advantage measurement value of the grayscale run matrix.
[0045] Step S106: determine the cause of the silver streak defect according to the long-run high grayscale advantage metric value and the short-run low grayscale advantage metric value.
[0046] Silver streak is a common defect in injection molded parts. It is usually caused by different influencing factors during pouring. According to the influencing factors, the causes of silver streak defects are mainly divided into the following three types: insufficient drying, gas mixing and thermal decomposition.
[0047] Figure 2Schematic diagram of the surface image of the injection molded part under three different causes of silver streak defects in the embodiment of the present invention is shown below. Figure 2 A brief introduction to the three different causes of silver streak defects.
[0048] It should be noted that the specific reasons for the silver streak defect caused by insufficient drying include: inappropriate drying equipment and drying conditions. In the surface image, it is specifically manifested as: silver streaks diverge in all directions and the streaks are linear, and the length of the silver streak part is longer and brighter.
[0049] The specific reasons for the silver streak defect caused by gas mixing include: forming conditions, mold conditions or raw material mismatch. In the surface image, it is specifically manifested as: from the central gate to the farther part, the silver streak is continuous and occurs randomly, and the brightness of the silver streak part is moderate.
[0050] The specific reasons for the silver streak defect caused by thermal decomposition include: uneven heating due to the heating bar, adjustment of the nozzle, cavity temperature, etc. In the surface image, the silver streak appears as dense and discrete dots with the central gate as the center, and the brightness of the silver streak area is darker.
[0051] Further, step S101, obtaining a surface image of the injection molded part to be inspected and graying it to obtain a grayscale image. Specifically includes:
[0052] First, obtain the surface image of the injection molded part to be inspected. The obtained surface image is in RGB format. RGB is a color standard that obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue.
[0053] Secondly, the surface image of the injection molded part is grayed to obtain a grayscale image. The grayscale process includes: taking the maximum value of the pixel value of the pixel point in the surface image of the injection molded part in the three RGB channels as the grayscale value of the pixel point in the grayscale image;
[0054] Furthermore, step S102 compares the grayscale value distribution in the grayscale image with the grayscale value distribution in the grayscale image of a normal injection molded part to determine whether the injection molded part has defects. If the determination result is yes, the subsequent steps are executed, otherwise the subsequent steps are not executed. Specifically, it includes:
[0055] The degree of matching between the grayscale value distribution of the collected injection molded part image and the grayscale value distribution of the normal injection molded part is used to determine whether the injection molded part has a silver streak defect. First, the matching coefficient between the surface image of the injection molded part and the surface image of the injection molded part under normal conditions is calculated. The specific process of the matching coefficient includes:
[0056] Among them, μ1 is the mean value of the grayscale value in the grayscale image of the injection molded part to be inspected, σ 1 is the variance of the grayscale value in the grayscale image of the injection molded part to be inspected, μ 2 is the mean value of the grayscale value in the grayscale image of a normal injection molded part, σ 2 is the variance of the grayscale value in the grayscale image of a normal injection molded part.
[0057] It should be noted that the matching coefficient obtained in this embodiment can reflect the matching degree between the injection molded part to be detected and the injection molded part under normal conditions. Therefore, the larger the matching coefficient in this embodiment, the greater the probability that the injection molded part to be detected is a normal injection molded part. When the matching coefficient Q is less than the preset third threshold value, there is a defect in the injection molded part to be detected, and further analysis is required. Otherwise, there is no defect in the injection molded part.
[0058] As an example, in the embodiment of the present invention, the third threshold is preset to be 0.9.
[0059] Firstly, multiple normal surface images of injection molded parts are collected, and the grayscale histogram of each normal surface image of injection molded parts is obtained respectively. The grayscale histogram represents the probability of each grayscale value appearing in multiple images. All grayscale values and the probabilities corresponding to the grayscale values are taken as sample data, and the mean and variance of these sample data are calculated.
[0060] Further, step S103, the skewness is obtained by using the degree of positive skewness distribution of the grayscale value distribution in the grayscale image of the defective injection molded part. When the skewness is greater than 0, the defect in the injection molded part is a silver streak defect. The grayscale threshold is determined according to the skewness and the grayscale mean and grayscale variance of the normal injection molded part, and the subsequent steps are executed, otherwise the subsequent steps are not executed. Specifically including:
[0061] First, the skewness is obtained according to the degree to which the grayscale value distribution in the grayscale histogram of the grayscale image is positively skewed. The calculation process of the skewness includes:
[0062] Among them, i max 、i min are the maximum and minimum grayscale values in the grayscale image, h(i) is the frequency of grayscale value i in the grayscale image, μ 3 is the mean frequency of all gray values in the grayscale image, σ 3 is the standard deviation of the gray value frequency.
[0063] The skewness S is used to measure the asymmetry of the grayscale distribution in the grayscale histogram. When the skewness S = 0, it means that the data is relatively evenly distributed on both sides of the mean value in the grayscale histogram, and the distribution of the grayscale histogram is a normal distribution; when the skewness S < 0, the distribution of the grayscale histogram is left-skewed, and the distribution of the grayscale histogram is negatively skewed; when the skewness S > 0, the distribution of the grayscale histogram is right-skewed, and the distribution of the grayscale histogram is positively skewed.
[0064] It should be noted that, since the grayscale histogram of a normal injection molded part is normally distributed, the existence of the silver streak defect causes the grayscale distribution in the grayscale histogram to be right-skewed, showing a positive skewed distribution, and the skewness S>0. Therefore, in this embodiment, the skewness is used to determine whether the defect is a silver streak defect. Specifically, when the defect of the injection molded part is a silver streak defect, it is necessary to further analyze the specific reasons for its existence so as to take corresponding improvement measures.
[0065] Further, step S104, fill the grayscale image judged as a silver streak defect to obtain a minimum circumscribed circle image of the grayscale image, wherein the pixel value of the filled part is the pixel value of a normal injection molded part, and radially expand the minimum circumscribed circle image to obtain an expanded image. Specifically comprising:
[0066] In the embodiment of the present invention, the silver streak radiates from the central gate to the surrounding areas, so the grayscale value change in the radial direction is calculated. Considering that the radial direction calculation cannot be performed directly on a single pixel, the image is filled and radially expanded, as follows:
[0067] The size of the grayscale image is M×N. With the center of the image as the center of the circle, the image is filled with a diameter of The minimum circumscribed circle image is obtained, and the gray value of the filled part is the mean gray value in the gray histogram of the normal injection molded part.
[0068] The obtained minimum circumscribed circle image is radially expanded. Since the grayscale of the radial direction is mainly calculated in this embodiment, by radially expanding the circular image, the vertical direction obtained after expansion can be directly used to represent the radial direction of the circle before expansion. At the same time, because the silver streak mainly appears at the pouring gate of the injection molded part, the position of the pouring gate is approximately coincident with the center of the minimum circumscribed circle of the image.
[0069] Further, step S105, the pixel values of the pixels whose grayscale values in the expanded image are less than the grayscale threshold are set to 0 to obtain a segmented image, a grayscale run matrix in the vertical direction of the segmented image is obtained, and a long run high grayscale advantage measurement value and a short run low grayscale advantage measurement value of the grayscale run matrix are calculated. Specifically, it includes:
[0070] First, a brief introduction is given to the grayscale run matrix, which is a matrix composed of the lengths of grayscale value runs. Specifically defined as: the grayscale run matrix is D[s, t, θ], where s represents the pixel value in the original image, all values of s are the grayscale levels of the original image, t represents the length of the pixel value, that is, t consecutive values are all s, and θ represents the calculated direction, which is generally 0 degrees, 45 degrees, 90 degrees and 135 degrees. Because 90 degrees can directly represent the radial direction in the circular image before radial expansion, the 90-degree direction is used for calculation in this embodiment.
[0071] For example, for the matrix Calculating the grayscale run matrix with θ=0 means calculating the grayscale run matrix in the horizontal direction. The grayscale run matrix is represented as D[s,t,θ], and the size of D is [3,4,1], where 3 represents the grayscale level [0,1,2]; 4 represents the longest data value, that is, the diagonal length is 4; 1 represents the number of θ, that is, only θ=0. Counting the number of times pixel 0 appears continuously in the horizontal direction, 0 appears 4 times in a row as 0, 0 appears 3 times in a row as 0, 0 appears 2 times in a row as 4, and 0 appears 1 time in a row as 0, so the result of pixel 0 is [0,4,0,0]. Calculating pixel 1 according to the above method is [0,2,0,0], so:
[0072] The result calculated according to θ = 0 degrees is:
[0073] The result calculated according to θ = 45 degrees is:
[0074] In the embodiment of the present invention, it is necessary to determine the characteristics of the pixel points belonging to the silver streak, so the grayscale mean μ 2 , Grayscale variance σ of normal injection molded parts 2 And the skewness S of the injection molded part to be tested, determine the grayscale threshold Then, the grayscale values of the pixels whose grayscale values are less than Y are set to 0 to eliminate the interference of these pixels on the subsequent calculation process.
[0075] It should be noted that the silver streak caused by insufficient drying is linear, long and bright; the silver streak caused by gas mixing occurs randomly, is continuous and flake-like, and has moderate brightness; the silver streak caused by thermal decomposition is densely discrete dots with darker brightness. In this embodiment, by analyzing the manifestation of surface images of different silver streak defects, it is found that the use of the run-length grayscale advantage measurement value can well characterize different forms of silver streak defects. In this embodiment, the run-length grayscale advantage measurement value includes a long-run high grayscale advantage measurement value and a short-run low grayscale advantage measurement value.
[0076] Secondly, the run grayscale advantage is obtained according to the radial grayscale run matrix. The calculation process of the run grayscale advantage metric value includes:
[0077] in, Indicates the integer after rounding down 255-Y, w st Indicates the frequency of the pixel with gray level s appearing t times in a row. 1 is the long-run high grayscale advantage measure, G 2 is the short-run low grayscale dominance measure, M is the width of the grayscale image, and N is the height of the grayscale image.
[0078] G 1 represents the long-run high grayscale advantage measure, G 1 Medium st s 2 t 2 Give greater weight to long-run high grayscale. When there are more long-run high grayscale, G 1 The larger the value, the higher the 2 represents the short-run low-grayscale advantage measure, G 2 middle Give greater weight to short-run low grayscale. When there are more short-run low grayscale, G 2 The larger the value.
[0079] Optionally, you can set a value greater than Every 10 gray values are divided into one level, with a total of gray levels, then the radial grayscale run matrix is D[s, t, θ] θ=1, θ is the radial direction, that is, the vertical direction of the unit. Calculate w according to the vertical direction st , represents the frequency of t consecutive occurrences of a pixel with gray level s, and the radial gray run matrix is obtained. In this way, the accuracy can be guaranteed while reducing the amount of calculation, thereby improving processing efficiency.
[0080] Further, step S106, judging the cause of the silver streak defect according to the long-run high grayscale advantage metric value and the short-run low grayscale advantage metric value, specifically comprising:
[0081] The purpose of this step is to determine the cause of the silver streak defect based on the texture run grayscale advantage, and then control the production process, so as to adopt corresponding strategies to reduce the unqualified rate of subsequent production processes.
[0082] Specifically, when the long-run high grayscale advantage measurement value is greater than the preset first threshold and the short-run low grayscale advantage measurement value is less than the preset second threshold, the surface texture has a long-run high grayscale advantage. The silver thread texture caused by insufficient drying is linear, long in length, and brighter in brightness. Therefore, the silver thread texture is caused by insufficient drying.
[0083] When the short-run low-grayscale advantage measurement value is greater than the preset first threshold and the long-run high-grayscale advantage measurement value is less than the preset second threshold, the surface texture of the injection molded part has a short-run low-grayscale advantage, and the silver thread texture caused by thermal decomposition is densely discrete points with darker brightness, so the silver thread texture is caused by thermal decomposition.
[0084] Otherwise, the surface texture has neither the advantage of long-stroke high grayscale nor the advantage of short-stroke low grayscale. The silver streak caused by gas mixing occurs randomly, in the form of continuous sheets with moderate brightness. The silver streak in the injection molded parts is caused by gas mixing.
[0085] As an example, in this embodiment, the first threshold is preset to be 0.8, and the second threshold is preset to be 0.3.
[0086] It should be noted that the production process control of injection molded parts needs to be reflected based on the defect characteristics in a batch of products. When the defect rate exceeds the standard, it means that there are problems in the production process, and the production process needs to be improved accordingly based on the specific causes of the defects of the injection molded parts.
[0087] Spot check the injection molded parts to be tested, determine whether each injection molded part has silver streak defects, and determine the causes of the silver streak defects in the injection molded parts with silver streak defects; when the proportion of injection molded parts with silver streak caused by insufficient drying in the sampled injection molded parts is greater than the preset fourth threshold, it is necessary to change the drying conditions; when the proportion of injection molded parts with silver streak caused by gas mixing in the sampled injection molded parts is greater than the preset fourth threshold, reset the molding conditions of the injection molded parts or change the materials used in production; when the proportion of injection molded parts with silver streak caused by thermal decomposition in the sampled injection molded parts is greater than the preset fourth threshold, check the heating strips, adjust the nozzle position and adjust the temperature in the mold cavity at the same time.
[0088] Based on the same inventive concept as the above method, the present embodiment also provides an injection molded part silver streak defect detection system based on grayscale run matrix. The injection molded part silver streak defect detection system based on grayscale run matrix in the present embodiment includes a memory and a processor. The processor executes a computer program stored in the memory to realize the detection of silver streak defects in injection molded parts as described in the embodiment of the injection molded part silver streak defect detection method based on grayscale run matrix.
[0089] Since the method for detecting silver streak defects in injection molded parts has been described in the embodiment of the method for detecting silver streak defects in injection molded parts based on grayscale run-length matrix, it will not be repeated here.
[0090] To sum up, the embodiments of the present invention can determine whether there is a defect in the injection molded part and whether the defect is a silver streak defect by analyzing the grayscale value distribution in the grayscale image of the injection molded part to be inspected. In the case of a silver streak defect, the cause of the silver streak defect can be determined, which is convenient for the implementer to take corresponding measures to control the subsequent production process, thereby improving the qualified rate of injection molded parts in the subsequent production process.
[0091] The words "including", "comprising", "having" and the like in the present invention are open words, meaning "including but not limited to", and can be used interchangeably therewith. The words "or" and "and" used herein mean the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein means the phrase "such as but not limited to", and can be used interchangeably therewith.
[0092] It should also be noted that in the method and system of the present invention, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0093] The above embodiments are merely examples for the purpose of clear explanation and do not constitute a limitation on the protection scope of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description, and it is not necessary and impossible to list all the implementation methods here. All designs that are the same or similar to the present invention belong to the protection scope of the present invention.
Claims
1. A method for detecting silver streak defects of injection molded parts based on grayscale run matrix, characterized in that: include: Obtaining a surface image of the injection molded part to be inspected and graying it to obtain a grayscale image; Comparing the grayscale value distribution in the grayscale image with the grayscale value distribution in the grayscale image of a normal injection molded part to determine whether the injection molded part has a defect, and if the determination result is yes, executing the subsequent steps, otherwise, not executing the subsequent steps; The skewness is obtained by using the degree to which the grayscale value distribution in the grayscale image of the defective injection molded part is positively skewed. When the skewness is greater than 0, the defect in the defective injection molded part is determined to be a silver streak defect. The grayscale threshold is determined according to the skewness and the grayscale mean and grayscale variance of the normal injection molded part, and the subsequent steps are executed. Otherwise, the subsequent steps are not executed. Filling the grayscale image judged as a silver streak defect to obtain a minimum circumscribed circle image of the grayscale image, wherein the pixel value of the filled portion is the pixel value of a normal injection molded part, and radially expanding the minimum circumscribed circle image to obtain an expanded image; The pixel values of the pixels whose grayscale values in the expanded image are less than the grayscale threshold are set to 0 to obtain a segmented image, a grayscale run matrix in the vertical direction of the segmented image is obtained, and a long-run high-grayscale advantage metric value and a short-run low-grayscale advantage metric value of the grayscale run matrix are calculated; When the long-run high grayscale dominance metric value is greater than the preset first threshold, and the short-run low grayscale dominance metric value is less than the preset second threshold, the silver streak is caused by insufficient drying; when the short-run low grayscale dominance metric value is greater than the preset first threshold, and the long-run high grayscale dominance metric value is less than the preset second threshold, the silver streak is caused by thermal decomposition; Otherwise, the silver streaks are caused by gas mixing.
2. The method for detecting silver streak defects of injection molded parts based on grayscale run matrix according to claim 1, characterized in that: Calculating the long-run high-grayscale advantage metric value and the short-run low-grayscale advantage metric value of the grayscale run matrix includes: Among them, G1 is the long-run high grayscale advantage metric value, G2 is the short-run low grayscale advantage metric value, and w st It indicates the frequency of the pixel with gray level s appearing t times in a row. represents an integer obtained by rounding down 255-Y, M is the length of the grayscale image, N is the width of the grayscale image, Y is the grayscale threshold, and e is a natural constant.
3. The method for detecting silver streak defects of injection molded parts based on grayscale run matrix according to claim 1, characterized in that: The skewness is obtained according to the degree to which the grayscale value distribution in the grayscale image is positively skewed, including Among them, i max 、i min are the maximum and minimum grayscale values on the grayscale histogram, h(i) is the frequency of grayscale value i, μ3 is the mean of the grayscale value frequency, and σ3 is the standard deviation of the grayscale value frequency.
4. The method for detecting silver streak defects of injection molded parts based on grayscale run matrix according to claim 1, characterized in that: Comparing the grayscale value distribution in the grayscale image with the grayscale value distribution in the grayscale image of a normal injection molded part to determine whether the injection molded part has defects, including: Calculate the matching coefficient after comparing the grayscale image with the grayscale image of the normal injection molded part: Among them, μ1 and σ1 are the mean and variance of the grayscale values in the grayscale image of the injection-molded part, respectively, μ2 and σ2 are the mean and variance of the grayscale values on the surface of the normal injection-molded part, respectively. When the matching coefficient Q is less than the preset third threshold, the injection-molded part has defects, otherwise, the injection-molded part does not have defects.
5. The method for detecting silver streak defects of injection molded parts based on grayscale run matrix according to claim 1, characterized in that: The grayscale threshold is: Among them, μ2 and σ2 are the mean and variance of the grayscale values in the grayscale image of the normal injection molded parts, respectively, and S is the skewness.
6. The method for detecting silver streak defects of injection molded parts based on grayscale run matrix according to claim 1, characterized in that: The method further comprises: Spot check the injection molded parts to be tested, determine whether each injection molded part has silver streak defects, and determine the causes of the silver streak defects in the injection molded parts with silver streak defects; When the proportion of injection molded parts with silver streaks caused by insufficient drying in the sampled injection molded parts is greater than a preset fourth threshold, the drying conditions need to be changed; When the proportion of injection molded parts with silver streaks caused by gas mixing in the sampled injection molded parts is greater than a preset fourth threshold, the molding conditions of the injection molded parts are reset or the materials used in production are changed; When the proportion of injection-molded parts with silver streaks caused by thermal decomposition in the sampled injection-molded parts is greater than a preset fourth threshold, the heating strip is checked, and the nozzle position is adjusted while adjusting the temperature in the mold cavity.
7. The method for detecting silver streak defects of injection molded parts based on grayscale run matrix according to claim 1, characterized in that: Grayscale the surface image of the injection molded part to obtain a grayscale image, including: The maximum value of the pixel values of the pixel points in the surface image of the injection molded part in the three RGB channels is used as the grayscale value of the pixel points in the grayscale image.
8. A silver streak defect detection system for injection molded parts based on grayscale run-length matrix, comprising: A memory and a processor, wherein the processor executes a computer program stored in the memory to implement the method for detecting silver streak defects of injection molded parts based on a grayscale run-length matrix as described in any one of claims 1 to 7.
