Visual inspection method for surface defects of injection mold
By dividing the injection mold into areas and combining high-definition and infrared image detection, combining feature extraction and temperature analysis, the accuracy of the surface defect detection of injection molds in the prior art is solved, and more efficient defect identification and evaluation is achieved.
Patent Information
- Application Number
- CN202411296077.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to fully and accurately identify the surface defects of the injection mold, and there is a risk of missing subtle and concealed defects, resulting in a reduction in detection accuracy and reliability.
By dividing the injection mold to be tested and the standard injection mold into multiple areas, using high-definition cameras and infrared cameras to capture images, combining image recognition models and heating elements, extracting feature vectors and temperature data, determining defect scores and target areas, and achieving multiple results Defect detection of dimensions.
It improves the accuracy and reliability of surface defect detection of injection molds, can more accurately identify obvious and concealed defects, and enhances the objectivity and comprehensiveness of the detection.
Smart Images

Figure CN119131000A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a method for visually detecting surface defects of an injection mold. Background Art
[0002] In the related art, CN118071753A relates to the field of image processing technology, and specifically to a method for visually detecting surface defects of injection molds, including: obtaining a grayscale image of the injection mold; obtaining a second edge image; obtaining edge feature indicators of the edge according to the fluctuation of each edge in the second edge image; obtaining the grayscale change consistency of the edge according to the grayscale change direction of the pixel point in the edge; obtaining the possibility of the edge as a texture edge according to the difference in edge feature indicators and grayscale change consistency of different edges in the neighborhood area; obtaining several defective edges of the second edge image; obtaining several defective areas of the grayscale image of the injection mold according to the distance between different defective edges and the difference in edge feature indicators. This scheme reduces the interference of the texture edge of the injection mold on the defect edge detection, and improves the accuracy of the surface defect detection results of the injection mold.
[0003] CN118429219A discloses a method for visually detecting surface defects of injection molds, and relates to the field of image processing technology. It includes basic information acquisition: acquiring an image shooting component, a lighting component, a sample injection mold, a standard injection mold corresponding to the sample injection mold, and basic feedback information. This scheme can optimize the image by setting an image optimization method, which is conducive to reducing the probability of errors in the detection of the defect detection method due to poor image quality. By associating the working path group with the relevant relationship, the final working path of the lighting component corresponding to the sample injection mold in the real-time detection can be obtained. The lighting component is illuminated according to the final working path, which is conducive to fully lighting the mold cavity of the sample injection mold, avoiding the image being affected by uneven illumination and affecting the detection of the subsequent defect detection method, which is conducive to reducing the probability of errors in the detection, and is convenient for further improving the quality of the image and the accuracy of the defect information.
[0004] Therefore, in the related art, infrared images are not combined to further detect the surface defects of the injection mold, which leads to the risk of missing subtle and hidden defects, and it is difficult to comprehensively and accurately identify the surface defects of the injection mold, thereby reducing the accuracy and reliability of the injection mold surface defect detection.
[0005] The information disclosed in the background technology section of this application is only intended to deepen the understanding of the general background technology of this application, and should not be regarded as an admission or any form of suggestion that the information constitutes the prior art already known to those skilled in the art. Summary of the invention
[0006] The present invention provides a method for visually detecting surface defects of an injection mold, which can solve the technical problem that it is difficult to comprehensively and accurately identify surface defects of an injection mold in the related art.
[0007] According to a first aspect of the present invention, a method for visual inspection of surface defects of injection molds is provided, comprising: dividing an injection mold to be tested and a standard injection mold into a plurality of regions respectively, taking a high-definition image to be tested of each region of the injection mold to be tested and a standard high-definition image of each region of the standard injection mold by a high-definition camera, wherein the standard injection mold is an injection mold that is consistent with the type of the injection mold to be tested and meets the inspection standard, and the high-definition image to be tested corresponds to the standard high-definition image one-to-one; performing feature extraction processing on the high-definition image to be tested and the standard high-definition image through the feature coding level of a trained image recognition model to obtain a first surface feature vector of the high-definition image to be tested in each region and a second surface feature vector of the standard high-definition image in each region; and obtaining a first surface feature vector of the high-definition image to be tested and a second surface feature vector of the standard high-definition image in each region according to the high-definition image to be tested and the standard injection mold. The first surface defect score and the first surface target area are determined by using a standard high-definition image, the first surface feature vector and the second surface feature vector; the multiple areas of the injection mold to be tested and the standard injection mold are uniformly heated within a preset time period by a heating element; at the end of the preset time period, an infrared image of each area of the injection mold to be tested and a standard infrared image of an area of the standard injection mold are taken by an infrared camera, wherein the infrared camera has the same viewing angle as the high-definition camera; a second surface defect score and a second surface target area are determined according to the infrared image to be tested and the standard infrared image; the surface defect area of the injection mold is determined according to the first surface defect score, the first surface target area, the second surface defect score and the second surface target area.
[0008] Furthermore, a first surface defect score and a first surface target area are determined according to the high-definition image to be tested, the standard high-definition image, the first surface feature vector and the second surface feature vector, including: obtaining pixel values to be tested of multiple pixel points in the high-definition image to be tested, and standard pixel values of multiple pixel points in the standard high-definition image; when the difference between the pixel value to be tested and the corresponding standard pixel value is greater than or equal to a preset pixel difference threshold, determining that the pixel point in the high-definition image to be tested is a first target pixel point; performing a connected domain analysis on multiple first target pixel points to determine the first surface target area of each area of the injection mold to be tested; and determining a first surface defect score according to the pixel value to be tested, the standard pixel value, the preset pixel difference threshold, the first surface feature vector and the second surface feature vector.
[0009] Further, determining a first surface defect score according to the pixel value to be tested, the standard pixel value, the preset pixel difference threshold, the first surface feature vector and the second surface feature vector comprises: determining a first surface defect score according to the formula Determine the first surface defect score D of the i-th area of the injection mold to be tested 1,i , where I i,j is the jth pixel value of the high-definition image of the i-th area of the injection mold to be tested, I i,j,p is the jth standard pixel value of the standard high-definition image of the i-th area of the standard injection mold, ΔI is the preset pixel difference threshold, V 1,i is the first surface feature vector of the i-th region of the injection mold to be tested, V 2,i is the second surface feature vector of the i-th region of the standard injection mold, V 1,i The transposed vector of N, α1 and α2 are preset weights, and α1+α2=1, N i is the number of pixels of the HD image to be tested and the standard HD image of the i-th area of the injection mold to be tested and the standard injection mold, j≤N i , and i, j and N i All are positive integers, and max is the maximum value function.
[0010] Further, according to the infrared image to be tested and the standard infrared image, a second surface defect score and a second surface target area are determined, including: obtaining the temperature values to be tested corresponding to multiple pixel points in the infrared image to be tested, and the standard temperature value corresponding to a pixel point in the standard infrared image; averaging the temperature values to be tested corresponding to multiple pixel points of each of the infrared images to be tested to obtain an average temperature value to be tested; when the difference between the temperature value to be tested and the standard temperature value is greater than or equal to a preset temperature difference threshold, determining that the pixel point in the infrared image to be tested is a second target pixel point; averaging the temperature values to be tested corresponding to multiple pixel points of the standard infrared image to be tested to obtain an average temperature value to be tested; when the difference between the temperature value to be tested and the standard temperature value is greater than or equal to a preset temperature difference threshold, determining that the pixel point in the infrared image to be tested is a second target pixel point; and averaging the temperature values to be tested corresponding to multiple pixel points of the standard infrared image to obtain an average temperature value to be tested. Performing connected domain analysis to obtain the temperature abnormality area; determining the second surface target area of each area of the injection mold to be tested corresponding to the temperature abnormality area in the high-definition image to be tested according to the position of the temperature abnormality area; determining the temperature uniformity score according to the temperature value to be tested and the average temperature value to be tested; if the temperature uniformity score is greater than or equal to the temperature uniformity score threshold, determining the second surface defect score to be 0; if the temperature uniformity score is less than the temperature uniformity score threshold, determining the second surface defect score according to the temperature value to be tested, the standard temperature value and the preset temperature difference threshold.
[0011] Further, according to the temperature value to be measured and the average temperature value to be measured, determining the temperature uniformity score includes: according to the formula Determine the temperature uniformity score B of the i-th area of the injection mold to be tested i , where t i,s is the sth temperature value to be measured of the infrared image of the ith area of the injection mold to be measured, is the average temperature value of the infrared image of the i-th area of the injection mold to be tested, M i is the number of pixels of the infrared image to be tested and the standard infrared image of the i-th area of the injection mold to be tested and the standard injection mold, s≤M i , and i, s and M i They are all positive integers, max is the maximum value function, and min is the minimum value function.
[0012] Further, if the temperature uniformity score is less than the temperature uniformity score threshold, a second surface defect score is determined according to the temperature value to be measured, the standard temperature value and the preset temperature difference threshold, including: according to the formula Determine the second surface defect score D of the i-th area of the injection mold to be tested 2,i , where t i,s is the sth temperature value to be measured of the infrared image of the ith area of the injection mold to be measured, t p is the standard temperature value of the standard injection mold, Δt is the preset temperature difference threshold, β1 and β2 are preset weights, and β1+β2=1, M i is the number of pixels of the infrared image to be tested and the standard infrared image of the i-th area of the injection mold to be tested and the standard injection mold, s≤M i , and i, s and M i All are positive integers.
[0013] Further, determining the surface defect area of the injection mold according to the first surface defect score, the first surface target area, the second surface defect score and the second surface target area includes: when the first surface defect score of the i-th area of the injection mold to be tested is greater than or equal to the first surface defect score threshold, and the second surface defect score is greater than or equal to the second surface defect score threshold, if the first surface defect score is greater than or equal to the second surface defect score, determining the first surface target area of the i-th area of the injection mold to be tested as the injection mold surface defect area, wherein i is a positive integer; if the first surface defect score is less than the second surface defect score, determining the second surface target area of the i-th area of the injection mold to be tested as the injection mold surface defect area; when the injection mold to be tested has a surface defect score of less than 0.05, the surface defect score of the i-th area of ... When the first surface defect score of the i-th region is greater than or equal to the first surface defect score threshold, and the second surface defect score is less than the second surface defect score threshold, the first surface target region of the i-th region of the injection mold to be tested is determined to be the injection mold surface defect region; when the first surface defect score of the i-th region of the injection mold to be tested is less than the first surface defect score threshold, and the second surface defect score is greater than or equal to the second surface defect score threshold, the second surface target region of the i-th region of the injection mold to be tested is determined to be the injection mold surface defect region; when the first surface defect score of the i-th region of the injection mold to be tested is less than the first surface defect score threshold, and the second surface defect score is less than the second surface defect score threshold, the i-th region of the injection mold to be tested is determined to be a defect-free region.
[0014] According to a second aspect of the present invention, there is provided a visual inspection system for surface defects of injection molds, comprising: a module for high-definition images to be tested and standard high-definition images, for dividing the injection mold to be tested and the standard injection mold into a plurality of regions, respectively, and taking a high-definition image to be tested of each region of the injection mold to be tested and a standard high-definition image of each region of the standard injection mold by a high-definition camera, wherein the standard injection mold is an injection mold that is consistent with the type of the injection mold to be tested and meets the inspection standard, and the high-definition image to be tested corresponds to the standard high-definition image one-to-one; a module for first surface feature vectors and second surface feature vectors, for performing feature extraction processing on the high-definition image to be tested and the standard high-definition image through the feature coding level of a trained image recognition model, and obtaining a first surface feature vector of the high-definition image to be tested in each region and a second surface feature vector of the standard high-definition image in each region; a module for first surface defect scoring and first surface target area, for obtaining a first surface feature vector of the high-definition image to be tested and a second surface feature vector of the standard high-definition image in each region according to the high-definition image to be tested, the standard image, and the first surface defect scoring. A quasi-high-definition image, the first surface feature vector and the second surface feature vector are used to determine a first surface defect score and a first surface target area; a uniform heating module is used to uniformly heat multiple areas of the injection mold to be tested and the standard injection mold within a preset time period through a heating element; a module for infrared images to be tested and a standard infrared image is used to take an infrared image of each area of the injection mold to be tested and a standard infrared image of an area in the standard injection mold through an infrared camera at the end of the preset time period, wherein the infrared camera has the same viewing angle as the high-definition camera; a module for second surface defect score and a second surface target area is used to determine a second surface defect score and a second surface target area according to the infrared image to be tested and the standard infrared image; an injection mold surface defect area module is used to determine the injection mold surface defect area according to the first surface defect score, the first surface target area, the second surface defect score and the second surface target area.
[0015] Technical effect: According to the present invention, by dividing the injection mold to be tested and the standard injection mold into multiple areas for independent shooting and analysis, the defects of each area can be identified more accurately, thereby improving the accuracy of the overall detection. Using the standard injection mold as a reference makes the detection of the injection mold to be tested comparable. High-definition images provide clear visual information on the surface of the injection mold to help identify obvious defects, while infrared images can reveal subtle and hidden defects. Combining the detection methods of high-definition images and infrared images, the surface defects of the injection mold can be fully and accurately identified, and the accuracy and reliability of the detection of surface defects of the injection mold can be improved. When determining the first surface defect score, the multi-dimensional evaluation can more comprehensively reflect the defect situation and determine the first surface defect score by comparing the pixel value to be tested with the standard pixel value, and the similarity between the first surface feature vector and the second surface feature vector. The difference between the injection mold to be tested and the standard injection mold is objectively and accurately expressed, and the objectivity, accuracy and comprehensiveness of the first surface defect score are improved. When determining the temperature uniformity score, the temperature uniformity score can be determined by the degree of deviation between the maximum and minimum values of the temperature value to be measured and the average temperature value to be measured, which can effectively identify the temperature abnormality area and improve the accuracy and comprehensiveness of the temperature uniformity score. When determining the second surface defect score, the second surface defect score can be determined by the temperature value to be measured, the standard temperature value and the preset temperature difference threshold, so as to objectively and accurately express the degree of temperature deviation between the injection mold to be tested and the standard injection mold, which helps to accurately identify the subtle and hidden defects of the injection mold to be tested, and improves the objectivity and accuracy of the second surface defect score.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present invention. Other features and aspects of the present invention will become more apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can be obtained based on these drawings without creative work.
[0018] Figure 1 A schematic diagram exemplarily shows a flow chart of a method for visually inspecting surface defects of an injection mold according to an embodiment of the present invention;
[0019] Figure 2 A block diagram of a visual inspection system for surface defects of an injection mold according to an embodiment of the present invention is exemplarily shown. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0022] Figure 1 A flow chart of a method for visual inspection of surface defects of injection molds according to an embodiment of the present invention is exemplarily shown, the method comprising: step S101, dividing the injection mold to be tested and the standard injection mold into a plurality of regions respectively, taking a high-definition image to be tested of each region of the injection mold to be tested and a standard high-definition image of each region of the standard injection mold by a high-definition camera, wherein the standard injection mold is an injection mold that is consistent with the type of the injection mold to be tested and meets the inspection standard, and the high-definition image to be tested corresponds to the standard high-definition image one by one; step S102, performing feature extraction processing on the high-definition image to be tested and the standard high-definition image through the feature encoding level of the trained image recognition model to obtain a first surface feature vector of the high-definition image to be tested in each region and a second surface feature vector of the standard high-definition image in each region; step S103, based on the high-definition image to be tested, the high-definition image to be tested and the standard image to be tested, the high-definition image to be tested and the standard image to be tested correspond to each other one by one. The standard high-definition image, the first surface feature vector and the second surface feature vector are used to determine a first surface defect score and a first surface target area; step S104, uniformly heating the injection mold to be tested and multiple areas of the standard injection mold within a preset time period by a heating element; step S105, at the end of the preset time period, taking an infrared image to be tested of each area of the injection mold to be tested and a standard infrared image of an area of the standard injection mold by an infrared camera, wherein the infrared camera has the same viewing angle as the high-definition camera; step S106, determining a second surface defect score and a second surface target area according to the infrared image to be tested and the standard infrared image; step S107, determining the surface defect area of the injection mold according to the first surface defect score, the first surface target area, the second surface defect score and the second surface target area.
[0023] According to the method for visual inspection of surface defects of injection molds according to an embodiment of the present invention, by dividing the injection mold to be tested and the standard injection mold into multiple areas for independent shooting and analysis, the defects of each area can be more accurately identified, thereby improving the accuracy of the overall inspection. Using the standard injection mold as a reference makes the inspection of the injection mold to be tested comparable. High-definition images provide clear visual information of the surface of the injection mold to help identify obvious defects, while infrared images can reveal subtle and hidden defects. Combining the detection methods of high-definition images and infrared images, surface defects of injection molds can be comprehensively and accurately identified, improving the accuracy and reliability of injection mold surface defect detection.
[0024] According to one embodiment of the present invention, in step S101, the injection mold to be tested and the standard injection mold are respectively divided into multiple areas, so that each area can be independently tested and compared. Use a high-definition camera to shoot each area of the injection mold to be tested and the standard injection mold. For the injection mold to be tested, the high-definition image to be tested is shot, and for the standard injection mold, the standard high-definition image is shot. And the high-definition image to be tested corresponds to the standard high-definition image one by one, that is, the high-definition image to be tested of each area of the injection mold to be tested has a corresponding standard high-definition image of the standard injection mold area, and the shooting angle size of the corresponding high-definition image to be tested is consistent with that of the standard high-definition image, so as to facilitate subsequent comparison and analysis. The selected standard injection mold must be consistent with the type of the injection mold to be tested, and the inspection result of the standard injection mold meets the industry standard, that is, the quality of the standard injection mold is qualified.
[0025] According to one embodiment of the present invention, in step S102, the image recognition model may be a convolutional neural network model. The feature encoding level of the image recognition model is used to perform feature extraction processing on the HD image to be tested and the standard HD image, and the first surface feature vector of the HD image to be tested in each region and the second surface feature vector of the standard HD image in each region are obtained respectively. The first surface feature vector and the second surface feature vector generally include various features of the image, such as edges, textures, shapes, etc., as well as possible other visual features, and the features are encoded at different levels to form feature vectors.
[0026] According to an embodiment of the present invention, in step S103, a first surface defect score and a first surface target area are determined according to the high-definition image to be tested, the standard high-definition image, the first surface feature vector, and the second surface feature vector.
[0027] According to one embodiment of the present invention, step S103 includes: obtaining pixel values to be tested of multiple pixel points in the high-definition image to be tested, and standard pixel values of multiple pixel points in the standard high-definition image; when the difference between the pixel value to be tested and the corresponding standard pixel value is greater than or equal to a preset pixel difference threshold, determining that the pixel point in the high-definition image to be tested is a first target pixel point; performing a connected domain analysis on the multiple first target pixel points to determine the first surface target area of each area of the injection mold to be tested; determining a first surface defect score based on the pixel value to be tested, the standard pixel value, the preset pixel difference threshold, the first surface feature vector and the second surface feature vector.
[0028] According to one embodiment of the present invention, pixel values to be tested of a plurality of pixel points are extracted from a high-definition image to be tested, and standard pixel values corresponding to a plurality of pixel points are extracted from a standard high-definition image. The difference between each pair of pixel values to be tested and the standard pixel value is calculated. When the difference between the pixel value to be tested and its corresponding standard pixel value is greater than or equal to a preset pixel difference threshold, the pixel point corresponding to the pixel value to be tested is marked as a first target pixel point, thereby identifying a pixel point with a significant difference, where a defect may exist. The connectivity relationship between a plurality of first target pixel points can be determined to form a connected domain, and the boundary and range of the connected domain can be used as the boundary and range of the first surface target area, thereby identifying the first surface target area. Among them, the connected domain refers to a collection of target position information having a mutual connection or adjacent relationship. The first surface defect score reflects the surface quality of the injection mold to be tested, and can effectively identify surface defects of the injection mold to be tested.
[0029] According to one embodiment of the present invention, determining a first surface defect score according to the pixel value to be tested, the standard pixel value, the preset pixel difference threshold, the first surface feature vector and the second surface feature vector includes: determining a first surface defect score D of the i-th area of the injection mold to be tested according to formula (1): 1,i ,
[0030]
[0031] Among them, I i,j is the jth pixel value of the high-definition image of the i-th area of the injection mold to be tested, I i,j,p is the jth standard pixel value of the standard high-definition image of the i-th area of the standard injection mold, ΔI is the preset pixel difference threshold, V 1,i is the first surface feature vector of the i-th region of the injection mold to be tested, V 2,i is the second surface feature vector of the i-th region of the standard injection mold, V 1,iThe transposed vector of N, α1 and α2 are preset weights, and α1+α2=1, N i is the number of pixels of the HD image to be tested and the standard HD image of the i-th area of the injection mold to be tested and the standard injection mold, j≤N i , and i, j and N i All are positive integers, and max is the maximum value function.
[0032] According to one embodiment of the present invention, in formula (1), It is the relative difference between the jth pixel value to be tested of the high-definition image to be tested of the i-th area of the injection mold to be tested and the jth standard pixel value of the standard high-definition image of the i-th area of the standard injection mold, indicating the degree of deviation between the pixel value to be tested and the standard pixel value. The larger the relative difference is, the more obvious the difference between the two pixel points is, and the more serious the defect at the point where the pixel value to be tested is located is. It represents the average value of the relative difference between all pixel values to be tested and the corresponding standard pixel values of the high-definition image to be tested of the i-th area of the injection mold to be tested. The larger the average value is, the more serious the defect of the area is. The ratio of the maximum value of the difference between all the pixel values to be tested and the corresponding standard pixel values of the high-definition image to be tested in the i-th area of the injection mold to be tested is deducted from the preset pixel difference threshold value, and the preset pixel difference threshold value is used. The larger the ratio is, the smaller the maximum value of the difference between the pixel value to be tested and the corresponding standard pixel value is, and the area meets the standard. The result of 1 minus the ratio is obtained. The larger the result is, the larger the maximum value of the difference between the pixel value to be tested and the corresponding standard pixel value is, and the more obvious the defects in the area are. The value of the product of the above two items is obtained. The larger the value is, the more serious and obvious the defects in the area are. is the similarity between the first surface feature vector of the i-th region of the injection mold to be tested and the second surface feature vector of the i-th region of the standard injection mold. The result of 1 minus the similarity can be obtained, and the result can be used to indicate the similarity between the features of the i-th region of the injection mold to be tested and the features of the i-th region of the standard injection mold. The closer the result is to 1, the less similar the i-th region of the injection mold to be tested is to the i-th region of the standard injection mold, and the more defects there are in this region.
[0033] It is the result of the weighted sum of the above two items, that is, the first surface defect score of the i-th area of the injection mold to be tested. The higher the first surface defect score is, the more serious the defect situation in this area is.
[0034] In this way, through the comparison between the pixel values to be tested and the standard pixel values, as well as the similarity between the first surface feature vector and the second surface feature vector, the multi-dimensional evaluation can more comprehensively reflect the defect situation and determine the first surface defect score, thereby objectively and accurately expressing the difference between the injection mold to be tested and the standard injection mold, thereby improving the objectivity, accuracy and comprehensiveness of the first surface defect score.
[0035] According to one embodiment of the present invention, in step S104, an appropriate heating element is selected, such as an electric heating device, steam heating and infrared heating, to heat the injection mold to be tested and the standard injection mold. The heating element can provide uniform heat so that the heating effect of each area of the injection mold to be tested and the standard injection mold is consistent. Since the standard injection mold has no defects and meets the standards, the temperature of each area of the standard injection mold is consistent. The preset time period can be set to 10 minutes, 20 minutes, etc., and the present invention is not limited to this.
[0036] According to one embodiment of the present invention, in step S105, the viewing angle of the infrared camera is consistent with that of the high-definition camera, so that during the shooting process, the infrared camera can capture the same area as the high-definition camera and the same viewing angle as the high-definition camera, which is convenient for determining the position of the defect in the high-definition image. Use an infrared camera to shoot each area of the injection mold to be tested, and record the infrared image to be tested, which reflects the temperature distribution on the surface of the injection mold to be tested. At the same time, use an infrared camera to shoot one of the multiple areas of the standard injection mold, and record the standard infrared image of the area. The standard infrared image is used as a reference for comparison with the infrared image to be tested. The temperature of each area of the standard injection mold is consistent, so only one area of the multiple areas of the standard injection mold needs to be selected for shooting.
[0037] According to an embodiment of the present invention, in step S106, a second surface defect score and a second surface target area are determined according to the infrared image to be tested and the standard infrared image.
[0038] According to one embodiment of the present invention, infrared images have unique advantages in detecting surface defects of injection molds, and can detect subtle defects that are difficult to detect with high-definition images. For example, shallow cracks on the surface of the injection mold that do not cause significant physical fractures or deformations are difficult to visually detect with high-definition images, but infrared imaging technology can effectively identify them, using the temperature difference between the crack and the surrounding materials (affecting heat conduction) to form obvious hot and cold spots in the image, thereby revealing subtle defects. The subtle bumps on the surface of the injection mold are difficult to detect in high-definition images due to limitations in resolution or lighting conditions, however, infrared images can capture the temperature differences between these tiny areas and the surrounding areas caused by heat changes. Some surface defects (such as local material deterioration, etc.) are not obvious in high-definition images, but infrared images can directly measure and display temperature changes, thereby effectively revealing potential surface quality problems.
[0039] According to one embodiment of the present invention, step S106 includes: obtaining the temperature values to be measured corresponding to multiple pixels in the infrared image to be measured, and the standard temperature value corresponding to a pixel in the standard infrared image; averaging the temperature values to be measured corresponding to multiple pixels in each of the infrared images to be measured to obtain an average temperature value to be measured; when the difference between the temperature value to be measured and the standard temperature value is greater than or equal to a preset temperature difference threshold, determining that the pixel in the infrared image to be measured is a second target pixel; performing a connected domain analysis on multiple second target pixels to obtain a temperature abnormality area; determining, according to the position of the temperature abnormality area, a second surface target area of each area of the injection mold to be tested corresponding to the temperature abnormality area in the high-definition image to be tested; determining a temperature uniformity score according to the temperature value to be measured and the average temperature value to be measured; if the temperature uniformity score is greater than or equal to the temperature uniformity score threshold, determining a second surface defect score of 0; if the temperature uniformity score is less than the temperature uniformity score threshold, determining a second surface defect score according to the temperature value to be measured, the standard temperature value and the preset temperature difference threshold.
[0040] According to one embodiment of the present invention, the temperature of each area of the standard injection mold is consistent. Therefore, the temperature of the entire standard injection mold can be obtained by obtaining the standard temperature value corresponding to a pixel from the standard infrared image. The average temperature value to be measured is used to evaluate the temperature uniformity of the injection mold to be measured. The difference between each temperature value to be measured and the standard temperature value is calculated. If the difference between the temperature value to be measured and the standard temperature value is greater than or equal to the preset temperature difference threshold, the pixel is marked as a second target pixel, so that the pixel with abnormal temperature can be identified. The connectivity relationship between multiple second target pixels can be determined to form a connected domain, and the boundary and range of the connected domain can be used as the boundary and range of the second surface target area, so as to identify the specific area with abnormal temperature on the surface of the injection mold to be measured. The temperature uniformity score reflects the consistency of the temperature of each area of the injection mold to be measured. If the temperature uniformity score is greater than or equal to the temperature uniformity score threshold, the second surface defect score is determined to be 0, indicating that the temperature uniformity of the area of the injection mold to be measured is good and there is no defect. If the temperature uniformity score is less than the temperature uniformity score threshold, further analysis is performed based on the temperature value to be measured, the standard temperature value, and the preset temperature difference threshold to determine the second surface defect score.
[0041] According to one embodiment of the present invention, the temperature uniformity score is determined according to the temperature value to be measured and the average temperature value to be measured, including: determining the temperature uniformity score B of the i-th area of the injection mold to be measured according to formula (2): i ,
[0042]
[0043] Among them, t i,s is the sth temperature value to be measured of the infrared image of the ith area of the injection mold to be measured, is the average temperature value of the infrared image of the i-th area of the injection mold to be tested, M i is the number of pixels of the infrared image to be tested and the standard infrared image of the i-th area of the injection mold to be tested and the standard injection mold, s≤M i , and i, s and M i They are all positive integers, max is the maximum value function, and min is the minimum value function.
[0044] According to one embodiment of the present invention, in formula (2), It is the ratio of the maximum value of all the measured temperature values of the infrared image of the i-th area of the injection mold to be tested minus the average measured temperature value of the infrared image of the i-th area of the injection mold to be tested, to the maximum value of the measured temperature value. The larger the ratio is, the greater the deviation between the maximum value of the measured temperature value and the average measured temperature value is, and the temperature distribution in this area is uneven. It is the ratio of the minimum value of all the temperature values to be measured of the infrared image of the i-th area of the injection mold to be tested minus the average temperature value to be measured of the infrared image of the i-th area of the injection mold to be tested, to the minimum value of the temperature value to be measured. The larger the ratio is, the greater the deviation between the minimum value of the temperature value to be measured and the average temperature value to be measured is, and the temperature distribution in this area is uneven. 1 minus the maximum value of the above two items is taken as the temperature uniformity score of the i-th area of the injection mold to be tested. The closer the temperature uniformity score is to 1, the better the temperature uniformity of the area is, and the closer the temperature uniformity score is to 0, the more uneven the temperature distribution in this area is.
[0045] In this way, the temperature uniformity score can be determined by the degree of deviation between the maximum and minimum values of the measured temperature values and the average measured temperature value, which can effectively identify temperature anomaly areas and improve the accuracy and comprehensiveness of the temperature uniformity score.
[0046] According to one embodiment of the present invention, if the temperature uniformity score is less than the temperature uniformity score threshold, a second surface defect score is determined according to the temperature value to be measured, the standard temperature value and the preset temperature difference threshold, including: determining the second surface defect score D of the i-th area of the injection mold to be measured according to formula (3): 2,i ,
[0047]
[0048] Among them, t i,s is the sth temperature value to be measured of the infrared image of the ith area of the injection mold to be measured, t p is the standard temperature value of the standard injection mold, Δt is the preset temperature difference threshold, β1 and β2 are preset weights, and β1+β2=1, M i is the number of pixels of the infrared image to be tested and the standard infrared image of the i-th area of the injection mold to be tested and the standard injection mold, s≤M i , and i, s and M i All are positive integers.
[0049] According to one embodiment of the present invention, in formula (3), It is the relative difference between the sth temperature value to be measured in the infrared image of the i-th area of the injection mold to be measured and the standard temperature value of the standard injection mold, indicating the degree of deviation between the temperature value to be measured and the standard temperature value. The larger the relative difference is, the more obvious the temperature difference between the two pixels is, and the more serious the defect is at the point where the temperature value to be measured is located. It represents the average value of the relative difference between all the temperature values to be measured and the standard temperature value of the infrared image of the i-th area of the injection mold to be tested. The larger the average value is, the more serious the defect of the area is. It is the ratio of the difference between all the temperature values to be measured and the standard temperature value of the infrared image of the i-th area of the injection mold to be measured, minus the preset temperature difference threshold, to the preset temperature difference threshold. The larger the ratio, the smaller the difference between the temperature value to be measured and the standard temperature value, and the area meets the standard. The result of 1 minus the ratio is obtained. The closer the result is to 1, the greater the difference between the temperature value to be measured and the standard temperature value, and the more obvious the defect of the area. It represents the average value of the above ratio minus the i-th region 1 of the injection mold to be tested. The weighted sum of the above two average values can be used to obtain the second surface defect score of the i-th region of the injection mold to be tested. The higher the second surface defect score, the more serious the defect in this region.
[0050] In this way, the second surface defect score can be determined by the measured temperature value, the standard temperature value and the preset temperature difference threshold, thereby objectively and accurately expressing the degree of temperature deviation between the injection mold to be tested and the standard injection mold, which helps to accurately identify subtle and hidden defects of the injection mold to be tested and improves the objectivity and accuracy of the second surface defect score.
[0051] According to one embodiment of the present invention, in step S107, the surface defect area of the injection mold is determined according to the first surface defect score, the first surface target area, the second surface defect score and the second surface target area.
[0052] According to one embodiment of the present invention, step S107 includes: when the first surface defect score of the i-th area of the injection mold to be tested is greater than or equal to the first surface defect score threshold, and the second surface defect score is greater than or equal to the second surface defect score threshold, if the first surface defect score is greater than or equal to the second surface defect score, then determining the first surface target area of the i-th area of the injection mold to be tested as the injection mold surface defect area, wherein i is a positive integer; if the first surface defect score is less than the second surface defect score, then determining the second surface target area of the i-th area of the injection mold to be tested as the injection mold surface defect area; when the first surface defect score of the i-th area of the injection mold to be tested is greater than or equal to the second surface defect score, then determining the second surface target area of the i-th area of the injection mold to be tested is the injection mold surface defect area. When the first surface defect score of the i-th region of the injection mold to be tested is less than the first surface defect score threshold, and the second surface defect score is less than the second surface defect score threshold, the first surface target region of the i-th region of the injection mold to be tested is determined to be the injection mold surface defect region; when the first surface defect score of the i-th region of the injection mold to be tested is less than the first surface defect score threshold, and the second surface defect score is greater than or equal to the second surface defect score threshold, the second surface target region of the i-th region of the injection mold to be tested is determined to be the injection mold surface defect region; when the first surface defect score of the i-th region of the injection mold to be tested is less than the first surface defect score threshold, and the second surface defect score is less than the second surface defect score threshold, the i-th region of the injection mold to be tested is determined to be a defect-free region.
[0053] According to one embodiment of the present invention, the first surface defect scores and the second surface defect scores of all regions of the injection mold to be tested are judged against corresponding thresholds to determine the surface defect regions of the injection mold, which helps to accurately identify the defects of the injection mold.
[0054] According to the method for visual inspection of surface defects of injection molds of an embodiment of the present invention, by dividing the injection mold to be tested and the standard injection mold into multiple areas for independent shooting and analysis, the defects of each area can be more accurately identified, thereby improving the accuracy of the overall inspection. Using the standard injection mold as a reference makes the inspection of the injection mold to be tested comparable. The high-definition image provides clear visual information of the surface of the injection mold to help identify obvious defects, while the infrared image can reveal subtle and hidden defects. Combining the detection means of high-definition images and infrared images, the surface defects of the injection mold can be fully and accurately identified, and the accuracy and reliability of the detection of surface defects of the injection mold can be improved. When determining the first surface defect score, the multi-dimensional evaluation can more comprehensively reflect the defect situation and determine the first surface defect score by comparing the pixel value to be tested with the standard pixel value, and the similarity between the first surface feature vector and the second surface feature vector. The difference between the injection mold to be tested and the standard injection mold is objectively and accurately expressed, and the objectivity, accuracy and comprehensiveness of the first surface defect score are improved. When determining the temperature uniformity score, the temperature uniformity score can be determined by the degree of deviation between the maximum and minimum values of the temperature value to be measured and the average temperature value to be measured, which can effectively identify the temperature abnormality area and improve the accuracy and comprehensiveness of the temperature uniformity score. When determining the second surface defect score, the second surface defect score can be determined by the temperature value to be measured, the standard temperature value and the preset temperature difference threshold, so as to objectively and accurately express the degree of temperature deviation between the injection mold to be tested and the standard injection mold, which helps to accurately identify the subtle and hidden defects of the injection mold to be tested, and improves the objectivity and accuracy of the second surface defect score.
[0055] Figure 2A block diagram of a visual inspection system for surface defects of injection molds according to an embodiment of the present invention is exemplarily shown, the system comprising: a module for high-definition images to be tested and standard high-definition images, for dividing the injection mold to be tested and the standard injection mold into a plurality of regions, respectively, and taking a high-definition image to be tested of each region of the injection mold to be tested and a standard high-definition image of each region of the standard injection mold by a high-definition camera, wherein the standard injection mold is an injection mold that is consistent with the type of the injection mold to be tested and meets the inspection standard, and the high-definition image to be tested corresponds to the standard high-definition image one-to-one; a module for first surface feature vectors and second surface feature vectors, for performing feature extraction processing on the high-definition image to be tested and the standard high-definition image through the feature coding level of a trained image recognition model, and obtaining a first surface feature vector of the high-definition image to be tested in each region and a second surface feature vector of the standard high-definition image in each region; a module for first surface defect scoring and first surface target area, for obtaining a first surface feature vector of the high-definition image to be tested and a second surface feature vector of the standard high-definition image in each region according to the high-definition image to be tested, The standard high-definition image, the first surface feature vector and the second surface feature vector are used to determine a first surface defect score and a first surface target area; a uniform heating module is used to uniformly heat multiple areas of the injection mold to be tested and the standard injection mold within a preset time period through a heating element; a module for infrared images to be tested and standard infrared images is used to take infrared images of each area of the injection mold to be tested and a standard infrared image of an area in the standard injection mold through an infrared camera at the end of the preset time period, wherein the infrared camera has the same viewing angle as the high-definition camera; a module for second surface defect score and second surface target area is used to determine a second surface defect score and a second surface target area based on the infrared image to be tested and the standard infrared image; an injection mold surface defect area module is used to determine the injection mold surface defect area based on the first surface defect score, the first surface target area, the second surface defect score and the second surface target area.
[0056] It should be understood by those skilled in the art that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functional and structural principles of the present invention have been demonstrated and explained in the embodiments, and the embodiments of the present invention may be deformed or modified in any way without departing from the principles.
Claims
1. A method for visually detecting surface defects of an injection mold, characterized in that: include: The injection mold to be tested and the standard injection mold are divided into multiple areas respectively, and a high-definition image to be tested of each area of the injection mold to be tested and a standard high-definition image of each area of the standard injection mold are captured by a high-definition camera, wherein the standard injection mold is an injection mold that is consistent with the type of the injection mold to be tested and meets the detection standard, and the high-definition image to be tested corresponds to the standard high-definition image one by one; through the feature coding level of the trained image recognition model, feature extraction processing is performed on the high-definition image to be tested and the standard high-definition image to obtain a first surface feature vector of the high-definition image to be tested in each area and a second surface feature vector of the standard high-definition image in each area; according to the high-definition image to be tested, the standard high-definition image, the first surface feature vector and the second surface feature vector, determine a first surface defect score and a first surface target area; uniformly heat the injection mold to be tested and multiple areas of the standard injection mold within a preset time period by a heating element; at the end of the preset time period, take an infrared image of each area of the injection mold to be tested and a standard infrared image of an area of the standard injection mold by an infrared camera, wherein the infrared camera has the same viewing angle as the high-definition camera; determine a second surface defect score and a second surface target area according to the infrared image to be tested and the standard infrared image; determine the surface defect area of the injection mold according to the first surface defect score, the first surface target area, the second surface defect score and the second surface target area.
2. The method for visually inspecting surface defects of injection molds according to claim 1, characterized in that: Determine a first surface defect score and a first surface target area according to the high-definition image to be tested, the standard high-definition image, the first surface feature vector, and the second surface feature vector, including: obtaining pixel values to be tested of multiple pixel points in the high-definition image to be tested, and standard pixel values of multiple pixel points in the standard high-definition image; when the difference between the pixel value to be tested and the corresponding standard pixel value is greater than or equal to a preset pixel difference threshold, determine that the pixel point in the high-definition image to be tested is a first target pixel point; perform connected domain analysis on multiple first target pixel points to determine the first surface target area of each area of the injection mold to be tested; determine a first surface defect score according to the pixel value to be tested, the standard pixel value, the preset pixel difference threshold, the first surface feature vector, and the second surface feature vector.
3. The method for visually inspecting surface defects of injection molds according to claim 2, characterized in that: Determining a first surface defect score according to the pixel value to be tested, the standard pixel value, a preset pixel difference threshold, the first surface feature vector and the second surface feature vector includes: determining a first surface defect score according to the formula Determine the first surface defect score D of the i-th area of the injection mold to be tested 1,i , where I i,j is the jth pixel value of the high-definition image of the i-th area of the injection mold to be tested, I i,j,p is the jth standard pixel value of the standard high-definition image of the i-th area of the standard injection mold, ΔI is the preset pixel difference threshold, V 1,i is the first surface feature vector of the i-th region of the injection mold to be tested, V 2,i is the second surface feature vector of the i-th region of the standard injection mold, V 1,i The transposed vector of N, α1 and α2 are preset weights, and α1+α2=1, N i is the number of pixels of the HD image to be tested and the standard HD image of the i-th area of the injection mold to be tested and the standard injection mold, j≤N i , and i, j and N i All are positive integers, and max is the maximum value function.
4. The method for visually inspecting surface defects of injection molds according to claim 1, characterized in that: Determining a second surface defect score and a second surface target area according to the infrared image to be tested and the standard infrared image includes: obtaining temperature values to be tested corresponding to a plurality of pixel points in the infrared image to be tested and a standard temperature value corresponding to a pixel point in the standard infrared image; averaging the temperature values to be tested corresponding to a plurality of pixel points in each of the infrared images to be tested to obtain an average temperature value to be tested; determining a pixel point in the infrared image to be tested as a second target pixel point when the difference between the temperature value to be tested and the standard temperature value is greater than or equal to a preset temperature difference threshold; and averaging the temperature values to be tested corresponding to a plurality of pixel points in the standard infrared image to obtain an average temperature value to be tested. Through domain analysis, the temperature abnormality area is obtained; according to the position of the temperature abnormality area, the second surface target area of each area of the injection mold to be tested corresponding to the temperature abnormality area in the high-definition image to be tested is determined; according to the temperature value to be tested and the average temperature value to be tested, the temperature uniformity score is determined; if the temperature uniformity score is greater than or equal to the temperature uniformity score threshold, the second surface defect score is determined to be 0; if the temperature uniformity score is less than the temperature uniformity score threshold, the second surface defect score is determined according to the temperature value to be tested, the standard temperature value and the preset temperature difference threshold.
5. The method for visually inspecting surface defects of injection molds according to claim 4, characterized in that: Determining a temperature uniformity score according to the temperature value to be measured and the average temperature value to be measured includes: according to the formula Determine the temperature uniformity score B of the i-th area of the injection mold to be tested i , where t i,s is the sth temperature value to be measured of the infrared image of the ith area of the injection mold to be measured, is the average temperature value of the infrared image of the i-th area of the injection mold to be tested, M i is the number of pixels of the infrared image to be tested and the standard infrared image of the i-th area of the injection mold to be tested and the standard injection mold, s≤M i , and i, s and M i They are all positive integers, max is the maximum value function, and min is the minimum value function.
6. The method for visually inspecting surface defects of injection molds according to claim 4, characterized in that: If the temperature uniformity score is less than the temperature uniformity score threshold, a second surface defect score is determined according to the temperature value to be measured, the standard temperature value and the preset temperature difference threshold, including: according to the formula Determine the second surface defect score D of the i-th area of the injection mold to be tested 2,i , where t i,s is the sth temperature value to be measured of the infrared image of the ith area of the injection mold to be measured, t p is the standard temperature value of the standard injection mold, Δt is the preset temperature difference threshold, β1 and β2 are preset weights, and β1+β2=1, M i is the number of pixels of the infrared image to be tested and the standard infrared image of the i-th area of the injection mold to be tested and the standard injection mold, s≤M i , and i, s and M i All are positive integers.
7. The method for visually inspecting surface defects of injection molds according to claim 1, characterized in that: Determining the surface defect area of the injection mold according to the first surface defect score, the first surface target area, the second surface defect score and the second surface target area, comprising: when the first surface defect score of the i-th area of the injection mold to be tested is greater than or equal to a first surface defect score threshold, and the second surface defect score is greater than or equal to a second surface defect score threshold, if the first surface defect score is greater than or equal to the second surface defect score, determining the first surface target area of the i-th area of the injection mold to be tested as the injection mold surface defect area, wherein i is a positive integer; if the first surface defect score is less than the second surface defect score, determining the second surface target area of the i-th area of the injection mold to be tested as the injection mold surface defect area; when the i-th area of the injection mold to be tested is greater than or equal to the second surface defect score, determining the second surface target area of the i-th area of the injection mold to be tested is the injection mold surface defect area; When the first surface defect score of the i-th region of the injection mold to be tested is greater than or equal to the first surface defect score threshold, and the second surface defect score is less than the second surface defect score threshold, the first surface target region of the i-th region of the injection mold to be tested is determined to be the injection mold surface defect region; when the first surface defect score of the i-th region of the injection mold to be tested is less than the first surface defect score threshold, and the second surface defect score is greater than or equal to the second surface defect score threshold, the second surface target region of the i-th region of the injection mold to be tested is determined to be the injection mold surface defect region; when the first surface defect score of the i-th region of the injection mold to be tested is less than the first surface defect score threshold, and the second surface defect score is less than the second surface defect score threshold, the i-th region of the injection mold to be tested is determined to be a defect-free region.
8. A visual inspection system for surface defects of injection molds, characterized in that: include: A module for high-definition images to be tested and standard high-definition images, used to divide the injection mold to be tested and the standard injection mold into multiple areas, respectively, and take a high-definition image to be tested of each area of the injection mold to be tested, and a standard high-definition image of each area of the standard injection mold through a high-definition camera, wherein the standard injection mold is an injection mold that is consistent with the type of the injection mold to be tested and meets the inspection standards, and the high-definition image to be tested corresponds to the standard high-definition image one by one; a module for first surface feature vectors and second surface feature vectors, used to perform feature extraction processing on the high-definition image to be tested and the standard high-definition image through the feature coding level of the trained image recognition model, and obtain the first surface feature vector of the high-definition image to be tested in each area and the second surface feature vector of the standard high-definition image in each area; a module for first surface defect scoring and first surface target area, used to generate a first surface feature vector of the high-definition image to be tested, the standard high-definition image, the first surface feature vector and the second surface feature vector of the standard high-definition image according to the high-definition image to be tested, the standard high-definition image, the first surface feature vector and the second surface feature vector of the standard high-definition image. The second surface feature vector determines the first surface defect score and the first surface target area; a uniform heating module is used to uniformly heat multiple areas of the injection mold to be tested and the standard injection mold within a preset time period through a heating element; a module for infrared image to be tested and a standard infrared image of a region in the standard injection mold is used to take an infrared image to be tested of each region of the injection mold to be tested and a standard infrared image of a region in the standard injection mold through an infrared camera at the end of the preset time period, wherein the infrared camera has the same viewing angle as the high-definition camera; a second surface defect score and a second surface target area module is used to determine the second surface defect score and the second surface target area based on the infrared image to be tested and the standard infrared image; an injection mold surface defect area module is used to determine the injection mold surface defect area based on the first surface defect score, the first surface target area, the second surface defect score and the second surface target area.
Citation Information
Patent Citations
Visual inspection method for surface defects of injection mold
CN118071753A
Visual inspection method for surface defects of injection mold
CN118429219A
Injection molding product online grading-detection device and method
CN110132983A
Machine vision detection method and system
CN111968100A
Battery surface defect detection method and system based on machine vision and related equipment
CN114972258A
