Automotive interior injection molding defect detection method and system based on computer vision
By calculating the parameter value and gradient value information entropy value of the connected area in the grayscale image of the automotive interior injection molded parts, the probability value of the flow mark defect is determined, which solves the problem of low detection accuracy in the existing technology and achieves higher detection Accuracy and reliability.
Patent Information
- Application Number
- CN202411563447.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-05
AI Technical Summary
In the prior art, the accuracy of flow mark defect detection of injection molded parts of automobile interiors is low, and it is difficult to effectively divide the flow mark defect area.
By obtaining the grayscale image of the automotive interior injection molded parts, multiple connected areas are determined, and the parameter values of the pixels in the target connected area are calculated to characterize the consistency of the grayscale levels in the neighborhood of the pixels, and based on the edge pixels The information entropy value of the gradient value of the point determines the probability value of the flow mark defect.
The accuracy of detection of plastic parts in the automotive interior of the car is improved, and it can more accurately determine the area of flow marks defects and enhance the reliability of detection.
Smart Images

Figure CN119090870B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image data processing, and in particular to a method and system for detecting defects of automobile interior injection molded parts based on computer vision. Background Art
[0002] The injection molding process can be used to produce automotive interior injection molding parts such as storage boxes, door interior panels and roof interiors in vehicles. During the production process of automotive interior injection molding parts, flow marks such as streamlines, ripples and silver streaks may be formed on the surface of the automotive interior due to improper settings of parameters such as injection speed, injection pressure and injection temperature.
[0003] The flow marks on the surface of the car interior will directly affect the appearance and user experience of the car interior, and because there is stress concentration inside the car interior with flow marks on the surface, the functionality and service life of the car interior with flow marks on the surface will also be affected.
[0004] In order to detect flow marks on the surface of injection molded parts, in the relevant technology, for example, in the Chinese patent application document with publication number CN115187602A, a method for detecting defects of injection molded parts based on image processing is provided, including: acquiring an image of the injection molded part, performing threshold segmentation on the image of the injection molded part through an initial threshold, and obtaining possible defect areas and non-defect areas; obtaining the defect rate of the possible defect area; dividing a new non-defect area in the possible defect area based on the size of the defect rate, obtaining an adjustment threshold using the contrast between the updated possible defect area and the non-defect area, and performing threshold segmentation on the image of the injection molded part using the adjusted threshold.
[0005] However, the characteristics of flow marks on the surface of injection molded parts are relatively complex, and it is difficult to directly segment flow mark defects through thresholds. Therefore, the detection accuracy of flow mark defects on automotive interior injection molded parts in related technologies is low. Summary of the invention
[0006] In order to overcome the problem of low detection accuracy of flow mark defects of automobile interior injection molded parts in the related art, the present application provides a method and system for detecting defects of automobile interior injection molded parts based on computer vision.
[0007] According to the first aspect of the embodiment of the present application, a computer vision-based method for defect detection of automotive interior injection molded parts is provided, comprising: obtaining a grayscale image of a surface to be detected of an automotive interior injection molded part, and determining multiple connected areas from the grayscale image; the grayscale features of pixels in the same connected area are similar; for a target connected area in multiple connected areas, determining a parameter value of the pixels in the target connected area, the parameter value being used to characterize the degree of consistency between the number of pixels of the two grayscale levels with the largest number of pixels in the neighborhood of the pixel point; summing the parameter values of multiple pixels in the target connected area, and using the summation result as an evaluation value of the target connected area; determining a probability value of the target connected area belonging to a flow mark defect based on the evaluation value of the target connected area, and using the target connected area with a probability value greater than a preset probability threshold as a flow mark defect area; wherein the probability value , norm is the normalization function, U is the evaluation value of the target connected area, Q is the information entropy value of the gradient value of the edge pixel point in the target connected area, To take the absolute value, is the area of the target connected region, is the average area of other connected areas except the target connected area, The default value is a positive number.
[0008] In this way, a grayscale image of the surface to be inspected of an automobile interior injection molded part is obtained, and multiple connected areas are determined from the grayscale image, the parameter values of multiple pixel points in the target connected area are summed, and the sum result is used as the evaluation value of the target connected area; the probability value that the target connected area belongs to a flow mark defect is determined according to the evaluation value of the target connected area, thereby determining the flow mark defect area on the surface of the automobile interior injection molded part; since the parameter value is used to characterize the consistency between the number of pixels of the two gray levels with the largest number of pixels in the neighborhood of the pixel point, and the probability value is determined based on the information entropy value of the gradient value of the edge pixel point in the target connected area, compared with direct segmentation by grayscale threshold, the probability value can better characterize the probability that the connected area belongs to a flow mark defect, so the flow mark defect area on the surface of the automobile interior injection molded part can be determined more accurately, thereby improving the detection accuracy of the flow mark defects of the automobile interior injection molded parts.
[0009] Optionally, the parameter value of the pixel point is obtained by: , where F is the parameter value of the pixel point, is the absolute value, Y is the average gray value of the pixel in the neighborhood of the pixel, H is the gray value of the pixel, L is the gray difference between the two gray levels with the largest number in the neighborhood of the pixel, exp is the indicator function with the natural constant as the base, is the number of pixels corresponding to the first gray level within the neighborhood of the pixel point, is the number of pixels corresponding to the second gray level within the neighborhood of the pixel point, and the first gray level and the second gray level are the two gray levels with the largest number within the neighborhood of the pixel point.
[0010] Optionally, the information entropy value of the gradient value of the edge pixel point in the target connected area is obtained by: , M is the information entropy value of the gradient value of the edge pixel point in the target connected area, K is the number of types of gradient values in the edge pixel point of the target connected area, is the ratio of the number of edge pixels corresponding to the i-th gradient value among all edge pixels in the target connected area, is a logarithmic function.
[0011] In this way, by determining the information entropy value of the gradient value of the edge pixel points in the target connected area, the complexity of the gradient value in the target connected area can be reflected, thereby reflecting the probability of the existence of flow mark defects in the target connected area, so as to more accurately obtain the flow mark defects in the grayscale image.
[0012] Optionally, the gradient value of the edge pixel points in the target connected area is obtained in the following manner: using an edge detection operator to determine the gradient value of the pixel points in the target connected area, and taking the pixel points in the target connected area whose gradient values are greater than a preset gradient threshold as edge pixel points to obtain the gradient value of the edge pixel points in the target connected area.
[0013] Optionally, multiple connected areas are determined from the grayscale image, including: for a target pixel in the grayscale image, the average grayscale value of the pixels in the neighborhood where the target pixel is located is used as the segmentation threshold corresponding to the target pixel; when the target pixel is smaller than the corresponding segmentation threshold, the target pixel is used as a candidate pixel; a connected area including the candidate pixel in the grayscale image is determined to obtain multiple connected areas; the connected area includes at least one other candidate pixel adjacent to the target candidate pixel and located in the same grayscale range, and the target candidate pixel is any candidate pixel in the connected area.
[0014] In this way, when the target pixel point is smaller than the corresponding segmentation threshold, the target pixel point is taken as a candidate pixel point, and the connected area including the candidate pixel point in the grayscale image is determined to obtain multiple connected areas. The obtained connected areas are more likely to be the areas where the flow mark defects in the grayscale image are located, which can narrow the scope of screening of the connected areas, thereby more accurately determining the flow mark areas in the grayscale image.
[0015] Optionally, the method further includes: when there are multiple flow mark defect areas in the grayscale image, obtaining the regional area of the flow mark defect area; determining a target marking method corresponding to the flow mark defect area from multiple preset marking methods according to the regional area, and marking the flow mark defect area using the target marking method.
[0016] In this way, since flow mark defect areas of different areas have different degrees of influence on the appearance; or the magnitude of internal stress of flow mark defects of different areas is different, the influence of flow mark defects of different areas on the service life of automobile interior injection moldings is different; marking flow mark defect areas of different areas in different ways can help users more intuitively understand the influence of flow mark defects in different parts of automobile interior injection moldings.
[0017] Optionally, the grayscale image of the surface to be inspected of the automobile interior injection-molded part is acquired in the following manner: an initial image of the surface to be inspected of the automobile interior injection-molded part acquired by an image acquisition device is acquired, and the initial image is input into a pre-trained image segmentation model to obtain the grayscale image; wherein the image segmentation model is trained using the initial image of the surface to be inspected of the automobile interior injection-molded part and a mask image corresponding to the initial image, and the pixel values of other pixel points in the mask image except for the automobile interior injection-molded part are 0.
[0018] In this way, the initial image captured by the image acquisition device on the surface to be inspected of the automobile interior injection molding parts is input into the pre-trained image segmentation model, which can avoid the adverse effects of other pixels other than the automobile interior injection molding parts on the image processing process, thereby more accurately obtaining the flow mark defects of the automobile interior injection molding parts.
[0019] According to a second aspect of an embodiment of the present application, a computer vision-based automobile interior injection molded parts defect detection system is provided, comprising: a processor and a memory, the memory storing computer program instructions, and the computer program instructions, when executed by the processor, implement the steps of the computer vision-based automobile interior injection molded parts defect detection method provided in the first aspect of the present application.
[0020] The technical solution provided by the embodiments of the present application may include the following beneficial effects: obtaining a grayscale image of the surface to be inspected of an automobile interior injection molding part, determining multiple connected areas from the grayscale image, summing the parameter values of multiple pixel points in the target connected area, and using the summation result as the evaluation value of the target connected area; determining the probability value that the target connected area belongs to a flow mark defect according to the evaluation value of the target connected area, thereby determining the flow mark defect area on the surface of the automobile interior injection molding part; since the parameter value is used to characterize the degree of consistency between the number of pixels of the two gray levels with the largest number of pixels within the neighborhood of the pixel point, and the probability value is determined based on the information entropy value of the gradient value of the edge pixel point in the target connected area, compared with direct segmentation by grayscale threshold, the probability value can better characterize the probability that the connected area belongs to a flow mark defect, and therefore the flow mark defect area on the surface of the automobile interior injection molding part can be determined more accurately, thereby improving the detection accuracy of the flow mark defects of the automobile interior injection molding part.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0023] Figure 1 is a flow chart of a method for detecting defects of automotive interior injection molded parts based on computer vision according to an exemplary embodiment;
[0024] Figure 2 The figure is a schematic structural diagram of a computer vision-based automobile interior injection molded parts defect detection system according to an exemplary embodiment. DETAILED DESCRIPTION
[0025] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0026] First, the application scenario of the embodiment of the present application is briefly introduced. In the application scenario of the present application, flow marks generated on the surface of automobile interior injection-molded parts will directly affect the appearance of the automobile interior injection-molded parts, and since there is stress concentration inside the injection-molded parts with flow mark defects on the surface, the service life of the injection-molded parts with flow mark defects on the surface will be affected. Therefore, it is necessary to detect the flow mark defects on the surface of automobile interior injection-molded parts.
[0027] When detecting flow mark defects on the surface of injection molded parts, the related technology determines a more accurate grayscale segmentation threshold and uses the determined grayscale segmentation threshold to detect flow mark defects. However, the characteristics of different flow mark defects in the same grayscale image may be different. It is difficult to achieve more accurate detection of flow mark defects through a single grayscale segmentation threshold, resulting in a low detection accuracy of flow mark defects on automotive interior injection molded parts.
[0028] In view of the above technical problems, the embodiments of the present application provide a method and system for defect detection of automobile interior injection molded parts based on computer vision, which can detect flow mark defects on finished automobile interior injection molded parts. Figure 1 is a flowchart of a method for detecting defects of automotive interior injection molded parts based on computer vision according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps.
[0029] In step S101, a grayscale image of a surface to be inspected of an automobile interior injection molded part is obtained, and a plurality of connected regions are determined from the grayscale image.
[0030] In order to prevent automobile interior injection molding parts with flow mark defects on the surface from being installed on the vehicle, so as to ensure the reliability of the automobile interior injection molding parts installed on the vehicle; or, in order to detect the surface flow marks of automobile interior injection molding parts installed inside the vehicle and timely discover the surface flow mark defects of automobile interior injection molding parts installed in the vehicle, the grayscale image of the surface to be inspected of the automobile interior injection molding parts can be acquired through image acquisition equipment.
[0031] Flow mark defects located in the same local range in a grayscale image usually have similar grayscale features. In order to better screen out the areas where flow mark defects may exist in the grayscale image, multiple connected areas can be determined from the grayscale image; among which, the grayscale features of the pixels in the same connected area are similar, for example, the pixel values of the pixels in the same connected area are within the same grayscale range.
[0032] In one embodiment, multiple connected areas are determined from the grayscale image, including: for a target pixel in the grayscale image, the average grayscale value of the pixels in the neighborhood of the target pixel is used as the segmentation threshold corresponding to the target pixel; when the target pixel is less than the corresponding segmentation threshold, the target pixel is used as a candidate pixel; a connected area including the candidate pixel in the grayscale image is determined to obtain multiple connected areas; the connected area includes at least one other candidate pixel adjacent to the target candidate pixel and located in the same grayscale range, and the target candidate pixel is any candidate pixel in the connected area.
[0033] The neighborhood range of the target pixel point can be a 7×7 image area centered on the target pixel point, or it can be a 9×9 image area centered on the target pixel point. The embodiment of the present application does not limit the specific size of the neighborhood range of the target pixel point.
[0034] When there is a flow mark defect on the surface of an automobile interior injection molded part, for the automobile interior injection molded part, the grayscale value of the pixel at the location of the flow mark defect is usually smaller than the grayscale value of the pixel at other locations other than the flow mark defect. Therefore, if the grayscale value of the target pixel is smaller than that of other pixels within the same neighborhood, it means that the target pixel has a higher probability of being the pixel at which the flow mark defect is located.
[0035] The average gray value of the pixels in the neighborhood where the target pixel is located is used as the segmentation threshold corresponding to the target pixel. Since the average gray value can reflect the average gray value of the neighborhood where the target pixel is located, if the target pixel is smaller than the corresponding segmentation threshold, it means that the gray value of the target pixel is lower than that of other pixels in the neighborhood. The target pixel has a higher probability of being the pixel where the flow mark defect is located compared with other pixels in the neighborhood.
[0036] Since the segmentation threshold corresponding to the target pixel is determined according to the average grayscale value of the pixels in the neighborhood, different target pixels in the grayscale image can correspond to different segmentation thresholds. Compared with using the same segmentation threshold for the entire grayscale image, candidate pixels with a higher probability of being located at flow mark defects can be screened out.
[0037] In this way, when the target pixel point is smaller than the corresponding segmentation threshold, the target pixel point is taken as a candidate pixel point, and the connected area including the candidate pixel point in the grayscale image is determined to obtain multiple connected areas. The obtained connected areas are more likely to be the areas where the flow mark defects in the grayscale image are located, which can narrow the scope of screening of the connected areas, thereby more accurately determining the flow mark areas in the grayscale image.
[0038] In step S102, for a target connected region among the plurality of connected regions, parameter values of pixels in the target connected region are determined.
[0039] The target connected region may be any one of the multiple connected regions, and the parameter value is used to characterize the consistency between the numbers of pixels of the two gray levels with the largest number of pixels within the neighborhood of the pixel point.
[0040] The embodiments of the present application can be used to detect flow mark defects on automobile interior injection molded parts with consistent colors; when the neighborhood range of a pixel point is outside the flow mark defect, or when there is no flow mark defect on the surface of the automobile interior injection molded part, the pixels in the neighborhood range of the pixel point are mainly pixels in the normal area, so that the gray level corresponding to the pixel value of the pixel point in the normal area is the highest among all the pixels in the neighborhood range, and the difference between the number of pixels corresponding to other gray levels is relatively large, and it occupies an absolute dominant position among all the gray levels in the neighborhood range.
[0041] In the case where a flow mark defect exists within the neighborhood of a pixel point, due to the existence of the flow mark defect, some pixels within the neighborhood are the pixels where the flow mark defect is located, and the pixel value of the pixel where the flow mark defect is located is different from the pixel value of a similar point in a normal area, so that the gray level of the flow mark defect and the gray level corresponding to the normal area exist simultaneously within the neighborhood of the pixel point.
[0042] Since the grayscale of the flow mark defect and the grayscale corresponding to the normal area exist in the neighborhood of the flow mark defect at the same time, and the number of pixels in the neighborhood of the pixel is limited, the number of pixels corresponding to the grayscale of the pixel of the flow mark defect is relatively consistent with the number of normal pixels, and the grayscale of the pixel of the flow mark defect and the grayscale of the normal pixel are the two grayscales with the largest number of pixels among all grayscales in the neighborhood.
[0043] The grayscale levels corresponding to all pixels within the neighborhood of the pixel point can be determined, and the two grayscale levels corresponding to the largest number of pixels among all the grayscale levels within the neighborhood can be used as the first grayscale level and the second grayscale level, respectively. The first grayscale level can be the grayscale level corresponding to the largest number of pixels among all the grayscale levels within the neighborhood, and the second grayscale level can be the grayscale level corresponding to the largest number of pixels among all the grayscale levels within the neighborhood except the first grayscale level.
[0044] Among all pixels within the neighborhood of the pixel point, the higher the consistency between the number of pixels corresponding to the first gray level and the number of pixels corresponding to the second gray level, the more likely it is that a flow mark defect exists within the neighborhood of the pixel point.
[0045] By determining the parameter values of the pixels in the target connected area, the parameter values are used to characterize the consistency between the number of pixels of the two gray levels with the largest number of pixels in the neighborhood of the pixel point, which helps to determine a more accurate flow mark area for automotive interior injection molding parts through the parameter values of the pixels.
[0046] In step S103, the parameter values of multiple pixel points in the target connected area are summed, and the sum result is used as the evaluation value of the target connected area.
[0047] Since the parameter value is used to characterize the degree of consistency between the number of pixels of the two gray levels with the largest number of pixels in the neighborhood of the pixel point, the evaluation value of the target connected area can be determined by the parameter values of multiple pixels in the target connected area. For example, the parameter values of all pixels in the target connected area can be summed, and the sum result can be used as the evaluation value of the target connected area.
[0048] For example, the evaluation value of the target connected area , norm is the normalization function, N is the number of pixels in the target connected area, is the parameter value of the nth pixel in the target connected area.
[0049] In step S104, the probability value of the target connected area being a flow mark defect is determined according to the evaluation value of the target connected area, and the target connected area with a probability value greater than a preset probability threshold is taken as a flow mark defect area.
[0050] Probability value , norm is the normalization function, U is the evaluation value of the target connected area, Q is the information entropy value of the gradient value of the edge pixel point in the target connected area, To take the absolute value, is the area of the target connected region, is the average area of other connected areas except the target connected area, The default value is a positive number.
[0051] The information entropy value of the gradient value of the edge pixel points in the target connected area can characterize the texture complexity of the edge pixel points in the target connected area; when there are flow mark defects in the target connected area, the edge features in the target connected area will be more obvious.
[0052] Since the information entropy value is determined based on edge pixels, and the probability of flow mark defects existing in the target connected area with more obvious edge features is higher, the obtained probability value can better characterize the probability of flow mark defects existing in the target connected area.
[0053] Compared with the pixels in the normal part of the automobile interior injection molding parts, the characteristics of the flow mark defects in the automobile interior injection molding parts have higher randomness and dispersion, which makes the areas of the flow mark defects at different positions in the grayscale image different, and there is a difference between the area of the flow mark defects and the area of the normal image area in the grayscale image. Therefore, by comparing the area of the target connected area with the average area of other connected areas except the target connected area, it is helpful to obtain the flow mark defects in the automobile interior injection molding parts more accurately.
[0054] The greater the probability value that the target connected area belongs to a flow mark defect, the more likely the target connected area is the location of the flow mark defect on the surface of the automobile interior injection molded part. When the probability value of the target connected area is greater than a preset probability threshold, the target connected area has a greater probability of belonging to a flow mark defect; wherein the preset probability threshold may be between 0.7 and 0.9.
[0055] By using the computer vision-based automotive interior injection molding defect detection method provided in the embodiment of the present application, a grayscale image of the surface to be detected of the automotive interior injection molding is obtained, and multiple connected areas are determined from the grayscale image, the parameter values of multiple pixel points in the target connected area are summed, and the sum result is used as the evaluation value of the target connected area; the probability value that the target connected area belongs to a flow mark defect is determined according to the evaluation value of the target connected area, thereby determining the flow mark defect area on the surface of the automotive interior injection molding; since the parameter value is used to characterize the consistency between the number of pixels of the two gray levels with the largest number of pixels in the neighborhood of the pixel point, and the probability value is determined based on the information entropy value of the gradient value of the edge pixel point in the target connected area, compared with direct segmentation by grayscale threshold, the probability value can better characterize the probability that the connected area belongs to a flow mark defect, so that the flow mark defect area on the surface of the automotive interior injection molding can be more accurately determined, thereby improving the detection accuracy of the flow mark defects of the automotive interior injection molding.
[0056] In one embodiment, the parameter value of the pixel point is obtained in the following manner: , where F is the parameter value of the pixel point, is the absolute value, Y is the average gray value of the pixel in the neighborhood of the pixel, H is the gray value of the pixel, L is the gray difference between the two gray levels with the largest number in the neighborhood of the pixel, exp is the indicator function with the natural constant as the base, is the number of pixels corresponding to the first gray level within the neighborhood of the pixel point, is the number of pixels corresponding to the second gray level within the neighborhood of the pixel point, and the first gray level and the second gray level are the two gray levels with the largest number within the neighborhood of the pixel point.
[0057] The grayscale difference between the two grayscale levels with the largest number in the neighborhood of the pixel point may refer to the absolute value of the difference between the grayscale values of the two grayscale levels with the largest number in the neighborhood of the pixel point; the greater the grayscale difference between the two grayscale levels with the largest number, the more likely the pixel point is to be located at the location of the flow mark defect.
[0058] When the pixel point is located in the normal area of the automobile interior injection molding part, the pixel value between the pixel point and other pixel points in the neighborhood is relatively close; when the pixel point is located at the flow mark defect position of the automobile interior injection molding part, since the pixel value of the pixel point has changed compared with the pixel points in the normal area, the difference between the pixel value of the pixel point and the pixel values of other pixel points in the neighborhood becomes larger. Therefore, by comparing the grayscale value of the pixel point with the average grayscale value of the pixels in the neighborhood, it is helpful to more accurately screen out the flow mark defects from the grayscale image.
[0059] When the neighborhood range of a pixel point is located at the position where the flow mark defect is located, compared with the gray level in the neighborhood range where the pixel point in the normal area is located, the introduction of the gray level corresponding to the flow mark defect makes the proportion of the original dominant normal gray level in the neighborhood range decrease, resulting in the situation where the gray level corresponding to the flow mark defect and the normal gray level exist simultaneously in the neighborhood range.
[0060] Since the number of pixels in the neighborhood of a pixel is limited, for example, the neighborhood of a pixel includes 7×7=49 pixels, although there may be other pixels where flow mark defects are located in the neighborhood of the pixel, the probability that all pixels in the neighborhood of the pixel are where flow mark defects are located is low.
[0061] By determining the two gray levels, the first gray level and the second gray level, which have the largest number in the neighborhood range of the pixel point, the closer the number of pixel points corresponding to the first gray level and the second gray level in the neighborhood range are, the higher the probability of the flow mark defect existing in the neighborhood range of the pixel point.
[0062] On the contrary, since the first grayscale and the second grayscale are the two grayscales with the largest number of corresponding values in the neighborhood range, the greater the difference between the number of pixels corresponding to the first grayscale and the second grayscale in the neighborhood range, the more it indicates that the neighborhood range of the pixel point is dominated by a single grayscale.
[0063] Affected by the dispersion characteristics of flow mark defects, the probability that the neighborhood range of a pixel point is mainly a flow mark defect is low, so that when the neighborhood range of a pixel point is dominated by a single grayscale level, the pixel point has a greater probability of being a pixel point in the normal area of an automotive interior injection molded part.
[0064] In this way, by comparing the numbers of pixels corresponding to the two gray levels with the largest numbers within the neighborhood of the pixel, the flow mark defect area in the gray image can be determined more accurately.
[0065] In one embodiment, the information entropy value of the gradient value of the edge pixel point in the target connected area is obtained by: , M is the information entropy value of the gradient value of the edge pixel point in the target connected area, K is the number of types of gradient values in the edge pixel point of the target connected area, is the ratio of the number of edge pixels corresponding to the i-th gradient value among all edge pixels in the target connected area, is a logarithmic function.
[0066] The information entropy value of the gradient value of the edge pixel point can characterize the complexity of the gradient value of the edge pixel point in the target connected area; when there is no flow mark defect in the target connected area, the grayscale value of the pixel point in the target connected area is relatively simple, which makes the gradient value of the pixel point in the target connected area smaller, and the complexity of the gradient value of the pixel point in the target connected area is low, which makes the information entropy value of the gradient value of the target connected area smaller.
[0067] On the contrary, when there are flow mark defects in the target connected area, the grayscale values of the pixels in the target connected area are more diverse, which makes the gradient values of the pixels in the target connected area more diverse, and makes the information entropy of the gradient value of the target connected area larger.
[0068] In this way, by determining the information entropy value of the gradient value of the edge pixel points in the target connected area, the complexity of the gradient value in the target connected area can be reflected, thereby reflecting the probability of the existence of flow mark defects in the target connected area, so as to more accurately obtain the flow mark defects in the grayscale image.
[0069] In one embodiment, the gradient value of the edge pixel points in the target connected area is obtained in the following manner: the gradient value of the pixel points in the target connected area is determined using an edge detection operator, and the pixel points in the target connected area whose gradient values are greater than a preset gradient threshold are taken as edge pixel points to obtain the gradient value of the edge pixel points in the target connected area.
[0070] The image operator for edge detection of the grayscale image may be a Sobel operator, a Prewitt operator, a Canny operator, a Laplacian operator, etc. The gradient value of the pixel point in the grayscale image can be obtained through the edge detection operator.
[0071] The preset gradient threshold can be between 25 and 45, and can be set according to actual needs. When the gradient value of a pixel in the target connected area is greater than the preset gradient threshold, it means that the gray value at the pixel changes faster, and the pixel has a higher probability of being a pixel at the edge.
[0072] In this way, by screening the pixel points in the target connected area to obtain the edge pixel points in the target connected area, it is helpful to determine the complexity of the gradient values of the edge pixel points in the target connected area, so as to better obtain the flow mark defects in the grayscale image.
[0073] In one embodiment, when there are multiple flow mark defect areas in the grayscale image, the area of the flow mark defect area can be obtained; the target marking method corresponding to the flow mark defect area is determined from multiple preset marking methods according to the area, and the flow mark defect area is marked using the target marking method.
[0074] Multiple preset marking methods use marking lines of different colors or shapes for marking. For example, the thickness of the lines used for marking in different preset marking methods is different, or the colors of the lines used for marking in different preset marking methods are different. Dotted lines and triangular lines are different preset marking methods. The embodiments of the present application do not constitute a limitation on the marking style.
[0075] In this way, since flow mark defect areas of different areas have different degrees of influence on the appearance; or the magnitude of internal stress of flow mark defects of different areas is different, the influence of flow mark defects of different areas on the service life of automobile interior injection moldings is different; marking flow mark defect areas of different areas in different ways can help users more intuitively understand the influence of flow mark defects in different parts of automobile interior injection moldings.
[0076] In one embodiment, a grayscale image of a surface to be inspected of an automobile interior injection-molded part is acquired in the following manner: an initial image of the surface to be inspected of the automobile interior injection-molded part acquired by an image acquisition device is acquired, and the initial image is input into a pre-trained image segmentation model to acquire the grayscale image; wherein the image segmentation model is trained using the initial image of the surface to be inspected of the automobile interior injection-molded part and a mask image corresponding to the initial image, and the pixel values of other pixels in the mask image except for the automobile interior injection-molded part are 0.
[0077] For example, the initial image of the surface to be inspected of an automobile interior injection molded part can be used as the input of a pre-built network model, and the mask image corresponding to the initial image can be used as the output of the pre-built network model, thereby using the trained network model as an image segmentation model.
[0078] The mask image can be obtained by marking the pixel values of other pixels except the automobile interior injection molding parts as 0, so that the image segmentation model can output a grayscale image containing only the surface to be detected of the automobile interior injection molding parts.
[0079] In this way, the initial image captured by the image acquisition device on the surface to be inspected of the automobile interior injection molding parts is input into the pre-trained image segmentation model, which can avoid the adverse effects of other pixels other than the automobile interior injection molding parts on the image processing process, thereby more accurately obtaining the flow mark defects of the automobile interior injection molding parts.
[0080] Figure 2 FIG. 1 is a schematic diagram of a system 1000 for detecting defects in automotive interior injection molded parts based on computer vision according to an exemplary embodiment. Figure 2 The computer vision-based automotive interior injection molded parts defect detection system 1000 includes: a processor 1100 and a memory 1200, wherein the memory 1200 stores computer program instructions, and when the computer program instructions are executed by the processor 1100, all or part of the steps of the computer vision-based automotive interior injection molded parts defect detection method in this application are implemented.
[0081] It should be understood that the features of some embodiments of the various applications described herein may be combined with each other unless specifically stated otherwise.
[0082] Although terms such as "first", "second", and "third" may be used herein to describe various components, parts, regions, layers, or sections, these components, parts, regions, layers, or sections are not limited to these terms. Instead, these terms are only used to distinguish one component, part, region, layer, or section from another component, part, region, layer, or section. Therefore, without departing from the teachings of the examples described herein, the first component, part, region, layer, or section mentioned in the examples may also be referred to as the second component, part, region, layer, or section.
[0083] In addition, 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 at least one of the features. In the description herein, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0084] In addition, the word "exemplary" is used herein to mean serving as an example, instance, or diagram. Any aspect or design described herein as "exemplary" is not necessarily to be understood as being advantageous over other aspects or designs. Instead, the use of the word exemplary is intended to present concepts in a concrete manner. As used herein, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or".
[0085] Likewise, although the present application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art upon reading and understanding this specification and the accompanying drawings. With particular regard to the various functions performed by the components (e.g., elements, resources, etc.) described above, unless otherwise noted, the terms used to describe such components are intended to correspond to any component (functionally equivalent) that performs the specific functions of the described components, even if not structurally equivalent to the disclosed structures.
[0086] Additionally, while particular features of the present application may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations as may be desired and advantageous for any given or particular application.
[0087] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application, and the specification and embodiments are only considered as exemplary.
[0088] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A method for defect detection of automobile interior injection molded parts based on computer vision, characterized in that: include: Acquire a grayscale image of a surface to be inspected of an automobile interior injection molded part, and determine a plurality of connected regions from the grayscale image; The grayscale features of pixels in the same connected region are similar; For a target connected area among the multiple connected areas, determining a parameter value of a pixel point in the target connected area, wherein the parameter value is used to characterize the consistency between the number of pixels of two gray levels with the largest number of pixels within a neighborhood of the pixel point; The parameter values of multiple pixels in the target connected area are summed, and the sum result is used as the evaluation value of the target connected area; Determine the probability value of the target connected area belonging to the flow mark defect according to the evaluation value of the target connected area, and take the target connected area with a probability value greater than a preset probability threshold as the flow mark defect area; Among them, the probability value , norm is the normalization function, U is the evaluation value of the target connected area, Q is the information entropy value of the gradient value of the edge pixel point in the target connected area, To take the absolute value, is the area of the target connected region, is the average area of other connected areas except the target connected area, The default value is a positive number.
2. The method for defect detection of automotive interior injection molded parts based on computer vision according to claim 1, characterized in that: The parameter values of the pixel points are obtained in the following way: , where F is the parameter value of the pixel point, is the absolute value, Y is the average gray value of the pixel in the neighborhood of the pixel, H is the gray value of the pixel, L is the gray difference between the two gray levels with the largest number in the neighborhood of the pixel, exp is an exponential function with a natural constant as the base, is the number of pixels corresponding to the first gray level within the neighborhood of the pixel point, is the number of pixels corresponding to the second gray level within the neighborhood of the pixel point, and the first gray level and the second gray level are the two gray levels with the largest number within the neighborhood of the pixel point.
3. The method for defect detection of automotive interior injection molded parts based on computer vision according to claim 1, characterized in that: The information entropy value of the gradient value of the edge pixel point in the target connected area is obtained by the following method: , M is the information entropy value of the gradient value of the edge pixel points in the target connected area, K is the number of types of gradient values in the edge pixel points in the target connected area, is the ratio of the number of edge pixels corresponding to the i-th gradient value among all edge pixels in the target connected area, is a logarithmic function.
4. The method for detecting defects of automotive interior injection molded parts based on computer vision according to claim 1, characterized in that: The gradient values of edge pixels in the target connected area are obtained in the following way: The edge detection operator is used to determine the gradient value of the pixel points in the target connected area, and the pixel points in the target connected area whose gradient value is greater than the preset gradient threshold are regarded as edge pixels to obtain the gradient value of the edge pixel points in the target connected area.
5. The method for defect detection of automotive interior injection molded parts based on computer vision according to claim 1, characterized in that: Determining a plurality of connected regions from the grayscale image includes: For the target pixel in the grayscale image, the average grayscale value of the pixels in the neighborhood where the target pixel is located is used as the segmentation threshold corresponding to the target pixel; When the target pixel is smaller than the corresponding segmentation threshold, the target pixel is taken as a candidate pixel; Determine a connected area including candidate pixels in a grayscale image to obtain a plurality of connected areas; the connected area includes at least one other candidate pixel adjacent to a target candidate pixel and located in the same grayscale range, and the target candidate pixel is any candidate pixel in the connected area.
6. The method for defect detection of automotive interior injection molded parts based on computer vision according to claim 1, characterized in that: The method further comprises: When there are multiple flow mark defect regions in the grayscale image, obtaining the area of the flow mark defect region; A target marking method corresponding to the flow mark defect area is determined from a plurality of preset marking methods according to the area of the area, and the flow mark defect area is marked using the target marking method.
7. The method for defect detection of automotive interior injection molded parts based on computer vision according to claim 1, characterized in that: The grayscale image of the surface to be inspected of the automotive interior injection molded part is obtained in the following way: Acquire an initial image of the surface to be inspected of the automobile interior injection molded part acquired by an image acquisition device, input the initial image into a pre-trained image segmentation model, and obtain the grayscale image; The image segmentation model is obtained by training using an initial image of the surface to be detected of an automobile interior injection molded part and a mask image corresponding to the initial image, and the pixel values of other pixels in the mask image except for the automobile interior injection molded part are 0.
8. A computer vision-based automotive interior injection molding defect detection system, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for detecting defects of automotive interior injection molded parts based on computer vision according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Injection molding part defect detection method and system based on image processing
CN115187602A
Part spraying quality detection method based on machine vision
CN118096728A
Furniture surface quality detection method based on machine vision
CN118823029A