Injection molding part coating quality detection method and system based on machine vision

Through machine vision-based technology, the grayscale features and edge features in the grayscale image of the injection molded parts surface are analyzed, and the deep bright and light bright stamp areas are accurately identified, which solves the accuracy of detection of bright stamp defects of injection molded parts in the prior art, and improves the accuracy and efficiency of detection.

CN120182247AActive Publication Date: 2025-06-20XIAN WEIER PRECISION TECH CO LTD

Patent Information

Application Number
CN202510616254.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-06-20
Estimated Expiration
2045-05-14

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify the bright printing defects on the surface of the injection molded parts in the quality detection of injection molded parts, resulting in low accuracy of the detection results.

Method used

Using machine vision-based coating quality detection method for injection molded parts, the pixel points in the dark bright printing area are determined by analyzing the difference between the grayscale values ​​of pixel points in the surface grayscale image and the mean of grayscale differences between neighborhoods of different scales, and the pixel points in the light bright printing area are accurately screened through edge approximation and chromaticity distance analysis.

Benefits of technology

Accurate identification of bright printing defects on the surface of injection molded parts is achieved, and the accuracy and efficiency of coating quality detection of injection molded parts is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182247A_ABST
    Figure CN120182247A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, in particular to an injection molding part coating quality detection method and system based on machine vision. The method comprises the following steps: determining pixel points of a deep bright printing area and edge pixel points of the deep bright printing area according to a difference between a gray value of a pixel point in a surface gray image and a maximum gray value and a gray difference mean value between the pixel point and neighborhoods with different scales; according to the probability that the remaining pixel points are in the deep bright printing area, the difference between the brightness value and the standard value and the chromaticity distance between the remaining pixel points and the remaining pixel points corresponding to the standard value, the pixel points in the light bright printing area are obtained; the deep bright printing area pixel points and the corresponding edge pixel points in the surface image of the injection molding part, and the light bright printing area pixel points and the corresponding edge pixel points in the surface image of the injection molding part are trained after being enhanced, so that the coating quality detection of the injection molding part is realized, and the accuracy and the efficiency of the coating quality detection of the injection molding part are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and particularly to a method and system for detecting the coating quality of injection molded parts based on machine vision. Background Art

[0002] An injection molded part refers to a plastic product manufactured through an injection molding process, which can be applied in fields such as automobiles, electronics, household appliances, and medical devices. By detecting the quality of the injection molded parts after production, it can be verified whether the injection molded parts have corresponding performance, so as to reduce the possibility of potential safety hazards in the relevant fields during the use of injection molded parts.

[0003] During the production process of injection molded parts, problems such as improper injection pressure setting, changes in raw material properties, and the quality of injection molded part molds may occur. For example, polyethylene materials will have a gloss change when the temperature is too high, ultimately resulting in bright marks on the surface of the produced injection molded parts, which usually appear as irregular curved lines with blurred boundaries. On an injection molding production line, the production speed of products is usually relatively fast. In order to improve production efficiency, it is usually necessary to quickly complete the detection of bright mark defects of a large number of injection molded parts in a short time, so as to facilitate accurate screening in the subsequent process.

[0004] The prior art often identifies bright marks on images through manual recognition or after image enhancement. However, manual recognition has a high cost and is easily affected by the subjective experience of the staff. During the image enhancement process, the boundary between the bright marks and the background area is relatively blurred, and accurate enhancement cannot be achieved. Eventually, the accuracy of the obtained quality detection results is relatively low.

[0005] In summary, how to accurately identify the bright mark defects on the surface of injection molded parts in the quality detection of injection molded parts, so as to accurately obtain the quality detection results of injection molded parts, is a problem that needs to be solved currently. Summary of the Invention

[0006] In order to solve the technical problem of how to accurately identify the bright mark defects on the surface of injection molded parts in the quality detection of injection molded parts, so as to accurately obtain the quality detection results of injection molded parts, the present invention provides a method and system for detecting the coating quality of injection molded parts based on machine vision.

[0007] In the first aspect, the present invention provides a method for detecting the coating quality of injection molded parts based on machine vision, adopting the following technical solution: The method for detecting the coating quality of injection molded parts based on machine vision includes the steps: Obtain the edges in the surface grayscale image of the injection molded part; according to the difference between the grayscale value of the pixel point in the surface grayscale image and the maximum grayscale value, and the average grayscale difference between this pixel point and different scale neighborhoods, obtain the probability that this pixel point is in the deep bright mark area, and determine the pixel points in the deep bright mark area; iterate in the neighborhood change range to obtain the grayscale entropy values in different neighborhoods of the pixel points in the edge, and in response to the grayscale entropy values before and after iteration satisfying the iteration termination condition, obtain the edge pixel points of the deep bright mark area in each edge; convert the remaining pixel points in the surface grayscale image of the injection molded part except the pixel points in the deep bright mark area and the edge pixel points into a surface color image, and record the brightness value that appears most frequently in the surface color image as the standard value; according to the probability that the remaining pixel points are in the shallow bright mark area, the difference between the brightness value and the standard value, and the chromaticity distance between this remaining pixel point and the remaining pixel points corresponding to the standard value, determine the probability that this remaining pixel point is in the shallow bright mark area, and obtain the pixel points in the shallow bright mark area; use the edge pixel points in the surface grayscale image edge except the edge pixel points in the deep bright mark area as the edge pixel points of the shallow bright mark area; enhance the pixel points in the deep bright mark area and the corresponding edge pixel points and the pixel points in the shallow bright mark area and the corresponding edge pixel points in the surface image of the injection molded part and then perform training to realize the detection of the coating quality of the injection molded part.

[0008] The present invention can accurately obtain the detection result of the coating quality of the injection molded part by constructing an identification model for the bright mark defect area on the surface of the injection molded part. When extracting the bright mark defects on the surface of the injection molded part, the present invention considers that global enhancement of the surface image of the injection molded part will also amplify the background noise. However, when only enhancing the bright mark area, the bright mark area simultaneously includes a deep bright mark area and a shallow bright mark area, and its boundary is relatively blurred, and it is impossible to accurately identify the bright mark defect area. Based on this, the present invention accurately screens the deep bright mark area in the surface image by analyzing the grayscale feature difference between the pixel points in the deep bright mark area and the background area and combining the edge bending feature of the deep bright mark area. In addition, the present invention accurately screens the shallow bright mark area in the surface image according to the brightness and chromaticity feature differences between the remaining pixel points and the background area in the remaining pixel points, effectively improving the accuracy and efficiency of extracting the bright mark defects on the surface of the injection molded part when constructing the model, thereby effectively improving the accuracy of the coating quality detection of the injection molded part.

[0009] According to the method for detecting the coating quality of an injection molded part based on machine vision provided by the present invention, before the step of obtaining the edges in the surface grayscale image of the injection molded part, it further includes: performing preprocessing after photographing the surface of the injection molded part to obtain the surface image of the injection molded part; performing grayscale processing on the surface image of the injection molded part to obtain the surface grayscale image of the injection molded part.

[0010] The method for detecting the coating quality of injection molded parts based on machine vision provided by the present invention, obtaining the probability that a pixel point is a deep bright mark area according to the difference between the gray value of the pixel point and the maximum gray value in the surface gray image, and the average gray difference between the pixel point and different scale neighborhoods, includes: presetting the neighborhood scale size of the pixel point; calculating the probability that the pixel point is a deep bright mark area : ; is the gray value of the pixel point, is the maximum gray value of the surface gray image of the injection molded part, is the number of neighborhood scales, is the gray average value of the neighborhood of the pixel point at the th scale, is the exponential function with e as the base.

[0011] The present invention provides an accurate calculation formula for the probability that a pixel point is a deep bright mark area. By analyzing the difference between the gray value of the pixel point and the gray value of the background area, and the gray change of the pixel point in different scale neighborhoods, the probability that the pixel point is a deep bright mark area is accurately obtained.

[0012] According to the method for detecting the coating quality of injection molded parts based on machine vision provided by the present invention, determining the pixel points of the deep bright mark area includes: using the pixel points with the probability of the deep bright mark area in the surface gray image greater than the average value of the probability of the deep bright mark area of the surface gray image as the pixel points of the deep bright mark area.

[0013] According to the method for detecting the coating quality of injection molded parts based on machine vision provided by the present invention, the method for obtaining the neighborhood change range includes: using the maximum value of the edge width in the surface gray image as the upper limit of the neighborhood change range, and using 1 as the lower limit of the neighborhood change range.

[0014] The present invention uses the maximum value of the edge width as the maximum range of the neighborhood, so that the neighborhood can cover all pixel points in the edge area, thereby more comprehensively and accurately obtaining the gray characteristics of the edge and improving the accuracy of edge approximation.

[0015] According to the method for detecting the coating quality of injection molded parts based on machine vision provided by the present invention, in response to the gray entropy values before and after iteration satisfying the iteration termination condition, obtaining the edge pixel points of the deep bright mark area in each edge includes: using the upper limit of the neighborhood change range of the pixel point as the initial neighborhood of the pixel point starting iteration, determining the gray entropy value within the initial neighborhood of the pixel point and the neighborhood The gray entropy value within , the neighborhood The gray entropy value within and the neighborhood The gray entropy value within ; If this pixel point meets the iteration termination condition: and , then determine this pixel point as the edge pixel point of the deep bright print area; otherwise, continue the iteration until the iteration termination condition is met or the iteration ends within the neighborhood change range.

[0016] The present invention takes into account that the edge of the deep bright print area is located in the middle of the deep bright print area and the light bright print area, and there are significant differences in gray levels on both sides. Therefore, the present invention determines the pixel points that meet this feature through edge approximation, so as to accurately obtain the edge of the deep bright print area.

[0017] According to the injection molded part coating quality detection method based on machine vision provided by the present invention, the determining the probability that the remaining pixel point is the light bright print area includes: taking the average value of the coordinates of all the remaining pixel points corresponding to the standard value to obtain the standard pixel point coordinates corresponding to the standard value; calculating the probability that the remaining pixel point is the light bright print area : ; is the probability that the remaining pixel point is the deep bright print area, is the brightness value of the remaining pixel point, is the standard value, is the chromaticity distance between the remaining pixel point coordinates and the standard pixel point coordinates, is the maximum value of the chromaticity distances between all the remaining pixel point coordinates and the standard pixel point coordinates, is the standard normalization function.

[0018] The present invention takes into account that the pixel points in the light bright print area are close in brightness to the background area but have a large chromaticity difference in the surface color image. Therefore, an accurate calculation method for the probability that the remaining pixel point is the light bright print area is provided. By analyzing the brightness difference and chromaticity difference between the remaining pixel point and the background area, the probability that the remaining pixel point is the light bright print area can be accurately obtained.

[0019] According to the injection molded part coating quality detection method based on machine vision provided by the present invention, the obtaining the pixel points of the light bright print area includes: taking the pixel points in the surface color image whose probability of the light bright print area is greater than the average value of the probability of the light bright print area of the surface color image as the pixel points of the light bright print area.

[0020] Based on the method for detecting the coating quality of injection molded parts using machine vision provided by the present invention, the pixel points and corresponding edge pixel points in the deep bright mark area and the pixel points and corresponding edge pixel points in the shallow bright mark area in the surface image of the injection molded part are enhanced and then trained to achieve the detection of the coating quality of the injection molded part, including: labeling the pixel points and corresponding edge pixel points in the deep bright mark area and the pixel points and corresponding edge pixel points in the shallow bright mark area after enhancement, and inputting them into the model for training to obtain a model for detecting the coating quality of the injection molded part; inputting the latest collected surface image of the injection molded part into the model for detecting the coating quality of the injection molded part to obtain the detection result of the coating quality of the injection molded part.

[0021] In a second aspect, the present invention provides a system for detecting the coating quality of injection molded parts using machine vision, adopting the following technical solutions: The system for detecting the coating quality of injection molded parts using machine vision includes: a processor and a memory, and the memory stores computer program instructions, which implement the above-mentioned method for detecting the coating quality of injection molded parts using machine vision when executed by the processor.

[0022] By adopting the above technical solutions, the above-mentioned method for detecting the coating quality of injection molded parts using machine vision is generated into a computer program and stored in the memory to be loaded and executed by the processor, so as to manufacture a terminal device according to the memory and the processor, which is convenient to use.

[0023] The present invention has the following technical effects: Based on the above technical solutions, the method and system for detecting the coating quality of injection molded parts using machine vision provided by the present invention can accurately obtain the detection result of the coating quality of injection molded parts by constructing an identification model for the bright mark defect area on the surface of the injection molded part. When extracting the bright mark defects on the surface of the injection molded part, the present invention considers that global enhancement of the surface image of the injection molded part will also amplify the background noise, but when only enhancing the bright mark area, the bright mark area includes both the deep bright mark area and the shallow bright mark area, and its boundary is relatively blurred, making it impossible to accurately identify the bright mark defect area; based on this, the present invention accurately screens the deep bright mark area in the surface image by analyzing the gray-scale feature difference between the pixel points in the deep bright mark area and the background area and combining the edge bending feature of the deep bright mark area. In addition, the present invention accurately screens the shallow bright mark area in the surface image according to the brightness and chromaticity feature difference between the remaining pixel points and the background area among the remaining pixel points, effectively improving the accuracy and efficiency of extracting the bright mark defects on the surface of the injection molded part when constructing the model, and thus effectively improving the accuracy of detecting the coating quality of the injection molded part. Description of the Drawings

[0024] Figure 1 It is a schematic flow chart in the method for detecting the coating quality of injection molded parts using machine vision provided by an embodiment of the present invention; Figure 2 Schematic diagram of the surface grayscale image of an injection molded part with bright mark defects provided by an embodiment of the present invention; Figure 3 Schematic diagram of the surface brightness image of an injection molded part with bright mark defects provided by an embodiment of the present invention. Detailed implementation manners

[0025] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments.

[0026] In order to accurately identify the bright mark defects on the surface of the injection molded part and thus accurately obtain the quality inspection results of the injection molded part, an embodiment of the present invention discloses an injection molded part coating quality inspection method based on machine vision. This method analyzes the difference between the normal background area and the bright mark area on the surface of the injection molded part, thereby accurately realizing the identification of the bright mark area, so that a coating quality inspection model of the injection molded part can be accurately constructed based on this, effectively improving the accuracy of the injection molded part coating quality inspection.

[0027] Specifically, please refer to Figure 1 as shown in Figure 1 Schematic diagram of the process in the injection molded part coating quality inspection method based on machine vision provided by an embodiment of the present invention. This method specifically includes the following steps: S1: Collect the surface grayscale image of the injection molded part.

[0028] It should be noted that the grayscale difference on the surface of an injection molded part without bright mark defects is generally small as a whole. And during the process of constructing the model, a large number of surface images of injection molded parts need to be collected. If bright mark identification is also performed on normal injection molded part images, it may cause waste of resources. Based on this, in the embodiment of the present invention, the injection molded part images can be preprocessed before starting the identification.

[0029] Exemplarily, in the embodiment of the present invention, collecting the surface grayscale image of the injection molded part includes: performing preprocessing after photographing the surface of the injection molded part to obtain the surface image of the injection molded part; performing grayscale processing on the surface image of the injection molded part to obtain the surface grayscale image of the injection molded part.

[0030] Among them, the preprocessing can be edge detection, screening the surface images of injection molded parts that may have bright marks, image denoising, grayscale conversion, etc., which can be specifically set according to actual needs, and the embodiment of the present invention does not limit too much here.

[0031] Specifically, when photographing the surface of the injection molded part, the produced injection molded part can be placed in the center of a horizontal desktop, and a high-resolution industrial camera can be installed directly above the desktop to photograph the surface of the injection molded part.

[0032] It can be understood that due to the interference of electronic components inside the shooting device, etc., there may be random noise when shooting the surface image of the injection molded part. Therefore, after shooting the surface of the injection molded part, the image of the injection molded part can be denoised.

[0033] Exemplarily, the influence of random noise on subsequent image processing can be eliminated by a locally weighted regression filtering algorithm. Then, the denoised image is subjected to grayscale processing to obtain the surface grayscale images of all injection molded parts.

[0034] Based on the surface grayscale images of all injection molded parts obtained in the above steps, the surface grayscale images of all injection molded parts can be initially classified to obtain the surface grayscale images of the injection molded parts that may contain bright mark defects.

[0035] It should be noted that the most significant feature in the surface grayscale image of the injection molded part with bright mark defects is the relatively large degree of grayscale chaos in the surface grayscale image. Based on this, in the embodiment of the present invention, when screening the surface grayscale images that may have bright mark defects, the grayscale entropy values in the surface grayscale images of all injection molded parts can be obtained, and the surface grayscale images with larger grayscale entropy values are used as the grayscale surface images of the injection molded parts that need to perform subsequent steps for bright mark defect identification.

[0036] Exemplarily, the image with a grayscale entropy value greater than the entropy threshold can be used as the surface grayscale image of the injection molded part.

[0037] Among them, the entropy threshold can be obtained according to the histogram distribution of the surface grayscale images of all injection molded parts, or can be set according to actual needs. The embodiment of the present invention does not limit this too much here.

[0038] After obtaining the surface grayscale image of the injection molded part through the above steps, edge detection can be performed on the surface grayscale image of the injection molded part to obtain the edges in the surface grayscale image of the injection molded part. Specifically, refer to Figure 2 as shown Figure 2 which is a schematic diagram of the surface grayscale image of an injection molded part with bright mark defects provided by the embodiment of the present invention. Combining Figure 2 it can be seen that the bright marks on the surface of the injection molded part have the characteristics of irregular curved lines, blurred boundaries, and different depths. The deeper bright marks are shown as white areas in the image and the background is not visible; while the shallower bright marks are shown as white areas, but the background is still visible.

[0039] Based on this, before identifying the bright mark defects in the embodiment of the present invention, the bright mark defects can be enhanced to accurately identify the bright mark defects.

[0040] It can be understood that the bright mark area includes a deep bright mark area and a shallow bright mark area, and the manifestations of the deep bright mark area and the shallow bright mark area are not the same. The grayscale value of the deep bright mark area in the surface grayscale image is generally larger, and it has an obvious bending feature.

[0041] Therefore, in the embodiments of the present invention, the dark and bright mark area in the surface grayscale image of the injection molded part can be obtained by first analyzing the grayscale characteristics of the pixel points and the bending characteristics of the edges in the surface grayscale image of the injection molded part.

[0042] For the sake of easy understanding, the embodiments of the present invention take the surface grayscale image of any injection molded part that may have bright mark defects as an example for description, but it does not mean that the embodiments of the present invention are only limited to this.

[0043] S2: According to the difference between the grayscale value of the pixel point in the surface grayscale image and the maximum grayscale value, and the average grayscale difference between this pixel point and different scale neighborhoods, obtain the probability that this pixel point is in the dark and bright mark area, and determine the pixel points in the dark and bright mark area.

[0044] It should be noted that the pixel points in the dark and bright mark area have larger grayscale values and larger grayscale differences from the background area. Therefore, the grayscale characteristics of each pixel point can be evaluated by analyzing the grayscale difference between the pixel points in the surface grayscale image of the injection molded part and the pixel points in the background area, so as to accurately screen out the pixel points that meet the grayscale characteristics of the dark and bright mark area.

[0045] Exemplarily, in the embodiments of the present invention, when obtaining the maximum grayscale value in the surface grayscale image, the grayscale histogram of the surface grayscale image of the injection molded part can be drawn with the grayscale value of the pixel point as the horizontal axis and the number of pixel points corresponding to the grayscale value as the vertical axis. On the horizontal axis of the grayscale histogram, the grayscale value gradually increases from left to right, and on the vertical axis, the number of pixel points gradually increases from bottom to top. Finally, the grayscale value on the far right of the horizontal axis is used as the maximum grayscale value in the surface grayscale image of the injection molded part.

[0046] It can be understood that the maximum grayscale value in the surface grayscale image is the brightest grayscale value in the surface grayscale image. Therefore, the maximum grayscale value is used as an index to measure the dark and bright mark area in the surface grayscale image. The closer the grayscale value of the pixel point is to the maximum grayscale value, the closer the grayscale value of this pixel point is to the grayscale characteristics of the dark and bright mark area, and the greater the possibility that it is a pixel point in the dark and bright mark area. In addition, neighborhoods of different sizes of pixel points can cover different ranges of spatial information, which helps to judge the grayscale characteristics of the pixel point in its local area and the relationship with the surrounding pixel points, so as to more comprehensively analyze whether the pixel point is in the dark and bright mark area and avoid processing pixel points in isolation.

[0047] Based on this, in the embodiments of the present invention, by combining the difference between the grayscale value of the pixel point and the maximum grayscale value, and the average grayscale difference between this pixel point and different scale neighborhoods, the probability that this pixel point is in the dark and bright mark area can be obtained, so that the possibility of each pixel point being in the dark and bright mark area can be accurately obtained.

[0048] Exemplarily, the number of neighborhood scales of a pixel can be set to 3, and the sizes of the scales can be 3, 5, and 7. The scale size is the side length of the neighborhood. The number of neighborhood scales of a pixel and the scale sizes can be specifically set according to actual needs.

[0049] Specifically, when obtaining the neighborhood of the current pixel at each scale, the current pixel can be used as the center, and different-scale neighborhoods of the current pixel can be constructed with the scale size as the side length.

[0050] Among them, when the number of surrounding pixels of some pixels is insufficient to construct their neighborhoods, supplementation can be performed by means such as mirror filling.

[0051] An example to illustrate the different-scale neighborhoods of a pixel: If the neighborhood scale of a pixel is 3, a neighborhood with a size of 3×3 centered on the pixel can be obtained, and the number of pixels included in the neighborhood is 9.

[0052] Exemplarily, in the embodiments of the present invention, calculating the probability that a pixel is in a deep bright print area can be specifically referred to the following relational expression: ; is the probability that the pixel is in a deep bright print area, is the gray value of the pixel, is the maximum gray value of the gray image on the surface of the injection molded part, is the number of neighborhood scales, is the gray mean value of the neighborhood of the pixel at the scale, is the exponential function with base e,

[0053] In the above formula, the normalization difference term represents the difference between the gray value of the pixel and the maximum gray value. The smaller this value is, the closer the gray value of the pixel is to the gray feature of the deep bright print area, and the greater the possibility of being in the deep bright print area.

[0054] The normalization difference term represents the gray difference between the gray value of the pixel and different-scale neighborhoods. The smaller this value is, the closer the gray value of the pixel is to the gray value of its neighborhood, and the higher the possibility that the pixel is in the deep bright print area.

[0055] After obtaining the probabilities of each pixel point in the surface gray-scale image of the injection molded part being the deep bright mark area based on the above steps, the pixel points in the deep bright mark area of the surface gray-scale image of the injection molded part can be screened out.

[0056] Exemplarily, in the embodiment of the present invention, determining the pixel points of the deep bright mark area includes: taking the pixel points in the surface gray-scale image whose probability of the deep bright mark area is greater than the average value of the probability of the deep bright mark area of the surface gray-scale image as the pixel points of the deep bright mark area.

[0057] Through the above steps, the pixel points of the deep bright mark area can be obtained by analyzing the probabilities of each pixel point being the deep bright mark area. However, the edge of the deep bright mark area is blurred and mixed with the pixel points of the light bright mark area. Based on this, in the embodiment of the present invention, the edge bending characteristics in the surface gray-scale image are analyzed through the following steps to obtain the edges of each deep bright mark area.

[0058] S3: Obtain the edges in the surface gray-scale image of the injection molded part, iteratively obtain the gray entropy values in different neighborhoods of the pixel points in the edges within the neighborhood change range, and in response to the gray entropy values before and after iteration satisfying the iteration termination condition, obtain the edge pixel points of the deep bright mark area in each edge.

[0059] Exemplarily, the Canny edge detection algorithm can be used to obtain the edges in the gray-scale image, and the edge detection algorithm can be specifically set according to actual needs.

[0060] It should be noted that the edges obtained based on the edge detection algorithm include both the edges of the deep bright mark area and the edges of the light bright mark area. The edge of the deep bright mark area is between the deep bright mark area and the light bright mark area. Therefore, there are significant differences in the gray levels on both sides of the edge pixel points of the deep bright mark area.

[0061] Based on this, in the embodiment of the present invention, according to the edge approximation principle, it can be judged whether the change in the gray level values of the pixel points at the positions of the edges before and after the edge contour approximation within the neighborhood change range conforms to the bending characteristics of the edge pixel points of the deep bright mark area, so as to accurately obtain the edge pixel points of the deep bright mark area.

[0062] Exemplarily, in the embodiment of the present invention, the method for obtaining the neighborhood change range of pixel points includes: taking the maximum value of the width of the edge in the surface gray-scale image as the upper limit of the neighborhood change range, and taking 1 as the lower limit of the neighborhood change range.

[0063] It can be understood that the maximum value of the edge width determines the maximum range of the neighborhood, so that the neighborhood can cover all pixel points in the edge area. In this way, when analyzing the gray information of pixel points and their neighborhoods, the pixel points related to the edge will not be missed, so as to more comprehensively and accurately obtain the gray characteristics of the edge, and avoid the situation of edge information loss or misjudgment caused by the neighborhood being too small to completely contain the edge.

[0064] Exemplarily, in the embodiments of the present invention, in response to the gray entropy values before and after iteration satisfying the iteration termination condition, obtaining the edge pixel points of the deep and bright imprint regions in each edge includes: taking the upper limit of the neighborhood change range of the pixel point as the initial neighborhood of the pixel point Starting iteration, determining the initial neighborhood of the pixel point and the gray entropy value within it , the neighborhood and the gray entropy value within it , the neighborhood and the gray entropy value within it as well as the neighborhood and the gray entropy value within it ; if the pixel point satisfies the iteration termination condition and , then determining that the pixel point is an edge pixel point of the deep and bright imprint region; otherwise, continue the iteration until the iteration termination condition is satisfied or the iteration ends within the neighborhood change range.

[0065] It can be understood that the pixel point satisfies the iteration termination condition: and , indicating that the pixel point conforms to the edge characteristics of the deep and bright imprint region. Based on this, all the edge pixel points of the deep and bright imprint region can be accurately obtained.

[0066] So far, the embodiments of the present invention can accurately obtain the deep and bright imprint region and the edge pixel points of the deep and bright imprint region.

[0067] It can be understood that the edges obtained based on the edge detection algorithm include both the edges of the deep and bright imprint regions and the edges of the light and bright imprint regions. Therefore, after determining the edge pixel points of the deep and bright imprint regions in the edges of the surface gray image based on the above steps, the remaining edge pixel points in the edges are the edge pixel points of the light and bright imprint regions.

[0068] It should be noted that there are obvious gray differences between the deep and bright imprint regions and the edge pixel points of the deep and bright imprint regions and the background region of the surface gray image of the injection molded part. Therefore, accurate positioning can be performed based on the surface gray image of the injection molded part, while the pixel points of the light and bright imprint regions are relatively close to the background region in the gray space. Therefore, it is difficult to accurately screen out the light and bright imprint regions in the surface gray image of the injection molded part. However, the light and bright imprint regions and the background region have different characteristics in the brightness space, and their brightness is relatively close but there are significant differences in color.

[0069] Based on this, the embodiments of the present invention can accurately screen the pixel points of the light and bright imprint regions from the remaining pixel points in the surface gray image of the injection molded part except for the pixel points and edge pixel points of the deep and bright imprint regions, that is, perform the following steps.

[0070] S4: Obtain the surface color image of the remaining pixel points, and determine the probability that the remaining pixel points are light bright print regions according to the probability that the remaining pixel points are dark bright print regions, the difference between the brightness value and the standard value, and the chromaticity distance between the remaining pixel points and the corresponding remaining pixel points of the standard value, so as to obtain the pixel points of the light bright print regions.

[0071] Exemplarily, when obtaining the surface color image of the remaining pixel points, the remaining pixel points except the pixel points of the dark bright print regions and the edge pixel points in the surface gray-scale image of the injection molded part can be converted into a surface color image. For details, please refer to Figure 3 as shown in Figure 3 FIG. 7, which is a schematic diagram of the surface brightness image of an injection molded part with a bright print defect provided by an embodiment of the present invention.

[0072] Wherein, in the color space of the surface color image, each remaining pixel point corresponds to a three-dimensional coordinate (x, y, z), where y is the brightness value of the remaining pixel point, and x and z are the chromaticity values of the remaining pixel point.

[0073] Exemplarily, after obtaining the surface color image, a white balance correction algorithm can also be used for processing, which can be specifically set according to actual needs.

[0074] Exemplarily, in the embodiment of the present invention, the brightness value that appears most frequently in the surface color image can be recorded as the standard value in the surface color image.

[0075] Specifically, when obtaining the standard value, the brightness value of the remaining pixel points can be used as the horizontal axis, and the number of remaining pixel points corresponding to the brightness value can be used as the vertical axis to draw the brightness histogram of the surface brightness image of the injection molded part. On the horizontal axis of the brightness histogram, the brightness value increases gradually from left to right, and on the vertical axis, the number of remaining pixel points increases gradually from bottom to top. The brightness value corresponding to the maximum peak of the number of remaining pixel points is the standard value in the surface color image.

[0076] It can be understood that the brightness of the background area in the surface brightness image of the injection molded part is relatively uniform and the area is large. Therefore, the obtained standard value can represent the standard brightness of the background area in the surface brightness image. However, the number of remaining pixel points corresponding to the standard value is not unique. Therefore, it is necessary to first determine the coordinates corresponding to the standard value, so as to accurately analyze the difference between the coordinates of the remaining pixel points and the coordinates of the standard value.

[0077] Exemplarily, the average value of the coordinates of all remaining pixel points corresponding to the standard value can be taken respectively to obtain the standard pixel point coordinates corresponding to the standard value ( , , ).

[0078] Exemplarily, in the embodiments of the present invention, calculating the probability that the remaining pixel points are in the light bright print area, specifically, the following relational expression can be referred to: ; is the probability that the remaining pixel points are in the light bright print area, is the probability that the remaining pixel points are in the dark bright print area, is the brightness value of the remaining pixel points, is the standard value, is the chromaticity distance between the coordinates of the remaining pixel points and the coordinates of the standard pixel points, is the maximum value of the chromaticity distances between the coordinates of all the remaining pixel points and the coordinates of the standard pixel points, is the standard normalization function.

[0079] In the above formula, the chromaticity distance between the coordinates of the remaining pixel points and the coordinates of the standard pixel points can be obtained through the formula , where, , are the chromaticity values of the standard pixel points respectively, , are the chromaticity values of the remaining pixel points respectively. It can be understood that since evaluates the chromaticity distance, only the chromaticity value coordinates in the three-dimensional coordinates are used.

[0080] is the normalized difference value between the brightness value of the remaining pixel points and the standard value. On the basis that the probability that the remaining pixel points are in the dark bright print area is greater in the th remaining pixel points, the smaller this value is, it indicates that the brightness value of the remaining pixel points is closer to the brightness of the background area. At this time, if the chromaticity distance between the coordinates of the remaining pixel points and the coordinates of the standard pixel points is greater, it indicates that the brightness and chromaticity differences between the remaining pixel points and the background area are more in line with the characteristics of the light bright print area, and the possibility that this pixel point is a pixel point in the light bright print area is greater, and the corresponding probability is also greater.

[0081] After obtaining the probability that each remaining pixel point is in the light bright print area according to the above steps, the pixel points in the light bright print area among the remaining pixel points can be accurately screened out.

[0082] Exemplarily, in the embodiments of the present invention, obtaining the pixel points of the light bright print area includes: taking the pixel points in the surface color image whose probability of the light bright print area is greater than the average probability of the light bright print area of the surface color image as the pixel points of the light bright print area.

[0083] In this way, after the embodiments of the present invention respectively obtain the pixel points of the dark bright print area, the edge pixel points of the dark bright print area, the pixel points of the light bright print area, and the edge pixel points of the light bright print area based on the above steps, they can be merged to accurately obtain the bright print area in the surface image of the injection molded part.

[0084] S5: Training is performed on the pixel points of the dark bright print area and the corresponding edge pixel points, and the pixel points of the light bright print area and the corresponding edge pixel points in the surface image of the injection molded part after enhancement to implement the coating quality detection of the injection molded part.

[0085] Exemplarily, in the embodiments of the present invention, training is performed on the pixel points of the dark bright print area and the corresponding edge pixel points, and the pixel points of the light bright print area and the corresponding edge pixel points in the surface image of the injection molded part after enhancement to implement the coating quality detection of the injection molded part, including: labeling the pixel points of the dark bright print area and the corresponding edge pixel points, and the pixel points of the light bright print area and the corresponding edge pixel points in the surface image of the injection molded part after enhancement, and inputting them into the model for training to obtain a coating quality detection model for the injection molded part; inputting the latest collected surface image of the injection molded part into the coating quality detection model for the injection molded part to obtain the coating quality detection result of the injection molded part.

[0086] Among them, the enhancement method can be a local contrast enhancement algorithm. The enhancement steps can be implemented by existing technologies, and the embodiments of the present invention will not elaborate herein.

[0087] Among them, the model can be a convolutional neural network, a random forest, etc., and can be specifically set according to actual needs. In the embodiments of the present invention, a convolutional neural network can be used.

[0088] Exemplarily, when labeling the pixel points of the dark bright print area and the corresponding edge pixel points, and the pixel points of the light bright print area and the corresponding edge pixel points in the surface image of the injection molded part after enhancement, the pixel points of the dark bright print area and the corresponding edge pixel points, and the pixel points of the light bright print area and the corresponding edge pixel points can be merged through logical operations, and morphological operations are applied for optimization. Finally, the complete bright print area is obtained and labeled, and the obtained bright print area from the center outwards is the pixel points of the dark bright print area, the edge pixel points of the dark bright print area, the pixel points of the light bright print area, and the edge pixel points of the light bright print area.

[0089] Among them, the marking method can be a region-growing based marking method, an edge-detection based marking method, etc., which can be specifically set according to actual needs. In the embodiments of the present invention, an edge-detection based marking method can be used for marking, and the marking steps can be implemented by existing technologies, which will not be elaborated herein in the embodiments of the present invention.

[0090] After marking the bright mark areas in the surface images of all injection molded parts based on the above steps, training can be performed according to the marked surface images of the injection molded parts.

[0091] Specifically, the marked surface images of the injection molded parts are divided into a training set, a validation set, and a test set and input into the model. After setting the learning parameters of the model, training and validation are started, and finally, an injection molded part coating quality detection model that can be used for identifying bright mark defects on the surface of injection molded parts is obtained.

[0092] It can be seen that in the embodiments of the present invention, when determining the injection molded part coating quality detection result, the edges in the surface grayscale image of the injection molded part can be obtained; according to the difference between the grayscale value of the pixel point in the surface grayscale image and the maximum grayscale value, and the average grayscale difference between this pixel point and different scale neighborhoods, the probability that this pixel point is a deep bright mark area is obtained to determine the pixel points in the deep bright mark area; the grayscale entropy values in different neighborhoods of the pixel points in the edge are iteratively obtained within the neighborhood change range, and in response to the grayscale entropy values before and after iteration satisfying the iteration termination condition, the edge pixel points of the deep bright mark areas in each edge are obtained; the remaining pixel points in the surface grayscale image of the injection molded part except for the pixel points in the deep bright mark area and the edge pixel points are converted into a surface color image, and the brightness value that appears the most times in the surface color image is recorded as the standard value; according to the probability that the remaining pixel points are in the deep bright mark area, the difference between the brightness value and the standard value, and the chromaticity distance between this remaining pixel point and the remaining pixel points corresponding to the standard value, the probability that this remaining pixel point is a shallow bright mark area is determined to obtain the pixel points in the shallow bright mark area; the edge pixel points in the surface grayscale image edge except for the edge pixel points in the deep bright mark area are used as the edge pixel points of the shallow bright mark area; the pixel points in the deep bright mark area in the surface image of the injection molded part and the corresponding edge pixel points and the pixel points in the shallow bright mark area and the corresponding edge pixel points are enhanced and then trained to implement the injection molded part coating quality detection, effectively improving the accuracy and efficiency of the injection molded part coating quality detection.

[0093] The embodiments of the present invention also disclose an injection molded part coating quality detection system based on machine vision, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the injection molded part coating quality detection method provided by the present invention is implemented.

[0094] The above system also includes other components well-known to those skilled in the art, such as a communication bus and a communication interface. Their settings and functions are known in the art, so they will not be elaborated here.

[0095] In the present invention, the aforementioned memory can be any tangible medium that contains or stores a program, and the program can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0096] The above are all preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for detecting the coating quality of injection molded parts based on machine vision, characterized in that: include: Obtain the edge in the grayscale image of the surface of the injection molded part; According to the difference between the gray value of the pixel point in the surface gray image and the maximum gray value, and the mean gray difference between the pixel point and the neighbors of different scales, the probability that the pixel point is a dark bright print area is obtained, and the pixel point of the dark bright print area is determined; Iteratively obtain the grayscale entropy values ​​in different neighborhoods of the pixel points in the edge within the neighborhood variation range, and in response to the grayscale entropy values ​​before and after the iteration satisfying the iteration termination condition, obtain the edge pixel points of the dark bright print area in each edge; convert the remaining pixel points in the surface grayscale image of the injection molded part except the dark bright print area pixel points and the edge pixel points into the surface color image, and record the brightness value that appears the most times in the surface color image as the standard value; determine the probability that the remaining pixel points are the light bright print area according to the probability that the remaining pixel points are the dark bright print area, the difference between the brightness value and the standard value, and the chromaticity distance between the remaining pixel points and the remaining pixel points corresponding to the standard value, and obtain the light bright print area pixel points; regard the edge pixel points of the surface grayscale image except the dark bright print area as the light bright print area edge pixel points; enhance the dark bright print area pixel points and the corresponding edge pixel points and the light bright print area pixel points and the corresponding edge pixel points in the surface image of the injection molded part and then train them to realize the injection molded part coating quality detection.

2. The method for detecting the quality of coating of injection molded parts based on machine vision according to claim 1, characterized in that: The step of obtaining the edge in the surface grayscale image of the injection molded part also includes: After photographing the surface of the injection-molded part, pre-processing is performed to obtain a surface image of the injection-molded part; and the surface image of the injection-molded part is gray-scaled to obtain a surface gray-scale image of the injection-molded part.

3. The method for detecting the quality of coating of injection molded parts based on machine vision according to claim 1, characterized in that: The method of obtaining the probability that the pixel is a dark bright print area according to the difference between the grayscale value of the pixel in the surface grayscale image and the maximum grayscale value, and the mean grayscale difference between the pixel and the neighbors of different scales, includes: Preset the neighborhood scale of the pixel point; calculate the The probability that the pixel is a dark bright print area : ; For the The gray value of the pixel, is the maximum grayscale value of the grayscale image of the injection molded part surface, is the number of neighborhood scales, For the Pixel No. The grayscale mean of the neighborhood at each scale, is an exponential function with base e.

4. The method for detecting the quality of coating of injection molded parts based on machine vision according to claim 1, characterized in that: The step of determining the pixel points of the dark bright print area comprises: The pixel points whose probability of the dark bright print area in the surface grayscale image is greater than the probability mean of the dark bright print area in the surface grayscale image are taken as the dark bright print area pixel points.

5. The method for detecting the quality of coating of injection molded parts based on machine vision according to claim 1, characterized in that: The method for obtaining the neighborhood change range includes: The maximum value of the edge width in the surface grayscale image is taken as the upper limit of the neighborhood variation range, and 1 is taken as the lower limit of the neighborhood variation range.

6. The method for detecting the quality of coating of injection molded parts based on machine vision according to claim 1, characterized in that: The step of obtaining edge pixel points of dark bright print areas in each edge in response to the grayscale entropy values ​​before and after iteration satisfying the iteration termination condition comprises: The upper limit of the neighborhood change range of the pixel point is used as the initial neighborhood of the pixel point Start iteration and determine the initial neighborhood of the pixel Gray entropy value within , Neighborhood Gray entropy value within , Neighborhood Gray entropy value within and neighborhood Gray entropy value within ; If the pixel meets the iteration termination condition: and , then the pixel is determined to be the edge pixel of the dark bright print area; otherwise, the iteration continues until the iteration termination condition is met or the iteration ends within the neighborhood change range.

7. The method for detecting the quality of coating of injection molded parts based on machine vision according to claim 1, characterized in that: Determining the probability that the remaining pixel point is a light bright print area includes: Take the average of the coordinates of all remaining pixels corresponding to the standard value to obtain the standard pixel coordinates corresponding to the standard value; calculate the The probability that the remaining pixels are light-bright printed areas : ; For the The probability that the remaining pixels are dark bright print areas, For the The brightness values ​​of the remaining pixels, is the standard value, For the The chromaticity distance between the remaining pixel coordinates and the standard pixel coordinates, is the maximum chromaticity distance between the coordinates of all remaining pixels and the coordinates of the standard pixel. is the standard normalization function.

8. The method for detecting the quality of coating of injection molded parts based on machine vision according to claim 1, characterized in that: The step of obtaining pixel points in the light-bright printing area includes: The pixel points whose probability of the light-bright printing area in the surface color image is greater than the probability mean of the light-bright printing area in the surface color image are regarded as the light-bright printing area pixel points.

9. The method for detecting the quality of coating of injection molded parts based on machine vision according to claim 1, characterized in that: The training is performed after enhancing the pixels of the dark bright print area and the corresponding edge pixels and the pixels of the light bright print area and the corresponding edge pixels in the surface image of the injection molded part to realize the coating quality detection of the injection molded part, including: The pixels in the dark bright print area and the corresponding edge pixels as well as the pixels in the light bright print area and the corresponding edge pixels are enhanced and labeled, and input into the model for training to obtain an injection molded part coating quality detection model; the latest collected injection molded part surface image is input into the injection molded part coating quality detection model to obtain the injection molded part coating quality detection result.

10. The injection molded parts coating quality inspection system based on machine vision is characterized by: 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 the quality of coating of injection molded parts based on machine vision according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Bright spot defect detection method and device, computer equipment and storage medium

    CN115330704A

  • Injection molding part surface defect detection method based on image processing

    CN115953409A

  • Online injection mold quality detection system based on machine vision

    CN117764981A

  • Product defect detection method and device and storage medium

    CN118037719A

  • Injection molding quality detection method and system for injection molding part

    CN118334019A

Cited By

  • Thermal spraying coating quality detection system and method based on machine vision

    CN121544558A