A castings defect detection method and system based on three-dimensional model and flaw detection image

By using a method based on 3D models and flaw detection images, simulated flaw detection images are generated and compared with real flaw detection images, which solves the problems of missed and false detections in casting inspection and realizes accurate detection of casting defects and process optimization.

CN115713622BActive Publication Date: 2026-03-24HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-18
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing casting quality inspection methods suffer from high rates of missed and false detections, which affect the actual use of castings and process optimization. In particular, defect detection is difficult to perform accurately in complex casting structures.

Method used

By using a method based on 3D models and flaw detection images, a virtual ray imaging system is used to generate simulated flaw detection images, which are then compared with real flaw detection images to determine the defect information of the casting, including its shape and location. Combined with grayscale fitting and defect classification techniques, accurate detection is achieved.

Benefits of technology

It improved the accuracy of casting defect detection, reduced false and missed detections, lowered production costs, increased production efficiency, and provided guidance for process optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115713622B_ABST
    Figure CN115713622B_ABST
Patent Text Reader

Abstract

The application provides a cast defect detection method and system based on a three-dimensional model and a flaw detection image, comprising: performing ray simulation imaging on a three-dimensional model of a cast based on a virtual ray imaging system to obtain a simulation flaw detection image of the cast; performing ray imaging on the cast based on a ray flaw detection system to obtain a real flaw detection image of the cast; the imaging parameters of the virtual ray imaging system and the ray flaw detection system are the same, and the imaging parameters comprise a cast angle, a ray angle and imaging parameters; comparing the simulation flaw detection image and the real flaw detection image to determine defect information of the cast; the defect information comprises the morphology and position of defects; and classifying the defects based on the defect information of the cast. The application can well distinguish the cast structure and the area of the cast defects in the image through the comparison method of the defect-free simulation flaw detection image and the real cast flaw detection image, and the cast structure is not easily included in the false detection range, so that the accuracy of the cast defect detection is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of casting product quality detection, and more particularly relates to a casting defect detection method and system based on a three-dimensional model and a flaw detection image. BACKGROUND

[0002] There are common problems such as "key quality point out of tolerance, large quality fluctuation" in the manufacturing process of complex castings for major equipment in the aviation, aerospace, automobile, rail transportation, engineering machinery and other industries.

[0003] At present, casting industry mainly relies on manual or computer automatic detection of casting X-ray flaw detection images for casting quality detection. Because of the differences in actual process of various casting enterprises, the influencing factors of defect problems are complex, and whether manual or computer detection, the defect detection of castings is prone to missed detection and misdiagnosis, which will greatly affect the actual use of castings or the subsequent process optimization of castings. Due to the overlapping of casting structure and the similar appearance of part defects on the flaw detection image, the computer automatic detection has high misdiagnosis and missed detection rate for these part defects, which is easy to produce large error, resulting in low reliability and poor practicability of casting quality detection, which leads to difficulties in process finding and effective control of casting product quality. SUMMARY

[0004] In view of the defects of the prior art, the purpose of the present application is to provide a casting defect detection method and system based on a three-dimensional model and a flaw detection image, which aims to solve the problem that the existing casting ray flaw detection method is prone to missed detection and misdiagnosis, affecting the actual use of castings or the subsequent process optimization of castings.

[0005] To achieve the above-mentioned purpose, in the first aspect, the present application provides a casting defect detection method based on a three-dimensional model and a flaw detection image, comprising the following steps:

[0006] Based on a virtual ray imaging system, a three-dimensional model of the casting is subjected to ray simulation imaging to obtain a simulation flaw detection image of the casting;

[0007] Based on a ray flaw detection system, a ray image of the casting is obtained to obtain a real flaw detection image of the casting; the imaging parameters of the virtual ray imaging system and the ray flaw detection system are the same, and the imaging parameters include casting angle, ray angle and imaging parameters;

[0008] The simulation flaw detection image and the real flaw detection image are compared to determine the defect information of the casting; the defect information includes the morphology and position of the defect;

[0009] Based on the defect information of the casting, the defect is classified.

[0010] It should be noted that the three-dimensional model of the casting is a defect-free casting model.

[0011] In an optional example, the virtual radiographic imaging system comprises a light source panel, an imaging panel and a rotating disc;

[0012] The light source panel takes the geometric center of the simulated ray light source exit point as the center, establishes a coordinate system of the light source with the geometric center as the origin, and simulates the radiographic imaging process;

[0013] The light source panel and the imaging panel are provided with a cast three-dimensional model; the cast three-dimensional model is composed of a plurality of triangular facets and is built according to the structure of a real cast to be detected;

[0014] The rotating disc is arranged at the bottom of the cast three-dimensional model and is used to rotate the three-dimensional model to adjust the angle of the three-dimensional model relative to the light source panel;

[0015] The imaging panel is used to image the situation after the simulated rays penetrate the cast three-dimensional model.

[0016] In an optional example, based on the virtual radiographic imaging system, a simulated radiographic image of the cast is obtained by radiographically imaging the three-dimensional model of the cast, specifically as follows:

[0017] The intersection of the ray with any plane is determined based on the exit direction of the ray and the propagation distance of the ray;

[0018] Any point in each triangular facet of the three-dimensional model is understood to be obtained by moving along two edges of the triangular facet, and the coordinates of the arbitrary point on the triangular facet are determined based on the proportion of the length of the arbitrary point in the two edge directions to the length of the two edges and the coordinates of the three vertices of the triangular facet;

[0019] The multiple intersections of each ray with the three-dimensional model are determined in combination with the coordinates of the intersection of the ray with any plane and the arbitrary point on the triangular facet, and the thickness of the three-dimensional model penetrated by each ray is determined according to the multiple intersection information of each ray with the three-dimensional model;

[0020] The intensity of each ray after penetrating the three-dimensional model is determined according to the attenuation principle of the ray propagation medium and the thickness of the three-dimensional model penetrated by each ray;

[0021] The simulated radiographic image of the cast is obtained based on the intensity of each ray after penetrating the three-dimensional model.

[0022] In an optional example, the intersection of the ray with any plane is P 1 is: ; wherein, O is the exit point of the ray, D is the exit direction of the ray, t is the propagation distance of the ray.

[0023] In an optional example, three vertices of a triangular facet are A, B and C respectively; and the coordinates of any point on the triangular facet are P 2 are:

[0024]

[0025] wherein, u is the ratio of the length of the point in the AC direction to the length of the AC line segment, v is the ratio of the length of the point in the AB direction to the length of the AB line segment; V 1, V 2 and V 3 are the coordinates of the vertices A, C and B respectively;

[0026] When P 2= P 1, and u > 0, v > 0, u + v < 2 1, the ray intersects with the triangular facet.

[0027] In an optional example, the thickness of the ray penetrating the three-dimensional model is determined according to the intersection information of each ray with the three-dimensional model, specifically as follows:

[0028] The intersection of the ray with each face of the three-dimensional model is determined according to the parameters of the three-dimensional model and the intersection information of the ray with the triangular facet;

[0029] The intersection of the ray with each face of the three-dimensional model is numbered in odd and even numbers along the outgoing direction of the ray, and the odd intersection is the ray incident to the three-dimensional model, and the even intersection is the ray emitted from the three-dimensional model, and the thickness of the ray penetrating the three-dimensional model is determined according to the coordinate difference between the odd and even intersections.

[0030] In an optional example, before comparing the simulated flaw detection image and the real flaw detection image, the following steps are further included:

[0031] The least square method is selected to fit the gray information of the pixel points on the simulated flaw detection image, so as to match the simulated flaw detection image and the real flaw detection image.

[0032] In an optional example, the method further includes the following steps:

[0033] The position of the defect in the three-dimensional model is back calculated based on the defect information obtained by comparison and the parameters of the three-dimensional model of the casting, and the defect in the three-dimensional model is displayed to realize three-dimensional visualization and visualization of the defect.

[0034] In a second aspect, the present application provides a casting defect detection system based on a three-dimensional model and a flaw detection image, comprising:

[0035] The simulation flaw detection unit is configured to perform ray simulation imaging on the three-dimensional model of the casting based on a virtual ray imaging system to obtain a simulation flaw detection image of the casting;

[0036] The real flaw detection unit is configured to perform ray imaging on the casting based on a ray flaw detection system to obtain a real flaw detection image of the casting; the virtual ray imaging system and the ray flaw detection system have the same imaging parameters, and the imaging parameters include a casting angle, a ray angle and imaging parameters;

[0037] The defect positioning unit is configured to compare the simulation flaw detection image and the real flaw detection image to determine defect information of the casting; the defect information includes the appearance and position of the defect;

[0038] The defect classification unit is configured to classify the defect based on the defect information of the casting.

[0039] In an optional example, the virtual ray imaging system used by the simulation flaw detection unit includes a light source panel, an imaging panel and a turntable; the light source panel takes a simulated ray light source exit point as a geometric center, and establishes a light source coordinate system with the geometric center as an origin to simulate a ray imaging process; the light source panel and the imaging panel are provided with a three-dimensional model of the casting; the three-dimensional model of the casting is composed of a plurality of triangular facets and is built according to the structure of a real casting to be detected; the turntable is arranged at the bottom of the three-dimensional model of the casting and is used to rotate the three-dimensional model to adjust the angle of the three-dimensional model relative to the light source panel; and the imaging panel is used to image the situation after the simulated ray penetrates through the three-dimensional model of the casting.

[0040] In a third aspect, the application provides another casting defect detection system based on a three-dimensional model and a flaw detection image, which includes a memory and a processor;

[0041] The memory is configured to store a computer program;

[0042] The processor is configured to implement the method of the first aspect when the computer program is executed.

[0043] In a fourth aspect, the application provides a computer readable storage medium, which stores a computer program; when the computer program is executed by a processor, the method provided in the first aspect is implemented.

[0044] Overall, compared with the prior art, the above technical solutions conceived by the application have the following beneficial effects:

[0045] This invention provides a method and system for detecting casting defects based on a 3D model and flaw detection images. Unlike previous computer deep learning-based target detection algorithms, this invention compares defect-free simulated flaw detection images with actual flaw detection images to identify areas of difference, thus providing a contrast and complement to the target detection algorithm. This invention changes the previous model of optimization through process expert experimentation, reducing production costs and improving casting production efficiency. The comparison method between defect-free simulated flaw detection images and actual casting flaw detection images effectively distinguishes between areas of casting structure and defects in the images, reducing the likelihood of false positives for casting structures. This significantly improves the accuracy of casting defect detection for subsequent manual or computer-based inspections. Furthermore, the invention utilizes a virtual ray imaging system to guide the setting of flaw detection instrument imaging parameters and applies the final results back to the casting model, aiding in process optimization. Attached Figure Description

[0046] Figure 1 This is a flowchart of a casting defect detection method based on a three-dimensional model and flaw detection images provided in an embodiment of the present invention;

[0047] Figure 2a This is a schematic diagram of the virtual ray imaging system model provided in an embodiment of the present invention;

[0048] Figure 2b This is a schematic diagram of a ray passing through a triangular facet of a three-dimensional model of a casting, provided in an embodiment of the present invention.

[0049] Figure 2c This is a schematic diagram of a triangular facet on a three-dimensional model of a casting provided in an embodiment of the present invention;

[0050] Figure 2d This is a schematic diagram of any point on the triangular facet provided in an embodiment of the present invention;

[0051] Figure 3 This is an application flowchart for implementing the casting defect detection function provided in an embodiment of the present invention;

[0052] Figure 4 This is a comparison image of the simulated image and the actual flaw detection image provided in the embodiments of the present invention;

[0053] Figure 5 This is an image illustrating the effect of defect calibration in castings provided by an embodiment of the present invention.

[0054] Figure 6 This is an architecture diagram of a casting defect detection system based on a three-dimensional model and flaw detection images provided in an embodiment of the present invention. Detailed Implementation

[0055] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The following description of at least one example embodiment is merely illustrative in nature and not intended to limit the present application and its applications or uses in any way. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of the present application.

[0056] It should be noted that the terms used herein are only intended to describe specific embodiments and are not intended to limit exemplary embodiments according to the present application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and it should also be understood that the terms "comprise" and / or "include" as used in the specification indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0057] In the description of the present application, it should be understood that the orientation description, such as the orientation or position relationship indicated by up, down, front, back, left, right, etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, and is not intended to indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application.

[0058] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "exemplary embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the exemplary description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the described specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0059] For the calibration problem of casting defects, the purpose of the present application is to provide a casting defect detection method and system based on three-dimensional model and flaw detection image. The three-dimensional model data is designed for the casting product, and the data corresponds to the spatial information of a defect-free casting. The present application starts from the defect-free three-dimensional model data, generates a simulated flaw detection image of the casting, and then compares it with the actual flaw detection image of the casting to obtain the position information of the casting defects in actual production and life, and has a good effect on distinguishing the overlapping situation of casting defects and casting structure, providing a new idea and reference for solving the problem of inaccurate automatic calibration of casting defect position by computer.

[0060] To solve the above problems, the application adopts the following technical solutions:

[0061] 1. A virtual radiographic imaging system based on multi-dimensional information is constructed to simulate the process of radiographic imaging of a casting on an imaging plate, and a simulated flaw detection image is produced based on a three-dimensional model of the casting.

[0062] 2. Based on the position and irradiation parameter information provided by the virtual radiographic imaging system, a more suitable angle and imaging parameter for the casting are found to guide the radiographic flaw detection system to take a photograph and form an image of the casting, and a flaw detection image of the casting at the same irradiation angle and parameter as in the first step is obtained.

[0063] 3. A gray scale fitting curve is constructed according to the simulated flaw detection image, and the simulated image and the real image are automatically matched to make the gray scale value imaging algorithms of the two consistent and reduce the gap between the two.

[0064] 4. Based on the simulated image and the real image, a contrast detection method is used to expose the position of defects in the real image, and the contour and position information of the defect area are obtained.

[0065] 5. The category of the defect is distinguished according to the topographic features and gray scale difference information of the defect area, and the purpose of defect detection is achieved.

[0066] 6. The three-dimensional positioning of the casting defect is inversely solved through the virtual light source system and the position information of the defect.

[0067] Figure 1 A flow chart of a casting defect detection method based on a three-dimensional model and a flaw detection image provided by the embodiment of the application is shown in FIG. 1, and includes the following steps: Figure 1

[0068] S101. Radiographic simulation imaging is performed on the three-dimensional model of the casting based on a virtual radiographic imaging system to obtain a simulated flaw detection image of the casting.

[0069] S102. Radiographic imaging is performed on the casting based on a radiographic flaw detection system to obtain a real flaw detection image of the casting; the imaging parameters of the virtual radiographic imaging system and the radiographic flaw detection system are the same, and the imaging parameters include the casting angle, the radiographic angle and the imaging parameter.

[0070] S103. The simulated flaw detection image and the real flaw detection image are compared to determine the defect information of the casting; the defect information includes the topography and position of the defect.

[0071] S104. The defect is classified based on the defect information of the casting.

[0072] It should be noted that the three-dimensional model of the casting is a defect-free casting model. ​

[0073] Optionally, the virtual radiographic imaging system comprises a light source panel, an imaging panel and a rotating disc;

[0074] The light source panel takes the geometric center of the simulated ray light source exit point as the center to establish a coordinate system of the light source, to simulate the radiographic imaging process;

[0075] A cast three-dimensional model is arranged between the light source panel and the imaging panel; the cast three-dimensional model is composed of a plurality of triangular facets and is built according to the structure of a real cast to be detected;

[0076] The rotating disc is arranged at the bottom of the cast three-dimensional model and is used to rotate the three-dimensional model to adjust the angle of the three-dimensional model relative to the light source panel;

[0077] The imaging panel is used to image the situation after the simulated rays penetrate the cast three-dimensional model.

[0078] In one specific embodiment, the steps of the present application are specifically described as follows:

[0079] 1. Construct a virtual radiographic imaging system, as shown in Figure 2a Fig. 1, a Cartesian coordinate system with the light source as the core is established O l -x l y l z l The geometric center of the light source panel is taken as the origin, and the direction of the light ray is taken as the positive direction; a Cartesian coordinate system with the cast and the workbench as the core is established y l O m -x m y m z m A cylindrical coordinate system with the cast and the workbench as the core is established O m -r m m z m The geometric center of the rotating disc at the bottom of the cast is taken as the coordinate origin, and the normal direction of the rotating disc is taken as the positive direction; a planar rectangular coordinate system with the imaging panel as the core is established z m O i -x i y i ​​, imaging plate coordinates and light source panel oxy correspond, plane normal vector direction and light source coordinates are opposite. Where the casting is represented by its three-dimensional model, below the turntable can realize horizontal 360° rotation, light source plane can be around the casting platform in space.

[0080] 2, in the virtual imaging system to simulate the ray from the imaging panel, according to the parameter equation of the ray, such as Figure 2b , the intersection of the ray and any plane P 1:

[0081]

[0082] Where the starting point coordinates are O (Located on the light source panel), the direction is D (I.e. the normal vector of the light source panel), the intersection of the ray and the three-dimensional model composed of triangular patches (.stl) is obtained, i.e. the intersection of each triangular patch of the three-dimensional model. As shown in Figure 2c , any point in the triangle can be understood as starting from vertex A, moving along edge AB for a distance, then moving along edge AC for a distance, and then their sum vector is the vector from point A to the point. Where the casting three-dimensional model is an STL format file, the STL format file is composed of the definition of multiple triangular patches, and the definition of each triangular patch includes the three-dimensional coordinates of the triangular vertices and the normal vector of the triangular patch.

[0083] Then the parameter equation of any point P2 on the triangle in space is as follows:

[0084]

[0085] Where, as shown in Figure 2d , u , v , the ratio of the distance of the point in the AC direction to the length of the AC line segment and the ratio of the distance of the point in the AB direction to the length of the AB line segment are V 1, V 2 and V 3 are the coordinates of points A, C and B. The above two equations are combined and satisfy u≥ 0, v > 0, u + v < 2 1(i.e. the point is inside the triangle) is the intersection point of the ray and the triangular patch. For each ray and three-dimensional model, the intersection point information is sorted according to the y-axis coordinates, and the odd point coordinates are subtracted from the even point coordinates to obtain the thickness of the ray penetrating the model. Where a casting corresponds to a thickness for a ray, and the thickness of the casting entity is represented here if the casting has a hollow condition.

[0086] According to the X-ray propagation medium attenuation principle, for a single medium object such as a casting, we have:

[0087]

[0088] wherein, I O is the original light intensity of X-ray, µ is the attenuation coefficient of medium, d is the thickness of light through the three-dimensional model of the casting, I is the remaining light intensity after penetration. That is, input the initial light intensity and the attenuation coefficient of the casting material, and the thickness of the ray penetration can be obtained, and the light intensity received on the imaging plate can be obtained. According to the adjustment between the previously established coordinate systems, the imaging angle of the simulated flaw detection image and the angle of the actual flaw detection instrument for shooting can be consistent. According to the ratio of the light intensity of each point of the imaging plate to the maximum light intensity, the gray value is allocated according to 256 levels, and stored as an 8-bit gray image.

[0089] 3. Sampling the gray information on the simulated flaw detection image to make a gray histogram, which is x axis. The gray histogram of the image obtained by the actual flaw detection instrument is extracted, and the gray data at the same position on the actual flaw detection image is listed as y-axis data. The same x value may produce more points at different y values, and the points far away from most y values are removed to avoid the influence of defects on curve fitting. The least square method is selected to fit the gray information of the pixel points on the simulated flaw detection image, and a highly simulated defect-free flaw detection image generated by the three-dimensional model can be obtained. This method is effective for different instruments and different processing modes.

[0090] 4. The simulated flaw detection image and the actual flaw detection image are subjected to median filtering and 3*3 pixel window preprocessing operation to remove the noise points on the image. The subtract function is used to subtract the gray values of the two images. The threshold function is used to set the threshold (10, 255) for the subtracted image to form a binary image after gray value subtraction. The canny function is used to obtain the defect area on the binary image for calibration, and the position corresponding to the actual flaw detection image is obtained, that is, the position of the defect on the casting.

[0091] 5. Based on the obtained contour of the defect area of the casting, the defects are classified and numbered, such as fog, cluster (that is, multiple regions in the calibration result are separated by 5 pixels or less), and the gray value of the defect area is lower than that of the actual flaw detection image, that is, the shrinkage cavity is defined, and multiple defect areas are merged into a single shrinkage cavity defect.

[0092] It can be understood that the classification of the casting defects can be assisted by various classification networks or artificial classification, and the present application does not make any limitation thereon, and the person skilled in the art can select according to the actual needs.

[0093] In one example, the ratio of the longest and shortest sides of two pixels in the defect profile is taken as the basis for judgment, the ratio is greater than 4, and the gray value is lower than that of the actual flaw detection image to be defined as a crack, the gray value is higher than that of the actual flaw detection image to be defined as segregation, and the ratio is lower than 4 and the gray value is higher than that of the actual flaw detection image to be defined as a high-density inclusion. The gray value lower than that of the actual flaw detection image is further distinguished.

[0094] The centroid coordinates of the defect profile are determined. The minimum circumscribed circle and the maximum inscribed circle of the defect profile are taken, and the average of the areas of the two circles is compared with the defect area, and the ratio is k , if k >=2 or k<=0.5, the defect type is determined to be a low-density inclusion, otherwise, the defect is determined to be a pore.

[0095] Other types of defect classification methods can refer to the prior art, and the present application will not be described again.

[0096] The above processing and operation automatically classifies the recognized defect area, and completes the defect detection work of the casting flaw detection image.

[0097] 6. According to the position of the defect area obtained on the two-dimensional image, and the position information of the casting, the light source and the imaging plate, the parameter equation of the ray corresponding to the defect area is obtained, and the parameter equation is intersected on the three-dimensional model of the casting again, and the obtained area is rendered on the three-dimensional model of the casting with different colors to prompt the possible position of the defect, and can be rotated and viewed in the preview window of the three-dimensional model.

[0098] Figure 4 is a comparison chart of the simulation image and the actual flaw detection image provided by the embodiment of the present application; wherein (a)-(d) are respectively a local three-dimensional model, a real flaw detection image of the casting generated by the instrument, an enhanced real flaw detection image and a simulation flaw detection image generated by the present application; it can be known that Figure 4 the present application can generate a casting simulation flaw detection image, and the simulation flaw detection image has a high matching degree with the real flaw detection image, so the present application scheme has strong implementability.

[0099] Figure 5 is an effect diagram of the defect calibration of the casting provided by the embodiment of the present application, wherein (a)-(d) are respectively a complete three-dimensional model of the part, a "defect" position diagram, a simulated flaw detection image on the three-dimensional model and a defect calibration result diagram; it can be known that Figure 5 the present application can effectively identify the defects on the casting using the gray value subtraction method.

[0100] The virtual X-ray imaging system is constructed by fusing position information (angle and distance of the casting) irradiated by a simulated ray source, angle information of the casting, imaging plate position information, simulated light source intensity and other parameters, research on simulation X-ray flaw detection equipment generating simulation images is carried out, and the limitation that the relative position relationship of the existing simulation imaging cannot be quantified among the three (ray source, casting and imaging plate) is broken through; based on the virtual light source imaging system and the three-dimensional model structure feature output imaging position information, research on X-ray flaw detection equipment imaging parameter automatic input is carried out, and the limitation that the imaging quality is unstable by manual parameter adjustment according to the imaging visual effect is broken through.

[0101] The present application constructs a gray scale fitting curve for gray scale correction, carries out research on automatic matching of simulation images and real images, breaks through the limitation that the existing simulation image imaging is idealized and deviates from reality; based on the simulation flaw detection image generated by the three-dimensional casting model and the actual flaw detection image, research on automatic detection and positioning of defects is carried out, and the limitation that the existing deep learning automatic detection only extracts defect features according to the data set, so that the casting body and the defect similar to the defect are difficult to distinguish is broken through.

[0102] Based on the gray scale difference between the simulation image and the flaw detection image and the topographic features of the defect area, research on automatic classification of casting defects is carried out, and the limitation that the existing defect classification method only considers the real flaw detection image and is easily disturbed by the gray scale value of the casting body structure is broken through. Based on the virtual light source imaging system and the defect position information, research on automatic positioning of three-dimensional casting defects is carried out, and the limitation that the existing flaw detection two-dimensional image defect is difficult to be positioned on the three-dimensional casting is broken through.

[0103] Figure 6 The present application is based on the three-dimensional model and the flaw detection image, and the casting defect detection system architecture diagram provided by the embodiment is as shown in Figure 6 , which comprises:

[0104] The simulation flaw detection unit 610 is used for carrying out ray simulation imaging on the three-dimensional model of the casting based on the virtual ray imaging system, and obtaining the simulation flaw detection image of the casting;

[0105] The real flaw detection unit 620 is used for carrying out ray imaging on the casting based on the ray flaw detection system, and obtaining the real flaw detection image of the casting; the imaging parameters of the virtual ray imaging system and the ray flaw detection system are the same, and the imaging parameters include the casting angle, the ray angle and the imaging parameter;

[0106] The defect positioning unit 630 is used for comparing the simulation flaw detection image and the real flaw detection image, and determining the defect information of the casting; the defect information includes the topography and position of the defect;

[0107] The defect classification unit 640 is used for classifying the defects based on the defect information of the casting.

[0108] It can be understood that the detailed function implementation of each unit can refer to the description in the foregoing method embodiments, and will not be described herein.

[0109] In addition, the embodiment of the present application provides another casting defect detection system, which comprises a memory and a processor.

[0110] The memory is configured to store a computer program.

[0111] The processor is configured to implement the method in the foregoing embodiments when executing the computer program.

[0112] In addition, the present application also provides a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the method in the foregoing embodiments.

[0113] Based on the method in the foregoing embodiments, the embodiment of the present application provides a computer program product, which, when running on a processor, causes the processor to execute the method in the foregoing embodiments.

[0114] Based on the method in the foregoing embodiments, the embodiment of the present application also provides a chip comprising one or more processors and an interface circuit. Optionally, the chip can also include a bus. Wherein:

[0115] The processor can be an integrated circuit chip having a processing capability of signals. In the implementation process, each step of the foregoing method can be completed by an integrated logic circuit or an instruction in the form of software in the processor. The processor can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or any conventional processor.

[0116] The interface circuit can be used for sending or receiving data, instructions or information. The processor can process the data, instructions or other information received by the interface circuit, and can send the processed information out through the interface circuit.

[0117] Optionally, the chip also includes a memory, which can include a read-only memory and a random access memory, and provides operation instructions and data for the processor. A part of the memory can also include a non-volatile random access memory (NVRAM).

[0118] Optionally, the memory stores executable software modules or data structures, and the processor can execute corresponding operations by calling operation instructions stored in the memory (the operation instructions can be stored in an operating system).

[0119] Optionally, the interface circuit can be used to output the execution result of the processor.

[0120] It should be noted that the functions of the processor and the interface circuit can be realized by hardware design, software design or a combination of hardware and software, and the present application is not limited in this regard.

[0121] It should be understood that each step of the above method embodiments can be completed by a logic circuit in the form of hardware in the processor or instructions in the form of software.

[0122] It should be understood that the size of the serial number of each step in the above embodiments does not mean the execution order, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, in some possible implementations, each step in the above embodiments can be selectively executed, partially executed or fully executed according to actual conditions, and the present application is not limited in this regard.

[0123] It should be understood that the processor in the embodiments of the present application can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor.

[0124] The method steps in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.

[0125] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0126] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting casting defects based on a three-dimensional model and flaw detection images, characterized in that, Includes the following steps: A virtual ray imaging system is used to perform ray simulation imaging on a three-dimensional model of a casting to obtain a simulated flaw detection image of the casting. Specifically, the intersection point of the ray with any plane is determined based on the ray's emission direction and propagation distance. Any point within each triangular facet of the 3D model is understood as being obtained by moving along the two sides of the facet. The coordinates of any point on the facet are determined based on the ratio of the length of any point in the direction of the two sides to the length of the two sides, and the coordinates of the three vertices of the facet. The multiple intersection points of each ray with the 3D model are determined by combining the intersection points of the ray with any plane and the coordinates of any point on the facet. The thickness of the ray penetrating the 3D model is determined based on the multiple intersection points of each ray with the 3D model. The intensity of each ray after penetrating the 3D model is determined based on the attenuation principle of the ray propagation medium and the thickness of each ray penetrating the 3D model. The simulated flaw detection image of the casting is obtained based on the intensity of each ray after penetrating the three-dimensional model; The casting is imaged using a radiographic flaw detection system to obtain a true flaw detection image of the casting. The virtual X-ray imaging system has the same imaging parameters as the X-ray flaw detection system, including: casting angle, X-ray angle, and imaging parameters. The simulated flaw detection images and the real flaw detection images are compared to determine the defect information of the casting; the defect information includes the shape and location of the defect. Defects are classified based on the defect information of the casting.

2. The method according to claim 1, characterized in that, The virtual ray imaging system includes: a light source panel, an imaging panel, and a turntable; The light source panel establishes a coordinate system for the light source with the emission point of the simulated ray light source as the geometric center and the geometric center as the origin, in order to simulate the ray imaging process. A three-dimensional model of the casting is provided between the light source panel and the imaging panel; the three-dimensional model of the casting is composed of multiple triangular facets and is constructed based on the actual structure of the casting to be detected. The turntable is located at the bottom of the three-dimensional model of the casting and is used to rotate the three-dimensional model to adjust the angle of the three-dimensional model relative to the light source panel. The imaging panel is used to image the situation after simulated rays penetrate the three-dimensional model of the casting.

3. The method according to claim 1, characterized in that, The intersection point P1 of the ray and any plane is: Where O is the emission point of the ray, D is the emission direction of the ray, and t is the propagation distance of the ray.

4. The method according to claim 1, characterized in that, Let the three vertices of the triangular facet be A, B, and C; then the coordinates P2 of any point on the triangular facet are: ; Where u is the ratio of the length of the point in the AC direction to the length of the AC line segment, and v is the ratio of the length of the point in the AB direction to the length of the AB line segment; V 1, V 2 and V 3 represents the coordinates of vertices A, C, and B, respectively; When P2=P1, and u≥0, v≥0, u+v≤1, the ray intersects the triangular facet.

5. The method according to claim 1, characterized in that, The thickness of the ray penetrating the 3D model is determined based on the multiple intersection points of each ray with the 3D model, specifically: The intersection points of the ray with each face of the 3D model are determined based on the parameters of the 3D model and the intersection information of the ray and the triangular facet. The intersection points of the ray with each face of the 3D model are numbered with odd or even numbers along the ray's exit direction. Odd-numbered intersection points indicate that the ray entered the 3D model, while even-numbered intersection points indicate that the ray exited the 3D model. The thickness of the ray penetrating the 3D model is determined based on the coordinate difference between the odd and even-numbered intersection points.

6. The method according to any one of claims 1 to 5, characterized in that, Before comparing simulated flaw detection images with real flaw detection images, the following steps are also included: The least squares method was used to fit the grayscale information of pixels in the simulated flaw detection image in order to match the simulated flaw detection image with the real flaw detection image.

7. A casting defect detection system based on a three-dimensional model and flaw detection images, characterized in that, include: The simulation flaw detection unit is used to perform ray simulation imaging on the three-dimensional model of the casting based on the virtual ray imaging system to obtain the simulation flaw detection image of the casting. Specifically, it determines the intersection point of the ray with any plane based on the ray's emission direction and propagation distance. Any point within each triangular facet of the 3D model is understood as being obtained by moving along the two sides of the facet. The coordinates of any point on the facet are determined based on the ratio of the length of any point in the two sides to the length of the two sides, and the coordinates of the three vertices of the facet. The multiple intersection points of each ray with the 3D model are determined by combining the intersection points of the ray with any plane and the coordinates of any point on the facet. The thickness of the ray penetrating the 3D model is determined based on the multiple intersection points of each ray with the 3D model. The intensity of the ray after penetrating the 3D model is determined based on the attenuation principle of the ray propagation medium and the thickness of the ray penetrating the 3D model. The simulated flaw detection image of the casting is obtained based on the intensity of each ray after penetrating the three-dimensional model; The real flaw detection unit is used to perform X-ray imaging on castings based on the X-ray flaw detection system to obtain real flaw detection images of the castings. The virtual X-ray imaging system has the same imaging parameters as the X-ray flaw detection system, including: casting angle, X-ray angle, and imaging parameters. The defect location unit is used to compare simulated flaw detection images and real flaw detection images to determine the defect information of the casting; the defect information includes the shape and location of the defect. The defect classification unit is used to classify defects based on the defect information of the casting.

8. The casting defect detection system based on a three-dimensional model and flaw detection images according to claim 7, characterized in that, The virtual X-ray imaging system used in the simulated flaw detection unit includes: a light source panel, an imaging panel, and a turntable. The light source panel establishes a coordinate system for the light source with the emission point of the simulated X-ray source as the geometric center and the geometric center as the origin, to simulate the X-ray imaging process. A three-dimensional model of the casting is set between the light source panel and the imaging panel. The three-dimensional model of the casting is composed of multiple triangular facets and is constructed based on the actual structure of the casting to be detected. The turntable is set at the bottom of the three-dimensional model of the casting and is used to rotate the three-dimensional model to adjust the angle of the three-dimensional model relative to the light source panel. The imaging panel is used to image the situation after the simulated X-rays penetrate the three-dimensional model of the casting.

9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is configured to implement the method as described in any one of claims 1-6 when executing the computer program.