Die casting defect detection method, system and device for aluminum alloy die casting
By analyzing the characteristics of aluminum alloy die castings, such as thickness variation, grayscale non-uniformity, and edge regularity, and combining the three-dimensional thickness information of the CAD model, the problem of low defect identification accuracy caused by the superposition of three-dimensional structural projections and the registration error of the CAD model in aluminum alloy die castings was solved, thus achieving accurate defect identification and reliable quality control.
Patent Information
- Application Number
- CN202511667253.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-11-14
AI Technical Summary
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 distinguish between real porosity defects and structural overlap interference.
By analyzing the characteristics of suspected defect areas, such as thickness variation, grayscale non-uniformity, and edge regularity, and combining the three-dimensional thickness information of the CAD model, a hierarchical multi-criteria filtering strategy is adopted to remove interference signals from the superposition of three-dimensional structural projections and the registration error of the CAD model, so as to accurately identify the real loose defects.
It significantly improves the accuracy and reliability of die casting defect identification, reduces the probability of structural misjudgment, and achieves precise positioning of real porosity defects and reliable quality control.
Smart Images

Figure CN121120651A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of casting defect detection, in particular to a die casting defect detection method, system and device for aluminum alloy die castings. BACKGROUND
[0002] Aluminum alloy die casting is a near-net forming, efficient and high-precision advanced manufacturing process, which has been widely used in modern industrial core fields such as automobiles, aerospace, communication electronics and household appliances. The die casting process covers multiple complex physical stages such as metal liquid filling, solidification and cooling. Defects such as shrinkage, porosity and inclusions are easily generated inside due to process parameter fluctuations, mold design defects or material purity problems. Aluminum alloy die castings usually have complex structures and uneven wall thicknesses, and need to withstand harsh working conditions of high temperature, high pressure and high load. Therefore, the internal quality of the aluminum alloy die casting directly determines the safety, reliability and service life of the end product.
[0003] To ensure quality, the industry generally 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 the die casting will produce superposition of different depth features on the two-dimensional projection image. In the overlapping area where the ray penetration path is longer, its gray value is similar to the real defect, forming serious recognition interference; second, when the Computer Aided Design (CAD) model is introduced for comparison to eliminate structural interference, it is difficult to achieve accurate registration at the pixel level, especially in the boundary area with steep gray gradient. Small registration errors will introduce new false defect signals, seriously affecting the accuracy and reliability of the die casting defect detection results. SUMMARY
[0004] In order to solve the technical problem of low recognition accuracy of die casting defects caused by three-dimensional structure projection superposition and CAD model registration error, the purpose of the present application is to provide a die casting defect detection method, system and device for aluminum alloy die castings, and the technical solution adopted is as follows: In the first aspect, an embodiment of the present application provides a die casting defect detection method for aluminum alloy die castings, which comprises: Obtaining an X-ray image of the aluminum alloy die casting to be detected, the pixel points in the image having corresponding thickness data; Obtaining a suspected defect area in the X-ray image; obtaining a registration compliance degree according to the change degree of the thickness data of the pixel points in the suspected defect area, the stability degree of the gray change and the regularity degree of the edge; selecting a non-registration false image area in the suspected defect area based on the registration compliance degree; Obtaining a defect gray shape compliance degree according to the non-uniformity degree of the gray level and the irregularity degree of the shape of the non-registration false image area; According to the thickness data and the change degree of the pixels in the non-registered artifact region, an overlapping thickness coincidence degree is obtained; According to the defect gray scale shape coincidence degree and the overlapping thickness coincidence degree, a final defect region in the non-registered artifact region is selected.
[0005] Further, the obtaining of the registration coincidence degree comprises: The range difference and the standard deviation of the thickness data of all the pixels in the suspected defect region are obtained respectively, and the thickness change degree of the suspected defect region is obtained according to the range difference and the standard deviation; The gradient values of the pixels in the suspected defect region are obtained, the mean value and the variance of the gradient values of all the pixels in the suspected defect region are calculated respectively, and the significant consistency degree is obtained according to the mean value and the variance; The chain codes of each edge pixel point in the suspected defect region are obtained, and the standard deviation of the chain codes of all the edge pixel points is taken as the edge regularity degree; According to the thickness change degree, the significant consistency degree and the edge regularity degree, the registration coincidence degree of the suspected defect region is obtained.
[0006] Further, the obtaining of the defect gray scale shape coincidence degree comprises: The variance of the gray scale values of all the pixels in the non-registered artifact region is taken as the gray scale unevenness degree; The convex hull of the non-registered artifact region is obtained, the ratio of the area of the non-registered artifact region to the area of the convex hull is taken as a first shape irregularity index, the standard deviation of the distances from the centroid of the non-registered artifact region to all the edge pixel points is taken as a second shape irregularity index, and the shape irregularity degree is obtained according to the first shape irregularity index and the second shape irregularity index; The product of the gray scale unevenness degree and the shape irregularity degree is taken as the defect gray scale shape coincidence degree of the non-registered artifact region.
[0007] Further, the obtaining of the overlapping thickness coincidence degree comprises: The ratio of the mean value of the thickness data of the pixels in the non-registered artifact region to the mean value of the thickness data of the pixels in the X-ray image is taken as the thickness significant degree; The thickness change degree of the non-registered artifact region is negatively correlated mapped, and the product of the mapping result and the thickness significant degree is taken as the overlapping thickness coincidence degree.
[0008] Further, the selecting of the final defect region in the non-registered artifact region comprises: The overlapping thickness coincidence degree of the non-registered artifact region is negatively correlated mapped, and the product of the mapping result and the defect gray scale shape coincidence degree is taken as the casting defect degree. The non-registration false image area is selected from the casting defect degree greater than the preset defect threshold.
[0009] Further, the suspected defect area in the X-ray image is obtained, and the method comprises the following steps: An ideal ray image is obtained, and the X-ray image and the ideal ray image are subjected to image difference processing to obtain a difference image; pixel points with an absolute value of a difference value greater than a preset difference threshold in the difference image are selected and recorded as suspected defect points; Different connected domains are formed from the suspected defect points in the difference image, and each connected domain is mapped to an area in the X-ray image and recorded as a suspected defect area.
[0010] Further, the non-registration false image area in the suspected defect area is selected based on the registration coincidence degree, and the method comprises the following steps: A segmentation threshold is obtained by using the maximum inter-class variance method for the registration coincidence degrees of all suspected defect areas, and a suspected defect area with a registration coincidence degree less than the segmentation threshold is selected and recorded as a non-registration false image area.
[0011] Further, the thickness variation degree and the edge regularity degree are negatively correlated with the registration coincidence degree, and the significant consistency degree is positively correlated with the registration coincidence degree.
[0012] In a second aspect, an embodiment of the present application provides a die casting defect detection system for aluminum alloy die castings, and the system comprises: A data acquisition module is configured to obtain an X-ray image of an aluminum alloy die casting to be detected, and pixel points in the image have corresponding thickness data; A non-registration false image selection module is configured to obtain a suspected defect area in the X-ray image; obtain a registration coincidence degree according to a variation degree of thickness data of pixel points in the suspected defect area, a stable degree of gray scale variation, and an edge regularity degree; and select a non-registration false image area in the suspected defect area based on the registration coincidence degree. A gray scale shape coincidence analysis module is configured to obtain a defect gray scale shape coincidence degree according to a gray scale non-uniformity degree and a shape irregularity degree of the non-registration false image area. An overlapping thickness coincidence analysis module is configured to obtain an overlapping thickness coincidence degree according to thickness data of pixel points in the non-registration false image area and a variation degree thereof. A defect detection module is configured to select a final defect area in the non-registration false image area according to the defect gray scale shape coincidence degree and the overlapping thickness coincidence degree.
[0013] In a third aspect, another embodiment of the present application provides a die casting defect detection device for aluminum alloy die castings, and the device comprises a processor, and the processor is configured to implement the steps of the die casting defect detection method for aluminum alloy die castings.
[0014] The present application has the following beneficial effects: First aspect: By analyzing the positional relationship between the suspected defect area and the structure edge, the internal thickness variation degree, and the edge regularity, the false defect signal caused by the registration error of the CAD model and the X-ray image can be accurately identified and effectively removed, and the non-registration artifact area is obtained. The technical problem of introducing false defect signals by CAD model registration error is solved, and the fault tolerance and robustness of the detection algorithm to registration error are greatly improved.
[0015] Second aspect: By comprehensively evaluating the gray unevenness degree and shape irregularity degree of the suspected defect area, the real loose defect and the structure overlapping interference formed by the projection superposition of the geometric structure can be effectively distinguished. At the same time, the three-dimensional thickness information provided by the CAD model is deeply fused as a key criterion, and by analyzing the thickness data and its variation degree of the defect area, the real loose defect and the structure overlapping interference are distinguished from the physical essence level, the recognition interference problem caused by three-dimensional structure projection superposition is solved, and the probability of structure misjudgment being mistaken for defect is significantly reduced.
[0016] Third aspect: The scheme first screens by morphological features, then excludes registration artifacts, and finally screens by thickness features. A hierarchical and multi-criterion filtering strategy is adopted to gradually strip the interference signals caused by three-dimensional structure projection superposition and CAD model registration error, realize accurate positioning of real loose defects, and improve the accuracy and reliability of die casting defect recognition. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, and the advantages thereof, a brief introduction will be given to the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor based on these drawings.
[0018] Figure 1 A step flow chart of a die casting defect detection method for an aluminum alloy die casting provided by an embodiment of the present application; Figure 2 A flow chart of a registration compliance acquisition method provided by an embodiment of the present application; Figure 3 A system structure diagram of a die casting defect detection system for an aluminum alloy die casting provided by an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to further clarify the technical means and effects taken by the present application to achieve the predetermined object of the application, the following describes in detail the specific implementation, structure, features and effects of the aluminum alloy die casting defect detection method, system and device according to the present application, combined with the preferred embodiments and the drawings. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0020] 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 application belongs.
[0021] The specific scheme of the aluminum alloy die casting defect detection method, system and device provided by the present application is described in detail below in combination with the drawings.
[0022] Embodiment 1: The present application provides an aluminum alloy die casting defect detection method, please refer to Figure 1 , which shows the step flow chart of the aluminum alloy die casting defect detection method provided by one embodiment of the present application. The method comprises: Step S1: Obtain the X-ray image of the aluminum alloy die casting to be detected. The pixel points in the image have corresponding thickness data.
[0023] Through the motion control platform, the aluminum alloy die casting to be detected on the production line is transported into the detection area defined by the ray source and the detector. By adjusting the relative distance between the ray source and the detector, it is ensured that the die casting to be detected is completely covered in the effective range of the X-ray field. After positioning and calibration are completed, the ray source is controlled to emit X-rays, which penetrate the die casting located at the detection position, and then the corresponding X-ray image is generated by the detector.
[0024] In the embodiment of the present application, the method for obtaining the ideal radiographic image comprises: directly obtaining the CAD three-dimensional model of the aluminum alloy die casting to be detected from a design source file; taking the CAD three-dimensional model and the geometric parameters during X-ray image shooting as inputs, simulating the physical process of X-ray penetrating the CAD three-dimensional model through the digital reconstructed radiography technology, and generating an initial ideal X-ray image which is simulated and defect-free. The geometric parameters include the position of the X-ray source, the position of the detector, the placement angle and position of the die casting. A feature detection algorithm such as scale-invariant feature transform is used to select the feature points in the X-ray image and the initial ideal X-ray image; secondly, the correspondence between the feature points in the two images is established through a feature descriptor comparison and a nearest neighbor search strategy, so as to obtain a matched point pair representing the same position; then, based on the matched point pair, a robust estimation algorithm such as RANSAC algorithm is used to fit an optimal spatial geometric transformation model, which is usually an affine transformation or a perspective transformation; finally, the initial ideal X-ray image is interpolated and resampled using the transformation model, and is mapped to the coordinate system of the X-ray image to generate a spatially aligned registered image as the final ideal radiographic image. The above operations are all known to those skilled in the art and will not be described here. The final ideal radiographic image is one-to-one corresponding to the pixel points in the X-ray image.
[0025] In the process of generating the initial ideal X-ray image through the digital reconstructed radiography technology, the computer program simultaneously simulates and records the path length of each ray penetrating the CAD three-dimensional model, and then generates an initial simulated thickness map which is completely spatially registered with the initial ideal X-ray image. The pixel value in the thickness map represents the theoretical physical thickness of the die casting at the corresponding position. The initial simulated thickness map is converted into a final simulated thickness map, and the method is the same as that of converting the initial ideal X-ray image into the final ideal X-ray image, so that the final simulated thickness map is one-to-one corresponding to the pixel points in the X-ray image. The pixel value of each pixel point in the final simulated thickness map is taken as the thickness data of the pixel point with the same pixel coordinate in the X-ray image.
[0026] Step S2: obtaining a suspected defect area in the X-ray image; obtaining a registration compliance degree according to the change degree of the thickness data of the pixel points in the suspected defect area, the stability degree of the gray scale change and the regularity degree of the edge; and selecting a non-registration artifact area in the suspected defect area based on the registration compliance degree.
[0027] A suspected defect region which is likely to be a real loose defect is determined. In X-ray detection based on a CAD three-dimensional model, there are inevitably slight errors in the image registration process. Such errors are particularly sensitive in regions with a sharp gray gradient, and even a one-pixel misalignment can produce a registration artifact. The essence of the registration artifact is a geometric deviation caused by imperfect alignment of the ideal model projection and the X-ray image, rather than a real physical thickness change, so the thickness change of the registration artifact is small. At the same time, the registration artifact usually appears on both sides of the structure edge or coincides with the edge, and the edge of the registration artifact also presents a regular line due to the regular line of the structure edge. Moreover, the gray change of the registration artifact is relatively stable due to the large gray change of the edge in the image and the continuous distribution of the artifact along the edge. However, a real loose defect usually appears at the thick-thin junction of a die casting, and the shape presents a cloud-like shape and the essence is a physical separation inside the material, so the loose defect region presents the characteristics of unstable gray change, irregular edge and large thickness change. Therefore, the degree of change of the thickness data of the pixels in the suspected defect region, the stability of the gray change and the regularity of the edge are comprehensively evaluated, the degree of coincidence of the suspected defect region and the related characteristics of the registration artifact is analyzed, the registration coincidence degree is obtained, and then the non-registration artifact region is selected.
[0028] Step S3: Obtain a defect gray shape coincidence degree according to the gray non-uniformity degree and the shape irregularity degree of the non-registration artifact region.
[0029] The aluminum alloy die casting has a large number of structures such as ribs, plates, holes and screw columns for the purpose of lightweight and functional integration. X-ray imaging is a projection imaging, and the complex structure in three-dimensional space is compressed to a two-dimensional plane, which can cause the structures of different depths and shapes to overlap on the image, such as the intersection of the rib and the wall, resulting in thickness superposition. The ray penetration path at the overlapping position is longer or more complex, resulting in a gray value similar to that of a real loose defect.
[0030] The formation of a real loose defect is the result of random convergence of small pores caused by poor feeding during metal solidification. This random progressive process results in a highly irregular defect shape and uneven internal density distribution, which presents the characteristics of uneven gray distribution and irregular shape on the image. The structure overlapping region is caused by the superposition of the inherent rib, plate and wall regular geometric structures in the projection direction. Although the local thickness increases, the material density is uniform, and the boundary is determined by the projection of the regular geometric body, which presents the characteristics of uniform gray distribution and regular shape on the image. By comprehensively evaluating the gray non-uniformity degree and the shape irregularity degree of the non-registration artifact region, the coincidence degree of the gray feature and the shape feature of the real loose defect is determined, and the defect gray shape coincidence degree is obtained.
[0031] Step S4: Obtain an overlapping thickness coincidence degree according to the thickness data of the pixels in the non-registration artifact region and the degree of change thereof.
[0032] The non-registration artifact region mainly includes two types of different causes: one is a real loose defect, and the other is a structural overlap interference formed by superimposed projection of complex geometry. The loose defect caused by unreasonable design structure is often in a specific geometry such as a thick-thin adapter near the inner runner or a large plane thin wall, and the thickness of these positions fluctuates greatly and is relatively small. The non-registration artifact region caused by structural overlap is essentially the superposition of separated entities in two-dimensional projection in three-dimensional space. The thickness of the structural overlap region is relatively large because the internal performance is the thickness information of multiple superimposed structures. Moreover, the thickness of different positions of the same structure is relatively close because the structures such as ribs, plates, holes and screw columns of the die casting are relatively regular, so the thickness of the overlapping structure is usually close. Therefore, according to the thickness data and the change degree of the pixel points in the non-registration artifact region, the coincidence degree of the thickness characteristics of the non-registration artifact region and the structural overlap region is analyzed to obtain the overlap thickness coincidence degree.
[0033] Step S5: selecting a final defect region in the non-registration artifact region according to the defect gray scale morphology coincidence degree and the overlap thickness coincidence degree.
[0034] The defect gray scale morphology coincidence degree and the overlap thickness coincidence degree are used to measure the coincidence degree of the gray scale morphology characteristics and the thickness characteristics of the suspected defect region and the real loose defect in turn. Through multi-feature fusion decision, the limitations of single feature judgment are avoided, the selection of the final defect region is more reliable, and the problem of low accuracy of die casting defect recognition caused by three-dimensional structure projection superposition and CAD model registration error is effectively solved.
[0035] The system will automatically highlight the accurate position, contour and number of the final defect region representing the real loose defect in the three-dimensional coordinate system corresponding to the CAD three-dimensional model of the aluminum alloy die casting to be detected, and generate an intuitive defect atlas report. Then, the information is automatically pushed to a manufacturing execution system or a process optimization platform, providing direct data support for tracing defect causes, accurately adjusting injection parameters, mold temperature or spraying cooling process, so as to realize closed-loop quality control from "detection-judgment" to "feedback-optimization".
[0036] Preferably, in some possible implementation manners of the embodiment of the present application, the acquisition method of the suspected defect region comprises: acquiring an ideal radiographic image; performing image difference processing on the X-ray image and the ideal radiographic image to obtain a difference image; selecting pixel points with an absolute value of difference greater than a preset difference threshold value in the difference image, and marking them as suspected defect points; and mapping each connected domain formed by the suspected defect points in the difference image to a region in the X-ray image, and marking it as a suspected defect region. It should be noted that the greater the absolute value of the difference value, the more significant the difference between the actual die casting and the ideal model, and the greater the possibility of defects in the die casting.
[0037] In one implementation form of the embodiment of the present application, the maximum between-class variance method is used to obtain the segmentation threshold value of the absolute value of the difference value of all pixel points in the difference image, and the segmentation threshold value is taken as the preset difference threshold value. In other embodiments, the mean value of the absolute value of the difference value of the pixel points in the difference image can also be taken as the preset difference threshold value.
[0038] Preferably, in some possible implementation forms of the embodiment of the present application, the acquisition method of the registration compliance degree is as follows: Figure 2 Fig. 4 shows a flow chart of an acquisition method of a registration compliance degree according to one embodiment of the present application, and the method comprises the following steps: Step S210: the range and the standard deviation of the thickness data of all pixel points in the suspected defect region are respectively obtained, and the thickness variation degree of the suspected defect region is obtained according to the range and the standard deviation.
[0039] It should be noted that the range and the standard deviation reflect the thickness fluctuation amplitude and the thickness dispersion degree of the suspected defect region in turn, and the greater the two are, the more obvious the change degree of the thickness data of the pixel points in the suspected defect region is. Therefore, the range and the standard deviation are positively correlated with the thickness variation degree. In the embodiment of the present application, the product of the range and the standard deviation of the thickness data of all pixel points in the suspected defect region is taken as the thickness variation degree. The thickness variation degree can effectively amplify the signal characteristics of the real defect and at the same time suppress the slight thickness fluctuation caused by noise and the like, thereby significantly improving the accuracy and anti-interference ability of defect identification.
[0040] Step S220: the gradient value of the pixel points in the suspected defect region is obtained, the mean value and the variance of the gradient value of all pixel points in the suspected defect region are respectively calculated, and the significant consistency degree is obtained according to the mean value and the variance.
[0041] It should be noted that the registration artifact usually occurs at the edge of the structure with dramatic thickness change, these edges have high gradient values in the image and the artifacts are usually continuously distributed along the edges, resulting in relatively uniform distribution of the gradient values of the pixel points in the region, so that the variance is small and the mean value is large. The real loose defect usually appears at the thickness junction, the gradient value is high at the defect boundary and low at the internal position, resulting in large variance and small mean value. If the mean value is larger and the variance is smaller, the gradient of the suspected defect region is higher and more consistent, and the significant consistency degree is larger, which is more consistent with the gradient distribution characteristics of the registration artifact region. The significant consistency degree presents the significance and consistency of the gradient values of the pixel points in the suspected defect region, i.e. the stability degree of the gray scale change. Therefore, the mean value is positively correlated with the significant consistency degree, and the variance is negatively correlated with the significant consistency degree. In the embodiment of the present application, the significant consistency degree is obtained by taking the ratio of the mean value of the gradient value of all pixel points in the suspected defect region as the numerator and the sum of the variance and a preset positive number as the denominator. The preset positive number prevents the denominator from being zero, which makes the fraction meaningless, and the experience value 0.1 is taken in the present embodiment.
[0042] Step S230: obtaining the chain code of each edge pixel point in the suspected defect region, and taking the standard deviation of the chain codes of all edge pixel points as the edge regularity degree.
[0043] It should be noted that the smaller the edge regularity degree is, the more gently the direction of the chain code of the edge pixel point in the suspected defect region changes, and the more regular the edge of the suspected defect region presents, and the greater the possibility that the region is a registration artifact is. The method for obtaining the chain code of the edge pixel point is as follows: an edge pixel point on the edge of the suspected defect region is selected as an example point, the next edge pixel point of the example point in the clockwise or counterclockwise direction on the edge is determined, and the chain code of the example point is determined based on the positions of the example point and the next edge pixel point thereof. The chain code is an 8-direction chain code.
[0044] In one implementation form of the embodiment of the present application, the Sobel operator is selected to obtain the gradient value, and the Scharr operator or the like can also be used, which is not limited herein.
[0045] Step S240: obtaining the registration compliance degree of the suspected defect region according to the thickness variation degree, the significant consistency degree and the edge regularity degree.
[0046] It is known that the characteristics of the registration artifact present the characteristics of stable gradient, regular edge and small thickness variation. In addition, the registration artifact is often continuously distributed along the structural edge, which leads to a large gradient value of the edge position and close to each other, that is, the gray scale changes are stable. If the thickness variation degree and the edge regularity degree are smaller and the significant consistency degree is greater, it indicates that the thickness variation of the suspected defect region is smaller, the edge presents a more regular line, and the gray scale changes are more stable, which is more consistent with the related characteristics of the registration artifact region. Therefore, the greater the registration compliance degree is, the greater the possibility that the region is a registration artifact is, and the smaller the possibility that the suspected defect region is an actual loose defect is. Therefore, the thickness variation degree and the edge regularity degree are negatively correlated with the registration compliance degree, and the significant consistency degree is positively correlated with the registration compliance degree. In the embodiment of the present application, the thickness variation degree and the edge regularity degree of the suspected defect region are negatively correlated, and the product of the significant consistency degree and the two mapping results is taken as the registration compliance degree.
[0047] In the embodiment, the data to be processed is taken as the index of the exponential function with a natural constant as the base number, the negative correlation mapping of the data to be processed is realized, and the negative correlation mapping can also be realized by linear transformation, taking the reciprocal and the like, which is not limited herein.
[0048] Preferably, in some possible implementation manners of the embodiment of the present application, the acquisition method of the non-registration artifact region comprises: using the maximum between-class variance method to acquire a segmentation threshold for the registration coincidence degree of all suspected defect regions, selecting a suspected defect region corresponding to a registration coincidence degree less than the segmentation threshold, and recording the suspected defect region as the non-registration artifact region. It should be noted that the smaller the registration coincidence degree of the suspected defect region is, the greater the possibility that the suspected defect region is an actual loose defect and the smaller the possibility that the suspected defect region is a registration artifact are. The non-registration artifact region is the remaining suspected defect region excluding the registration artifact region.
[0049] In other embodiments of the present application, the registration coincidence degrees of all suspected defect regions can also be arranged from large to small to form a registration sequence, a first-order difference sequence of the registration sequence is acquired, and the two registration coincidence degrees corresponding to the maximum element in the first-order difference sequence are recorded as division coincidence degrees. The suspected defect region corresponding to the minimum subscript division coincidence degree and the registration coincidence degree after the minimum subscript division coincidence degree in the registration sequence is the non-registration artifact region.
[0050] Preferably, in some possible implementation manners of the embodiment of the present application, the acquisition method of the defect gray-scale morphology coincidence degree comprises: recording the variance of the gray-scale values of all pixel points in the non-registration artifact region as a gray-scale unevenness degree; acquiring a convex hull of the non-registration artifact region, and taking the ratio of the area of the non-registration artifact region to the area of the convex hull as a first shape irregularity index; calculating the standard deviation of the distances from the centroid of the non-registration artifact region to all edge pixel points as a second shape irregularity index; acquiring a shape irregularity degree according to the first shape irregularity index and the second shape irregularity index; and taking the product of the gray-scale unevenness degree and the shape irregularity degree as the defect gray-scale morphology coincidence degree of the non-registration artifact region.
[0051] It should be noted that a real loose defect is prone to internal recesses and cavities during the formation process, resulting in a large difference between the shape of the real loose defect and the convex hull. The structure overlap region is usually convex, resulting in a small difference between the shape of the structure overlap region and the convex hull. Therefore, the larger the first shape irregularity index is, the closer the area of the non-registration artifact region to the convex hull is, and the more regular the shape of the non-registration artifact region is. In the present embodiment, the number of pixel points in a region is used as the area of the region. The expansion of the loose defect in each direction is not uniform. The larger the second shape irregularity index is, the more dispersed the boundary distances of the non-registration artifact region in each direction are, and the more irregular the shape of the non-registration artifact region is. Therefore, the first shape irregularity index is negatively correlated with the shape irregularity degree, and the second shape irregularity index is positively correlated with the shape irregularity degree. In the embodiment of the present application, the ratio of the second shape irregularity index to the first shape irregularity index of the non-registration artifact region is taken as the shape irregularity degree. It is known that the gray-scale distribution of the loose defect is uneven and the shape of the loose defect is irregular. The larger the gray-scale unevenness degree and the shape irregularity degree are, the more the non-registration artifact region conforms to the gray-scale characteristics and shape characteristics of the loose defect, and the larger the defect gray-scale morphology coincidence degree is.
[0052] Preferably, in some possible implementation manners of the embodiment of the present application, the acquisition method of the overlap thickness compliance degree comprises: taking the ratio of the thickness data mean value of the pixel points in the misregistration artifact region to the thickness data mean value of the pixel points in the X-ray image as the thickness salience; performing negative correlation mapping on the thickness variation degree of the misregistration artifact region, and taking the product of the mapping result and the thickness salience as the overlap thickness compliance degree.
[0053] It should be noted that the thickness variation of the region caused by the structural overlap interference is small and the thickness is large. The higher the thickness of the misregistration artifact region is relative to the overall thickness level of the X-ray image. The greater the thickness salience and the smaller the thickness variation degree, the higher the thickness of the misregistration artifact region is relative to the overall thickness level of the X-ray image and the smaller the thickness variation, the more the misregistration artifact region conforms to the thickness characteristics of the region caused by the structural overlap interference, the greater the overlap thickness compliance degree, and the greater the possibility that the misregistration artifact region is the structural overlap region. Conversely, the smaller the overlap thickness compliance degree, the greater the possibility that the misregistration artifact region is the real loose defect. Therefore, the thickness salience is positively correlated with the overlap thickness compliance degree, and the thickness variation degree is negatively correlated with the overlap thickness compliance degree.
[0054] In the embodiment, the data to be processed is taken as the index of the exponential function with the natural constant as the base number to achieve the negative correlation mapping of the data to be processed. The negative correlation mapping can also be achieved by linear transformation and other methods, which are not limited herein.
[0055] Preferably, in some possible implementation manners of the embodiment of the present application, the acquisition method of the final defect region comprises: performing negative correlation mapping on the overlap thickness compliance degree of the misregistration artifact region, and performing normalization processing on the product of the mapping result and the defect gray scale shape compliance degree to obtain the casting defect degree; selecting the misregistration artifact region corresponding to the casting defect degree greater than the preset defect threshold as the final defect region.
[0056] It should be noted that the greater the defect gray scale shape compliance degree and the smaller the overlap thickness compliance degree, the more the misregistration artifact region conforms to the gray scale characteristics and shape characteristics of the loose defect and the less the misregistration artifact region conforms to the thickness characteristics of the region caused by the structural overlap interference, that is, the more the misregistration artifact region conforms to the thickness characteristics of the real loose defect, and the greater the casting defect degree. Therefore, the defect gray scale shape compliance degree is positively correlated with the casting defect degree, and the overlap thickness compliance degree is negatively correlated with the casting defect degree. In the embodiment of the present application, the ratio of the defect gray scale shape compliance degree as the numerator and the sum of the overlap thickness compliance degree and the preset positive number as the denominator is taken as the casting defect degree.
[0057] In the embodiment of the present application, the maximum-minimum normalization is used for normalization processing, and other normalization methods such as Sigmoid function can also be selected, which are not limited herein.
[0058] In one implementation form of the embodiment of the application, the preset defect threshold is set to 0.6, and the implementer can set it according to the specific situation.
[0059] So far, the application is completed.
[0060] Embodiment 2 The application provides a die casting defect detection system for aluminum alloy die castings, please refer to Figure 3 which shows a system structure diagram of a die casting defect detection system for aluminum alloy die castings according to one embodiment of the application, the system comprises: The data acquisition module 610 is configured to acquire an X-ray image of the aluminum alloy die casting to be detected, and the pixel points in the image have corresponding thickness data. The non-registration artifact selection module 620 is configured to acquire a suspected defect area in the X-ray image, acquire a registration compliance degree according to the change degree of the thickness data of the pixel points in the suspected defect area, the stability degree of the grayscale change and the edge regularity degree, and select a non-registration artifact area in the suspected defect area based on the registration compliance degree. The grayscale shape compliance analysis module 630 is configured to acquire a defect grayscale shape compliance degree according to the grayscale non-uniformity degree and the shape irregularity degree of the non-registration artifact area. The overlapping thickness compliance analysis module 640 is configured to acquire an overlapping thickness compliance degree according to the thickness data of the pixel points in the non-registration artifact area and the change degree thereof. The defect detection module 650 is configured to select a final defect area in the non-registration artifact area according to the defect grayscale shape compliance degree and the overlapping thickness compliance degree.
[0061] It should be noted that the device provided in the above embodiment is only exemplified by the division of the above functional modules, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the die casting defect detection system for aluminum alloy die castings and the die casting defect detection method for aluminum alloy die castings provided in the above embodiment belong to the same concept, and the specific implementation process is described in detail in the method embodiment, which will not be repeated here.
[0062] Embodiment 3 Based on the same inventive concept as the die casting defect detection method for aluminum alloy die castings described above, the die casting defect detection device for aluminum alloy die castings provided in one embodiment of the application comprises a processor, and the processor realizes the die casting defect detection method for aluminum alloy die castings as described above when executed. The die casting defect detection for aluminum alloy die castings has been described in detail in the above embodiment, and will not be repeated here.
[0063] Embodiment 4: The embodiment further provides a computer readable storage medium, which stores computer program codes, and when the computer program codes are run on a computer, the computer is caused to execute the above-mentioned related method steps to realize the method for detecting the die casting defects of the aluminum alloy die casting provided in the above-mentioned embodiment.
[0064] Embodiment 5: The embodiment further provides a computer program product, and when the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to realize the method for detecting the die casting defects of the aluminum alloy die casting provided in the above-mentioned embodiment.
[0065] In the embodiment provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiment described above is merely schematic, for example, the division of the modules or units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another apparatus, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed ones can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.
[0066] It should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiment described above is merely schematic, for example, the division of the modules or units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another apparatus, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed ones can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.
[0067] It should be understood that the above-mentioned sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0068] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment mainly describes the difference 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 conformance of the defect and the overlap thickness conformance, the final defect region in the non-registration artifact region is selected.
2. The method for detecting die-casting defects in aluminum alloy die-casting parts according to claim 1, characterized in that, 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.
3. The method for detecting die-casting defects in aluminum alloy die-casting parts according to claim 1, characterized in that, 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.
4. The method for detecting die-casting defects in aluminum alloy die-casting parts according to claim 2, 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.
5. 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.
6. The method for detecting die-casting defects in aluminum alloy die-casting parts 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.
7. The method for detecting die-casting defects in aluminum alloy die-castings 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.
8. The method for detecting die-casting defects in aluminum alloy die-casting parts according to claim 2, 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.
9. 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.
10. 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 8.
Citation Information
Patent Citations
Method for detecting internal defect of automobile brake disc
CN105654495A
Casting surface defect detection method based on computer vision
CN116758061A
Aluminum alloy casting machining forming quality evaluation method
CN120451164A
Apparatus and methods for the inspection of objects
US20040120571A1
Methods and Systems for Detecting Defects in Devices Using X-rays
US20210012499A1