Precision mold quality inspection method based on defect recognition

By extracting feature points in the mold image and calculating texture feature values, image matching and correction are performed, the problem of inaccurate mold image correction in the prior art is solved, and the accuracy of judging the degree of mold deformation and the reliability of quality detection are improved.

CN118823086BActive Publication Date: 2024-12-20JIANGSU GUANGLAI TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411303633.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-20
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

When correcting the mold image, the distribution of the position of the feature points is relatively single, resulting in poor correction effect, affecting the matching result, and thus inaccurate judgment of the degree of mold deformation.

Method used

By obtaining the template image and image to be tested under visible light, feature points are extracted and local texture feature values ​​and texture weights are calculated. Based on the difference in grayscale value, local texture feature values ​​and texture weight differences, the image is scale-transformed based on the difference in grayscale value, the difference in local texture feature values ​​and texture weight differences. and angle transformation, obtain a corrected image, and calculate the degree of deformation of the mold based on the number of feature points and position distribution.

Benefits of technology

The accuracy of image correction and the accuracy of judging the degree of mold deformation are improved, and the reliability of quality detection results is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823086B_ABST
    Figure CN118823086B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of defect recognition using optical means, and specifically to a precision mold quality detection method based on defect recognition. Using optical means, firstly, a template image and an image to be tested and feature points in the image under visible light irradiation are obtained, and the feature points in the image are matched using the optical features reflected in the image to be tested, thereby achieving image correction, and finally, according to the distribution between the feature points in the corrected image and the template image, the deformation degree value of the mold to be tested is calculated and quality detection is performed. The present invention uses optical means for analysis, which can more accurately calculate the deformation degree value of the mold to be tested, thereby improving the accuracy of the quality detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect recognition using optical means, and in particular to a precision mold quality detection method based on defect recognition. Background Art

[0002] A mold is an industrial manufacturing tool used to manufacture a large number of products of the same shape and is widely used in the manufacturing industry. The appearance and size of the mold have a direct impact on the quality of the products it produces. In order to ensure that the products manufactured by the mold meet the production quality standards, the quality of the mold needs to be tested.

[0003] When inspecting the quality of a mold, visible light is usually used to obtain the image to be tested and the template image, and a method of matching the image to be tested with the template image is adopted. However, due to the influence of factors such as the inspection environment and conditions, there are size and shooting angle deviations between the image to be tested and the template image, so the image to be tested needs to be corrected. When correcting the image, the existing technology performs correction according to the position distribution of feature points, and the basis is relatively single, resulting in poor correction effect, affecting the matching result, thereby leading to inaccurate judgment of the deformation degree of the mold to be tested and causing inaccurate final quality results. Summary of the invention

[0004] In order to solve the technical problem that the prior art corrects the image based on the position distribution of the feature points, the basis is relatively single, resulting in poor correction effect, affecting the matching result, and thus leading to inaccurate judgment of the deformation degree of the mold to be tested, resulting in inaccurate final quality results, the purpose of the present invention is to provide a precision mold quality inspection method based on defect recognition, and the technical solution adopted is as follows:

[0005] Acquire a template image containing only a normal mold and an image to be tested containing only the mold to be tested under visible light irradiation, wherein both the template image and the image to be tested are grayscale images;

[0006] Extract feature points from each grayscale image; obtain local texture feature values ​​corresponding to the feature points according to the grayscale changes and quantity distribution of the pixels within a preset range centered on each feature point; obtain texture weights corresponding to each feature point in each grayscale image according to the numerical distribution of the local texture feature values ​​of all feature points;

[0007] The feature points in the template image are used as reference points, and the feature points in the image to be tested are used as test points; matching feature point pairs are obtained according to the gray value differences, local texture feature value differences, and texture weight differences between all reference points and all test points; and the scale and angle transformations are performed on the image to be tested according to the position distribution differences between all matching feature point pairs to obtain a corrected image;

[0008] According to the difference in the number of feature points in the template image and the correction image and the difference in the position distribution of the matching feature point pairs, the deformation degree value of the mold to be tested is obtained; and according to the deformation degree value of the mold to be tested, the quality of the mold to be tested is tested to obtain a test result.

[0009] Furthermore, obtaining the local texture feature value corresponding to each feature point according to the grayscale change and quantity distribution of the pixel points within a preset range centered on each feature point includes:

[0010] In the preset range corresponding to each feature point, the local contrast corresponding to the feature point is obtained according to the difference between the maximum grayscale value and the minimum grayscale value of the pixel and the number of pixels corresponding to the maximum grayscale value;

[0011] In a preset range corresponding to each feature point, the grayscale values ​​of all pixels are arranged in order to obtain an arrangement sequence corresponding to the feature point; and the texture factor corresponding to the feature point is obtained according to the difference in the number of pixels corresponding to adjacent grayscale values ​​in the arrangement sequence;

[0012] A local texture feature value of each feature point is obtained according to the local contrast and texture factor corresponding to each feature point, and both the local contrast and texture factor are positively correlated with the local texture feature value.

[0013] Furthermore, within the preset range corresponding to each feature point, according to the difference between the maximum grayscale value and the minimum grayscale value of the pixel point and the occurrence frequency of the maximum grayscale value, obtaining the local contrast corresponding to the feature point includes:

[0014] In the preset range corresponding to each feature point, the difference between the maximum grayscale value and the minimum grayscale value of the pixel point is taken as the grayscale range;

[0015] The ratio of the number of pixels corresponding to the maximum grayscale value to the total number of pixels in the corresponding preset range is taken as the number ratio;

[0016] The number ratio and the grayscale range are added to obtain the local contrast corresponding to the feature point.

[0017] Furthermore, the formula model of the texture factor is:

[0018] ;in, Indicates The texture factor corresponding to the feature point is Indicates The total number of grayscale values ​​in the sorted sequence corresponding to the feature points, Indicated in Within the preset range corresponding to the feature point, the gray value is the The number of pixels with grayscale values, Indicated in Within the preset range corresponding to the feature point, the gray value is the The number of pixels with grayscale values.

[0019] Furthermore, in each grayscale image, the texture weight corresponding to each feature point is obtained according to the numerical distribution of the local texture feature values ​​of all feature points, including:

[0020] The sum of the local texture feature values ​​of all feature points in each grayscale image is taken as the texture feature sum;

[0021] The ratio of the local texture feature value of each feature point to the texture feature sum corresponding to the grayscale image is used as the texture weight corresponding to each feature point.

[0022] Furthermore, obtaining matching feature point pairs according to the gray value differences, local texture feature value differences, and texture weight differences between all reference points and all test points includes:

[0023] Each reference point is taken as a target point in turn, and the product of the gray value difference, local texture feature value difference and texture weight difference between the target point and each test point is normalized and negatively correlated to obtain a matching degree value between the target point and the test point;

[0024] The test point with the largest matching degree value corresponding to each reference point is used as the matching point of the reference point, and each reference point and the corresponding matching point form a matching feature point pair.

[0025] Furthermore, the scale transformation and angle transformation of the image to be measured are performed according to the position distribution differences between all the matching feature point pairs to obtain a corrected image, including:

[0026] Select the same origin position and the same direction in the template image and the image to be tested to construct a two-dimensional coordinate system respectively;

[0027] Combine all matching feature point pairs in pairs to obtain combined feature point pairs;

[0028] In each combined feature point pair, the ratio of the distance between the coordinates of the two reference points to the distance between the coordinates of the two test points is used as the scaling ratio between the template image and the test image; among all scaling ratios, the scaling ratio with the most occurrences is used as the final scaling ratio;

[0029] All the combined feature point pairs corresponding to the final scaling ratio are taken as the target feature point pairs; for each target feature point pair, the reference point and the point to be measured in one pair of matching feature point pairs are taken as the starting point, and the reference point and the point to be measured in the other pair of matching feature point pairs are taken as the end point, and the first vector in the image to be measured and the second vector in the template image are respectively obtained, and the deflection angle of the first vector relative to the second vector is taken as the initial deflection angle based on the second vector; among all the initial deflection angles, the initial deflection angle with the most occurrences is taken as the final deflection angle;

[0030] The image to be tested is scaled according to the final scaling ratio, and the scaled image to be tested is deflected according to the final deflection angle to obtain a corrected image corresponding to the image to be tested.

[0031] Further, obtaining the deformation degree value of the mold to be tested according to the difference in the number of feature points in the template image and the correction image and the difference in the position distribution of the matching feature point pairs includes:

[0032] The corrected image is translated so that the centroid of the corrected image coincides with the centroid of the template image to obtain an integrated image, and the distance between the test point and the reference point in each matching feature point pair in the integrated image is used as the distance factor corresponding to the matching feature point pair;

[0033] The sum of the distance factors corresponding to all matching feature point pairs is multiplied by the difference in the number of feature points in the template image and the correction image, and the resulting product is normalized to obtain the deformation degree value of the mold to be tested.

[0034] Further, the method of performing quality inspection on the mold to be tested according to the deformation degree value of the mold to be tested to obtain the inspection result includes:

[0035] The deformation degree value of the mold to be tested is compared with the preset judgment threshold. If it is greater than the preset judgment threshold, the quality of the mold to be tested is unqualified and needs to be replaced or repaired; if it is less than or equal to the preset judgment threshold, the quality of the mold to be tested is qualified.

[0036] Furthermore, extracting feature points from each grayscale image includes:

[0037] Feature points in each grayscale image are extracted based on the scale-invariant feature transformation algorithm.

[0038] The present invention has the following beneficial effects:

[0039] The present invention first obtains the template image and the image to be tested under visible light irradiation. Since the purpose is to improve the matching accuracy, and the deformation of the mold to be tested that is not easy to be found is often a relatively small deformation, and most areas of the mold are normal, the size and deflection of the image to be tested can be corrected by matching the feature points in the image, and then the deformation degree value is calculated. In the feature point matching process, the calculation can be performed based on the optical feature information reflected by the feature points in the image. In view of the fact that molds of the same shape have the same texture features at the same position, in order to improve the matching accuracy between feature points, the grayscale changes of the pixel points can be analyzed within the local range where the feature points are located to obtain the local texture feature values ​​corresponding to the feature points; similarly, the weight or proportion of the local texture feature values ​​of each feature point should also be consistent, so the present invention calculates the weight of the local texture feature value of each feature point in the image to which it belongs, recorded as the texture weight, and the local texture feature value and texture weight can be used as the basis for subsequent feature point matching. Furthermore, the feature points in the template image are used as reference points, and the feature points in the image to be tested are used as test points. Then, based on the grayscale value difference, local texture feature value difference, and texture weight difference between the reference point and the test point, the reference point and the test point are matched to obtain a pair of matching feature points. Furthermore, the size and angle of the image to be tested can be corrected according to the positional relationship between the matching feature point pairs to obtain a corrected image. At this time, the corrected image is obtained based on the position distribution of the matching feature point pairs obtained according to the grayscale difference, local texture feature difference, and texture weight difference between the feature points between the images, so the correction effect is better and has higher accuracy. If the mold undergoes a slight deformation, the feature points in the image will change to a certain extent. Therefore, if the deformation degree of the mold to be tested is analyzed only based on the matching feature points, it will be one-sided. Therefore, it is necessary to combine the overall characteristics of the image, that is, the number of feature points in the image is also used as an indicator to evaluate the deformation degree of the mold to be tested. At this time, according to the number distribution and position distribution of the feature points in the correction image and the template image, the deformation degree value of the mold to be tested under visible light irradiation will be more accurate, and then the test results obtained by quality inspection based on the deformation degree value will also be more accurate and reliable. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1A flow chart of a precision mold quality inspection method based on defect recognition provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a precision mold quality inspection method based on defect recognition proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0043] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0044] Embodiment of the precision mold quality detection method based on defect recognition:

[0045] The specific scheme of a precision mold quality inspection method based on defect recognition provided by the present invention is described in detail below with reference to the accompanying drawings.

[0046] See also Figure 1 , which shows a method flow chart of a precision mold quality inspection method based on defect recognition provided by an embodiment of the present invention, the method comprising the following steps:

[0047] Step S1: obtaining a template image containing only a normal mold and an image to be tested containing only the mold to be tested under visible light irradiation, wherein both the template image and the image to be tested are grayscale images.

[0048] A mold is an industrial manufacturing tool used to manufacture a large number of products of the same shape. It is usually made of metal, plastic or other materials, and has a cavity or groove in the shape required for the product. It is widely used in processes such as injection molding, die casting, indentation, and forging. The appearance and size of the mold have a direct impact on the quality of the products it produces. Therefore, in order to ensure that the products manufactured by the mold meet the production quality standards, the quality of the mold needs to be tested. Since one of the main factors affecting the quality of the mold is the shape of the mold, the mold is very likely to deform when producing products in a high-intensity and complex and changeable temperature change environment. If the deformed mold continues to be used to produce products, the yield of the product may decrease, resulting in inevitable losses.

[0049] In order to improve production efficiency, enterprises or factories will be equipped with a large number of molds. When the molds are inspected regularly or the producers conduct quality inspections on the molds before they leave the factory, due to factors such as the inspection environment and conditions and the angle and position of the molds on the conveyor belt, the image of the mold to be tested will have certain deviations from the image of the normal mold in shooting angle and image scale, resulting in poor inspection results when image matching is performed to complete quality inspection.

[0050] Therefore, the embodiment of the present invention compares and analyzes the image of the mold to be tested and the image of the normal mold, first adjusts and corrects the image of the mold to be tested, and then performs image matching, so as to improve the accuracy of the final quality inspection result. First, a panoramic image of the mold to be tested and a panoramic image of the normal mold need to be obtained. The acquisition method can be: a high-definition camera is arranged above the conveyor belt, and auxiliary lighting equipment is installed. Under visible light, the molds to be tested on the conveyor belt are photographed, and any mold to be tested is taken as the mold to be tested. By analyzing the mold to be tested as an example, the process of the entire solution is explained. In a good lighting environment, a high-definition camera is used to capture lossless images of normal molds. The images of normal molds and the images of the molds to be tested are grayscaled and filtered to denoise, so as to avoid the influence of noise on the images and preliminarily improve the accuracy of subsequent quality inspection results. Since the grayscale value distribution of background pixels is chaotic and irregular, it will have a greater impact on subsequent processing steps, so it is necessary to remove the background part to obtain a grayscale image containing only the mold. The pre-trained semantic segmentation network can be used to find the edge of the background and the mold, remove the background part, and leave a grayscale image containing only the mold information. At this time, the grayscale image corresponding to the normal mold can be used as the template image; the grayscale image corresponding to the mold to be tested is used as the image to be tested. At this time, the grayscale value of each pixel in the image to be tested can represent the brightness information at the pixel, reflecting certain optical characteristics.

[0051] It should be noted that the specific acquisition equipment, angle settings and other conditions can be adjusted according to the actual scene, and are not limited or elaborated here; the training method of the semantic segmentation network is a technical means well known to technicians in this field, and is not elaborated here; when graying the image, average graying, weighted graying and maximum graying methods can be used, and they are all technical means well known to technicians in this field, and are not limited or elaborated here; when filtering and denoising the image, bilateral filtering, median filtering, Gaussian filtering and other methods can be used, and they are all technical means well known to technicians in this field, and are not limited or elaborated here; the normal mold and the mold to be tested should be the same mold, for example, both are LED lamp housing manufacturing molds.

[0052] At this point, the grayscale image of the mold to be tested that needs to be inspected, i.e., the image to be tested, and the grayscale image of the normal mold as a template, i.e., the template image, can be obtained, and the optical feature information in the image can be used to perform subsequent analysis on the image.

[0053] Step S2: extract feature points in each grayscale image; within a preset range centered on each feature point, obtain the local texture eigenvalue corresponding to the feature point based on the grayscale change and quantity distribution of the pixel points; in each grayscale image, obtain the texture weight corresponding to each feature point based on the numerical distribution of the local texture eigenvalues ​​of all feature points.

[0054] Considering that the deformation of the mold to be tested is often relatively small and difficult to detect, most areas of the mold are normal. Therefore, we can start from the local part of the image, analyze the local features in the image, and use the local features as indicators for subsequent correction of the image to be tested.

[0055] When analyzing the local features of an image, feature points in the image can be extracted. Since the embodiment of the present invention is directed to a scenario in which the image to be tested is scaled and angularly deflected compared to the template image, an algorithm with scale invariance and rotation invariance needs to be selected when extracting feature points.

[0056] Preferably, in one embodiment of the present invention, extracting feature points in each grayscale image includes:

[0057] Since the scale invariant feature transform (SIFT) algorithm is an algorithm for extracting and describing local features of an image, and the algorithm detects feature points in different scale spaces, and calculates the main direction of the gradient of the neighborhood of the feature point as the directional feature of the point, the algorithm has scale invariance and rotation invariance, and has certain stability and robustness to illumination changes, affine transformations, etc., the embodiment of the present invention can use the SIFT algorithm to extract feature points in the template image and the image to be tested, respectively. It should be noted that SIFT is a technical means well known to those skilled in the art to extract feature points in an image, which will not be elaborated here; other algorithms with scale invariance and rotation invariance can also be selected to extract feature points in an image, which will not be limited here.

[0058] Even if the image to be tested has scaling and deflection problems, the variation pattern of the texture details of the mold itself will not change, that is, there are differences in the size and position of the image to be tested and the template image, but this does not change the grayscale variation pattern of its internal texture. Therefore, after obtaining the feature points in the template image and the image to be tested, the local texture feature value corresponding to each feature point can be obtained by calculating the grayscale variation of the pixel points in the local range, and the local texture feature value can be used as an indicator for subsequent correction of the image to be tested.

[0059] Preferably, in one embodiment of the present invention, within a preset range centered on each feature point, obtaining a local texture feature value corresponding to the feature point according to the grayscale change and quantity distribution of the pixel points includes:

[0060] Since the contrast of an image can better describe the grayscale difference between pixels within a local range, it can better highlight the texture features of the image, and the maximum and minimum values ​​in the grayscale value of a pixel can characterize the trend of the grayscale change of the pixel within the local range to a certain extent, the local contrast can be calculated by the maximum grayscale value and the minimum grayscale value. Within the preset range corresponding to each feature point, the local contrast corresponding to the feature point is obtained according to the difference between the maximum grayscale value and the minimum grayscale value of the pixel and the number of pixels corresponding to the maximum grayscale value. The specific acquisition method is: within the preset range corresponding to each feature point, the difference between the maximum grayscale value and the minimum grayscale value of the pixel is calculated, and the difference is used as the grayscale extreme difference, and then the ratio of the number of pixels corresponding to the maximum grayscale value to the total number of pixels in the corresponding preset range is calculated, recorded as the number ratio, and the sum of the number ratio and the grayscale extreme difference is used as the local contrast corresponding to the feature point. The formula model of the local contrast corresponding to each feature point can be, for example, as follows:

[0061]

[0062] in, Indicates The local contrast corresponding to the feature points is Indicates The number of pixels corresponding to the maximum grayscale value within the preset range corresponding to the feature point. Indicates The total number of pixels within the preset range corresponding to the feature points. Indicates The maximum grayscale value of the pixels within the preset range corresponding to the feature points. Indicates The minimum grayscale value of pixels within a preset range corresponding to a feature point.

[0063] In the formula model of local contrast, within the preset range corresponding to the feature point, the maximum grayscale value and the minimum grayscale value of the pixel point represent the two extremes of the grayscale value distribution of the pixel point within the preset range. It represents the maximum grayscale difference between pixels within the preset range. The larger the grayscale range, the more drastic the grayscale value change of the pixel within the preset range. A larger grayscale range will lead to an increase in local contrast. Similarly, since the grayscale features of the maximum grayscale value within the preset range are often more prominent, the ratio of the number of pixels corresponding to the maximum grayscale value to the total number of all pixels is calculated, that is, the number ratio. , the number ratio can reflect the weight of the pixel with the maximum gray value within the preset range. The larger the number ratio, the greater the influence of the pixel with the maximum gray value in the local area, which will more significantly change the gray distribution in the local area, thereby increasing the local contrast; and Add them together to get the local contrast corresponding to the feature point.

[0064] After obtaining the local contrast corresponding to each feature point, since the image texture feature can be characterized according to the number of pixels with different grayscale values, the grayscale values ​​of all pixels are arranged in order within the preset range corresponding to each feature point to obtain the arrangement sequence corresponding to the feature point; then, in the arrangement sequence, the texture factor corresponding to the feature point is obtained according to the difference in the number of pixels corresponding to adjacent grayscale values. The specific method for obtaining the texture factor is as follows: within the preset range corresponding to each feature point, according to the arrangement sequence corresponding to the feature point, the difference in the number of pixels corresponding to adjacent grayscale values ​​is calculated, the difference in the number of pixels corresponding to all adjacent grayscale values ​​is accumulated and averaged, and the average is used as the texture factor. The formula model of the texture factor corresponding to each feature point is:

[0065]

[0066] in, Indicates The texture factor corresponding to the feature point is Indicates The total number of grayscale values ​​in the sorted sequence corresponding to the feature points, Indicated in Within the preset range corresponding to the feature point, the gray value is the The number of pixels with grayscale values, Indicated in Within the preset range corresponding to the feature point, the gray value is the The number of pixels with grayscale values.

[0067] In the formula model of texture factor, by calculating the difference in the number of pixels corresponding to adjacent gray values, the distribution change of the number of pixels between different gray levels can be analyzed. This change can reflect the texture information in the image. The larger the value is, the more obvious the distribution of pixels in the image between gray levels is within the corresponding preset range, that is, the more complex the texture features of the image are. On the contrary, if the difference in the number of pixels corresponding to adjacent gray values ​​is greater, the more concentrated the distribution of pixels in the image between gray levels is within the corresponding preset range, that is, the simpler the texture features of the image are. Finally, the differences in the number of pixels corresponding to all adjacent gray values ​​are added up and averaged to obtain the quantized texture factor, which can be used as an important parameter for subsequent evaluation of local texture features.

[0068] Finally, the local texture eigenvalue of the feature point can be obtained according to the local contrast and texture factor corresponding to each feature point, and the local contrast and texture factor are positively correlated with the local texture eigenvalue. The formula model of the local texture eigenvalue corresponding to each feature point can be, for example, as follows:

[0069]

[0070] in, Indicates The local texture eigenvalues ​​corresponding to the feature points are Indicates The local contrast corresponding to the feature points is Indicates The texture factor corresponding to the feature point is Represents the normalization function.

[0071] In the formula model of local texture eigenvalues, according to prior knowledge, when the contrast of the image is greater, the texture features in the image may be more obvious. Conversely, when the contrast of the image is smaller, the texture features in the image will be less obvious. Therefore, the local contrast corresponding to each feature point can be used as the confidence of the texture factor corresponding to each feature point. In addition, the contrast of the image can also be used as one of the local features of the image. Therefore, the two are multiplied and normalized to obtain the local texture eigenvalue corresponding to the feature point. At this time, when the local contrast corresponding to the feature point is greater and the texture factor corresponding to the feature point is also greater, the final local texture eigenvalue will be greater. Conversely, when the local contrast corresponding to the feature point is smaller and the texture factor corresponding to the feature point is also smaller, the final local texture eigenvalue will be smaller.

[0072] It should be noted that, in this embodiment of the present invention, the preset range is set to be an area obtained by taking each feature point as the center and a preset positive number as the radius, and the preset positive number can take a value of 3. The setting of the preset range can be adjusted according to the actual scene, which is not limited or elaborated here; within the preset range corresponding to each feature point, when the grayscale values ​​of all pixels are arranged in order, ascending order or descending order can be selected, which is not limited here.

[0073] At this point, local texture analysis is performed on each feature point in the test image and the template image through the above method, and the local texture feature value corresponding to each feature point is obtained. The local texture feature value can be used as an evaluation indicator for feature point matching later.

[0074] After obtaining the local texture feature value of each feature point, since molds of the same shape have the same texture features at each position, the weight or proportion of the local texture feature value of each feature point should also be consistent. Therefore, the local texture feature values ​​of the feature points in the template image and the image to be tested can be further analyzed to obtain the weight or proportion.

[0075] Preferably, in one embodiment of the present invention, in each grayscale image, the texture weight corresponding to each feature point is obtained according to the numerical distribution of the local texture feature values ​​of all feature points, including:

[0076] In each grayscale image, the sum of the local texture eigenvalues ​​of all feature points is calculated and recorded as the texture feature sum. Then, the ratio of the local texture eigenvalue of each feature point to the corresponding texture feature sum is used as the texture weight corresponding to each feature point. For example, the image to be tested The formula model of the texture weight corresponding to each feature point in is:

[0077]

[0078] in, Indicates the image to be tested Middle The texture weight corresponding to the feature point is Indicates the image to be tested Middle The local texture eigenvalues ​​corresponding to the feature points are Indicates the image to be tested Middle The local texture eigenvalues ​​corresponding to the feature points are Indicates the image to be tested The total number of feature points in .

[0079] In the formula model of texture weight, the sum of the local texture feature values ​​corresponding to all feature points in each image is calculated, that is, the texture feature sum is obtained. The texture feature sum represents the overall situation of the quantized texture information of all feature points in the corresponding image. Then, by calculating the ratio of each feature point to the corresponding texture feature sum, we can get the weight or proportion of the local texture feature value corresponding to each feature point in the corresponding image, and get the texture weight. The larger the local texture feature value of a feature point, the more obvious the texture information corresponding to the feature point is, and the larger the texture weight will be.

[0080] At this point, through the texture weight acquisition method, the texture weights corresponding to all feature points in the template image and the image to be tested can be obtained, that is, another indicator required for matching feature points is obtained, and the subsequent analysis process can continue.

[0081] Step S3: taking the feature points in the template image as reference points and the feature points in the image to be tested as test points; obtaining matching feature point pairs according to the grayscale value differences, local texture feature value differences and texture weight differences between all reference points and all test points; performing scale transformation and angle transformation on the image to be tested according to the position distribution differences between all matching feature point pairs to obtain a corrected image.

[0082] When performing quality inspection on the mold to be tested, the image to be tested can be matched with the template image to obtain the degree of deformation of the mold to be tested, and then obtain the quality inspection result. Since the image to be tested is compared with the template image, there will be scaling and angular deflection, and the feature points in the image obtained in the above steps will not be affected by the image scaling and angular deflection, and in view of the fact that the deformation that is not easy to be detected is often a small deformation, most areas of the mold are normal, so the texture information of the feature points is analyzed, and then the texture information between the feature points can be used as a basis for evaluating whether the feature points can be matched. At the same time, since the grayscale value of the pixel point is mainly determined by physical properties, such as lighting conditions, texture results of the object surface, etc., the scaling and angle transformation of the image will not change the overall grayscale difference of the image and the grayscale change law of local details, so the grayscale value of the feature point can also be used as one of the bases for feature point matching.

[0083] For the convenience of description and illustration, here, the feature points in the template image are taken as reference points, and the feature points in the image to be tested are taken as points to be tested.

[0084] Preferably, in one embodiment of the present invention, obtaining matching feature point pairs according to the gray value differences, local texture feature value differences, and texture weight differences between all reference points and all test points includes:

[0085] Since the feature points in the image to be tested and the template image are matched, it is necessary to calculate the matching degree value of any two feature points in the two images to select the best matching feature point.

[0086] Each reference point can be used as a target point in turn, and then the matching degree value between the target point and each test point is calculated. The specific calculation method of the matching degree value is: the product of the gray value difference, local texture feature value difference and texture weight difference between the target point and each test point is normalized and negatively correlated to obtain the matching degree value between the target point and the test point. The target point is denoted as , choose a point to be tested For example, the formula model of the matching degree value between the target point and the point to be measured can be specifically, for example:

[0087]

[0088] in, Indicates the target point With the test point The matching degree between Indicates the target point The gray value of Indicates the point to be tested The gray value of Indicates the target point The corresponding local texture eigenvalues, Indicates the point to be tested The corresponding local texture eigenvalues, Indicates the target point The corresponding texture weight, Indicates the point to be tested The corresponding texture weight, Represents the normalization function.

[0089] In the formula model of the matching degree value, the gray value difference between the target point and each point to be tested is calculated to obtain The smaller the value, the closer the gray value between the target point and the point to be tested is, which means that the two feature points are more similar, and the matching degree is higher. Similarly, the difference in local texture feature values ​​between the target point and each point to be tested is calculated to obtain , when the value is smaller, it means that the texture features contained in the two feature points are more similar, then it can be considered that the matching degree of the two feature points is higher. Similarly, the texture weight difference between the target point and each test point is calculated to obtain , the smaller the value is, the more similar the proportion of the texture information contained in the two feature points after quantization in their respective images is, which can also be regarded as a higher degree of matching between the two feature points. Based on the above analysis, the product of the gray value difference, local texture feature value difference and texture weight difference between the target point and each test point is normalized and negatively correlated to complete the logical relationship correction and obtain the matching degree value between the target point and each test point.

[0090] According to the above process, the matching degree value between each feature point in the template image and each feature point in the image to be tested can be obtained, and the higher the matching degree value, the more matched the two feature points are. Therefore, the point to be tested with the largest matching degree value corresponding to each reference point is used as the matching point of the reference point, and each reference point and the corresponding matching point can form a matching feature point pair.

[0091] At this point, by combining various indicators, calculating the matching degree value between the reference point and the point to be measured and completing the matching, the matching feature point pair is obtained, and subsequent analysis can be continued.

[0092] Since the feature points of the image acquired in the embodiment of the present invention will not be affected by the scale and rotation angle, after analyzing the local features of the image corresponding to each feature point and pairing them, the matching feature point pairs at this time will have higher accuracy, and then the scaling and angle deflection of the image to be measured can be analyzed by matching the positional relationship between the feature point pairs, thereby achieving correction of the image to be measured.

[0093] Preferably, in one embodiment of the present invention, according to the position distribution differences between all matching feature point pairs, the image to be measured is scaled and angled to obtain a corrected image, including:

[0094] Since the position distribution of feature point pairs is analyzed, in order to maintain higher consistency and accuracy, the origin should be set at the same position in the template image and the image to be tested, and the two-dimensional coordinate systems should be constructed in the same direction. At this time, the feature points in the template image and the image to be tested can be mapped to their respective corresponding two-dimensional coordinate systems, and each feature point corresponds to a two-dimensional coordinate.

[0095] Then all the matching feature point pairs are combined in pairs to obtain combined feature point pairs; in each combined feature point pair, the ratio of the distance between the coordinates of the two reference points to the distance between the coordinates of the two test points is used as the scaling ratio between the template image and the test image. And matching feature point pairs For example, the formula model of the scaling ratio is:

[0096]

[0097] in, Indicates the zoom ratio, Represents matching feature point pairs Reference point in , Represents matching feature point pairs Reference point in , Represents matching feature point pairs The test points in , Represents matching feature point pairs The test points in , Indicates the distance.

[0098] In the formula model of the scaling ratio, the scaling ratio is obtained by combining the distance between the reference point and the reference point in the feature point pair and dividing it by the distance between the test point and the test point in the feature point pair. Because the reference point is the feature point in the template image and the test point is the feature point in the test image, if the scaling ratio is smaller, it means that the test image is enlarged compared to the template image; conversely, if the scaling ratio is larger, it means that the test image is reduced compared to the template image. It should be noted that the method for calculating the distance between two feature points is the Euclidean distance between the two-dimensional coordinates of the two feature points. The calculation method is an operation process well known to those skilled in the art and will not be described in detail here.

[0099] Since the mold to be tested may have slight deformation and the positions of some feature points may be offset, if a certain scaling ratio appears the most times among all scaling ratios, it means that the positional relationship between more matching feature point pairs is more consistent with this scaling situation, which means that the scaling ratio is closer to the actual scaling ratio. Therefore, it can be regarded as the optimal scaling ratio, that is, the final scaling ratio.

[0100] After determining the final zoom ratio of the image to be tested compared to the template image, the angular deflection of the image to be tested compared to the template image can be further determined. Because the final zoom ratio can better represent the actual zoom situation of the image to be tested, in order to make the deflection angle finally calculated more accurate, all the combined feature point pairs corresponding to the final zoom ratio can be used as target feature point pairs, and then for each target feature point pair, the reference point and the point to be tested in one pair of matching feature point pairs in the target feature point pair are used as the starting point, and the reference point and the point to be tested in the other pair of matching feature point pairs are used as the end point, so as to obtain the vector in the template image and the vector in the image to be tested respectively, and the vector in the image to be tested is used as the first vector, and the vector in the template image is used as the second vector; then, the second vector is used as a reference to calculate the deflection angle of the first vector relative to the second vector, and the deflection angle is used as the initial deflection angle. For example, if the first vector is rotated 30 degrees clockwise relative to the second vector, then the initial deflection angle at this time is negative 30 degrees; if the first vector is rotated 30 degrees counterclockwise relative to the second vector, then the initial deflection angle at this time is positive 30 degrees. After calculating the initial deflection angles corresponding to all target feature point pairs, the initial deflection angle that appears the most times is used as the final deflection angle. Here, an example is given to illustrate the method of obtaining the first vector and the second vector: the two matching feature point pairs in the target feature point pair are denoted as 1 and 2 respectively, and then the reference point in the matching feature point pair 1 can be used to obtain the first vector and the second vector. As the starting point, match the reference point in feature point pair 2 As the end point, get the second vector, similarly, to match the point to be tested in feature point pair 1 is the starting point, the point to be tested As reference point Matching points to match the points to be tested in feature point pair 2 is the end point, the point to be tested As reference point The corresponding matching points are obtained to obtain the first vector.

[0101] Finally, the image to be tested is scaled according to the final scaling ratio, and the scaled image to be tested is deflected according to the final deflection angle, so as to obtain the correction image corresponding to the image to be tested. It should be noted that when the same position is selected in the template image and the image to be tested to set the origin, and the same direction is selected to construct the two-dimensional coordinate system, the lower left corner of the image can be selected as the origin, the horizontal right is the horizontal axis, and the vertical upward is the vertical axis, and the specific construction method is not limited; the acquisition process of the correction image is illustrated by example, if the final scaling ratio is 2, it means that the template image is twice the image to be tested, then the image to be tested needs to be enlarged by the corresponding proportion, if the final scaling ratio is 1 / 2, it means that the template image is half of the image to be tested, then the image to be tested needs to be reduced by the corresponding proportion; when the image to be tested is deflected, if the final deflection angle is positive 30 degrees, the image to be tested needs to be rotated 30 degrees clockwise, otherwise, if the final deflection angle is negative 30 degrees, the image to be tested needs to be rotated 30 degrees counterclockwise, and after the rotation is completed, the first vector and the second vector corresponding to the final deflection angle are in the same direction.

[0102] At this point, the calibration of the image to be tested is completed, and the calibrated image can be used in subsequent quality inspection processes.

[0103] Step S4: Obtain the deformation degree value of the mold to be tested according to the difference in the number of feature points in the template image and the correction image and the difference in the position distribution of the matching feature point pairs; perform quality inspection on the mold to be tested according to the deformation degree value of the mold to be tested to obtain the inspection result.

[0104] In the above process, the corrected image has been obtained. At this time, the problem of image scaling due to the angle deviation caused by the placement of the mold to be tested has been solved, so quality inspection can be carried out. The quality inspection of the mold mainly checks whether the mold is deformed. Since the feature points can reflect the feature information in the image, the positional relationship between the feature points in the template image and the corrected image is analyzed, and it is used as one of the indicators for evaluating the deformation degree of the mold to be tested. At the same time, since the feature points will change to a certain extent when the mold is slightly deformed, the number of feature points can also be used as another indicator for evaluating the deformation degree of the mold to be tested, thereby obtaining the deformation degree value of the mold to be tested.

[0105] Preferably, in one embodiment of the present invention, the deformation degree value of the mold to be tested is obtained according to the difference in the number of feature points in the template image and the correction image and the difference in the position distribution of the matching feature point pairs, including:

[0106] First, the corrected image and the template image need to be overlapped. The specific operation process is: obtain the centroids of the template image and the corrected image respectively, and then translate the corrected image. Stop when the centroid of the corrected image coincides with the centroid of the template image. At this time, the integrated image can be obtained.

[0107] Then, in the integrated image, a coordinate system is established with the centroid as the origin, the horizontal right direction as the horizontal axis, and the vertical upward direction as the vertical axis, and the feature points in the template image and the corrected image are mapped to the coordinate system.

[0108] In the integrated image, the distance between the test point and the reference point in each matching feature point pair is used as the distance factor corresponding to the matching feature point pair. The distance factor can characterize the distance deviation between the feature point in the template image and the feature point in the matching test image in the integrated image, and is used to evaluate the deformation degree of the mold to be tested.

[0109] Finally, the sum of the distance factors corresponding to all matching feature point pairs is multiplied by the difference in the number of feature points in the template image and the correction image, and the product is normalized to obtain the deformation degree value of the mold to be tested. The template image is recorded as , the corrected image is recorded as , the formula model of the deformation degree value can be specifically, for example:

[0110]

[0111] in, Indicates the deformation degree value. Represents a template image and corrected image The difference in the number of feature points in Indicates The distance between the test point and the reference point in the integrated image among the matching feature points. Represents the total number of matching feature point pairs, Represents the normalization function.

[0112] In the formula model of the deformation degree value, since the correction image has been scaled and deflected at an angle, the influence of scale and angle is eliminated. Therefore, in the integrated image, if the distance between the reference point of the feature matching and the point to be measured, that is, the distance factor If the difference is too large, it can be considered that the deformation of the mold to be tested is large. Similarly, due to the deformation of the mold, the number of feature points will change to a certain extent. Therefore, if the difference in the number of feature points between the template image and the calibration image is larger, that is, the difference in the number of reference points and the test points is larger, it can be considered that the deformation of the mold to be tested is larger. Therefore, the difference in number is The cumulative sum of distance factors corresponding to all feature point pairs It should be noted that the method for obtaining the centroid is an operation process well known to those skilled in the art and will not be described in detail here.

[0113] At this point, by overlaying the template image and the correction image, and then analyzing the position offset between the matching feature point pairs and the difference in the number of feature points, the deformation degree value of the mold to be tested is obtained, and quality inspection can be performed based on the deformation degree value.

[0114] Preferably, in one embodiment of the present invention, quality inspection of the mold to be tested is performed according to the deformation degree value of the mold to be tested to obtain the inspection result, including:

[0115] A preset judgment threshold is set, and then the deformation degree value of the mold to be tested is compared with the preset judgment threshold. If it is greater than the preset judgment threshold, the quality of the mold to be tested is considered to be unqualified and needs to be replaced or repaired; if it is less than or equal to the preset judgment threshold, the quality of the mold to be tested is considered to be qualified. It should be noted that since the deformation degree value is a value between 0 and 1, the preset judgment threshold is set to 0.3 in this embodiment of the present invention. The specific value can be adjusted according to the actual scenario and is not limited here.

[0116] In summary, the embodiments of the present invention aim at the problem that when matching the image to be tested with the template image, the final matching result is not accurate enough due to the different sizes and shooting angles between the image to be tested and the template image, which affects the judgment of the degree of deformation of the mold to be tested and causes inaccurate final quality inspection results. First, the template image and the image to be tested under visible light irradiation are obtained. Since the purpose is to improve the matching accuracy, and the deformation of the mold to be tested that is not easy to be found is often a relatively small deformation, and most areas of the mold are normal, the size and deflection of the image to be tested can be corrected by matching the feature points in the image, and then the deformation degree value is calculated. Because the scale-invariant feature transformation algorithm is not affected by size and rotation, the feature points in the template image and the image to be tested are obtained based on the algorithm, and the image to be tested is corrected based on the feature points. In view of the fact that molds of the same shape have the same texture features at the same position, in order to improve the matching accuracy between feature points, the grayscale changes of the pixels can be analyzed within the local range where the feature points are located to obtain the local texture feature values ​​corresponding to the feature points; similarly, the weight or proportion of the local texture feature values ​​of each feature point should also be consistent, so the embodiment of the present invention calculates the weight of the local texture feature value of each feature point in the image to which it belongs, recorded as the texture weight, and the local texture feature value and texture weight can be used as the basis for subsequent feature point matching. Further, the feature points in the template image are used as reference points, and the feature points in the image to be tested are used as the points to be tested, and then based on the grayscale value difference, local texture feature value difference and texture weight difference between the reference point and the point to be tested, the reference point and the point to be tested are matched to obtain a matching feature point pair. Further, the size and angle of the image to be tested can be corrected according to the positional relationship between the matching feature point pairs to obtain a corrected image. At this time, the corrected image is obtained according to the position of the feature points between the images and the texture features they have, so the correction effect is better and has higher accuracy. If the mold undergoes a slight deformation, the feature points in the image will change to a certain extent. Therefore, if the deformation degree of the mold to be tested is analyzed only based on the matching feature points, it will be one-sided. Therefore, it is necessary to combine the overall characteristics of the image, that is, the number of feature points in the image is also used as an indicator to evaluate the deformation degree of the mold to be tested. At this time, it will be more accurate to obtain the deformation degree value of the mold to be tested based on the number distribution and position distribution of the feature points in the correction image and the template image, and then the test results obtained by quality inspection based on the deformation degree value will also be more accurate and reliable.

[0117] Precision mold image correction method based on image features:

[0118] Molds are usually made of metal, plastic or other materials, and have cavities or grooves in the shape required for the product. They are widely used in the manufacturing industry. When performing quality inspection on the mold or monitoring the production process, the image of the mold needs to be compared and matched with the template image. However, due to the influence of factors such as the inspection environment and inspection conditions, the image of the mold to be tested usually has a certain scale deviation or angle deviation from the template image, so the image of the mold to be tested needs to be corrected. When correcting an image, the prior art usually matches the position distribution of feature points in the image. This method has a relatively simple matching basis and is prone to inaccurate image correction results. Therefore, an embodiment of the present invention provides a precision mold image correction method based on image features, including:

[0119] Step S1: obtaining a template image containing only a normal mold and an image to be tested containing only the mold to be tested, wherein both the template image and the image to be tested are grayscale images;

[0120] Step S2: extracting feature points from each grayscale image; obtaining local texture feature values ​​corresponding to the feature points according to the grayscale variation and quantity distribution of the pixels within a preset range centered on each feature point; obtaining texture weights corresponding to each feature point in each grayscale image according to the numerical distribution of the local texture feature values ​​of all feature points;

[0121] Step S3: taking the feature points in the template image as reference points and the feature points in the image to be tested as test points; obtaining matching feature point pairs according to the grayscale value differences, local texture feature value differences and texture weight differences between all reference points and all test points; performing scale transformation and angle transformation on the image to be tested according to the position distribution differences between all matching feature point pairs to obtain a corrected image.

[0122] Among them, steps S1 to S3 have been described in detail in the above-mentioned embodiment of the precision mold quality detection method based on defect recognition, and will not be repeated here.

[0123] The beneficial effects brought by this embodiment include:

[0124] The present invention aims at the problem that when matching the image to be tested with the template image, the final matching result is not accurate enough, which affects the image correction effect due to the different sizes and shooting angles of the image to be tested and the template image. First, the template image and the image to be tested are obtained. Since the purpose is to improve the matching accuracy, and the deformation of the mold to be tested that is not easy to be found is often a relatively small deformation, and most areas of the mold are normal, the size and deflection of the image to be tested can be corrected by matching the feature points in the image. The feature points in the template image and the image to be tested are extracted, and the image to be tested is corrected based on the feature points. In view of the fact that molds of the same shape have the same texture features at the same position, in order to improve the matching accuracy between the feature points, the grayscale changes of the pixel points can be analyzed in the local range where the feature points are located to obtain the local texture feature values ​​corresponding to the feature points; similarly, the weight or proportion of the local texture feature values ​​of each feature point should also be consistent, so the present invention calculates the weight of the local texture feature value of each feature point in the image to which it belongs, which is recorded as the texture weight. Both the local texture feature value and the texture weight can be used as the basis for subsequent feature point matching. Furthermore, the feature points in the template image are used as reference points, and the feature points in the image to be tested are used as test points. Then, based on the grayscale value difference, local texture feature value difference, and texture weight difference between the reference point and the test point, the reference point and the test point are matched to obtain a pair of matching feature points. Furthermore, the size and angle of the image to be tested can be corrected according to the positional relationship between the matching feature point pairs to obtain a corrected image. At this time, the corrected image is obtained based on the position distribution of the matching feature point pairs obtained according to the grayscale difference, local texture feature difference, and texture weight difference between the feature points between the images, so the correction effect is better and has higher accuracy.

[0125] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0126] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A precision mold quality inspection method based on defect recognition, It is characterized in that The method comprises: Acquire a template image containing only a normal mold and an image to be tested containing only the mold to be tested under visible light irradiation, wherein both the template image and the image to be tested are grayscale images; Extract feature points from each grayscale image; obtain local texture feature values ​​corresponding to the feature points according to the grayscale changes and quantity distribution of the pixels within a preset range centered on each feature point; obtain texture weights corresponding to each feature point in each grayscale image according to the numerical distribution of the local texture feature values ​​of all feature points; The feature points in the template image are used as reference points, and the feature points in the image to be tested are used as test points; matching feature point pairs are obtained according to the gray value differences, local texture feature value differences, and texture weight differences between all reference points and all test points; and the scale and angle transformations are performed on the image to be tested according to the position distribution differences between all matching feature point pairs to obtain a corrected image; According to the difference in the number of feature points in the template image and the correction image and the difference in the position distribution of the matching feature point pairs, the deformation degree value of the mold to be tested is obtained; and according to the deformation degree value of the mold to be tested, the quality of the mold to be tested is tested to obtain a test result.

2. According to claim 1, a precision mold quality detection method based on defect recognition, It is characterized in that The method of obtaining the local texture feature value corresponding to each feature point according to the grayscale change and quantity distribution of the pixel points within a preset range centered on each feature point includes: In the preset range corresponding to each feature point, the local contrast corresponding to the feature point is obtained according to the difference between the maximum grayscale value and the minimum grayscale value of the pixel and the number of pixels corresponding to the maximum grayscale value; In a preset range corresponding to each feature point, the grayscale values ​​of all pixels are arranged in order to obtain an arrangement sequence corresponding to the feature point; and the texture factor corresponding to the feature point is obtained according to the difference in the number of pixels corresponding to adjacent grayscale values ​​in the arrangement sequence; A local texture feature value of each feature point is obtained according to the local contrast and texture factor corresponding to each feature point, and both the local contrast and texture factor are positively correlated with the local texture feature value.

3. According to claim 2, a precision mold quality detection method based on defect recognition, It is characterized in that The method of obtaining the local contrast corresponding to each feature point according to the difference between the maximum grayscale value and the minimum grayscale value of the pixel point and the occurrence frequency of the maximum grayscale value within the preset range corresponding to each feature point includes: In the preset range corresponding to each feature point, the difference between the maximum grayscale value and the minimum grayscale value of the pixel point is taken as the grayscale range; The ratio of the number of pixels corresponding to the maximum grayscale value to the total number of pixels in the corresponding preset range is taken as the number ratio; The number ratio and the grayscale range are added to obtain the local contrast corresponding to the feature point.

4. According to claim 2, a precision mold quality detection method based on defect recognition, It is characterized in that The formula model of the texture factor is: ;in, Indicates The texture factor corresponding to the feature point is Indicates The total number of grayscale values ​​in the sorted sequence corresponding to the feature points, Indicated in Within the preset range corresponding to the feature point, the gray value is the The number of pixels with grayscale values, Indicated in Within the preset range corresponding to the feature point, the gray value is the The number of pixels with grayscale values.

5. According to claim 1, a precision mold quality detection method based on defect recognition, It is characterized in that In each grayscale image, the texture weight corresponding to each feature point is obtained according to the numerical distribution of the local texture feature values ​​of all feature points, including: The sum of the local texture feature values ​​of all feature points in each grayscale image is taken as the texture feature sum; The ratio of the local texture feature value of each feature point to the texture feature sum corresponding to the grayscale image is used as the texture weight corresponding to each feature point.

6. A precision mold quality inspection method based on defect recognition according to claim 1, It is characterized in that The step of obtaining matching feature point pairs according to the grayscale value differences, local texture feature value differences, and texture weight differences between all reference points and all test points includes: Each reference point is taken as a target point in turn, and the product of the gray value difference, local texture feature value difference and texture weight difference between the target point and each test point is normalized and negatively correlated to obtain a matching degree value between the target point and the test point; The test point with the largest matching degree value corresponding to each reference point is used as the matching point of the reference point, and each reference point and the corresponding matching point form a matching feature point pair.

7. A precision mold quality inspection method based on defect recognition according to claim 6, It is characterized in that The step of performing scale transformation and angle transformation on the image to be measured according to the position distribution differences between all matching feature point pairs to obtain a corrected image includes: Select the same origin position and the same direction in the template image and the image to be tested to construct a two-dimensional coordinate system respectively; Combine all matching feature point pairs in pairs to obtain combined feature point pairs; In each combined feature point pair, the ratio of the distance between the coordinates of the two reference points to the distance between the coordinates of the two test points is used as the scaling ratio between the template image and the test image; among all scaling ratios, the scaling ratio with the most occurrences is used as the final scaling ratio; All the combined feature point pairs corresponding to the final scaling ratio are taken as the target feature point pairs; for each target feature point pair, the reference point and the point to be measured in one pair of matching feature point pairs are taken as the starting point, and the reference point and the point to be measured in the other pair of matching feature point pairs are taken as the end point, and the first vector in the image to be measured and the second vector in the template image are respectively obtained, and the deflection angle of the first vector relative to the second vector is taken as the initial deflection angle based on the second vector; among all the initial deflection angles, the initial deflection angle with the most occurrences is taken as the final deflection angle; The image to be tested is scaled according to the final scaling ratio, and the scaled image to be tested is deflected according to the final deflection angle to obtain a corrected image corresponding to the image to be tested.

8. According to claim 1, a precision mold quality detection method based on defect recognition, It is characterized in that The step of obtaining the deformation degree value of the mold to be tested according to the difference in the number of feature points in the template image and the correction image and the difference in the position distribution of the matching feature point pairs comprises: The corrected image is translated so that the centroid of the corrected image coincides with the centroid of the template image to obtain an integrated image, and the distance between the test point and the reference point in each matching feature point pair in the integrated image is used as the distance factor corresponding to the matching feature point pair; The sum of the distance factors corresponding to all matching feature point pairs is multiplied by the difference in the number of feature points in the template image and the correction image, and the resulting product is normalized to obtain the deformation degree value of the mold to be tested.

9. The method for detecting quality of precision molds based on defect recognition according to claim 1, It is characterized in that The method of performing quality inspection on the mold to be tested according to the deformation degree value of the mold to be tested and obtaining the inspection result includes: The deformation degree value of the mold to be tested is compared with the preset judgment threshold. If it is greater than the preset judgment threshold, the quality of the mold to be tested is unqualified and needs to be replaced or repaired; if it is less than or equal to the preset judgment threshold, the quality of the mold to be tested is qualified.

10. A precision mold quality inspection method based on defect recognition according to claim 1, It is characterized in that The step of extracting feature points from each grayscale image comprises: Feature points in each grayscale image are extracted based on the scale-invariant feature transformation algorithm.

Citation Information

Patent Citations

  • Method for detecting defect on surface of bearing by image feature points

    CN104680550A

  • Image comparison method and device, equipment and storage medium

    CN115861622A

  • Intelligent detection method for surface flaws and defects of optical film

    CN117232791A

  • Surface flaw detection method, system, equipment and terminal

    CN117853765A

  • Defect detection method and apparatus for mold monitoring, and device and medium

    WO2022170706A1