Visual inspection method for surface quality of precise injection mold base
By randomly collecting image samples and building a support vector machine model for angle positioning and discrimination, the error problem caused by light reflection in injection mold surface detection is solved, and the accuracy and efficiency of detection are improved.
Patent Information
- Application Number
- CN202411771720.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-05-13
AI Technical Summary
In the prior art, when detecting the surface of an injection molded mold made of metal, light reflection causes the image to have spots or apertures, which reduces detection efficiency and accuracy, and excessive image processing increases errors.
By randomly collecting initialized image samples, the mean proportion of spot area and spot probability of the image surface surface are obtained, the analysis angle is determined, and the image characteristics of the current angle are collected. Build a support vector machine model for angle positioning and discrimination, filter out unnecessary angle images, and reduce image processing.
It effectively reduces the impact of spot or aperture on detection, reduces the error of detection results, and improves the accuracy and efficiency of surface quality detection of injection molding embryos.
Smart Images

Figure CN119985484A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual quality inspection, and more specifically, to a method for visually inspecting the surface quality of a precision injection mold base. Background Art
[0002] With the widespread application of precision injection molds in the field of high-end manufacturing, their surface quality directly affects the mold life and product quality. For molds of certain special sizes, the injection molds need to be manufactured by metal welding and splicing. For visual inspection of the surface of such molds, active visual inspection technology is usually used. Specifically, an industrial camera and a structured light transmitter are combined to perform surround shooting around the surface of the injection mold. The image processing algorithm is used to analyze and process the collected images, and the dimensional information of the surface shape is measured based on the principle of optical triangulation. The obtained dimensional information is compared with the standard data to realize the surface inspection of the weld of the injection mold.
[0003] The prior art has the following deficiencies:
[0004] At present, injection molds made of metal are more sensitive to light reflection, which leads to inevitable light spots or apertures in the actual images obtained by industrial cameras, reducing the efficiency and quality of weld surface inspection of injection molds. At the same time, excessive image processing causes errors in the final inspection results, reducing the accuracy of surface quality inspection. Therefore, a visual inspection method for the surface quality of precision injection molds is proposed.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0006] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a method for visually inspecting the surface quality of a precision injection mold base, which solves the problems raised in the above-mentioned background technology by using different product inspection methods.
[0007] To achieve the above object, the present invention provides the following technical solution, a method for visually inspecting the surface quality of a precision injection mold base, comprising:
[0008] S1: Randomly collect and record the initialization image samples, and perform data processing to obtain the mean of the spot area ratio on the image surface and the probability of the spot appearing in the image, and perform weighted calculation to obtain the detection evaluation coefficient, and compare it with the preset detection threshold, mark the sample to be tested, and determine the analysis angle for further detection of the image;
[0009] S2: Obtain the analysis angle of the further inspection image, collect the similarity of the welding position of the current angle image and the reflected light intensity of the mold base at the current angle;
[0010] S3: Obtain the similarity of the welding position of the current angle image and the reflected light intensity of the mold base at the current angle, build a support vector machine model, and perform angle positioning judgment of the injection mold base, and filter out the corresponding angle image according to the output result of the support vector machine model;
[0011] S4: Obtaining the discrimination result is to retain the corresponding angle image, and collecting the surface defect detection coefficient and the surface smoothness coefficient according to the shooting result of the industrial camera;
[0012] S5: Bring the surface defect detection coefficient and the surface smoothness coefficient into fuzzy logic to determine the surface quality result of the injection mold base.
[0013] In a preferred embodiment, according to a random sampling method, an angle and a light source intensity are randomly selected to acquire an image, and then the image is grayed, and the gray image is threshold segmented to extract the light spot area. For each light spot area, the total number of pixels is calculated, and then the total number of light spot pixels is ratioed to the total number of image pixels. Then, the ratio of the total number of light spot pixels corresponding to all images to the total number of image pixels is averaged to obtain the average of the light spot area ratio on the image surface.
[0014] According to the spot detection results of multiple groups of random images, the number of times the spot appears is counted, and the ratio of the number of times the spot appears to the total number of multiple groups of random images is calculated to obtain the probability of the spot appearing in the image.
[0015] In a preferred embodiment, the detection evaluation coefficient is obtained by weighted calculation of the mean value of the spot area ratio on the image surface and the probability of the spot appearing in the image. The detection evaluation coefficient is compared and analyzed with the detection threshold. If the detection evaluation coefficient is greater than or equal to the detection threshold, it is marked as a sample to be tested, and the analysis angle of the image is further detected.
[0016] In a preferred embodiment, the similarity of the welding area of the image at the current angle is obtained by analyzing the similarity between the length of the welding area of the image and the surface texture distribution and the ideal welding sample, and performing weighted calculation;
[0017] The reflection area of the mold base is determined by the grayscale co-occurrence matrix. In the reflection area, the average grayscale value of all pixels is counted to obtain the intensity of the light reflected by the mold base at the current angle.
[0018] In a preferred embodiment, image feature data of corresponding angles of historical injection molds are obtained as a reference data set and substituted into a support vector machine model; the similarity of the welding position of the current angle image obtained by image acquisition at multiple angles and the intensity of reflected light from the mold at the current angle are both data sets;
[0019] In step S3, the specific steps of building a support vector machine model are as follows:
[0020] Step A1: The similarity of the welding position of the current angle image and the intensity of the reflected light of the mold base at the current angle are used as analysis feature inputs, and the reference data set is used as comparison feature input;
[0021] Step A2: Select a kernel function and calculate the kernel function result based on the analysis features;
[0022] Step A3: setting the adjustment coefficient to converge the kernel function result and calculating the angle preservation discrimination threshold;
[0023] Step A4: Determine the angle positioning of the injection mold base;
[0024] Step A5: Output the judgment result.
[0025] In a preferred embodiment, the angle images corresponding to the judgment result of being eliminated are eliminated, and the angle images corresponding to the judgment result of being retained are retained.
[0026] In a preferred embodiment, the surface defect image area is obtained by contour extraction and region growing algorithm, and the ratio of the surface image area of the mold base is calculated to obtain the surface defect detection coefficient;
[0027] By performing fast Fourier transform on the angle image and extracting the frequency domain information, the ratio of high-frequency energy to total energy is calculated to obtain the surface smoothness coefficient.
[0028] In a preferred embodiment, the surface defect detection coefficient and the surface smoothness coefficient are defined as input variables and divided into different fuzzy sets respectively;
[0029] The surface quality results of the injection mold base are defined as output variables and divided into fuzzy sets;
[0030] Formulate fuzzy rules to describe the influence of surface defect detection coefficient and surface smoothness coefficient on the surface quality results of injection mold base;
[0031] Fuzzy reasoning is performed based on fuzzy rules to determine the surface quality results of the injection mold base.
[0032] Technical effects and advantages of the present invention:
[0033] 1. The present invention randomly collects initialized image samples, obtains the average proportion of the light spot area on the image surface and the probability of the light spot appearing in the image, determines the analysis angle for further detecting the image, collects the similarity of the welding point of the current angle image and the reflected light intensity of the mold at the current angle, constructs a support vector machine model for angle positioning and identification of the injection mold, and screens out the corresponding angle image based on the output result, so as to avoid excessive image processing, reduce the error of the detection result, and reduce the influence of the light spot or aperture on the surface quality detection of the injection mold.
[0034] 2. The present invention obtains the discrimination result to retain the corresponding angle image, formulates a set of fuzzy rules for fuzzy reasoning according to the surface defect detection coefficient and the surface smoothness coefficient, determines the surface quality result of the injection mold, improves the detection accuracy, ensures production consistency, and reduces the difference in mold surface quality detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The present invention is a schematic diagram of a method for visually inspecting the surface quality of a precision injection mold base.
[0036] Figure 2 The present invention is a method flow chart of a method for visually inspecting the surface quality of a precision injection mold base. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.
[0038] The present invention preferentially collects the initialization image samples randomly, obtains the mean value of the spot area ratio on the image surface and the probability of the spot appearing in the image, performs weighted calculation, and compares with the preset detection threshold, determines the analysis angle of further detecting the image, collects the image angle feature information and its corresponding light source intensity feature information, constructs a support vector machine model to perform angle positioning judgment of the injection mold base, screens out the corresponding angle image according to the output result of the support vector machine model, and establishes fuzzy logic to perform fuzzy reasoning based on the welding texture features and surface smoothness coefficient of the retained angle image to obtain the surface quality of the injection mold base;
[0039] Example 1
[0040] See also Figure 1 , a method for visual inspection of the surface quality of precision injection mold bases, the specific operation process is as follows:
[0041] S1: Randomly collect and record the initialization image samples, and perform data processing to obtain the mean of the spot area ratio on the image surface and the probability of the spot appearing in the image, and perform weighted calculation to obtain the detection evaluation coefficient, and compare it with the preset detection threshold, mark the sample to be tested, and determine the analysis angle for further detection of the image;
[0042] Among them, random collection refers to a random sampling method, a method of randomly selecting collection conditions from a given sampling space, and collecting random angles on the mold base surface. The specific angles include but are not limited to multiple directions in the horizontal plane, vertical plane or inclined plane. Specifically, by setting the minimum and maximum values of the angle, the angle is randomly selected within the range;
[0043] Furthermore, in order to ensure that the collected data can effectively cover different conditions, a uniform probability distribution is usually used to guide the collection process, that is, within the specified range, the probability of each collection condition being selected is equal;
[0044] It should be noted that the specific randomization strategy can be randomized in combination with the shooting angle and the light source intensity. At the same time, the probability distribution also includes normal distribution and weighted distribution. The above random sampling method is only used as an example and will not be described in detail here.
[0045] According to the random sampling method, the angle and light source intensity are randomly selected. Under each set of conditions, an industrial camera is used to capture and record images of the mold surface, and the recorded images are processed into data;
[0046] Specific data processing includes denoising, contrast enhancement and grayscale processing;
[0047] Denoising is the process of removing noise introduced by ambient light, equipment vibration, or hardware limitations of industrial cameras. Gaussian filtering is usually used to smooth the image to reduce the interference of high-frequency noise.
[0048] Contrast enhancement uses histogram equalization to enhance the dynamic range of the image, making the subtle textures or defects on the mold surface more prominent;
[0049] Grayscale processing is to convert color images into grayscale images, reduce data dimensions, and retain surface reflection and texture information. The specific formula is:
[0050] I g =0.2989×I R +0.5870×I G +0.1140×I B
[0051] In the formula, I R ,I G ,I B They represent the red, green, and blue channels of the image respectively. 0.2989, 0.2870, and 0.1140 are the perceptual weights of the three color channels for the human eye. g is a grayscale image;
[0052] The mean value of the proportion of the spot area on the image surface refers to the median value of the proportion of the spot area formed by light reflection or scattering in the entire image area in the multiple sets of images collected. It is used to measure the smoothness or reflective properties of the mold surface. Its acquisition logic is to perform threshold segmentation on the grayscale image, extract the spot area, calculate the total number of pixels for each spot area, and then calculate the ratio of the total number of spot pixels to the total number of image pixels. Then, the ratio of the total number of spot pixels corresponding to all images to the total number of image pixels is averaged to obtain the mean value of the proportion of the spot area on the image surface.
[0053] When performing threshold segmentation, a fixed value is usually set as the global threshold, and then the spot area is binarized to distinguish the spot from the background;
[0054] It should be noted that the grayscale image is obtained by the grayscale processing mentioned above, which will not be described in detail here. The binarization of the light spot area can be based on a set threshold, or can be obtained based on an adaptive threshold or connected domain analysis. Specifically, the light spot area in the image is identified by a connected domain algorithm, that is, all connected highlight pixels are classified as a connected domain, and the pixel set of each connected domain is a light spot area, etc., which will not be described in detail here;
[0055] Specifically, the formula for calculating the total number of pixels is:
[0056]
[0057] In the formula, I b (x, y) is the spot pixel, other pixels are 0, A s is the total number of spot pixels, x and y are the coordinate positions of the defined pixels;
[0058] Specifically, the calculation formula for the total pixels of the image is:
[0059] A t =H·W
[0060] In the formula, A t is the total pixel of the image, H is the image height, and W is the image width;
[0061] The probability of light spots appearing in an image refers to the ratio of the number of images containing light spots to the total number of sampled images under multiple sets of random sampling conditions. The acquisition logic is to count the number of light spots appearing based on the light spot detection results of multiple sets of random images, and calculate the ratio of the number of light spots appearing to the total number of random images to obtain the probability of light spots appearing in the image.
[0062] Among them, the detection technology of the light spot has been described above and will not be repeated here;
[0063] The detection evaluation coefficient is obtained by weighted calculation of the mean value of the spot area ratio on the image surface and the probability of the spot appearing in the image. The detection evaluation coefficient is compared and analyzed with the detection threshold. If the detection evaluation coefficient is greater than or equal to the detection threshold, it is marked as a sample to be tested and the analysis angle of the image is further tested. Otherwise, it returns to the previous level.
[0064] Specifically, the sample to be inspected refers to the image of the injection mold base taken by the current industrial camera, and the angle characteristics of each image and the corresponding light source intensity characteristics need to be analyzed again to screen out some angles;
[0065] Among them, the detection threshold is set by the experimenter based on the historical spot image and the initialization image, which will not be elaborated here;
[0066] Specifically, the analysis angle of further detecting the image refers to the difference between the currently captured image and the surface quality of the injection mold base, and further analysis and screening of some angles are required to meet the accuracy of the detection of the surface quality of the injection mold base, which is not limited here;
[0067] S2: Obtain the analysis angle of the further inspection image, collect the similarity of the welding position of the current angle image and the reflected light intensity of the mold base at the current angle;
[0068] The similarity of the welding part of the current angle image refers to the matching degree between the visual features of the mold base welding part and the ideal welding sample under specific shooting angle and light source conditions. The acquisition logic is to analyze the similarity between the length of the welding area of the image and the surface texture distribution and the ideal welding sample, and perform weighted calculation to obtain the similarity of the welding part of the current angle image;
[0069] Specifically, for the ideal welding sample, the experimenter can understand that the ideal welding sample can be the welding image obtained by photographing the front of the injection mold base, or it can be the best welding image in history. The specific best welding image in history can be obtained by manual screening or by machine learning, which will not be elaborated here;
[0070] Furthermore, by fitting the minimum circumscribed rectangle of the welding area contour points and calculating its main axis length, the length of the welding area in the image is obtained, and the similarity between the welding length of the ideal welding sample and the length of the welding area in the image is compared. The specific formula is as follows:
[0071]
[0072] In the formula, S l is the similarity of the length of the welding area in the image, L w is the length of the welding area in the image, L r is the welding length of the ideal welding sample;
[0073] The surface texture distribution is to calculate the grayscale symbiosis relationship of pixel pairs in the welding area, select four directions to construct the grayscale symbiosis matrix, and set a fixed distance;
[0074] Usually, the four directions are selected as 0 degrees, 45 degrees, 90 degrees, and 135 degrees. Since the texture of the image is usually arranged in a certain direction, the above four directions are the most basic and typical directions in the two-dimensional image, which can effectively capture the texture distribution characteristics in the horizontal, vertical, and diagonal directions. At the same time, although the selected directions can be diversified (for example, 30 degrees or 60 degrees, etc.), in terms of computational complexity, it is easy to cause more redundant information, which is not conducive to convenient calculation;
[0075] The elements of the gray-level co-occurrence matrix represent the co-occurrence frequency of pixel pairs of gray values in the image at a specified direction and distance;
[0076] Calculate the texture feature vector, and combine it from energy, contrast, correlation and entropy to form a texture feature vector;
[0077] Specifically, energy refers to the repeatability of the texture. The larger the energy value, the more regular the texture. The contrast reflects the contrast of the grayscale distribution. The larger the value, the greater the texture difference. The correlation describes the linear correlation between the grayscale values. The entropy describes the complexity of the texture. The larger the value, the more complex the texture. The specific calculation formula is the existing technology and will not be repeated here.
[0078] The welding area of the ideal welding sample is extracted according to the above method to obtain the texture feature vector of the ideal welding sample;
[0079] The surface texture distribution similarity calculation is based on cosine similarity, and the specific formula is:
[0080]
[0081] In the formula, S t is the surface texture distribution similarity, T w is the texture feature vector, T r is the texture feature vector of the ideal welding sample, ‖T w ‖ and ‖T r ‖ respectively represent the modulus length of the texture feature vector and the texture feature vector of the ideal welding sample;
[0082] The current angle mold base reflected light intensity refers to the light intensity value reflected by the surface of the injection mold base to the industrial camera under the irradiation of the light source at different shooting angles. Its acquisition logic is to determine the reflection area of the mold base through the grayscale co-occurrence matrix. In the reflection area, the average grayscale value of all pixels is counted to obtain the current angle mold base reflected light intensity;
[0083] Among them, the gray level co-occurrence matrix has been described above and will not be repeated here;
[0084] Specifically, the reflection area of the mold base is defined to avoid interference from the background or other irrelevant areas. The reflection area of the mold base is usually selected by a threshold segmentation technology or a mold base edge detection method, which is not limited here;
[0085] The formula for calculating the average gray value of all pixels is as follows:
[0086]
[0087] In the formula, I r is the intensity of light reflected from the mold base at the current angle, Ω ROI is the total number of pixels in the reflection area of the mold, ∑I(x,y) is the sum of the grayscale values of all pixels in the reflection area, x and y are the horizontal and vertical coordinates of the image pixels, respectively, (x,y)∈Ω ROI (x, y) is the pixel coordinate within the reflection area of the mold base;
[0088] S3: Obtain the similarity of the welding position of the current angle image and the reflected light intensity of the mold base at the current angle, build a support vector machine model, and perform angle positioning judgment of the injection mold base, and filter out the corresponding angle image according to the output result of the support vector machine model;
[0089] Specifically, image feature data of corresponding angles of historical injection mold bases are obtained as a reference data set and substituted into the support vector machine model;
[0090] It should be noted that the similarity of the welding position of the current angle image and the intensity of the reflected light of the mold base at the current angle are both data sets, that is, they contain multiple data, and are data obtained by image acquisition at multiple angles, which will not be described in detail here;
[0091] The similarity of the welding position of the current angle image, the reflected light intensity of the mold base at the current angle and the control data set are used as input variables to build a support vector machine model. The support vector machine performs simulation tests through the input variables and calculates the angle retention discrimination threshold. After the angle retention discrimination threshold is obtained, the angle positioning of the injection mold base is judged by comparing the image input data of different angles to be judged with the calculated angle retention discrimination threshold, and the discrimination result is output as the output result. The specific steps are as follows:
[0092] Step A1: The similarity of the welding position of the current angle image and the intensity of the reflected light of the mold base at the current angle are used as analysis feature inputs, and the reference data set is used as comparison feature input;
[0093] Step A2: Select the Sigmoid function as the kernel function to transform the input features. The Sigmoid kernel function formula is specifically expressed as:
[0094] K(d,p)=tanh(γd*p+c)
[0095] Where K(d,p) is the kernel function result after feature conversion, tanh is the hyperbolic tangent function, γ is a hyperparameter used to control the width of the kernel function, c is a constant used to control the offset of the kernel function, d and p are two input features in this example, namely, the similarity of the welding position of the current angle image corresponding to the same angle image and the reflected light intensity of the mold base at the current angle;
[0096] Step A3: Set the adjustment coefficient k, and converge the kernel function result according to the adjustment coefficient. The convergence formula can be:
[0097] K new (d,p)=k*K old (d,p)
[0098] In the formula, k is the adjustment coefficient, K new (d,p) is the kernel function result after convergence, K old (d, p) can be set to the sum average of the kernel function results obtained after feature conversion of all angle images, and the converged kernel function result is used as the angle retention discrimination threshold;
[0099] Step A4: Determine the angle positioning of the injection mold base, calculate the kernel function result after feature conversion according to the corresponding data of each angle image in the analysis feature, compare the calculated kernel function result with the angle retention discrimination threshold, if the calculated kernel function result is higher than the angle retention discrimination threshold, then mark the corresponding angle image as 1, otherwise, mark it as 0;
[0100] Step A5: output the discrimination result. When the angle image mark is 1, the discrimination result is retained; when the angle image mark is 0, the discrimination result is screened out and the discrimination result is output;
[0101] The support vector machine is used to comprehensively identify the angle positioning of the injection mold base, which greatly improves the identification of angle images. The method of setting the adjustment coefficient facilitates the subsequent improvement and adjustment of the support vector machine model.
[0102] It should be noted that the role of the Sigmoid function is to convert the input features into data that is easy to analyze and process. The selection of the kernel function and the loss function in the above steps is not unique. The hyperparameter γ and the constant c involved in the steps can be set according to the actual situation such as the angle discrimination requirements. For example, the hyperparameter is set to 0.8, the constant is set to 0.2, and the adjustment coefficient k is preset to 1, etc., which will not be repeated here;
[0103] Screen out the angle image corresponding to the judgment result of being screened out, and retain the angle image corresponding to the judgment result of being retained;
[0104] The present invention randomly collects initialized image samples, obtains the mean percentage of the image surface light spot area and the probability of the light spot appearing in the image, determines the analysis angle for further detecting the image, collects the similarity of the welding point of the current angle image and the reflected light intensity of the mold base at the current angle, constructs a support vector machine model for angle positioning judgment of the injection mold base, and screens out the corresponding angle image based on the output result, avoiding excessive image processing, reducing the error of the detection result, and reducing the influence of the light spot or aperture on the surface quality detection of the injection mold base.
[0105] Example 2
[0106] In Example 1 of the present invention, an example is given to illustrate that by randomly collecting initialization image samples, the mean value of the proportion of the spot area on the image surface and the probability of the spot appearing in the image are obtained, the analysis angle of the further detection image is determined, and the similarity of the welding position of the current angle image and the reflected light intensity of the mold base at the current angle are collected, a support vector machine model is constructed to perform angle positioning judgment of the injection mold base, and an operation strategy of screening out the corresponding angle image is performed according to the output result; however, in Example 1, only the analysis operation is performed on the corresponding screened images, and the surface quality of the injection mold base cannot be judged. Obviously, this will make it impossible to use the original algorithm for surface quality detection, thereby generating detection differences and reducing the detection quality; in view of the above problems, Example 2 of the present invention is further refined;
[0107] S4: Obtaining the discrimination result is to retain the corresponding angle image, and collecting the surface defect detection coefficient and the surface smoothness coefficient according to the shooting result of the industrial camera;
[0108] Specifically, the industrial camera shooting result refers to the judgment result after the corresponding image has been determined to be screened out to retain the corresponding angle image;
[0109] The surface defect detection coefficient is an indicator used to detect defects on the mold base surface (such as scratches, bubbles, cracks, etc.). The mold base surface is segmented using image processing technology to detect possible defect areas. Morphological processing such as corrosion, expansion, opening operation, and closing operation are used to remove image noise and highlight defects, thereby extracting the size and shape of the defect area. The acquisition logic is to obtain the surface defect image area through contour extraction and region growth algorithm, and calculate the ratio with the mold base surface image area to obtain the surface defect detection coefficient;
[0110] It should be noted that the image segmentation of the image processing technology has been described in Example 1 and will not be described in detail here.
[0111] Specifically, morphological processing is a technology that analyzes images based on their geometric shapes. It changes the shape of images by performing local operations on the convolution kernel and the image. Contour extraction extracts the outer contours of objects in the image to clarify the position and shape of the objects. The region growing algorithm is an image segmentation method based on seed points. It mainly starts from one or more seed points and gradually expands the region according to the specified features until the stop condition is met. From the above, it can be seen that there is more than one method for detecting surface defects. The experimenter can set it according to the specific contour shape and mold base size, which is not limited here.
[0112] The surface smoothness coefficient is an indicator that quantitatively describes the flatness of the injection mold surface. Its acquisition logic is to perform fast Fourier transform on the angle image, extract the frequency domain information, calculate the proportion of high-frequency energy to total energy, and obtain the surface smoothness coefficient;
[0113] Among them, the fast Fourier transform converts the signal from the time domain (or space domain) to the frequency domain. In the image processing, the periodicity and texture features in the image can be displayed;
[0114] Specifically, high-frequency energy is transformed to higher frequency components in the frequency domain through fast Fourier transformation, and higher frequency components indicate faster changes in pixel values, subtle surface changes and defects;
[0115] S5: Bringing the surface defect detection coefficient and the surface smoothness coefficient into fuzzy logic to determine the surface quality result of the injection mold base;
[0116] For example, "High", "Low", and "Medium" are for high, medium, and low judgments of surface smoothness coefficients, and "Many", "Less", and "Average" are for high, medium, and low judgments of surface defect detection coefficients;
[0117] Formulate a set of fuzzy rules to describe the impact of different input variables on output variables. The definition of rules can be based on professional knowledge or obtained through data analysis and experiments. For example:
[0118] The surface smoothness coefficient is marked as X, the surface defect detection coefficient is marked as U, and the injection mold surface quality results are marked as C_results;
[0119] Then we can define:
[0120] Rule 1:IF(X is Low)AND(Uis Many)THEN(C_results is Fail)
[0121] Rule 2:IF(U is High)AND(Uis Less)THEN(C_results is Acceptable) ...
[0123] Perform fuzzy reasoning based on fuzzy rules to determine the surface quality results of the injection mold base;
[0124] It should be noted that the division of fuzzy sets can be adjusted according to actual conditions. For example, although three fuzzy sets are used as examples in this embodiment, they can actually be divided into more than three sets to facilitate better precise adjustment according to images at different angles.
[0125] Furthermore, for the judgment of the surface defect detection coefficient and the surface smoothness coefficient, the threshold can be set according to the actual situation for judgment. For example, when the surface smoothness coefficient exceeds 68%, it is marked as "High", and when the surface defect detection coefficient is higher than 40%, it is marked as "Many", etc., which will not be elaborated here;
[0126] The present invention obtains the discrimination result to retain the corresponding angle image, formulates a set of fuzzy rules for fuzzy reasoning according to the surface defect detection coefficient and the surface smoothness coefficient, determines the surface quality result of the injection mold, improves the detection accuracy, ensures the production consistency, and reduces the difference in the surface quality detection of the mold.
[0127] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0128] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0129] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0130] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0131] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0132] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0133] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0134] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0135] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0136] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for visually inspecting the surface quality of a precision injection mold base, characterized in that: include: S1: Randomly collect and record the initialization image samples, and perform data processing to obtain the mean of the spot area ratio on the image surface and the probability of the spot appearing in the image, and perform weighted calculation to obtain the detection evaluation coefficient, and compare it with the preset detection threshold, mark the sample to be tested, and determine the analysis angle for further detection of the image; S2: Obtain the analysis angle of the further inspection image, collect the similarity of the welding position of the current angle image and the reflected light intensity of the mold base at the current angle; S3: Obtain the similarity of the welding position of the current angle image and the reflected light intensity of the mold base at the current angle, build a support vector machine model, and perform angle positioning judgment of the injection mold base, and filter out the corresponding angle image according to the output result of the support vector machine model; S4: Obtaining the discrimination result is to retain the corresponding angle image, and collecting the surface defect detection coefficient and the surface smoothness coefficient according to the shooting result of the industrial camera; S5: Bring the surface defect detection coefficient and the surface smoothness coefficient into fuzzy logic to determine the surface quality result of the injection mold base.
2. A method for visually inspecting the surface quality of a precision injection mold base according to claim 1, characterized in that: According to the random sampling method, the angle and light source intensity are randomly selected to obtain the image, and then the image is grayed, the gray image is threshold segmented, the spot area is extracted, and the total number of pixels in each spot area is calculated, and then the total number of spot pixels is calculated. The ratio of the total number of spot pixels to the total number of image pixels is calculated, and then the ratio of the total number of spot pixels corresponding to all images to the total number of image pixels is averaged to obtain the average value of the spot area ratio on the image surface; According to the spot detection results of multiple groups of random images, the number of times the spot appears is counted, and the ratio of the number of times the spot appears to the total number of multiple groups of random images is calculated to obtain the probability of the spot appearing in the image.
3. A method for visually inspecting the surface quality of a precision injection mold base according to claim 2, characterized in that: The detection evaluation coefficient is obtained by weighted calculation of the mean value of the spot area ratio on the image surface and the probability of the spot appearing in the image. The detection evaluation coefficient is compared and analyzed with the detection threshold. If the detection evaluation coefficient is greater than or equal to the detection threshold, it is marked as a sample to be tested, and the analysis angle of the image is further tested.
4. A method for visually inspecting the surface quality of a precision injection mold base according to claim 3, characterized in that: By analyzing the similarity between the length of the welding area of the image and the surface texture distribution and the ideal welding sample, and performing weighted calculation, the similarity of the welding point of the current angle image is obtained; The reflection area of the mold base is determined by the grayscale co-occurrence matrix. In the reflection area, the average grayscale value of all pixels is counted to obtain the intensity of the light reflected by the mold base at the current angle.
5. A method for visually inspecting the surface quality of a precision injection mold base according to claim 4, characterized in that: Obtain image feature data of corresponding angles of historical injection molds as a reference data set and substitute it into the support vector machine model; the similarity of the welding position of the current angle image obtained by image acquisition at multiple angles and the intensity of reflected light from the mold at the current angle are both data sets; In step S3, the specific steps of building a support vector machine model are as follows: Step A1: The similarity of the welding position of the current angle image and the intensity of the reflected light of the mold base at the current angle are used as analysis feature inputs, and the reference data set is used as comparison feature input; Step A2: Select a kernel function and calculate the kernel function result based on the analysis features; Step A3: setting the adjustment coefficient to converge the kernel function result and calculating the angle preservation discrimination threshold; Step A4: Determine the angle positioning of the injection mold base; Step A5: Output the judgment result.
6. A method for visually inspecting the surface quality of a precision injection mold base according to claim 5, characterized in that: The angle images corresponding to the judgment result of being eliminated are filtered out, and the angle images corresponding to the judgment result of being retained are retained.
7. A method for visually inspecting the surface quality of a precision injection mold base according to claim 6, characterized in that: The surface defect image area is obtained by contour extraction and region growing algorithm, and the surface defect detection coefficient is obtained by ratio calculation of the mold base surface image area. By performing fast Fourier transform on the angle image and extracting the frequency domain information, the ratio of high-frequency energy to total energy is calculated to obtain the surface smoothness coefficient.
8. A method for visually inspecting the surface quality of a precision injection mold base according to claim 7, characterized in that: The surface defect detection coefficient and the surface smoothness coefficient are defined as input variables and divided into different fuzzy sets respectively; The surface quality results of the injection mold base are defined as output variables and divided into fuzzy sets; Formulate fuzzy rules to describe the influence of surface defect detection coefficient and surface smoothness coefficient on the surface quality results of injection mold base; Fuzzy reasoning is performed based on fuzzy rules to determine the surface quality results of the injection mold base.
Citation Information
Cited By
Visual defect detection method for precise and complex parts
CN120259312A
A visual inspection method for defects in complex precision parts
CN120259312B
Medicinal material year identification method and system based on machine vision
CN120411095A
Cake quality detection device and detection method
CN121305547A