A machine vision-based quality detection method for an automobile accessory die-casting mold
Patent Information
- Application Number
- CN202610962198.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]本发明提供一种基于机器视觉的汽车配件压铸模具质量检测方法,以解决现有技术因无法区分具有方向性的脱模剂流痕干扰与无序性的冲蚀磨损缺陷,导致检测误报率高或漏检的技术问题
本发明的核心创新在于提出了纹理各向异性解耦+物理场加权的检测架构。首先,利用结构张量构建了各向异性响应指数,巧妙利用了冲蚀缺陷各向同性而干扰痕迹各向异性的形态学差异,实现了在复杂背景下对缺陷本体的精准抓取。
Smart Images

Figure CN122928731A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine vision and image analysis technology, specifically relating to a machine vision-based method for quality inspection of die-casting molds for automotive parts. Background Technology
[0002] In the die-casting production of automotive parts, the mold cavity, especially the runner and ingate areas, must withstand the high-speed erosion of molten metal for extended periods. With each production run, erosion and wear inevitably occur on the mold surface, manifesting as dense pitting or orange-peel-like depressions. If these surface defects are not detected and addressed promptly, they will directly affect the surface quality of the castings and may even lead to mold failure. Therefore, regular inspection of the mold surface condition is crucial.
[0003] However, in complex industrial environments, release agents such as graphite emulsion are typically sprayed onto the mold surface to facilitate casting demolding. The flow marks left by the release agent on the mold surface, as well as tool marks left during mold processing, often appear as dark, strip-shaped or sheet-like areas in the image. These interfering features are extremely similar in grayscale value to pits formed by erosion and wear, and both exhibit drastic grayscale changes and high gradient characteristics.
[0004] Existing technologies typically employ detection methods based on grayscale thresholds or gradient amplitudes, whose core logic assumes that the grayscale or gradient at the defect location will undergo abrupt changes. However, this logic has a fundamental flaw: since mold release agent flow marks and machining marks also exhibit high gradient characteristics, existing technologies cannot morphologically distinguish between linear residual traces and discrete erosion pits. This leads to the detection system either falsely reporting residue as mold damage, causing unnecessary downtime and mold maintenance costs; or increasing the detection threshold to reduce the false alarm rate, causing minor early erosion to be missed, resulting in the mold operating with defects and ultimately leading to serious production accidents. Summary of the Invention
[0005] This invention provides a machine vision-based method for quality inspection of die-casting molds for automotive parts, which solves the technical problem of high false alarm rate or missed detection in existing technologies due to the inability to distinguish between directional mold release agent flow marks and disordered erosion and wear defects.
[0006] In a first aspect, the present invention provides a machine vision-based method for quality inspection of die-casting molds for automotive parts, comprising the following steps: S1. Obtain the grayscale image of the die-casting mold surface and perform illumination field normalization processing on the grayscale image to obtain a texture image with uniform illumination. S2, construct the local texture anisotropic response index, use the structure tensor to analyze the texture direction of each pixel in the texture image, distinguish between directional interference textures and disordered defect textures by calculating the eigenvalues of the structure tensor, and generate the response index map corresponding to the texture image. S3. Based on the prior knowledge of the physical field, spatial weighted evaluation is performed to obtain the filling simulation data of the die casting mold and map it into a position weight matrix. The position weight matrix is used to perform nonlinear weighting on the response index map to calculate the final damage assessment value of the die casting mold surface. S4. Based on the final damage assessment value, determine the maintenance decision for the die-casting mold. When the final damage assessment value exceeds the preset threshold, it is determined that the die-casting mold has severe erosion wear and an alarm is triggered.
[0007] Its effectiveness lies in the innovative integration of machine vision texture analysis and CAE physical field prior knowledge, achieving high-precision and robust detection of mold erosion and wear under complex die-casting conditions. The core of this approach is the use of structural tensor matrices to analyze texture topology, mathematically decoupling directional strong interference from disordered real defects, effectively overcoming the challenges of uneven illumination and surface reflection. Simultaneously, by introducing fluid dynamics simulation data to establish a physical risk mapping, the algorithm is endowed with process cognitive capabilities, constructing a dual constraint mechanism of visual features + physical laws. This enables weighted monitoring of high-risk areas and automatic suppression of environmental noise in non-critical areas. This multi-source information fusion strategy not only significantly reduces false alarm and false negative rates, achieving a leap from qualitative screening to quantitative assessment, but also provides a reliable technical foundation for the intelligent operation and maintenance and full life-cycle management of die-casting molds.
[0008] Furthermore, the specific process of normalizing the illumination field of the grayscale image includes: using a homomorphic filtering algorithm to convert the grayscale image to the logarithmic domain, using a high-pass filter to weaken the low-frequency illumination component and enhance the high-frequency reflection component, and obtaining the texture image after exponential transformation.
[0009] Its effects are as follows: it eliminates interference from uneven lighting. Addressing the challenges of complex curved surfaces on molds and variable lighting conditions in production environments, it uses homomorphic filtering to weaken low-frequency illumination components and enhance high-frequency reflection components. This makes the detection algorithm unaffected by local overexposure or underexposure, enabling it to restore the true surface texture obscured by lighting and providing high-quality input images for subsequent analysis.
[0010] Furthermore, the structure tensor is constructed by weighted summation of the gradient direction distribution within a local neighborhood; For any pixel in the texture image Calculate its gradient vector Construct the local structure tensor matrix :
[0011] In the formula, the summation symbol indicates a weighted summation within the neighborhood window of a pixel. and These are the gradients in the horizontal and vertical directions, respectively.
[0012] Its effect is to establish a foundation for describing the directionality of local textures. By constructing a structure tensor matrix through a weighted summation of gradient direction distributions within a local neighborhood, it provides a mathematical basis for describing the texture orientation of pixels. This is a necessary prerequisite for subsequently distinguishing between linear and discrete textures.
[0013] Furthermore, eigenvalue decomposition is performed on the local structure tensor matrix to obtain the first eigenvalue. Second eigenvalue ,and ; The first eigenvalue represents the energy intensity in the direction of the most drastic texture change within the local region, and the second eigenvalue represents the energy intensity in the direction perpendicular to the most drastic direction.
[0014] Furthermore, the local texture anisotropic response index The calculation formula is:
[0015] In the formula, The constant is non-zero and is used to ensure numerical stability. The first term of the formula is the isotropic factor, which is used to suppress interference textures with strong anisotropy. The second term of the formula is the energy intensity factor, which is used to filter out low-energy noise.
[0016] Furthermore, the process of constructing the position weight matrix includes: Computer-aided engineering software for die casting is used to simulate the filling process of the die casting mold and extract the cumulative impact energy data or average flow velocity data on the surface of the die casting mold. The cumulative impact energy data or average flow velocity data are projected from the three-dimensional mesh onto the two-dimensional image coordinate system to generate a position weight matrix.
[0017] Furthermore, the values in the position weight matrix are positively correlated with the intensity of erosion experienced by the mold area during the filling process; the values in the position weight matrix are normalized to between zero and one.
[0018] Furthermore, the final damage assessment value The calculation formula is:
[0019] In the formula, The total number of pixels in the image. For the first The coordinates of each pixel The local texture anisotropic response index, This is the position weight matrix. These are weighting coefficients. It is an exponential function; the formula amplifies the response index in high-risk areas through an exponential weighting mechanism.
[0020] Furthermore, determining the maintenance decisions for die-casting molds includes: Set an alarm threshold and determine whether the final damage assessment value is greater than the alarm threshold; If the final damage assessment value is greater than the alarm threshold, it is determined that the die-casting mold surface is severely eroded and worn, and a shutdown and maintenance signal is issued.
[0021] Its effect is that by setting a threshold, the complex image analysis results are transformed into clear alarm or normal signals, realizing the automatic judgment and shutdown trigger of severe erosion and wear of the mold, and preventing the mold from operating with defects.
[0022] Furthermore, maintenance decisions also include trend analysis: The wear rate is calculated based on the final damage assessment data from historical time series. If the wear rate exceeds the preset rate threshold, the hardened layer on the mold surface is deemed to have failed, and a forced shutdown signal is issued.
[0023] Its effect is that by analyzing the wear rate trend of historical data, it is possible to monitor whether the hardened layer on the mold surface has failed. This changes the maintenance strategy from repairing only when it breaks down to predicting when it will break down, allowing for advance planning of welding repairs or replacements, effectively extending mold life and avoiding production accidents.
[0024] The beneficial effects are: The core innovation of this invention lies in proposing a detection architecture that combines texture anisotropy decoupling with physical field weighting. First, an anisotropic response index is constructed using structural tensors. By cleverly utilizing the morphological differences between the isotropic nature of erosion defects and the anisotropic nature of interference traces, the accurate capture of the defect entity in complex backgrounds is achieved.
[0025] Secondly, this invention overcomes the limitations of pure visual inspection by integrating CAE simulation data and constructing a spatial attention mechanism based on physical fields, enabling the detection algorithm to possess process recognition capabilities. This solution significantly improves the robustness of the detection system under harsh conditions such as mold release agent residue and uneven reflectivity, effectively solving the long-standing pain point in the industry of both false alarms and missed detections. Attached Figure Description
[0026] Figure 1 This is a flowchart of the machine vision-based quality inspection method for automotive parts die-casting molds according to the present invention.
[0027] Figure 2 This is a comparison between the original image of the mold surface acquired in this invention and the heat map after texture analysis.
[0028] Figure 3 This is a comparison of the detection effect of the present invention with the detection effect of the prior art. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0030] An embodiment of the machine vision-based quality inspection method for automotive parts die-casting molds provided by this invention: like Figure 1 As shown, a machine vision-based method for quality inspection of automotive parts die-casting molds includes the following steps: S1. Obtain the grayscale image of the die-casting mold surface and perform illumination field normalization processing on the grayscale image to obtain a texture image with uniform illumination.
[0031] In a specific embodiment, a high-resolution industrial camera is first used in conjunction with a ring light source to acquire a high-resolution grayscale image of the mold cavity, denoted as... High-resolution industrial cameras are area array cameras with more than 5 megapixels. Because the surface of die-casting molds is usually a complex metal curved surface, and the lighting conditions in the production environment are varied, the directly acquired images often have uneven reflection, that is, some areas are overexposed while other areas are underexposed. This low-frequency uneven lighting will mask the high-frequency surface defect texture.
[0032] Therefore, the original grayscale image cannot be directly used for analysis. This step employs a homomorphic filtering algorithm, utilizing the image's illumination-reflection model, where the image can be viewed as the product of illumination and reflection components. The specific calculation process is as follows: First, the image is transformed to the logarithmic domain, converting the multiplicative relationship into an additive one; then, a high-pass filter is used to weaken the low-frequency illumination component while enhancing the high-frequency reflection component; finally, an exponential transform is applied to restore the image, resulting in a textured image with uniform illumination. For example, the high-pass filter is a Butterworth high-pass filter.
[0033] By normalizing the illumination field of the grayscale image, a more accurate texture image can be obtained, effectively eliminating the interference caused by non-uniform illumination and highlighting the subtle texture features on the mold surface.
[0034] S2, construct the local texture anisotropic response index, use the structure tensor to analyze the texture direction of each pixel in the texture image, distinguish between directional interference textures and disordered defect textures by calculating the eigenvalues of the structure tensor, and generate the response index map corresponding to the texture image.
[0035] In specific embodiments, we need to map physical features to mathematical parameters; the structure tensor is an effective tool for describing the directionality of local textures. For texture images... any pixel in First, the gradient vector is calculated using the Sobel or Scharr operator. Then, in The gradient information is weighted and summed within a neighborhood window to construct a local structure tensor matrix. :
[0036] For matrix Eigenvalue decomposition yields two eigenvalues. and and agreed .in, The energy intensity represents the direction of the most drastic texture change within a local area. It represents the energy intensity in the direction perpendicular to the direction of maximum intensity.
[0037] Based on these two feature values, different texture scenes can be distinguished: Scene A (Residual / Knife-like Texture): This type of interference texture mainly presents as regular line-like shapes, and its texture features exhibit significant directional differences: in the vertical direction extending across the lines, the grayscale values change drastically, corresponding to extremely large gradient values; while in the parallel direction extending along the lines, the grayscale values transition smoothly, with extremely small gradient values. This directional difference is directly reflected in the eigenvalues of the structure tensor, manifested as the first eigenvalue. With the second eigenvalue There is a significant order of magnitude difference between them. This means that the texture energy in a local area is highly concentrated in a single direction, exhibiting the core characteristic of strong anisotropy. This is also one of the key differences between this type of interference and real defects in terms of morphological essence.
[0038] Scenario B (Erosion Wear): Erosion wear defects on the mold surface mainly manifest as densely distributed pits or irregular depressions. Their texture features do not exhibit a clear directional bias: regardless of the viewing angle of the defect area, the grayscale value shows a drastic and uniform change, with gradient values remaining at a high level in all directions. This is reflected in the eigenvalues of the structural tensor as the first eigenvalue. With the second eigenvalue The numerical values are similar ( Both are in the high energy range, which means that the texture energy in the defect area is evenly distributed in all directions, showing a typical characteristic of strong isotropy. This characteristic is the core basis for accurately identifying erosion wear defects.
[0039] To suppress scene A and highlight scene B, a local texture anisotropic response index is constructed. The calculation formula is as follows:
[0040] In the formula, It is a non-zero constant used to ensure numerical stability; in this embodiment, it is taken as... The first term of the formula is the isotropic factor, which is used to suppress interfering textures with strong anisotropy, and the second term of the formula is the energy intensity factor, which is used to filter out low-energy noise.
[0041] Calculation example: Suppose there is a mold release agent flow mark at a certain location in the image, i.e., scene A. The characteristic value of this point is calculated to be... .
[0042] Then the isotropic factor in the first term of the formula is: The second term in the formula, the energy factor, is: Final Response It is evident that although the gradient energy of the flow mark is high, its strong anisotropy significantly suppresses the final response.
[0043] Suppose there is an erosion pit at another location in the image, i.e., scene B, with the feature value being... .
[0044] Then the isotropic factor in the first term of the formula is: The second term in the formula, the energy factor, is: Final Response As can be seen, the response value at this point is much higher than that at the flow mark point, thus achieving effective extraction of defects.
[0045] By constructing a local texture anisotropic response index, it is possible to mathematically distinguish between linear interference and point-like defects, which greatly improves the signal-to-noise ratio of detection.
[0046] S3. Based on the prior knowledge of the physical field, spatial weighted evaluation is performed to obtain the filling simulation data of the die-casting mold and map it into a position weight matrix. The position weight matrix is used to perform nonlinear weighting on the response index map to calculate the final damage assessment value of the die-casting mold surface.
[0047] In specific embodiments, relying solely on visual texture analysis may still lead to misjudgments; for example, water stains on non-working surfaces might be identified as erosion. Therefore, a physical prior is introduced, and die-casting CAE software is used to simulate the mold filling process, extracting the cumulative impact energy or average flow velocity data from the die-casting mold surface. This 3D mesh data is then projected onto a 2D image coordinate system to generate a position weight matrix. . The normalization value is between 0 and 1. The larger the value, the more severe the erosion at that location during the filling process.
[0048] Calculate the final damage assessment value The formula is:
[0049] In the formula, The total number of pixels in the image. For the first The coordinates of each pixel The local texture anisotropic response index, This is the position weight matrix. These are weighting coefficients. For exponential functions, in this embodiment, we take... .
[0050] Calculation example: Scenario 1: Calculation of the contribution value of suspected erosion points in high-risk areas At the corner of the flow channel in a die-casting mold, the molten metal undergoes a sudden change in flow direction during filling. This area is subjected to severe impact and shearing forces from the high-temperature molten metal over a long period, making it a high-risk core area for erosion and wear. Therefore, a position weight matrix parameter is set for this area. Assuming that a suspected erosion wear feature point is detected at this location based on the anisotropic response index of the previous texture, its local texture anisotropic response index... .
[0051] Based on the nonlinear weighted logic in the final damage assessment formula, the contribution of the suspected erosion point to the overall mold damage assessment is calculated as follows: First, the exponential weighting term is calculated. The weighting coefficients After substituting the parameters, we get Then multiply the weighted result of the index by the response index, that is... The calculation results show that the contribution of suspected defect points appearing in high-risk areas to the overall damage assessment of the mold is significantly amplified, fully demonstrating the algorithm's zero-tolerance attitude towards defects in high-risk areas and ensuring that minute erosion marks in high-risk areas can be accurately identified and incorporated into the damage assessment system.
[0052] Scenario 2: Calculation of the contribution value of suspected interference points in low-risk areas The area near the overflow groove of the die-casting mold primarily functions to contain impurities and gases in the molten metal. The flow velocity of the molten metal in this area is slow, resulting in low impact energy; therefore, it is a low-risk area for erosion and wear. Thus, the position weight matrix parameters are set accordingly. Suppose a suspected point with visual features similar to the erosion point is detected at this location. Preliminary judgment suggests it is likely a non-damaging interfering substance such as dirt or residual mold release agent debris adhering to the mold surface. Its local texture anisotropy response index is also [missing value]. .
[0053] Following the same logic for calculating the final damage assessment value, the contribution value of this suspected interference point is calculated as follows: first, the exponential weighting term is calculated. Then multiply by the response index to get .
[0054] It is evident that, for the same visual response signal, points located in high-risk areas contribute approximately 15 times more to the final evaluation value than points in low-risk areas. This reflects a soft attention mechanism, which exhibits zero tolerance for defects in critical areas while being tolerant of interference in non-critical regions.
[0055] By using spatial weighted evaluation based on prior physical fields, the algorithm acquires process cognition capabilities, enabling it to automatically focus on high-risk areas and further eliminate interference from environmental noise.
[0056] S4. Based on the final damage assessment value, determine the maintenance decision for the die-casting mold. When the final damage assessment value exceeds the preset threshold, it is determined that the die-casting mold has severe erosion wear and an alarm is triggered.
[0057] In a specific embodiment, based on Establish a time series database and set alarm thresholds. ,For example When calculated An alarm signal is issued when the wear rate is reached. In addition, trend analysis is performed to calculate the wear rate. If a sharp increase in the wear rate is detected, it indicates that the hardened layer on the surface of the die-casting mold has failed and has entered the accelerated erosion period. At this time, a forced shutdown signal should be issued and the die-casting mold should be repaired by welding or replaced.
[0058] Through a scientific maintenance decision-making mechanism, a shift from passive maintenance to predictive maintenance has been achieved, effectively extending the service life of die-casting molds.
[0059] refer to Figure 2 and Figure 3 , Figure 2The technical effects of this application are demonstrated. The left image is the original acquired image, which contains obvious lateral flow mark interference; the right image is the heat map calculated by this application, which shows that the lateral flow marks are displayed in cool tones, while the hidden erosion points are displayed in warm tones, verifying the anisotropic decoupling logic of step S2. Figure 3 The final detection results are shown in the comparison. In the left image, the existing technology misreports a large number of flow marks as defects, while in the right image, the method of this application has a clean image and accurately locates the real erosion defects, which verifies the effectiveness of the physical field weighting in step S3.
[0060] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A machine vision-based method for quality inspection of automotive parts die-casting molds, characterized in that, Includes the following steps: S1. Obtain the grayscale image of the die-casting mold surface and perform illumination field normalization processing on the grayscale image to obtain a texture image with uniform illumination. S2, construct the local texture anisotropic response index, use the structure tensor to analyze the texture direction of each pixel in the texture image, distinguish between directional interference textures and disordered defect textures by calculating the eigenvalues of the structure tensor, and generate the response index map corresponding to the texture image. S3. Based on the prior knowledge of the physical field, spatial weighted evaluation is performed to obtain the filling simulation data of the die casting mold and map it into a position weight matrix. The position weight matrix is used to perform nonlinear weighting on the response index map to calculate the final damage assessment value of the die casting mold surface. S4. Based on the final damage assessment value, determine the maintenance decision for the die-casting mold. When the final damage assessment value exceeds the preset threshold, it is determined that the die-casting mold has severe erosion wear and an alarm is triggered.
2. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 1, characterized in that, The specific process of normalizing the illumination field of a grayscale image includes: using a homomorphic filtering algorithm to convert the grayscale image to the logarithmic domain, using a high-pass filter to weaken the low-frequency illumination component and enhance the high-frequency reflection component, and then restoring it through an exponential transformation to obtain the texture image.
3. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 1, characterized in that, The structure tensor is constructed by weighted summation of gradient direction distributions within a local neighborhood; For any pixel in the texture image Calculate its gradient vector Construct the local structure tensor matrix : In the formula, the summation symbol indicates a weighted summation within the neighborhood window of a pixel. and These are the gradients in the horizontal and vertical directions, respectively.
4. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 3, characterized in that, Perform eigenvalue decomposition on the local structure tensor matrix to obtain the first eigenvalue. Second eigenvalue ,and ; The first eigenvalue represents the energy intensity in the direction of the most drastic texture change within the local region, and the second eigenvalue represents the energy intensity in the direction perpendicular to the most drastic direction.
5. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 4, characterized in that, Local texture anisotropic response index The calculation formula is: In the formula, The constant is non-zero and is used to ensure numerical stability. The first term of the formula is the isotropic factor, which is used to suppress interference textures with strong anisotropy. The second term of the formula is the energy intensity factor, which is used to filter out low-energy noise.
6. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 1, characterized in that, The process of constructing the position weight matrix includes: Computer-aided engineering software for die casting is used to simulate the filling process of the die casting mold and extract the cumulative impact energy data or average flow velocity data on the surface of the die casting mold. The cumulative impact energy data or average flow velocity data are projected from the three-dimensional mesh onto the two-dimensional image coordinate system to generate a position weight matrix.
7. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 6, characterized in that, The values in the position weight matrix are positively correlated with the intensity of erosion experienced by the mold area during the filling process; The values in the position weight matrix are normalized to between zero and one.
8. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 1, characterized in that, Final damage assessment value The calculation formula is: In the formula, The total number of pixels in the image. For the first The coordinates of each pixel The local texture anisotropic response index, This is the position weight matrix. These are weighting coefficients. It is an exponential function; the formula amplifies the response index in high-risk areas through an exponential weighting mechanism.
9. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 1, characterized in that, Determining maintenance decisions for die-casting molds includes: Set an alarm threshold and determine whether the final damage assessment value is greater than the alarm threshold; If the final damage assessment value is greater than the alarm threshold, it is determined that the die-casting mold surface is severely eroded and worn, and a shutdown and maintenance signal is issued.
10. The machine vision-based method for quality inspection of automotive parts die-casting molds according to claim 9, characterized in that, Maintenance decisions also include trend analysis: The wear rate is calculated based on the final damage assessment data from historical time series. If the wear rate exceeds the preset rate threshold, the hardened layer on the mold surface is deemed to have failed, and a forced shutdown signal is issued.