A method and system for detecting injection molding quality of injection molded parts
By acquiring grayscale images during injection molding inspection, matching pixels and identifying light spot areas, the problem of wave texture identification under the influence of light sources is solved, and the accuracy and reliability of injection molding quality inspection are improved.
Patent Information
- Application Number
- CN202410750445.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-12
AI Technical Summary
In the existing technology, there are light sources and complex light distributions in the detection scene, which affect the recognition accuracy of the wave texture, resulting in poor quality detection results for injection molded parts and low reliability of quality detection.
By obtaining the grayscale image of the injection molded part, the edge texture and grayscale area are determined, the pixel points are matched based on the slope characteristics, the wavy edges are screened based on the texture shape and grayscale distribution characteristics, the spot area is identified, and the overall edge is fitted through the intersection point to determine Accurate wave area detection.
It achieves accurate detection of the quality of injection molded parts and improves the reliability of detection. Through the combination of light spot characteristics and wave texture characteristics, the wave area is accurately identified, which improves the accuracy and reliability of injection quality detection of injection molded parts.
Smart Images

Figure CN118334019B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image texture analysis, and in particular to a method and system for detecting the injection molding quality of injection molded parts. Background Art
[0002] The reasons for the appearance of wavy lines on injection molded parts include poor mold surface quality, excessive mold milling marks and roughness, uneven pressurization or pressure holding of the injection molding machine, improper injection speed or temperature control, excessive injection volume, excessive pressure, raw materials added to the injection molded product may be incompatible with the mold surface, foreign matter or untreated impurities in the raw materials, etc. The appearance of wavy lines affects the quality of the injection molded parts themselves, so it is necessary to identify wavy lines.
[0003] In the related art, the detection effect of wave patterns is achieved through edge detection. In this method, since there is a light source in the detection scene and the light distribution is relatively complex, it will affect the recognition accuracy of the wave patterns themselves, resulting in poor injection quality detection effect of injection molded parts and low reliability of quality detection. Summary of the invention
[0004] In order to solve the technical problem in the related art that the presence of a light source in the detection scene and the complex light distribution will affect the recognition accuracy of the wave pattern itself, resulting in poor injection quality detection effect of the injection molded parts and low reliability of quality detection, the present invention provides an injection quality detection method and system for injection molded parts, and the technical solutions adopted are as follows:
[0005] The present invention provides a method for detecting the quality of injection molding of an injection molded part, the method comprising:
[0006] Acquire a grayscale image of the injection molded part, and determine edge texture and grayscale area in the grayscale image;
[0007] According to the slope characteristics of the pixels in the two closest edge textures, the matching pixels in one edge texture are determined;
[0008] According to the texture morphology characteristics of each edge texture, the grayscale distribution characteristics of the pixels in the edge texture, and the distance characteristics between each pixel in the edge texture and the matching pixel, the wavy edge is obtained by screening the edge texture;
[0009] According to the overall morphological characteristics of each grayscale area and the grayscale values of the pixels in the grayscale area, a light spot area is obtained by screening the grayscale area;
[0010] According to the distance between the intersection point of the same spot area and the wave edge and the injection point, the intersection points are matched in pairs, and the overall edge is fitted according to the edge texture of the wave edge where the matched intersection point is located;
[0011] The wave area is determined according to all the overall edges and the wave edges that do not intersect with the light spot area, and the injection molding quality of the injection molded part is detected according to the wave area.
[0012] Furthermore, the grayscale region acquisition method comprises:
[0013] Performing super-pixel segmentation on the grayscale image based on a super-pixel segmentation algorithm to obtain a super-pixel region;
[0014] The grayscale values of all pixels in each superpixel region are determined, and all superpixel regions are clustered according to the grayscale values and the Euclidean distance between two superpixel regions to obtain grayscale regions.
[0015] Furthermore, the method for obtaining matching pixel points includes:
[0016] Determine the slope of the edge texture at each pixel point as the point slope;
[0017] In the two edge textures that are closest to each other, it is determined that any pixel point having the same point slope and other pixel points that do not belong to the same edge texture are matching pixel points.
[0018] Further, the step of screening the edge texture to obtain the wavy edge comprises:
[0019] Selecting any edge texture as a target texture, performing curve fitting on the target texture to obtain a fitting curve; determining a fitting error index of the target texture according to a mean distance between all pixel points in the target texture and the fitting curve, wherein the mean distance is negatively correlated with the fitting error index;
[0020] Taking the difference between the grayscale mean of all pixels in the target texture and the grayscale mean of all pixels in the grayscale image as a grayscale difference index;
[0021] The minimum value of the Euclidean distance between any pixel point in the target texture and the matching pixel point on the other edge texture closest to it is determined as the matching distance of the corresponding pixel point in the target texture; the flow characteristic index of the target texture is determined according to the discrete degree of the matching distance of all pixel points in the target texture, wherein the discrete degree is negatively correlated with the flow characteristic index;
[0022] Determining a target probability that the target texture is a wavy edge texture according to the fitting error index, the grayscale difference index, and the flow characteristic index of the target texture;
[0023] The edge texture whose target probability is greater than a preset probability threshold is regarded as a wavy edge.
[0024] Further, determining the target probability that the target texture is a wavy edge texture according to the fitting error index, the grayscale difference index and the flow characteristic index of the target texture includes:
[0025] The product of the fitting error index, the grayscale difference index and the flow characteristic index is normalized to obtain the target probability.
[0026] Furthermore, the method for acquiring the light spot area includes:
[0027] Calculating the grayscale mean of all pixels in the grayscale area to obtain the regional grayscale coefficient, and taking the grayscale area whose regional grayscale coefficient is greater than a preset coefficient threshold as a suspected area;
[0028] Determine a line segment connecting two pixels that are farthest apart in any suspected region as a region feature line segment, and use an angle between the region feature line segment and a preset reference line as a direction angle of the suspected region;
[0029] The average of the direction angles of all suspected regions is taken as the overall direction average; according to the difference between the direction angle of any suspected region and the overall direction average, the regional direction characteristic index corresponding to the suspected region is determined;
[0030] The difference between the length of the regional characteristic line segment of any suspected region and the average length of all the regional characteristic line segments is used as the overall characteristic difference index;
[0031] Determine the light spot probability that the suspected area is a light spot area according to the regional direction characteristic index and the overall characteristic difference index, wherein both the regional direction characteristic index and the overall characteristic difference index are positively correlated with the light spot probability, and the value of the light spot probability is a normalized value;
[0032] The suspected area where the light spot probability is greater than a preset probability threshold is taken as the light spot area.
[0033] Furthermore, the matching of the intersection points in pairs according to the distance between the intersection point of the same light spot area and the wave edge and the injection point includes:
[0034] Determine the pixel point that intersects with the wave edge in the same spot area as the intersection point, and use the distance between the intersection point and the preset glue injection point as the diffusion distance;
[0035] According to the difference in diffusion distance values between any two intersection points at the edge of the light spot area, they are matched in pairs, so that the difference in diffusion distance values between all matched two intersection points is minimized.
[0036] Furthermore, fitting the overall edge according to the edge texture of the wave edge where the matched intersection point is located includes:
[0037] Determine the tangent of the wave edge at the position of the two matched intersection points, determine the wave fitting curve according to the tangent and the intersection of the two tangents, and use the curve composed of the two wave edges and the wave fitting curve as the overall edge.
[0038] Further, determining the wave area according to all the overall edges and the wave edges that do not intersect with the light spot area includes:
[0039] The grayscale image is evenly divided into a preset number of square areas of the same size, and the wave area is determined according to the proportion of the number of pixel points belonging to the overall edge and the wave edge that does not intersect the spot area in each square area, wherein the square area whose proportion is greater than a preset number ratio threshold is regarded as the wave area.
[0040] On the other hand, the present invention also provides an injection molding quality inspection system for injection molded parts, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the methods described above when executing the computer program.
[0041] The present invention has the following beneficial effects:
[0042] The present invention is based on the influence of the spot area on the wave texture, and then accurately analyzes the overall wave texture, determines a more accurate and effective wave area, so as to provide an accurate and objective data basis for the quality inspection of injection molded parts, and ensures the reliability of the quality inspection of injection molded parts. Among them, since the wave texture diffuses outward, its texture distribution is relatively consistent. The matching pixel points are determined by the slope feature, and the wave edge is screened from the edge texture by combining the texture morphological features, the grayscale distribution features of the pixel points in the edge texture, and the distance features between each pixel point in the edge texture and the matching pixel point. Since the wave texture has a highly consistent morphology and grayscale distribution, and the distance is close, the wave edge can be accurately screened based on these dimensions; since the wave edge is still affected by the highlight of the spot area, the overall detection effect of the wave edge is poor. Therefore, the embodiment of the present invention determines the spot area, and analyzes the edge texture blocked by the spot area according to the intersection point feature, fits the overall edge, and then combines all the overall edges and the wave edges that do not intersect with the spot area to determine the accurate wave area, so as to realize the injection quality inspection of the injection molded parts. In summary, the present invention can combine the light spot characteristics and the wave texture characteristics to detect the wave area during the injection molding process, thereby achieving more accurate injection molding quality inspection of injection molded parts and improving the reliability of quality inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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 work.
[0044] Figure 1 A flow chart of a method for detecting the quality of injection molded parts provided by one embodiment of the present invention;
[0045] Figure 2 A schematic diagram of the structure of an injection molding detection device provided by an embodiment of the present invention;
[0046] Figure 3 A schematic diagram of a wave texture provided by an embodiment of the present invention;
[0047] Figure 4 A flow chart of a wave edge screening method provided by one embodiment of the present invention;
[0048] Figure 5 A flow chart of a method for acquiring a light spot area provided by an embodiment of the present invention;
[0049] Figure 6 A structural diagram of an injection molding quality inspection system for injection molded parts provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the injection molding quality detection method of injection molded parts proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0051] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0052] The specific scheme of the injection molding quality detection method and system provided by the present invention is described in detail below with reference to the accompanying drawings.
[0053] See also Figure 1 , which shows a flow chart of a method for detecting the quality of injection molding of an injection molded part provided by an embodiment of the present invention, the method comprising:
[0054] S101: Acquire a grayscale image of an injection molded part, and determine edge texture and grayscale area in the grayscale image.
[0055] It should be noted that the specific application scenario of the embodiment of the present invention is the automation scenario of the whole process of injection molding, de-gating and packaging. Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of an injection molding inspection device provided by an embodiment of the present invention. The injection molding machine program is set to the automatic operation gear, and the mold glue feeding method is point glue feeding. After the injection molding part is formed in the injection molding machine, it automatically ejects from the discharge port and enters the mixed conveyor belt. The quality inspection is carried out on the mixed conveyor belt to determine the qualified and unqualified products. According to the inspection results, the qualified and unqualified products are automatically separated through the separation net and put into their respective glue boxes.
[0056] That is, the embodiment of the present invention aims to achieve quality inspection of injection molded parts based on a visual solution. It is understandable that when the injection molded parts are quality inspected on a conveyor belt, image acquisition equipment and light sources are usually arranged above the conveyor belt. However, the quality problem of injection molded parts is usually abnormal casting, which means that a wavy texture will be generated on the surface of the injection molded parts. The wavy texture will become more complex when illuminated by a light source, thereby affecting the recognition of the wavy texture. Therefore, the present invention takes into account the light spot area and wavy texture of the light source on the surface of the injection molded part, thereby avoiding the influence of the light spot on the recognition of the wavy texture and obtaining an accurate wavy area.
[0057] In the embodiment of the present invention, an image acquisition device is arranged above the conveyor belt to acquire an original image in RGB format, and then the original image is preprocessed to obtain a grayscale image.
[0058] The image preprocessing in the embodiments of the present invention may specifically include, for example, image denoising, image grayscale processing, and semantic segmentation and other preprocessing methods, wherein the image denoising may specifically include, for example, mean denoising, and the image grayscale processing may specifically include, for example, mean grayscale processing. Of course, in other embodiments of the present invention, the technical means used for preprocessing may also be adjusted as needed to meet the actual usage scenarios, and no further elaboration or limitation is given for this.
[0059] In the embodiment of the present invention, edge detection may be performed on the grayscale image to obtain pixel points corresponding to edge texture, wherein the edge detection may be specifically, for example, Canny edge detection or Sobel edge detection, etc., which is not limited.
[0060] Among them, the grayscale area is an area composed of pixels with similar grayscale values. The present invention can use superpixel segmentation to determine the grayscale area, or can also obtain the grayscale area based on region growing, without limitation.
[0061] Furthermore, in some embodiments of the present invention, a method for obtaining a grayscale area includes: performing superpixel segmentation on a grayscale image based on a superpixel segmentation algorithm to obtain superpixel areas; determining the grayscale values of all pixels in each superpixel area, and clustering all superpixel areas according to the grayscale value and the Euclidean distance between two superpixel areas to obtain a grayscale area.
[0062] Among them, a superpixel segmentation method can be used, and clustering can be performed according to grayscale value and distance, so as to obtain grayscale areas.
[0063] In an embodiment of the present invention, the grayscale region is composed of multiple superpixel regions with similar distances and grayscale values. Therefore, the mean grayscale value of all pixels in each superpixel region can be calculated, and the absolute value of the difference between the mean grayscale values of two superpixel regions and the Euclidean distance can be used as indicators for clustering judgment.
[0064] Optionally, the product of the difference in grayscale value means and the Euclidean distance can be calculated, and the clustering judgment index can be obtained by using the maximum and minimum value normalization method. When the clustering judgment index is small, the two superpixel areas are regarded as one area. Among them, the preset clustering threshold can be specifically, for example, 0.8, that is, the two superpixel areas with a clustering judgment index less than 0.8 are regarded as one area, thereby traversing all superpixel areas for analysis to obtain grayscale areas, and there is no restriction on this.
[0065] S102: Determine matching pixel points of a pixel point in any edge texture that matches a pixel point in the other edge texture according to slope characteristics of pixel points in two edge textures that are closest to each other.
[0066] In the embodiment of the present invention, it can be understood that since the injection molding effect is achieved by pouring the molten agent into the injection mold during the injection molding process, the liquid molten agent tends to form water-like wavy textures, and these wavy textures will affect the injection molding quality of the injection molded parts.
[0067] It can be understood that since the wave texture is a texture that spreads outward from the center point, such as Figure 3 As shown, Figure 3 A schematic diagram of a wave texture is provided for an embodiment of the present invention. Based on this, when diffusing outward from the center point, if the edge texture belongs to the texture of a wave edge, then the corresponding curved edge is similar to the texture of other wave edges. In this embodiment of the present invention, a specific analysis is performed based on the slope as a feature of the texture change.
[0068] Furthermore, in some embodiments of the present invention, the method for obtaining matching pixel points includes: determining the slope of the edge texture at each pixel point position as the point slope; in the two edge textures closest to each other, determining that the point slope of any pixel point is the same, and other pixel points that do not belong to the same edge texture are matching pixel points.
[0069] That is to say, the pixel points with the same slope in two adjacent edge textures are combined. For example, the first edge texture and the second edge texture are two adjacent edge textures. For any pixel point a on the first edge texture, the point slope of point a is determined, and the pixel point on the second edge texture with the same point slope as point a is determined as the matching pixel point of point a. Thus, the matching pixel point of each pixel point on the edge texture is determined respectively.
[0070] It should be noted that, since the overall change of the wave is relatively complex, that is, the number of matching pixels corresponding to one pixel point can be one or more, that is, all matching pixels are counted to facilitate the subsequent wave analysis.
[0071] S103: Filtering the wavy edges from the edge textures according to the texture morphology characteristics of each edge texture, the grayscale distribution characteristics of the pixels in the edge texture, and the distance characteristics between each pixel in the edge texture and the matching pixel.
[0072] In an embodiment of the present invention, the distribution characteristics of matching pixel points can be used as the characteristics of edge texture for specific analysis, combined with the texture morphological characteristics of the edge texture and the grayscale distribution characteristics of the pixel points in the edge texture, so as to identify a wavy edge with a high degree of texture feature similarity.
[0073] Further, in some embodiments of the present invention, Figure 4 As shown, Figure 4 A flow chart of a wave edge screening method provided by an embodiment of the present invention; screening a wave edge from an edge texture comprises:
[0074] S401: Select an edge texture as a target texture, perform curve fitting on the target texture, and obtain a fitting curve; determine a fitting error index of the target texture according to the mean distance between all pixel points in the target texture and the fitting curve, wherein the mean distance is negatively correlated with the fitting error index.
[0075] The curve fitting may be, for example, least squares fitting, or any other possible fitting algorithm may be used, without limitation.
[0076] It can be understood that the larger the mean distance between all pixels in the target texture and the fitting curve, the more complex the distribution of pixels on the target texture is, which is significantly different from the smoother distribution effect on the normal wave texture. Therefore, the mean distance is negatively correlated with the fitting error index, that is, the larger the fitting error index, the smoother the distribution of pixels on the corresponding target texture, and the more it conforms to the characteristics of the wave texture.
[0077] Among them, a positive correlation means that the dependent variable will increase as the independent variable increases, and the dependent variable will decrease as the independent variable decreases. The specific relationship can be a multiplication relationship, an addition relationship, or the power of an exponential function, which is determined by actual application; a negative correlation means that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases. It can be a subtraction relationship, a division relationship, etc., which is determined by actual application.
[0078] As a specific example, in the embodiment of the present invention, the inverse of the distance mean can be calculated as the fitting error index of the target texture. That is, the larger the value of the fitting error index is, the more the distribution of the pixels on the corresponding target texture conforms to the characteristics of the wave texture.
[0079] It should be noted that in order to ensure that the calculation results are meaningful, when the negative correlation is a division relationship, a parameter adjustment factor greater than 0 must be added to the denominator to prevent the denominator from being 0. The value of the parameter adjustment factor is set by the implementer according to actual conditions, and this application does not impose any special restrictions.
[0080] S402: taking the difference between the grayscale mean of all pixels in the target texture and the grayscale mean of all pixels in the grayscale image as a grayscale difference index.
[0081] In the embodiment of the present invention, since the grayscale of the injection molded part as a whole is relatively normal, and the target texture is an abnormal texture, when the grayscale feature of the target texture is significantly different from that of the grayscale image as a whole, it indicates that the corresponding abnormality is more serious.
[0082] Therefore, the embodiment of the present invention uses the absolute value of the grayscale difference of the pixel points as the grayscale difference, and uses the difference between the grayscale mean of all the pixels in the target texture and the grayscale mean of all the pixels in the grayscale image, so as to realize the analysis of each target texture as a wave texture. That is, the larger the value of the grayscale difference index, the closer the grayscale feature of the corresponding target texture is to the wave texture.
[0083] S403: The minimum Euclidean distance between any pixel point in the target texture and the matching pixel point on the other nearest edge texture is determined as the matching distance of the corresponding pixel point in the target texture; the flow characteristic index of the target texture is determined according to the discrete degree of the matching distance of all pixel points in the target texture, wherein the discrete degree is negatively correlated with the flow characteristic index.
[0084] In an embodiment of the present invention, the number of matching pixel points can be multiple. Based on the actual situation, it can be known that the one with the closest distance is most likely the pixel point with the corresponding position on the two wave edges, that is, the matching distance is calculated, and each pixel point has a matching distance.
[0085] It should be noted that if the matching distances of all pixels are the same or close, the probability that the two edge textures are wavy edges is higher, while when the difference between the matching distances is large and the numerical distribution is more complex, the probability that the corresponding two edge textures are wavy textures is smaller.
[0086] The embodiment of the present invention realizes the distribution analysis of the matching distance through the degree of discreteness. The larger the value of the degree of discreteness, the more complex the distribution. Therefore, the degree of discreteness is negatively correlated with the flow characteristic index. That is, the larger the value of the flow characteristic index, the more it conforms to the actual wave texture.
[0087] The degree of discreteness can be specifically the variance of all matching distances, that is, the variance of all matching distances is taken as the degree of discreteness. Since the negative correlation indicates that the larger the value of the degree of discreteness is, the smaller the value of the flow characteristic index is, the present invention can negatively correlate the degree of discreteness. For example, the exp(-x) function can be used, wherein x represents the degree of discreteness, and exp represents an exponential function with the natural constant e as the base. Of course, the present invention also supports the use of a variety of other possible negative correlation mappings, such as directly calculating the inverse of the degree of discreteness, and there is no limitation on this.
[0088] S404: Determine the target probability that the target texture is a wave edge texture according to the fitting error index, the grayscale difference index and the flow characteristic index of the target texture.
[0089] In combination with the above analysis, the present invention can combine the fitting error index, grayscale difference index and flow characteristic index of the target texture to achieve a specific probabilistic analysis of the wave edge texture.
[0090] The larger the fitting error index is, the smoother the distribution of pixels on the corresponding target texture is, and the more it conforms to the characteristics of the wave texture; the larger the value of the grayscale difference index is, the closer the grayscale characteristics of the corresponding target texture are to the wave texture; and the larger the value of the flow characteristic index is, the more it conforms to the actual wave texture.
[0091] Therefore, the embodiment of the present invention can directly calculate the product of the fitting error index, the grayscale difference index and the flow characteristic index, and normalize them to obtain the target probability, or it can also calculate the sum of the fitting error index, the grayscale difference index and the flow characteristic index, and normalize them to obtain the target probability. The larger the target probability, the higher the possibility that the target texture is a wavy texture.
[0092] S405: The edge texture whose target probability is greater than a preset probability threshold is regarded as a wave edge.
[0093] Among them, the preset probability threshold is the threshold value of the target probability. In the embodiment of the present invention, the preset probability threshold can be specifically 0.8, for example. That is to say, the edge texture with a target probability greater than 0.8 is regarded as a wavy edge. Of course, the preset probability threshold can also be adjusted according to actual detection requirements, and there is no limitation on this.
[0094] The embodiment of the present invention combines the fitting error index, grayscale difference index and flow characteristic index of the target texture, thereby realizing accurate analysis of the target probability from multiple dimensions of grayscale characteristics, texture distribution characteristics and texture smoothness characteristics, so that the target probability can effectively characterize the wave probability of the target texture, thereby determining a more accurate and effective wave edge.
[0095] S104: According to the overall morphological features of each grayscale region and the grayscale values of the pixels in the grayscale region, a light spot region is obtained by screening the grayscale region.
[0096] It should be noted that the wave texture analysis is also affected by the light spot area. Since the surface of the injection molding melt itself is smoother after solidification and is more likely to produce a reflective effect, the injection molded parts are more easily affected by light during inspection, causing the wave texture to be blocked by the light spot. Therefore, in the embodiment of the present invention, the wave texture is further analyzed in combination with the light spot area.
[0097] Among them, since the light spot feature is a higher grayscale and a more regular overall shape, the light spot area is easier to identify. Therefore, the present invention combines the overall morphological characteristics of each grayscale area and the grayscale value of the pixel point in the grayscale area to filter out the light spot area from the grayscale area.
[0098] Further, in some embodiments of the present invention, Figure 5 As shown, Figure 5 A flow chart of a method for acquiring a light spot area provided in one embodiment of the present invention includes the following steps:
[0099] S501: Calculate the grayscale mean of all pixels in the grayscale region to obtain the regional grayscale coefficient, and take the grayscale region whose regional grayscale coefficient is greater than a preset coefficient threshold as a suspected region.
[0100] It can be understood that the grayscale area represents an area with the same or similar grayscale values. Therefore, by calculating the average grayscale value of all pixels in the grayscale area, the overall grayscale characteristics of the grayscale area are characterized. Since the light spot area is an area with a larger grayscale value, the grayscale area with a regional grayscale coefficient greater than a preset coefficient threshold can be regarded as a suspected area. That is, the suspected area has a higher probability of being a light spot area.
[0101] The preset coefficient threshold is a threshold value of the regional grayscale coefficient. In the embodiment of the present invention, the preset coefficient threshold can be set to 200, that is, the grayscale region with a regional grayscale coefficient greater than 200 is regarded as a suspected region. Of course, the embodiment of the present invention can also be adjusted according to actual detection requirements, and there is no limitation on this.
[0102] S502: Determine a line segment connecting two pixels that are farthest apart in any suspected region as a region feature line segment, and use an angle between the region feature line segment and a preset reference line as a direction angle of the suspected region.
[0103] Among them, the regional characteristic line segments represent the morphological features in the corresponding area. Since the waves as a whole present similar morphological features, the embodiment of the present invention specifically analyzes each suspected area through the directional angle, so that the suspected area is analyzed in the directional dimension.
[0104] Among them, the preset baseline is a preset reference straight line that is convenient for realizing angle analysis. In the embodiment of the present invention, a horizontal line can be used as the preset baseline, or a fixed preset baseline can be set according to the shooting angle of the camera device, and the angle formed between the preset baseline and the regional characteristic line segment is used as the direction angle of the suspected area.
[0105] It is understandable that when the regional characteristic line segment does not coincide with the preset baseline, the direction angle can be obtained by extending the regional characteristic line segment so that they intersect, or by retaining the direction of the preset baseline and changing its position to form an angle, and the direction angle can be obtained. There is no limitation on this.
[0106] S503: taking the average of the direction angles of all the suspected regions as the overall direction average; and determining the regional direction characteristic index corresponding to the suspected region according to the difference between the direction angle of any suspected region and the overall direction average.
[0107] In the embodiment of the present invention, since the wave texture morphology and angle distribution are similar, the greater the difference between the suspected area and the overall area, the greater the probability that it is the area affected by the light spot.
[0108] Therefore, in the embodiment of the present invention, the difference between the direction angle of the suspected area and the overall direction mean is determined, and then the difference between each suspected area and the normal wave texture is determined. That is to say, the greater the difference between the direction angle of the suspected area and the overall direction mean, the greater the value of the regional directional characteristic index, indicating that the corresponding suspected area is more likely to be an area affected by the light spot.
[0109] For example, the absolute value of the difference between the direction angle of the suspected area and the overall direction mean may be calculated, and the absolute value may be normalized to obtain the regional direction feature index.
[0110] S504: taking the difference between the length of the regional feature line segment of any suspected region and the average length of all regional feature line segments as the overall feature difference index.
[0111] In the embodiment of the present invention, the overall characteristic difference index realizes the difference analysis in the length dimension. Since the light spot area itself usually contains multiple different lengths, that is, the morphological regularity of the light spot area is low, the greater the difference between the length and the overall wave texture length, the greater the probability that it is a light spot area.
[0112] S505: Determine the probability of the suspected area being a light spot area according to the regional directional characteristic index and the overall characteristic difference index, wherein both the regional directional characteristic index and the overall characteristic difference index are positively correlated with the light spot probability, and the value of the light spot probability is a normalized value.
[0113] In the embodiment of the present invention, a specific analysis is performed in combination with the above steps. Since the larger the value of the regional directional characteristic index, the more likely the corresponding suspected area is to be an area affected by the light spot, and the larger the overall characteristic difference index, the greater the probability that it is a light spot area.
[0114] Therefore, the present invention can calculate the product of the regional directional characteristic index and the overall characteristic difference index, and use the maximum and minimum value normalization method to obtain the light spot probability.
[0115] S506: taking the suspected area whose light spot probability is greater than a preset probability threshold as the light spot area.
[0116] The preset probability threshold is a threshold value of the light spot probability. The preset probability threshold in the embodiment of the present invention may be specifically, for example, 0.75, that is, the suspected area with a light spot probability greater than 0.75 is regarded as the light spot area.
[0117] The present invention calculates the spot probability by analyzing the morphology, grayscale and other characteristics of the spot area, so that the spot area can be effectively identified. Since the spot area covers the actual wave area, the recognition effect of the wave area is poor. Therefore, the accurate spot area can provide a data basis for the subsequent completion of the wave area.
[0118] S105: According to the distance between the intersection point of the same spot area and the wave edge and the injection point, the intersection points are matched in pairs, and the overall edge is fitted according to the edge texture of the wave edge where the matched intersection point is located.
[0119] In the embodiment of the present invention, since the light spot will cover the edge of the wave, so that the complete wave is split into two small wave textures by the light spot, the embodiment of the present invention can try to fit the two small wave textures, so as to fit the complete wave texture. The embodiment of the present invention implements the fitting process by matching the intersection points in pairs.
[0120] Furthermore, in some embodiments of the present invention, the intersection points are matched pairwise based on the distance between the intersection point of the same light spot area and the wave edge and the glue injection point, including: determining the pixel point that intersects with the wave edge in the same light spot area as the intersection point, and taking the distance between the intersection point and the pre-set glue injection point as the diffusion distance; matching any two intersection points on the edge of the light spot area based on the difference in diffusion distance values, so that the difference in diffusion distance values between all two matched intersection points is minimized.
[0121] Among them, the pre-set injection point is the mouth position where the molten agent is extruded during the injection molding process, which is called the injection point. By determining the intersection point, the distance between the intersection point and the pre-set injection point is used as the diffusion distance. That is, when the diffusion distances are close, two different intersection points are more likely to be points in the same wave texture blocked by the light spot area. Therefore, in the embodiment of the present invention, the difference in the diffusion distance values of the two intersection points is used to achieve the process of pairwise matching.
[0122] Furthermore, in some embodiments of the present invention, the overall edge is fitted according to the edge texture of the wave edge at the matched intersection point, including: determining the tangent of the wave edge at the position of the two matched intersection points, determining the wave fitting curve according to the tangent and the intersection of the two tangents, and taking the curve composed of the two wave edges and the wave fitting curve as the overall edge.
[0123] Among them, since the wave texture is usually a curved texture, the present invention determines the curve within the range of two tangents through the tangent and the intersection of the two tangents. MATLAB is usually used to implement this function, which is a technology well known to those skilled in the art and will not be further limited or elaborated on.
[0124] It can be understood that based on the intersection point on each tangent and the intersection point of two tangents, linear interpolation, polynomial fitting and the like can be used to determine the wave fitting curve passing through the three points based on the coordinate values of the two points and the intersection point of the tangents in the same coordinate system. Of course, in other embodiments of the present invention, Bezier curves can also be used to determine the wave fitting curve. These are all existing curve fitting methods and are not limited to this.
[0125] In the embodiment of the present invention, it is determined that the wave fitting curve and the two wave edges together form a complete wave texture, that is, an overall edge.
[0126] S106: Determine a wave area according to all the overall edges and the wave edges that do not intersect with the light spot area, and detect the injection molding quality of the injection molded part according to the wave area.
[0127] It can be understood that the wave texture contains two parts, one blocked by the light spot area and the other not blocked by the light spot area. Therefore, these two parts can be used as the determination criteria for the wave area. The wave area determination in the embodiment of the present invention can be to perform a minimum circumscribed rectangle analysis on all wave edges, determine the minimum circumscribed rectangle of each wave edge, and mark it as the wave area. Of course, the embodiment of the present invention can also use a variety of other implementation methods to determine the wave area.
[0128] Furthermore, in some embodiments of the present invention, a wave area is determined based on all overall edges and wave edges that do not intersect with the light spot area, including: evenly dividing the grayscale image into a preset number of grid areas of the same size, and determining the wave area based on the proportion of pixel points belonging to overall edges and wave edges that do not intersect with the light spot area in each grid area, wherein the grid area whose proportion is greater than a preset number ratio threshold is regarded as the wave area.
[0129] That is, by partitioning, the proportion of pixel points belonging to the edge of the wave in each grid area is determined, so as to determine whether the grid area is the grid corresponding to the wave.
[0130] In the embodiment of the present invention, a preset number of grid areas, such as 100, may be directly determined, or a preset size of grid areas, such as 3×3, may be set, and there is no limitation to this.
[0131] Among them, the preset quantity ratio threshold is the threshold value of the quantity ratio. The preset quantity ratio threshold in the embodiment of the present invention can be specifically 0.6, that is, all square areas with a quantity ratio greater than 0.6 are counted as wave areas.
[0132] After obtaining the wave area, the embodiment of the present invention can directly determine the wave severity based on the density of the wave texture in the wave area, thereby realizing the injection molding quality inspection of the injection molded parts. Alternatively, the injection molding quality inspection can also be determined based on the area of the wave area. Both of these are well-known technologies in the art and are not limited thereto.
[0133] The present invention is based on the influence of the spot area on the wave texture, and then accurately analyzes the overall wave texture, determines a more accurate and effective wave area, so as to provide an accurate and objective data basis for the quality inspection of injection molded parts, and ensures the reliability of the quality inspection of injection molded parts. Among them, since the wave texture diffuses outward, its texture distribution is relatively consistent. The matching pixel points are determined by the slope feature, and the wave edge is screened from the edge texture by combining the texture morphological features, the grayscale distribution features of the pixel points in the edge texture, and the distance features between each pixel point in the edge texture and the matching pixel point. Since the wave texture has a highly consistent morphology and grayscale distribution, and the distance is close, the wave edge can be accurately screened based on these dimensions; since the wave edge is still affected by the highlight of the spot area, the overall detection effect of the wave edge is poor. Therefore, the embodiment of the present invention determines the spot area, and analyzes the edge texture blocked by the spot area according to the intersection point feature, fits the overall edge, and then combines all the overall edges and the wave edges that do not intersect with the spot area to determine the accurate wave area, so as to realize the injection quality inspection of the injection molded parts. In summary, the present invention can combine the light spot characteristics and the wave texture characteristics to detect the wave area during the injection molding process, thereby achieving more accurate injection molding quality inspection of injection molded parts and improving the reliability of quality inspection.
[0134] The present invention also provides an injection molding quality detection system for injection molded parts, see Figure 6 , Figure 6 A structural diagram of an injection molding quality inspection system for injection molded parts provided in one embodiment of the present invention, wherein the system 600 includes a memory 601, a processor 602, and a computer program 603 stored in the memory 601 and executable on the processor 602, and when the processor 602 executes the computer program 603, the steps of the aforementioned injection molding quality inspection method for injection molded parts are implemented.
[0135] This embodiment also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is run on a computer, the computer executes the above-mentioned related method steps to implement a method for detecting the injection molding quality of injection molded parts provided in the above embodiment.
[0136] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement a method for detecting the injection molding quality of injection molded parts provided in the above-mentioned embodiment.
[0137] Among them, the system, computer-readable storage medium or computer program product provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0138] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0139] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A method for detecting the quality of injection molded parts, characterized in that: The method comprises: Acquire a grayscale image of the injection molded part, and determine edge texture and grayscale area in the grayscale image; According to the slope characteristics of the pixels in the two closest edge textures, the matching pixels in one edge texture are determined; According to the texture morphology characteristics of each edge texture, the grayscale distribution characteristics of the pixels in the edge texture, and the distance characteristics between each pixel in the edge texture and the matching pixel, the wavy edge is obtained by screening the edge texture; According to the overall morphological characteristics of each grayscale area and the grayscale values of the pixels in the grayscale area, a light spot area is obtained by screening the grayscale area; According to the distance between the intersection point of the same spot area and the wave edge and the injection point, the intersection points are matched in pairs, and the overall edge is fitted according to the edge texture of the wave edge where the matched intersection point is located; Determine a wave area according to all the overall edges and the wave edges that do not intersect with the light spot area, and detect the injection molding quality of the injection molded part according to the wave area; The step of screening the edge texture to obtain the wavy edge comprises: Selecting any edge texture as a target texture, performing curve fitting on the target texture to obtain a fitting curve; determining a fitting error index of the target texture according to a mean distance between all pixel points in the target texture and the fitting curve, wherein the mean distance is negatively correlated with the fitting error index; Taking the difference between the grayscale mean of all pixels in the target texture and the grayscale mean of all pixels in the grayscale image as a grayscale difference index; The minimum value of the Euclidean distance between any pixel point in the target texture and the matching pixel point on the other edge texture closest to it is determined as the matching distance of the corresponding pixel point in the target texture; the flow characteristic index of the target texture is determined according to the discrete degree of the matching distance of all pixel points in the target texture, wherein the discrete degree is negatively correlated with the flow characteristic index; Determining a target probability that the target texture is a wavy edge texture according to the fitting error index, the grayscale difference index, and the flow characteristic index of the target texture; The edge texture whose target probability is greater than a preset probability threshold is regarded as a wave edge; The method for acquiring the light spot area includes: Calculating the grayscale mean of all pixels in the grayscale area to obtain the regional grayscale coefficient, and taking the grayscale area whose regional grayscale coefficient is greater than a preset coefficient threshold as a suspected area; Determine a line segment connecting two pixels that are farthest apart in any suspected region as a region feature line segment, and use an angle between the region feature line segment and a preset reference line as a direction angle of the suspected region; The average of the direction angles of all suspected regions is taken as the overall direction average; according to the difference between the direction angle of any suspected region and the overall direction average, the regional direction characteristic index corresponding to the suspected region is determined; The difference between the length of the regional characteristic line segment of any suspected region and the average length of all the regional characteristic line segments is used as the overall characteristic difference index; Determine the probability of the suspected area being a light spot area according to the regional direction characteristic index and the overall characteristic difference index, wherein both the regional direction characteristic index and the overall characteristic difference index are positively correlated with the light spot probability, and the value of the light spot probability is a normalized value; The suspected area where the light spot probability is greater than a preset probability threshold is taken as the light spot area.
2. A method for detecting the quality of injection molded parts according to claim 1, characterized in that: The grayscale region acquisition method comprises: Performing superpixel segmentation on the grayscale image based on a superpixel segmentation algorithm to obtain a superpixel region; The grayscale values of all pixels in each superpixel region are determined, and all superpixel regions are clustered according to the grayscale values and the Euclidean distance between two superpixel regions to obtain grayscale regions.
3. A method for detecting the quality of injection molded parts according to claim 1, characterized in that: The method for obtaining matching pixel points includes: Determine the slope of the edge texture at each pixel point as the point slope; In the two edge textures that are closest to each other, it is determined that any pixel point with the same point slope and other pixel points that do not belong to the same edge texture are matching pixel points.
4. A method for detecting the quality of injection molded parts according to claim 1, characterized in that: The step of determining the target probability that the target texture is a wavy edge texture according to the fitting error index, the grayscale difference index, and the flow characteristic index of the target texture comprises: The product of the fitting error index, the grayscale difference index and the flow characteristic index is normalized to obtain the target probability.
5. A method for detecting the quality of injection molded parts according to claim 1, characterized in that: The method of matching the intersection points in pairs according to the distance between the intersection point of the same light spot area and the wave edge and the injection point includes: Determine the pixel point that intersects with the wave edge in the same spot area as the intersection point, and use the distance between the intersection point and the preset glue injection point as the diffusion distance; According to the difference in diffusion distance values between any two intersection points at the edge of the light spot area, they are matched in pairs, so that the difference in diffusion distance values between all matched two intersection points is minimized.
6. A method for detecting the quality of injection molded parts according to claim 5, characterized in that: The step of fitting the overall edge according to the edge texture of the wave edge where the matched intersection point is located comprises: Determine the tangent of the wave edge at the position of the two matched intersection points, determine the wave fitting curve according to the tangent and the intersection of the two tangents, and use the curve composed of the two wave edges and the wave fitting curve as the overall edge.
7. A method for detecting the quality of injection molded parts according to claim 1, characterized in that: The step of determining the wave area according to all the overall edges and the wave edges that do not intersect the light spot area comprises: The grayscale image is evenly divided into a preset number of square areas of the same size, and the wave area is determined according to the proportion of the number of pixel points belonging to the overall edge and the wave edge that does not intersect the spot area in each square area, wherein the square area whose proportion is greater than a preset number ratio threshold is regarded as the wave area.
8. A system for detecting the quality of injection molded parts, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Defect detection method and system for automotive upholstery
CN120355720A
Automobile interior parts defect detection method and system
CN120355720B
Method and system for detecting surface roughness of automobile injection molded part
CN121883486A
Automobile injection molding part surface roughness detection method and system
CN121883486B
