A method, system and device for detecting defects in an aluminum alloy die casting

By comprehensively analyzing the thickness and grayscale characteristics of aluminum alloy die castings, removing artifact signals, and accurately identifying real porosity defects, the problem of low recognition accuracy caused by the superposition of three-dimensional structural projections and the registration error of CAD models is solved, and efficient defect detection and optimization feedback are achieved.

CN121120651BActive Publication Date: 2026-02-03WEINAN ZHONGHAI HUAMAO AUTO PARTS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511667253.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-02-03
Estimated Expiration
2045-11-14

AI Technical Summary

Technical Problem

In the existing technology, the three-dimensional structural projection superposition of aluminum alloy die castings and the registration error of CAD models result in low defect identification accuracy, making it difficult to accurately identify real porosity defects and structural overlap interference.

Method used

By analyzing the thickness data changes, grayscale stability, and edge regularity of suspected defect areas, and combining overlapping thickness and grayscale morphological features, a multi-criteria filtering strategy is adopted to remove artifact signals and accurately identify real loose defects.

Benefits of technology

It significantly improves the accuracy and reliability of defect identification in aluminum alloy die castings, reduces the probability of structural misjudgment, and realizes closed-loop quality control from detection to feedback optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120651B_ABST
    Figure CN121120651B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of casting defect detection, and particularly relates to a die casting defect detection method, system and device for aluminum alloy die castings. According to the change degree of thickness data of pixel points in a suspected defect area in an X-ray image, the stable degree of gray scale change and the regular degree of edges, a registration compliance degree is obtained, and a non-registration artifact area in the suspected defect area is selected. According to the non-uniformity degree of gray scale and the irregularity degree of shape of the non-registration artifact area, a defect gray scale shape compliance degree is obtained. According to the thickness data of pixel points in the non-registration artifact area and the change degree thereof, an overlapping thickness compliance degree is obtained. According to the defect gray scale shape compliance degree and the overlapping thickness compliance degree, a final defect area in the non-registration artifact area is selected. The present application comprehensively considers morphological characteristics and thickness characteristics, removes interference caused by projection superposition of three-dimensional structures and registration error of CAD models, and improves the accuracy of die casting defect recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of casting defect detection technology, specifically to a method, system, and apparatus for detecting die-casting defects in aluminum alloy die-castings. Background Technology

[0002] Aluminum alloy die casting is a near-net-shape, highly efficient, and precise advanced manufacturing process widely used in core areas of modern industry such as automobiles, aerospace, communications electronics, and home appliances. The die casting process involves multiple complex physical stages, including molten metal filling, solidification, and cooling. It is prone to internal defects such as shrinkage cavities, porosity, and inclusions due to fluctuations in process parameters, mold design flaws, or material purity issues. Aluminum alloy die castings typically have complex structures, uneven wall thicknesses, and must withstand harsh working conditions such as high temperature, high pressure, and high load. Therefore, their internal quality directly determines the safety, reliability, and service life of the final product.

[0003] To ensure quality, the industry widely uses X-ray digital imaging technology for non-destructive testing. However, this method faces the following challenges: First, the complex three-dimensional spatial structure of die-cast parts will produce superposition of features of different depths on the two-dimensional projection image. In the overlapping areas where the X-ray penetration path is longer, the gray value is similar to that of the real defect, forming serious identification interference. Second, when computer-aided design (CAD) models are introduced for comparison to eliminate structural interference, it is difficult to achieve pixel-level accurate registration. Especially in the boundary areas with sharp gray-level gradients, small registration errors can introduce new false defect signals, seriously affecting the accuracy and reliability of die-casting defect detection results. Summary of the Invention

[0004] To address the technical problem of low accuracy in detecting die-casting defects due to the superposition of three-dimensional structural projections and registration errors in CAD models, the present invention aims to provide a method, system, and apparatus for detecting die-casting defects in aluminum alloy die-castings. The specific technical solution adopted is as follows:

[0005] In a first aspect, one embodiment of the present invention provides a method for detecting die-casting defects in aluminum alloy die-casting parts, the method comprising:

[0006] Obtain an X-ray image of the aluminum alloy die casting to be inspected, wherein each pixel in the image has corresponding thickness data;

[0007] Obtain suspected defect areas in X-ray images; obtain registration accuracy based on the degree of variation in pixel thickness data, the stability of grayscale changes, and the regularity of edges within the suspected defect areas; select non-registration artifact areas within the suspected defect areas based on the registration accuracy.

[0008] The gray-scale morphology conformity of the defect is obtained based on the degree of gray-scale unevenness and shape irregularity of the unregistered artifact region.

[0009] The overlap thickness conformity is obtained by analyzing the thickness data of pixels in the unregistered artifact region and the degree of their variation.

[0010] Based on the grayscale shape conformance of the defect and the overlap thickness conformance, the final defect region in the non-registration artifact region is selected.

[0011] Furthermore, obtaining the registration conformity includes:

[0012] The range and standard deviation of the thickness data of all pixels in the suspected defect area are obtained respectively, and the thickness variation of the suspected defect area is obtained based on the range and standard deviation.

[0013] Obtain the gradient values ​​of pixels within the suspected defect area, calculate the mean and variance of the gradient values ​​of all pixels within the suspected defect area, and obtain the significant consistency based on the mean and variance.

[0014] Obtain the chain code of each edge pixel in the suspected defect area, and use the standard deviation of the chain codes of all edge pixels as the edge regularity.

[0015] Based on the thickness variation, the significant consistency, and the edge regularity, the registration conformity of the suspected defect area is obtained.

[0016] Furthermore, the acquisition of defect grayscale shape conformity includes:

[0017] The variance of the gray values ​​of all pixels in the unregistered artifact region is denoted as the degree of gray level non-uniformity.

[0018] Obtain the convex hull of the unregistered artifact region, and use the ratio of the area of ​​the unregistered artifact region to the area of ​​its convex hull as the first shape irregularity index; calculate the standard deviation of the distance from the centroid of the unregistered artifact region to all edge pixels, and record it as the second shape irregularity index; obtain the degree of shape irregularity based on the first shape irregularity index and the second shape irregularity index.

[0019] The product of the degree of grayscale non-uniformity and the degree of shape irregularity is taken as the grayscale morphology conformity of the defect in the unregistered artifact region.

[0020] Further, obtaining the overlap thickness conformity includes:

[0021] The ratio of the mean thickness data of pixels in the unregistered artifact region to the mean thickness data of pixels in the X-ray image is used as the thickness significance.

[0022] The thickness variation of the non-registration artifact region is negatively correlated and mapped. The product of the mapping result and the thickness significance is used as the overlap thickness conformity.

[0023] Furthermore, the selection of the final defect region within the non-registration artifact region includes:

[0024] The overlap thickness conformity of the non-registration artifact region is negatively correlated and mapped, and the product of the mapping result and the defect grayscale shape conformity is used as the casting defect degree.

[0025] The unregistered artifact region corresponding to the casting defect degree that is greater than the preset defect threshold is selected as the final defect region.

[0026] Furthermore, acquiring the suspected defect region in the X-ray image includes:

[0027] Obtain an ideal X-ray image; perform image difference processing on the X-ray image and the ideal X-ray image to obtain a difference image; select pixels in the difference image whose absolute difference value is greater than a preset difference threshold and record them as suspected defect points;

[0028] Different connected regions are formed by the suspected defect points in the difference image. Each connected region is mapped to a region in the X-ray image and is denoted as the suspected defect region.

[0029] Further, the step of selecting non-registration artifact regions within the suspected defect area based on the registration conformity includes:

[0030] The Otsu's method is used to obtain the segmentation threshold for the registration conformity of all suspected defective regions. The suspected defective regions with registration conformity less than the segmentation threshold are selected and recorded as non-registration artifact regions.

[0031] Furthermore, the degree of thickness variation and the degree of edge regularity are both negatively correlated with the registration conformity, while the degree of significant consistency is positively correlated with the registration conformity.

[0032] Secondly, one embodiment of the present invention provides a die-casting defect detection system for aluminum alloy die-casting parts, the system comprising:

[0033] The data acquisition module is used to acquire X-ray images of the aluminum alloy die casting to be inspected, wherein each pixel in the image has corresponding thickness data.

[0034] The unregistration artifact selection module is used to acquire suspected defect areas in X-ray images; obtain registration conformity based on the degree of change in pixel thickness data, the stability of grayscale changes, and the regularity of edges within the suspected defect areas; and select unregistration artifact areas within the suspected defect areas based on the registration conformity.

[0035] The grayscale morphology matching analysis module is used to obtain the grayscale morphology matching degree of defects based on the degree of grayscale non-uniformity and shape irregularity of the unregistered artifact area.

[0036] The overlap thickness conformance analysis module is used to obtain the overlap thickness conformance based on the thickness data of pixels in the unregistered artifact region and the degree of change.

[0037] The defect detection module is used to select the final defect region in the non-registration artifact region based on the defect grayscale shape conformity and the overlap thickness conformity.

[0038] Thirdly, another embodiment of the present invention provides a die-casting defect detection device for aluminum alloy die-casting parts, the device including a processor, which executes the steps of the die-casting defect detection method for aluminum alloy die-casting parts as described above.

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

[0040] Firstly, by analyzing the positional relationship between suspected defect areas and structural edges, the degree of internal thickness variation, and edge regularity, false defect signals caused by registration errors between CAD models and X-ray images can be accurately identified and effectively removed, resulting in non-registration artifact areas. This solves the technical challenge of false defect signals introduced by CAD model registration errors, greatly improving the detection algorithm's tolerance and robustness to registration errors.

[0041] Secondly, by comprehensively evaluating the degree of grayscale unevenness and shape irregularity of suspected defect areas, it is possible to effectively distinguish between real loose defects and structural overlap interference caused by the superposition of geometric projections. At the same time, it deeply integrates the three-dimensional thickness information provided by the CAD model as a key criterion. By analyzing the thickness data of the defect area and its degree of change, it distinguishes between real loose defects and structural overlap interference from the physical essence level, solves the identification interference problem caused by the superposition of three-dimensional structural projections, and significantly reduces the probability of structural misjudgment being misidentified as defects.

[0042] Thirdly, this scheme first performs initial screening using morphological features, then eliminates registration artifacts, and finally performs fine screening using thickness features. A hierarchical, multi-criteria filtering strategy is adopted to gradually remove interference signals generated by the superposition of 3D structural projections and CAD model registration errors, achieving precise localization of real porosity defects and improving the accuracy and reliability of die-casting defect identification. Attached Figure Description

[0043] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 The flowchart illustrates the steps of a method for detecting die-casting defects in aluminum alloy die-castings according to an embodiment of the present invention.

[0045] Figure 2 This is a flowchart illustrating a method for obtaining registration conformity according to an embodiment of the present invention.

[0046] Figure 3 This is a system structure diagram of a die-casting defect detection system for aluminum alloy die-casting parts provided in one embodiment of the present invention. Detailed Implementation

[0047] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a method, system, and apparatus for detecting die-casting defects in aluminum alloy die-casting parts according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0048] Unless otherwise defined, 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 pertains.

[0049] The following description, in conjunction with the accompanying drawings, details the specific scheme of the method, system, and apparatus for detecting die-casting defects in aluminum alloy die-casting parts provided by the present invention.

[0050] Example 1:

[0051] This invention proposes a method for detecting die-casting defects in aluminum alloy die-cast parts. Please refer to [link / reference]. Figure 1 The diagram illustrates a flowchart of a method for detecting die-casting defects in aluminum alloy die-castings according to an embodiment of the present invention. The method includes:

[0052] Step S1: Obtain an X-ray image of the aluminum alloy die casting to be inspected. The pixels in the image have corresponding thickness data.

[0053] The motion control platform transports the aluminum alloy die-cast parts to be inspected from the production line to the inspection area defined by the X-ray source and detector. By adjusting the relative distance between the X-ray source and detector, it is ensured that the die-cast parts to be inspected are completely covered within the effective range of the X-ray field. After positioning and calibration are completed, the X-ray source is controlled to emit X-rays, which penetrate the die-cast parts located at the inspection position and are received by the detector to generate the corresponding X-ray image.

[0054] In this embodiment of the invention, the method for acquiring an ideal X-ray image includes: directly acquiring the CAD 3D model of the aluminum alloy die-casting to be inspected from the design source file; using the CAD 3D model and the geometric parameters at the time of X-ray image capture as input, simulating the physical process of X-rays penetrating the CAD 3D model through digital reconstruction radiographic imaging technology, and generating a simulated and defect-free initial ideal X-ray image. The geometric parameters include: the position of the X-ray source, the position of the detector, and the placement angle and position of the die-casting. Feature points in the X-ray image and the initial ideal X-ray image are selected using feature detection algorithms such as scale-invariant feature transformation; secondly, the correspondence between feature points in the two images is established through feature descriptor comparison and nearest neighbor search strategies, thereby obtaining matching point pairs representing the same location; then, based on the matching point pairs, an optimal spatial geometric transformation model is fitted using robust estimation algorithms such as RANSAC, typically an affine transformation or perspective transformation; finally, the initial ideal X-ray image is interpolated and resampled using the transformation model, mapping it to the coordinate system of the X-ray image to generate a spatially aligned registered image, which serves as the final ideal X-ray image. The above operations are all techniques known to those skilled in the art and will not be described in detail here. The final ideal X-ray image corresponds one-to-one with the pixels in the X-ray image.

[0055] In the process of generating an initial ideal X-ray image using digital reconstruction radiographic imaging technology, a computer program synchronously simulates and records the path length of each ray penetrating the CAD 3D model, thereby generating an initial simulated thickness map that is completely spatially registered with the initial ideal X-ray image. The pixel values ​​in this thickness map characterize the theoretical physical thickness of the die-casting at the corresponding location. The initial simulated thickness map is converted into a final simulated thickness map using the same method as converting the initial ideal X-ray image into a final ideal X-ray image, ensuring a one-to-one correspondence between the final simulated thickness map and the pixels in the X-ray image. The pixel value of each pixel in the final simulated thickness map is used as the thickness data of the pixel at the same pixel coordinates in the X-ray image.

[0056] Step S2: Obtain the suspected defect area in the X-ray image; obtain the registration conformity based on the degree of change in the thickness data of the pixels in the suspected defect area, the stability of the gray-level change, and the regularity of the edge; select the non-registration artifact area in the suspected defect area based on the registration conformity.

[0057] Identify potential defect areas that may be genuine porosity defects. In X-ray inspection based on CAD 3D models, minor errors are unavoidable in the image registration process. These errors are particularly sensitive in areas with sharp gray-level gradients; even a misalignment of a single pixel can produce registration artifacts. These artifacts are essentially geometric deviations caused by the imperfect alignment between the ideal model projection and the X-ray image, rather than actual physical thickness changes, resulting in small thickness variations in the registration artifacts. Furthermore, registration artifacts typically appear on either side of or highly overlap with the edges of structures with dramatic thickness changes. Because structural edges are usually regular lines, the edges of the registration artifacts also appear regular lines. These edges exhibit significant gray-level variations in the image, and the artifacts are often continuously distributed along the edges, making the gray-level variations of the registration artifacts relatively stable. However, genuine porosity defects typically occur at the thickness transition points of die-cast parts, have a cloud-like shape, and are essentially due to physical separation within the material. This results in porosity defect areas exhibiting unstable gray-level variations, irregular edges, and significant thickness variations. Therefore, by comprehensively considering the degree of variation in the thickness data of pixels within the suspected defect area, the stability of grayscale changes, and the regularity of edge patterns, the degree of conformity between the suspected defect area and the registration artifact-related features is analyzed to obtain the registration conformity, and then the non-registration artifact area is selected.

[0058] Step S3: Obtain the grayscale morphology conformity of the defect based on the degree of grayscale non-uniformity and shape irregularity of the unregistered artifact region.

[0059] To achieve lightweighting and functional integration, aluminum alloy die-cast parts are designed with numerous ribs, plates, holes, and screw studs. X-ray imaging is a projection imaging technique; the complex three-dimensional structure is compressed onto a two-dimensional plane, causing structures of different depths and shapes to overlap in the image, such as the thickness superposition caused by the intersection of ribs and walls. The X-ray penetration paths at the overlapping locations are longer or more complex, resulting in grayscale values ​​that are similar to those of actual porosity defects.

[0060] The formation of true porosity defects is the result of the random aggregation of tiny pores caused by inadequate feeding during metal solidification. This random, gradual process leads to highly irregular defect shapes and uneven internal density distribution, manifesting as uneven grayscale distribution and irregular shapes in the image. Overlapping structural areas are caused by the superposition of the inherent regular geometric structures of the die-cast part, such as ribs, plates, and walls, in the projection direction. Although the local thickness increases, the material density is uniform, and the boundaries are determined by the projection of regular geometric shapes, resulting in a uniform grayscale distribution and relatively regular shapes in the image. By comprehensively evaluating the degree of grayscale unevenness and shape irregularity of the unregistered artifact areas, the degree of conformity with the grayscale and shape characteristics of true porosity defects is determined, thus obtaining the defect grayscale morphology conformity.

[0061] Step S4: Obtain the overlap thickness conformity based on the thickness data of pixels in the unregistered artifact region and the degree of change.

[0062] Unregistered artifact regions primarily comprise two fundamentally different causes: genuine porosity defects and structural overlap interference resulting from the superposition and projection of complex geometric structures. Porosity defects caused by unreasonable structural design often occur at specific geometric structures such as thickness transitions near the ingate or thin-walled areas on large planes. These locations exhibit significant thickness fluctuations and relatively small thicknesses. Unregistered artifact regions resulting from structural overlap are essentially the superposition of separated entities in three-dimensional space onto a two-dimensional projection. Because they internally represent the thickness information of multiple overlapping structures, the thickness of the overlapping area is relatively large. Furthermore, due to the relatively regular structure of ribs, plates, holes, and screw posts in die-cast parts, the thicknesses at different locations within the same structure are quite similar, leading to generally similar thicknesses in overlapping structures. Therefore, based on the thickness data and variation of pixels within the unregistered artifact region, the degree of consistency between the thickness characteristics of the unregistered artifact region and the structural overlap region is analyzed to obtain the overlap thickness consistency.

[0063] Step S5: Select the final defect area in the non-registration artifact region based on the grayscale shape conformity and overlap thickness conformity of the defect.

[0064] The grayscale morphology conformity and overlap thickness conformity are used to measure the degree of conformity between the suspected defect area and the actual loose defect in terms of grayscale morphology and thickness features, respectively. Through multi-feature fusion decision-making, the limitations of single feature judgment are avoided, making the final selection of defect area more reliable. This effectively solves the problem of low accuracy in die casting defect detection and identification caused by the superposition of three-dimensional structure projection and the registration error of CAD model.

[0065] The system will automatically highlight the precise location, outline, and number of the final defect area representing the actual porosity defect in the 3D coordinate system corresponding to the CAD 3D model of the aluminum alloy die casting to be inspected, and generate an intuitive defect map report. Then, the information will be automatically pushed to the manufacturing execution system or process optimization platform, providing direct data support for tracing the cause of defects, accurately adjusting injection parameters, mold temperature, or spray cooling processes, thereby realizing closed-loop quality control from "inspection-judgment" to "feedback-optimization".

[0066] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the suspected defect region includes: acquiring an ideal X-ray image; performing image difference processing on the X-ray image and the ideal X-ray image to obtain a difference image; selecting pixels in the difference image whose absolute difference value is greater than a preset difference threshold, and recording them as suspected defect points; constructing different connected components from the suspected defect points in the difference image, and mapping each connected component to a region in the X-ray image, recording it as a suspected defect region. It should be noted that when the absolute value of the difference value is larger, it indicates that the difference between the actual die-cast part and the ideal model is more significant, and the possibility of defects in the die-cast part is greater.

[0067] In one implementation of this invention, a segmentation threshold is obtained by applying the maximum inter-class variance method to the absolute values ​​of the differences among all pixels in the difference image, and this segmentation threshold is used as a preset difference threshold. In other embodiments, the mean of the absolute values ​​of the differences among pixels in the difference image can also be used as the preset difference threshold.

[0068] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the registration conformity is described in [reference needed]. Figure 2 The diagram illustrates a flowchart of a method for obtaining registration conformity according to an embodiment of the present invention, the method comprising:

[0069] Step S210: Obtain the range and standard deviation of the thickness data of all pixels in the suspected defect area, and obtain the thickness variation of the suspected defect area based on the range and standard deviation.

[0070] It should be noted that the range and standard deviation reflect the thickness fluctuation amplitude and thickness dispersion of the suspected defect area, respectively. The larger both are, the more significant the change in the thickness data of the pixels within the suspected defect area. Therefore, both the range and standard deviation are positively correlated with the degree of thickness variation. In this embodiment of the invention, the product of the range and standard deviation of the thickness data of all pixels within the suspected defect area is used as the degree of thickness variation. The degree of thickness variation can effectively amplify the signal characteristics of real defects while suppressing minor thickness fluctuations caused by noise, thereby significantly improving the accuracy of defect identification and its anti-interference capability.

[0071] Step S220: Obtain the gradient values ​​of pixels within the suspected defect area, calculate the mean and variance of the gradient values ​​of all pixels within the suspected defect area, and obtain the significant consistency based on the mean and variance.

[0072] It should be noted that registration artifacts typically occur at structural edges with dramatic thickness changes. These edges have high gradient values ​​in the image, and the artifacts are often continuously distributed along the edges, resulting in a relatively uniform distribution of gradient values ​​among pixels in this region, thus leading to a smaller variance and a larger mean. Real loose defects usually appear at the junctions of thick and thin areas, with higher gradient values ​​at the defect boundary and lower gradient values ​​inside, resulting in a larger variance and a smaller mean. If the mean is larger and the variance smaller, the gradients within the suspected defect region are higher and more consistent, leading to a greater degree of significant consistency, which better matches the gradient distribution characteristics of the registration artifact region. Significant consistency reflects the significance and consistency of the gradient values ​​of pixels in the suspected defect region, i.e., the stability of grayscale changes. Therefore, the mean is positively correlated with significant consistency, while the variance is negatively correlated. In this embodiment, the ratio of the mean gradient values ​​of all pixels within the suspected defect region as the numerator and the sum of the variance and a preset positive number as the denominator is used as the significant consistency. The preset positive number is used to prevent the denominator from being zero, making the fraction meaningless; in this embodiment, an empirical value of 0.1 is used.

[0073] Step S230: Obtain the chain code of each edge pixel in the suspected defect area, and use the standard deviation of the chain codes of all edge pixels as the edge regularity.

[0074] It should be noted that the lower the edge regularity, the smoother the change in chain code direction of the edge pixels in the suspected defect area, and the more regular the line shape of the edge of the suspected defect area, the greater the possibility that the area is a registration artifact. The chain code of the edge pixels is obtained as follows: Select any edge pixel above the edge of the suspected defect area and denote it as the example point. Determine the next edge pixel on the edge in a clockwise or counterclockwise direction from the example point. Based on the position of the example point and its next edge pixel, determine the chain code of the example point. The chain code is an 8-directional chain code.

[0075] In one implementation of this invention, the Sobel operator is selected to obtain the gradient value, but the Scharr operator or other operators can also be used, and this is not limited here.

[0076] Step S240: Obtain the registration conformity of the suspected defect area based on the thickness variation, significant consistency and edge regularity.

[0077] It is known that registration artifacts exhibit characteristics of stable gradients, regular edges, and small thickness variations. Specifically, because registration artifacts are often continuously distributed along the structural edges, the gradient values ​​at their edge positions are large and similar, resulting in relatively stable grayscale changes. The smaller the thickness variation and edge regularity, and the greater the significant consistency, the smaller the thickness variation, the more regular the linear edges, and the more stable the grayscale changes in the suspected defect area. This better matches the characteristics of a registration artifact area, leading to a higher registration fit, a greater likelihood that the area is a registration artifact, and a lower likelihood that the suspected defect area is an actual loose defect. Therefore, both thickness variation and edge regularity are negatively correlated with registration fit, while significant consistency is positively correlated. In this embodiment of the invention, the thickness variation and edge regularity of the suspected defect area are negatively correlated, and the product of the significant consistency and the two mapping results is taken as the registration fit.

[0078] In this embodiment, the data to be processed is used as the exponent of an exponential function with the natural constant as the base to achieve a negative correlation mapping of the data to be processed. Negative correlation mapping can also be achieved through linear transformation and taking the reciprocal, etc., which are not limited here.

[0079] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the non-registration artifact region includes: using the maximum inter-class variance method to obtain a segmentation threshold for the registration conformity of all suspected defect regions; selecting the suspected defect regions corresponding to registration conformity less than the segmentation threshold, and recording them as non-registration artifact regions. It should be noted that the smaller the registration conformity, the greater the likelihood that the suspected defect region is an actual loose defect, and the smaller the likelihood that it is a registration artifact. The non-registration artifact region refers to the remaining suspected defect regions excluding the registration artifact regions.

[0080] In other embodiments of the present invention, the registration conformity of all suspected defective regions can be arranged from largest to smallest to form a registration sequence. The first-order difference sequence of the registration sequence is obtained, and the two registration conformity corresponding to the largest element in the first-order difference sequence are recorded as the division conformity. The suspected defective region corresponding to the division conformity with the smallest subscript in the registration sequence and the subsequent registration conformity is regarded as the non-registration artifact region.

[0081] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the grayscale shape conformity of the defect includes: recording the variance of the grayscale values ​​of all pixels in the unregistered artifact region as the grayscale non-uniformity; obtaining the convex hull of the unregistered artifact region, and using the ratio of the area of ​​the unregistered artifact region to the area of ​​its convex hull as a first shape irregularity index; calculating the standard deviation of the distances from the centroid of the unregistered artifact region to all edge pixels, and recording it as a second shape irregularity index; obtaining the shape irregularity degree based on the first shape irregularity index and the second shape irregularity index; and using the product of the grayscale non-uniformity degree and the shape irregularity degree as the defect grayscale shape conformity of the unregistered artifact region.

[0082] It should be noted that real porosity defects tend to generate internal depressions and voids during their formation, resulting in a significant difference in shape from the convex hull. In contrast, overlapping structural regions are typically convex, making their shape less different from the convex hull. Therefore, the larger the first shape irregularity index, the closer the area of ​​the unregistered artifact region is to its convex hull, and the more regular its shape. In this embodiment, the number of pixels within the region is used as the region area. The expansion of porosity defects in all directions is uneven. The larger the second shape irregularity index, the more dispersed the boundary distances of the unregistered artifact region are in all directions, and the more irregular its shape. Therefore, the first shape irregularity index is negatively correlated with the degree of shape irregularity, while the second shape irregularity index is positively correlated with the degree of shape irregularity. In this embodiment, the ratio of the second shape irregularity index to the first shape irregularity index of the unregistered artifact region is used as the degree of shape irregularity. It is known that the gray-level distribution of loose defects is uneven and the shape is irregular. The greater the degree of gray-level unevenness and the degree of shape irregularity, the more the non-registration artifact area matches the gray-level and shape characteristics of the loose defect, and the greater the gray-level morphology matching degree of the defect.

[0083] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the overlap thickness compliance includes: taking the ratio of the average thickness data of pixels in the non-registration artifact region to the average thickness data of pixels in the X-ray image as the thickness significance; performing a negative correlation mapping on the thickness variation of the non-registration artifact region, and taking the product of the mapping result and the thickness significance as the overlap thickness compliance.

[0084] It should be noted that the thickness variation in regions caused by structural overlap interference is known to be small, and the thickness itself is relatively large. The thickness of the unregistered artifact region is higher relative to the overall thickness level of the X-ray image. If the thickness significance is greater and the thickness variation is smaller, it indicates that the thickness of the unregistered artifact region is higher and the thickness variation is smaller relative to the overall thickness level of the X-ray image. The more the unregistered artifact region matches the thickness characteristics of regions caused by structural overlap interference, the greater the overlap thickness consistency, and the greater the probability that the unregistered artifact region is a structural overlap region. Conversely, the smaller the overlap thickness consistency, the greater the probability that the unregistered artifact region is a real porosity defect. Therefore, thickness significance is positively correlated with overlap thickness consistency, while thickness variation is negatively correlated with overlap thickness consistency.

[0085] In this embodiment, the data to be processed is used as the exponent of an exponential function with the natural constant as the base to achieve a negative correlation mapping of the data to be processed. Negative correlation mapping can also be achieved through methods such as linear transformation, which are not limited here.

[0086] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the final defect region includes: performing a negative correlation mapping on the overlap thickness conformity of the non-registration artifact region, normalizing the product of the mapping result and the grayscale shape conformity of the defect to obtain the casting defect degree; and selecting the non-registration artifact region corresponding to the casting defect degree greater than a preset defect threshold as the final defect region.

[0087] It should be noted that if the grayscale morphology conformance of the defect is greater and the overlap thickness conformance is smaller, it indicates that the unregistered artifact region better matches the grayscale and shape characteristics of the loose defect, and less matches the thickness characteristics of the region caused by structural overlap interference, i.e., better matches the thickness characteristics of the real loose defect. Therefore, the casting defect degree is greater. Thus, the grayscale morphology conformance of the defect is positively correlated with the casting defect degree, while the overlap thickness conformance is negatively correlated. In this embodiment of the invention, the ratio obtained by using the grayscale morphology conformance of the defect as the numerator and the sum of the overlap thickness conformance and a preset positive number as the denominator is used as the casting defect degree.

[0088] In this embodiment of the invention, the normalization process is performed using max-min normalization, but other normalization methods such as the Sigmoid function can also be selected, and no limitation is made here.

[0089] In one implementation of this invention, the preset defect threshold is set to 0.6, which can be set by the implementer according to specific circumstances.

[0090] This invention is now complete.

[0091] Example 2:

[0092] This invention proposes a die-casting defect detection system for aluminum alloy die-casting parts. Please refer to [link / reference]. Figure 3 The diagram illustrates a system structure of a die-casting defect detection system for aluminum alloy die-casting parts according to an embodiment of the present invention. The system includes:

[0093] The data acquisition module 610 is used to acquire X-ray images of the aluminum alloy die casting to be inspected, and the pixels in the image have corresponding thickness data.

[0094] The unregistration artifact selection module 620 is used to acquire suspected defect areas in X-ray images; obtain registration conformity based on the degree of change in the thickness data of pixels in the suspected defect areas, the stability of grayscale changes, and the degree of edge regularity; and select unregistration artifact areas in the suspected defect areas based on the registration conformity.

[0095] The grayscale morphology conformance analysis module 630 is used to obtain the grayscale morphology conformance of defects based on the degree of grayscale non-uniformity and shape irregularity of the non-registration artifact area.

[0096] The overlap thickness matching analysis module 640 is used to obtain the overlap thickness matching degree based on the thickness data of pixels in the unregistered artifact area and its degree of change.

[0097] The defect detection module 650 is used to select the final defect area in the non-registration artifact region based on the grayscale shape conformity and overlap thickness conformity of the defect.

[0098] It should be noted that the devices provided in the above embodiments are only illustrative examples of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the die-casting defect detection system for aluminum alloy die-casting parts and the die-casting defect detection method for aluminum alloy die-casting parts provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0099] Example 3:

[0100] Based on the same inventive concept as the above-described embodiment of a method for detecting die-casting defects in aluminum alloy die-castings, an embodiment of the present invention provides a device for detecting die-casting defects in aluminum alloy die-castings. The device includes a processor, which, when executed, implements the method for detecting die-casting defects in aluminum alloy die-castings as described above. The detection of die-casting defects in aluminum alloy die-castings has been described in detail in the above embodiments and will not be repeated here.

[0101] Example 4:

[0102] This embodiment also provides a computer-readable storage medium storing computer program code. When the computer program code is run on a computer, the computer executes the above-described related method steps to implement the die-casting defect detection method for aluminum alloy die-casting parts provided in the above embodiment.

[0103] Example 5:

[0104] This embodiment also provides a computer program product. When the computer program product is run on a computer, it causes the computer to perform the above-mentioned related steps to realize the die-casting defect detection method for aluminum alloy die-casting parts provided in the above embodiment.

[0105] In this embodiment, the apparatus, computer-readable storage medium, or computer program product are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0106] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0107] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0108] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A method for detecting die-casting defects in aluminum alloy die-casting parts, characterized in that, The method includes: Obtain an X-ray image of the aluminum alloy die casting to be inspected, wherein each pixel in the image has corresponding thickness data; Obtain suspected defect areas in X-ray images; obtain registration accuracy based on the degree of variation in pixel thickness data, the stability of grayscale changes, and the regularity of edges within the suspected defect areas; select non-registration artifact areas within the suspected defect areas based on the registration accuracy. The gray-scale morphology conformity of the defect is obtained based on the degree of gray-scale unevenness and shape irregularity of the unregistered artifact region. The overlap thickness conformity is obtained by analyzing the thickness data of pixels in the unregistered artifact region and the degree of their variation. Based on the grayscale shape conformity of the defect and the overlap thickness conformity, the final defect region in the non-registration artifact region is selected. The acquisition of registration conformity includes: The range and standard deviation of the thickness data of all pixels in the suspected defect area are obtained respectively, and the thickness variation of the suspected defect area is obtained based on the range and standard deviation. Obtain the gradient values ​​of pixels within the suspected defect area, calculate the mean and variance of the gradient values ​​of all pixels within the suspected defect area, and obtain the significant consistency based on the mean and variance. Obtain the chain code of each edge pixel in the suspected defect area, and use the standard deviation of the chain codes of all edge pixels as the edge regularity. Based on the thickness variation, the significant consistency, and the edge regularity, the registration conformity of the suspected defect area is obtained; The acquisition of defect grayscale conformity includes: The variance of the gray values ​​of all pixels in the unregistered artifact region is denoted as the degree of gray level non-uniformity. Obtain the convex hull of the unregistered artifact region, and use the ratio of the area of ​​the unregistered artifact region to the area of ​​its convex hull as the first shape irregularity index; calculate the standard deviation of the distance from the centroid of the unregistered artifact region to all edge pixels, and record it as the second shape irregularity index; obtain the degree of shape irregularity based on the first shape irregularity index and the second shape irregularity index. The product of the degree of grayscale non-uniformity and the degree of shape irregularity is taken as the grayscale morphology conformity of the defect in the unregistered artifact region.

2. The method for detecting die-casting defects in aluminum alloy die-casting parts according to claim 1, characterized in that, The process of obtaining the overlap thickness compliance includes: The ratio of the mean thickness data of pixels in the unregistered artifact region to the mean thickness data of pixels in the X-ray image is used as the thickness significance. The thickness variation of the non-registration artifact region is negatively correlated and mapped. The product of the mapping result and the thickness significance is used as the overlap thickness conformity.

3. The method for detecting die-casting defects in aluminum alloy die-casting parts according to claim 1, characterized in that, The selection of the final defect region within the unregistered artifact region includes: The overlap thickness conformity of the non-registration artifact region is negatively correlated and mapped, and the product of the mapping result and the defect grayscale shape conformity is used as the casting defect degree. The unregistered artifact region corresponding to the casting defect degree that is greater than the preset defect threshold is selected as the final defect region.

4. The method for detecting die-casting defects in aluminum alloy die-castings according to claim 1, characterized in that, The acquisition of suspected defect areas in X-ray images includes: Obtain an ideal X-ray image; perform image difference processing on the X-ray image and the ideal X-ray image to obtain a difference image; select pixels in the difference image whose absolute difference value is greater than a preset difference threshold and record them as suspected defect points; Different connected regions are formed by the suspected defect points in the difference image. Each connected region is mapped to a region in the X-ray image and is denoted as the suspected defect region.

5. The method for detecting die-casting defects in aluminum alloy die-casting parts according to claim 1, characterized in that, The selection of non-registration artifact regions within the suspected defect area based on the registration conformity includes: The Otsu's method is used to obtain the segmentation threshold for the registration conformity of all suspected defective regions. The suspected defective regions with registration conformity less than the segmentation threshold are selected and recorded as non-registration artifact regions.

6. The method for detecting die-casting defects in aluminum alloy die-casting parts according to claim 1, characterized in that, The thickness variation and edge regularity are both negatively correlated with the registration conformity, while the significant consistency is positively correlated with the registration conformity.

7. A die-casting defect detection system for aluminum alloy die-casting parts, characterized in that, The system includes: The data acquisition module is used to acquire X-ray images of the aluminum alloy die casting to be inspected, wherein each pixel in the image has corresponding thickness data. The unregistration artifact selection module is used to acquire suspected defect areas in X-ray images; obtain registration conformity based on the degree of change in pixel thickness data, the stability of grayscale changes, and the regularity of edges within the suspected defect areas; and select unregistration artifact areas within the suspected defect areas based on the registration conformity. The grayscale morphology matching analysis module is used to obtain the grayscale morphology matching degree of defects based on the degree of grayscale non-uniformity and shape irregularity of the unregistered artifact area. The overlap thickness conformance analysis module is used to obtain the overlap thickness conformance based on the thickness data of pixels in the unregistered artifact region and the degree of change. The defect detection module is used to select the final defect region in the non-registration artifact region based on the defect grayscale shape conformity and the overlap thickness conformity. The acquisition of registration conformity includes: The range and standard deviation of the thickness data of all pixels in the suspected defect area are obtained respectively, and the thickness variation of the suspected defect area is obtained based on the range and standard deviation. Obtain the gradient values ​​of pixels within the suspected defect area, calculate the mean and variance of the gradient values ​​of all pixels within the suspected defect area, and obtain the significant consistency based on the mean and variance. Obtain the chain code of each edge pixel in the suspected defect area, and use the standard deviation of the chain codes of all edge pixels as the edge regularity. Based on the thickness variation, the significant consistency, and the edge regularity, the registration conformity of the suspected defect area is obtained; The acquisition of defect grayscale conformity includes: The variance of the gray values ​​of all pixels in the unregistered artifact region is denoted as the degree of gray level non-uniformity. Obtain the convex hull of the unregistered artifact region, and use the ratio of the area of ​​the unregistered artifact region to the area of ​​its convex hull as the first shape irregularity index; calculate the standard deviation of the distance from the centroid of the unregistered artifact region to all edge pixels, and record it as the second shape irregularity index; obtain the degree of shape irregularity based on the first shape irregularity index and the second shape irregularity index. The product of the degree of grayscale non-uniformity and the degree of shape irregularity is taken as the grayscale morphology conformity of the defect in the unregistered artifact region.

8. A device for detecting die-casting defects in aluminum alloy die-casting parts, characterized in that, The device includes a processor that, when executed, implements the steps of a method for detecting die-casting defects in aluminum alloy die-castings as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for detecting internal defect of automobile brake disc

    CN105654495A

  • Aluminum alloy casting machining forming quality evaluation method

    CN120451164A