Method, device and equipment for detecting and identifying casting defects and storage medium

By matching with historical castings and dividing the inspection area, and combining defect frequency and image feature parameter analysis, the problem of low defect detection efficiency in large-size spherical bearings was solved, and rapid and accurate casting defect detection was achieved.

CN120746987BActive Publication Date: 2026-04-14SEIS (LINXI COUNTY) BEARING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SEIS (LINXI COUNTY) BEARING CO LTD
Filing Date
2025-06-24
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies are inefficient in detecting defects in large-sized spherical bearings, and the increased number of segmented regions leads to excessively long detection times.

Method used

By acquiring images and information of the target casting, matching them with multiple historical castings to determine reference castings, dividing the detection areas into the same locations and quantities, determining the detection order based on the frequency of defects, extracting image feature parameters, and analyzing defect information in conjunction with preset thresholds.

Benefits of technology

It enables rapid location of defective areas in castings, improves inspection efficiency, reduces inspection time for each area, and enhances the accuracy and efficiency of defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120746987B_ABST
    Figure CN120746987B_ABST
Patent Text Reader

Abstract

The application provides a cast defect detection and identification method, device, equipment and storage medium, and belongs to the technical field of image data processing. The method comprises the following steps: obtaining a cast image and cast information of a target cast, and matching the target cast and a plurality of historical casts according to the cast information to determine a plurality of reference casts from the plurality of historical casts; dividing each reference cast into a plurality of detection regions, wherein the number of detection regions of each reference cast is the same and the positions correspond; determining a plurality of to-be-detected regions of the target cast and a detection sequence of the plurality of to-be-detected regions according to the defect frequency of each detection region of each reference cast; sequentially extracting image feature parameters of the plurality of to-be-detected regions from the cast image of the target cast according to the detection sequence of the plurality of to-be-detected regions of the target cast; and determining defect information of the target cast according to the image feature parameters of the plurality of to-be-detected regions. The application can effectively improve the cast defect detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image data processing technology, and in particular relates to methods, apparatus, equipment and storage media for detecting and identifying defects in castings. Background Technology

[0002] Agricultural machinery encompasses multiple stages including tilling, sowing, fertilizing, and harvesting. Its working environment is complex and variable, often facing wear from soil, gravel, and other particles, as well as challenges from heavy loads and vibrations. This necessitates that agricultural machinery components possess high strength, wear resistance, and fatigue resistance to ensure equipment reliability and lifespan. Spherical roller bearings, as key components in agricultural machinery, are widely used in tractor gearboxes, harvester drive shafts, and seeder metering devices due to their self-aligning capability, compact structure, and easy installation. This demonstrates the importance of spherical roller bearings in agricultural machinery.

[0003] Related technologies acquire images of spherical roller bearings and divide them into multiple segments. Then, based on the solid structure factor and probability factor within each segment, a comprehensive analysis is performed to determine defective structural regions, thereby achieving defect detection in spherical roller bearings. However, as the size of the spherical roller bearing increases, the number of segments also increases. At this point, further dividing the bearing image into multiple segments and analyzing them becomes time-consuming, indicating that the efficiency of related technologies in detecting defects in spherical roller bearings is relatively low. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a method, apparatus, equipment, and storage medium for detecting and identifying casting defects.

[0005] In a first aspect, this application provides a method for detecting and identifying defects in castings, including:

[0006] The process involves acquiring the casting image and information of the target casting, matching the target casting with multiple historical castings based on the casting information, and identifying several reference castings from the multiple historical castings.

[0007] Each reference casting is divided into multiple inspection areas, with each reference casting having the same number of inspection areas and corresponding positions.

[0008] Based on the defect frequency of each inspection area of ​​each reference casting, determine multiple inspection areas of the target casting and the inspection sequence of the multiple inspection areas.

[0009] Based on the detection order of multiple regions to be detected in the target casting, image feature parameters of multiple regions to be detected are extracted sequentially from the casting image of the target casting.

[0010] The defect information of the target casting is determined based on the image feature parameters of multiple areas to be detected. The defect information is used to characterize whether the target casting has defects and the type of defects.

[0011] In one embodiment, determining defect information of the target casting based on image feature parameters of multiple areas to be detected includes:

[0012] For each region to be detected, determine whether the image feature parameters of the region to be detected are less than the first preset image feature parameter threshold corresponding to the region to be detected.

[0013] When the image feature parameters of the area to be detected are less than the first preset image feature parameter threshold corresponding to the area to be detected, it is determined that there is a defect in the target casting, and the type of defect in the target casting is determined according to the image feature parameters of all areas to be detected.

[0014] In one embodiment, the image feature parameters include grayscale parameters and gloss parameters. The defect types of the target casting are determined based on the image feature parameters of all areas to be detected, including:

[0015] Obtain the number and coordinates of pixels in each region to be detected from the casting image;

[0016] The average grayscale parameter of each region to be detected is determined based on the number of pixels and the grayscale parameter of each pixel.

[0017] The three-dimensional coordinates of each pixel are constructed based on the coordinates and grayscale parameters of each pixel, and the curvature of each region to be detected is obtained by surface fitting based on the three-dimensional coordinates of each pixel.

[0018] The mean grayscale parameter, curvature, and gloss parameter of each area to be detected are input into multiple preset defect probability networks to obtain the existence probability of each type of defect.

[0019] The defect type corresponding to the maximum probability of existence is determined as the defect type of the target casting.

[0020] In one embodiment, when the defect type is a contour defect, determining the defect type of the target casting based on image feature parameters of all areas to be detected further includes:

[0021] For each region to be detected, the grayscale parameters of each pixel in the region to be detected are compared with the preset grayscale parameter threshold to determine a number of edge pixels. The grayscale parameters of the edge pixels are greater than the preset grayscale parameter threshold.

[0022] Determine the defect contour based on each edge pixel;

[0023] The maximum and minimum axes corresponding to the defect contour are determined based on the defect contour and the pixel coordinates of each edge pixel, and the aspect ratio is determined based on the maximum and minimum axes.

[0024] Determine whether the aspect ratio is within the preset aspect ratio range;

[0025] If the aspect ratio is within the preset aspect ratio range, the defect type is determined to be pitting;

[0026] If the aspect ratio is not within the preset aspect ratio range, the defect type is determined to be a crack.

[0027] In one embodiment, when the image feature parameters of all areas to be detected are greater than or equal to a first preset image feature parameter threshold corresponding to the areas to be detected, it is determined that the target casting has no defects. The method further includes:

[0028] The parameter difference is determined based on the image feature parameters of each region to be detected and the second preset image feature parameter threshold corresponding to each region to be detected;

[0029] Obtain the number of regions in the area to be detected, and calculate the parameter variance based on the differences of each parameter and the number of regions;

[0030] The anomaly level of each region to be detected is determined based on the preset correspondence between parameter variance, parameter variance, and anomaly level.

[0031] Based on the area identifier and anomaly level of each area to be detected, an early warning signal is generated.

[0032] In one embodiment, based on the defect frequency of each inspection area of ​​each reference casting, multiple inspection areas of the target casting and the inspection order of the multiple inspection areas are determined, including:

[0033] Based on the defect frequency corresponding to the detection area in each reference casting, the statistical defect frequency corresponding to the detection area is calculated, where the statistical defect frequency is the average value of the defect frequency corresponding to the detection area in each reference casting.

[0034] Determine whether the statistical defect frequency corresponding to each detection area is less than the preset defect frequency threshold, and determine the detection area with the statistical defect frequency less than the preset defect frequency threshold as a non-reference area, and determine the detection area with the statistical defect frequency greater than or equal to the preset defect frequency threshold as a reference area.

[0035] Based on the statistical defect frequency corresponding to each reference area and the correspondence between detection priority and defect frequency, the detection priority corresponding to each reference area is determined.

[0036] The detection sequence of multiple areas to be detected in the target casting is determined based on the detection priority corresponding to each reference area.

[0037] In one embodiment, after determining the defect information of the target casting based on image feature parameters of multiple areas to be detected, the method further includes:

[0038] The variation value of each defect type is determined based on the defect frequency corresponding to multiple preset durations;

[0039] Determine the changing trend of each defect type based on the change value of each defect type;

[0040] When the trend of any defect type is a preset trend, determine the associated process corresponding to the defect type;

[0041] Early warning signals are generated based on the associated processes and defect types, and then sent to the equipment on the maintenance personnel's side.

[0042] Secondly, this application provides a casting defect detection and identification device, which adopts the following technical solution:

[0043] A casting defect detection and identification device, comprising:

[0044] The reference casting determination module is used to acquire the casting image and casting information of the target casting, and match the target casting with multiple historical castings based on the casting information to determine several reference castings from the multiple historical castings.

[0045] The region division module is used to divide each reference casting into multiple inspection regions, wherein the number of inspection regions for each reference casting is the same and their positions correspond;

[0046] The inspection sequence determination module is used to determine multiple inspection areas of the target casting and the inspection sequence of the multiple inspection areas based on the defect frequency of each inspection area of ​​each reference casting.

[0047] The extraction module is used to extract image feature parameters of multiple regions to be detected from the casting image of the target casting in sequence according to the detection order of multiple regions to be detected in the target casting.

[0048] The defect information determination module is used to determine the defect information of the target casting based on the image feature parameters of multiple areas to be detected. The defect information is used to characterize whether the target casting has defects and the type of defects.

[0049] Thirdly, this application provides an electronic device that adopts the following technical solution:

[0050] At least one processor;

[0051] Memory;

[0052] At least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, the at least one application being configured to: perform the method for detecting and identifying casting defects as described in any of the first aspects.

[0053] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution:

[0054] A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform a method for detecting and identifying casting defects as described in any of the first aspects.

[0055] In summary, this application includes the following beneficial technical effects:

[0056] The process involves acquiring the casting image and information of the target casting, and matching the casting information with multiple historical castings to determine a reference casting for rapid location of defect areas. The reference casting is divided into multiple detection areas, and the detection order of each area in the target casting is determined based on the defect frequency of the detection areas. When castings are identical, the probability of surface defects appearing in the same area is higher; therefore, determining the detection order based on the reference casting allows for faster location of defective areas. Image feature parameters are extracted sequentially from the target casting based on the detection order of the areas to be detected and the casting image, and analyzed in conjunction with a first preset image feature parameter threshold to achieve rapid location of defect information in the target casting. Compared to related technologies that divide the casting into multiple areas and spend a considerable amount of time detecting each area, this embodiment can achieve rapid location of suspected defective areas based on the reference casting, and then determine the defect information based on the first preset image feature parameter threshold, effectively improving defect detection efficiency. Attached Figure Description

[0057] Figure 1 A flowchart illustrating a method for detecting and identifying casting defects provided in an embodiment of this application;

[0058] Figure 2 A schematic diagram of a casting with crack defects provided in an embodiment of this application;

[0059] Figure 3 This is a schematic diagram of the structure of a casting defect detection and identification device provided in an embodiment of this application;

[0060] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0061] The following is in conjunction with the appendix Figure 1 To be continued Figure 4This application will be described in further detail.

[0062] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application are described clearly and completely. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0063] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0064] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.

[0065] The casting defect detection and identification method provided in this application is executed by an electronic device, which can be a server or a terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. Figure 1 As shown, the method for detecting and identifying defects in castings includes the following steps.

[0066] Step S1: Obtain the casting image and casting information of the target casting, and match the target casting with multiple historical castings based on the casting information to determine several reference castings from the multiple historical castings.

[0067] Specifically, the casting can be a bearing or spherical bearing with a base in agricultural machinery; there can be multiple casting images, and a complete three-dimensional model of the target casting can be constructed from multiple casting images; historical castings are castings that have been found to have defects within a preset time period, and the preset time period in this application embodiment can be three months; the casting information includes the first casting model and the first production date of the target casting.

[0068] In one possible implementation, the casting image and casting information can be acquired upon receiving an acquisition request. A monitoring program is pre-integrated into the electronic device to monitor the triggering of acquisition requests. Once an acquisition request is detected, the acquisition operation is executed. For example, an acquisition request is triggered when the user determines whether a defect exists in the target casting. The triggering method could include the user clicking an acquisition button on the electronic device or triggering it via voice. Once the electronic device detects that the user has triggered the acquisition request, it executes the acquisition operation.

[0069] One possible implementation is to perform batch defect detection and identification on the castings. For example, after the castings are completed, they are transported to a rotary inspection platform. The rotary inspection platform is equipped with multiple industrial cameras, which are used to collect multiple images of the target castings.

[0070] The process of determining reference castings based on casting information includes: determining a set of production dates based on a first production date and a preset duration. For example, when the first production date is September 8th and the preset duration is 3 months, the corresponding set of production dates is from June 8th to September 8th; obtaining the second production dates corresponding to each of multiple historical castings, and determining several first historical castings located within the production date set based on the set of production dates and the second production dates; then obtaining the second casting model of each first historical casting, matching the first casting model of the target casting with the second casting model of each first historical casting, and determining the first historical castings whose second casting model is the same as the first casting model as the reference casting.

[0071] Step S2: Divide each reference casting into multiple inspection areas, wherein the number of inspection areas for each reference casting is the same and their positions correspond.

[0072] Specifically, image segmentation algorithms can be used for partitioning, but the embodiments of this application do not limit the specific partitioning process.

[0073] Step S3: Based on the defect frequency of each inspection area of ​​each reference casting, determine multiple inspection areas of the target casting and the inspection sequence of the multiple inspection areas.

[0074] Specifically, in the embodiments of this application, both the reference casting and the target casting are divided into the same number and the same shape of detection areas.

[0075] Specifically, based on the defect frequency of each inspection area of ​​each reference casting, multiple inspection areas of the target casting and the inspection sequence of these areas are determined, including:

[0076] Based on the defect frequency corresponding to the detection area in each reference casting, the statistical defect frequency corresponding to the detection area is calculated, where the statistical defect frequency is the average value of the defect frequency corresponding to the detection area in each reference casting.

[0077] Determine whether the statistical defect frequency corresponding to each detection area is less than the preset defect frequency threshold, and determine the detection area with the statistical defect frequency less than the preset defect frequency threshold as a non-reference area, and determine the detection area with the statistical defect frequency greater than or equal to the preset defect frequency threshold as a reference area.

[0078] Based on the statistical defect frequency corresponding to each reference area and the correspondence between detection priority and defect frequency, the detection priority corresponding to each reference area is determined.

[0079] The detection sequence of multiple areas to be detected in the target casting is determined based on the detection priority corresponding to each reference area.

[0080] Preferably, the preset defect frequency threshold is 2. It is understood that randomness and error may occur during actual inspection; therefore, it is necessary to screen inspection areas with lower statistical defect frequencies. That is, when the statistical defect frequency of an inspection area is low, it can be considered that the inspection area has no defects. In this embodiment, the inspection priority of inspection areas with high statistical defect frequencies is higher than that of inspection areas with low statistical defect frequencies. By prioritizing the inspection of inspection areas with higher statistical defect frequencies, defects in the target casting can be detected more quickly. Compared to inspecting the entire area to be inspected in the target casting, this application can detect whether there are defects in the target casting by referring to a local area, effectively improving inspection efficiency.

[0081] The calculation process for the statistical defect frequency includes: obtaining the number of castings of the reference casting and the total defect frequency of each inspection area, and obtaining the average defect frequency based on the formula for calculating the number of castings, the total defect frequency, and the mean, and then determining the average defect frequency as the statistical defect frequency.

[0082] Step S4: Based on the detection order of multiple areas to be detected in the target casting, extract the image feature parameters of multiple areas to be detected from the casting image of the target casting.

[0083] Specifically, image feature parameters include grayscale parameters and glossiness parameters.

[0084] The process of extracting grayscale parameters from the casting image of the target casting includes: converting the casting image from color mode to grayscale mode, and then reading the grayscale value of each pixel in the casting image.

[0085] The specific process of extracting gloss parameters includes: for each area to be detected, calculating the average gray value based on the gray value of each pixel in the area to be detected, inputting the average gray value into a preset gloss formula, and obtaining the gloss. In this embodiment, the preset gloss formula is the standard deviation calculation formula.

[0086] Understandably, analysis of historical data reveals that scratches, contour defects, and deformation defects are all frequently occurring defects during the casting production process. When scratches occur, they impair the surface gloss of the casting, reducing its ability to reflect light; therefore, gloss is a crucial factor. Contour defects, on the other hand, are represented in images as discontinuous or uneven distribution of grayscale values, meaning that the grayscale values ​​of pixels in the defect area differ significantly from those in the surrounding area. Figure 2 The image shown is a schematic diagram of the surface of a casting with cracks, provided in an embodiment of this application.

[0087] Step S5: Determine the defect information of the target casting based on the image feature parameters of multiple areas to be detected. The defect information is used to characterize whether the target casting has defects and the type of defects.

[0088] Specifically, the process of determining the defect information of the target casting based on image feature parameters can be found in the following embodiments.

[0089] Furthermore, after determining the defect information of the target casting based on the image feature parameters of multiple areas to be detected, the process also includes:

[0090] The variation value of each defect type is determined based on the defect frequency corresponding to multiple preset durations;

[0091] Determine the changing trend of each defect type based on the change value of each defect type;

[0092] When the trend of any defect type is a preset trend, determine the associated process corresponding to the defect type;

[0093] Early warning signals are generated based on the associated processes and defect types, and then sent to the equipment on the maintenance personnel's side.

[0094] Specifically, in this embodiment, the preset trend is an upward trend; the warning signal can be in text form. For example, for crack defects, the frequency of the first defect from January to March, the frequency of the second defect from April to June, and the frequency of the third defect from June to September can be obtained respectively. A first change value is determined based on the first and second defect frequencies, and a second change value is determined based on the second and third defect frequencies. The first and second change values ​​are compared. If the latter change value is greater than the former change value (i.e., the second change value is greater than the first change value), it indicates that the trend of the crack defect is an upward trend. Based on the correspondence between defect type, defect type, and manufacturing process, the associated process corresponding to the defect type is determined. In this embodiment, each defect type can correspond to multiple associated processes or a single associated process. For example, when the defect type is a crack defect, the associated processes can be cooling process and molding process. The warning signal is then sent to maintenance personnel so that they can carry out timely repairs.

[0095] Based on the above embodiments, the casting image and casting information of the target casting are obtained, and a reference casting is determined by matching the casting information with multiple historical castings, so as to quickly locate the defect area through the reference casting; the reference casting is divided into multiple detection areas, and the detection order of each detection area in the target casting is determined according to the defect frequency of the detection area. When the castings are the same, the probability of surface defects appearing in the same area is higher. Therefore, determining the detection order based on the reference casting can locate the defective area more quickly; according to the detection order of the detection area and the casting image, image feature parameters are extracted from the target casting in sequence, and analyzed in combination with the first preset image feature parameter threshold to achieve rapid location of defect information of the target casting. Compared with the related technology, which divides the casting into multiple areas and spends a long time to detect each area, the embodiments of this application can achieve rapid location of suspected defective areas based on the reference casting, and then determine the defect information based on the first preset image feature parameter threshold, so as to effectively improve the defect detection efficiency.

[0096] One possible implementation of this application embodiment involves determining the defect information of a target casting based on image feature parameters of multiple areas to be detected, including:

[0097] For each region to be detected, determine whether the image feature parameters of the region to be detected are less than the first preset image feature parameter threshold corresponding to the region to be detected.

[0098] When the image feature parameters of the area to be detected are less than the first preset image feature parameter threshold corresponding to the area to be detected, the target casting is determined to have a defect, and the type of defect of the target casting is determined according to the image feature parameters of all areas to be detected.

[0099] Specifically, the first preset image feature parameter threshold is set in advance by the technician and input into the electronic device, and the first preset image feature parameter threshold is the image feature parameter corresponding to the casting without defects.

[0100] The image feature parameters are compared one by one with the corresponding first preset image feature parameter thresholds. When the image feature parameter is less than the corresponding first preset image feature parameter threshold, it indicates that there is a difference between the target casting and the casting without defects. This difference is caused by defects, so it is determined that the target casting has defects. Further, the specific process of determining the type of defect based on the target image feature parameters can be referred to in the following embodiment. If the image feature parameters of the area to be detected are greater than or equal to the first preset image feature parameter threshold corresponding to the area to be detected, it indicates that the image feature parameters of the target casting are all within the normal range. Therefore, it can be determined that the target casting has no defects.

[0101] Based on the above embodiments, the difference between the target casting and the normal casting is determined by comparing the image feature parameters and the first preset image feature parameter threshold. When the image feature parameters are less than the first preset image feature parameter threshold, it indicates that there is a difference between the target casting and the normal casting, and therefore it can be determined that the target casting has a defect. Otherwise, it is determined that the target casting does not have a defect. It can be seen that this application directly locates the defect information of the target casting by data comparison, which effectively improves the efficiency of determining the casting defect information.

[0102] One possible implementation of this application embodiment includes image feature parameters such as grayscale parameters and glossiness parameters. The defect types of the target casting are determined based on the image feature parameters of all areas to be detected, including:

[0103] Obtain the number and coordinates of pixels in each region to be detected from the casting image;

[0104] The average grayscale value of the region to be detected is determined based on the number of pixels and the grayscale parameters of each pixel.

[0105] The three-dimensional coordinates of each pixel are constructed based on the coordinates and grayscale parameters of each pixel, and the curvature of each region to be detected is obtained by surface fitting based on the three-dimensional coordinates of each pixel.

[0106] The mean grayscale parameter, curvature, and gloss parameter of each area to be detected are input into multiple preset defect probability networks to obtain the existence probability of each type of defect.

[0107] The defect type corresponding to the maximum probability of existence is determined as the defect type of the target casting.

[0108] Specifically, preferably, the preset defect probability network is a Bayesian network, which is constructed based on multiple historical data. This application embodiment does not limit the specific construction process of the Bayesian network.

[0109] The process involves several steps. First, a two-dimensional coordinate system (established based on the casting image) is used to obtain the coordinates of each pixel. Then, the average grayscale parameter value corresponding to each region to be detected is calculated using the average value calculation formula. The grayscale value of each pixel is determined as the height value in the pixel coordinate system. The height value and pixel coordinates are combined to construct the three-dimensional coordinate system. The determination of the curvature of each region to be detected specifically includes: constructing a surface equation (which includes multiple unknown coefficients); obtaining multiple historical pixel coordinates (which can be the coordinates of pixels from historical castings); using the least squares method to fit the multiple historical pixel coordinates to the surface equation to obtain the coefficients of the surface equation; and then taking the second-order partial derivative of the surface equation to obtain the curvature of each region to be detected. The mean grayscale parameter, curvature, and gloss parameter are input respectively to obtain the existence probability of each defect type in each area to be detected. The mean existence probability of each defect type is calculated based on the mean existence probability of each defect type, and the mean existence probability is determined as the existence probability of the defect. Then, the existence probabilities of each defect type are compared, and the defect type corresponding to the maximum existence probability is determined as the defect type of the target casting.

[0110] Based on the above embodiments, the number and coordinates of pixels are obtained from the casting image, and the mean grayscale parameter is determined according to the number of pixels and the grayscale parameter of the pixels. Then, the three-dimensional coordinates of each pixel are constructed, and surface fitting is performed according to the three-dimensional coordinates to obtain the curvature of each area to be detected. Then, the mean grayscale parameter, curvature and gloss parameter are input into the preset defect probability network to obtain the existence probability of each defect type to achieve rapid determination of the existence probability of each defect type. The existence probabilities corresponding to each defect type are compared to determine the defect type of the target casting.

[0111] One possible implementation of this application embodiment, when the defect type is a contour defect, further includes determining the defect type of the target casting based on the image feature parameters of all areas to be detected, and also includes:

[0112] For each region to be detected, the grayscale parameters of each pixel in the region to be detected are compared with the preset grayscale parameter threshold to determine a number of edge pixels. The grayscale parameters of the edge pixels are greater than the preset grayscale parameter threshold.

[0113] Determine the defect contour based on each edge pixel;

[0114] The maximum and minimum axes corresponding to the defect contour are determined based on the defect contour and the pixel coordinates of each edge pixel, and the aspect ratio is determined based on the maximum and minimum axes.

[0115] Determine whether the aspect ratio is within the preset aspect ratio range;

[0116] If the aspect ratio is within the preset aspect ratio range, the defect type is determined to be pitting;

[0117] If the aspect ratio is not within the preset aspect ratio range, the defect type is determined to be a crack.

[0118] Specifically, the preset grayscale threshold is the grayscale value of a casting without defects. Both the preset grayscale threshold and the preset aspect ratio range are preset by technicians. Preferably, in this embodiment, the preset aspect ratio range is [0.8, 1.2].

[0119] Connect the edge pixels to form the defect contour. The specific process of determining the maximum axis includes: calculating the average coordinates (x-axis average and y-axis average) based on the number of edge pixels and their coordinates, and using these averages as the centroid coordinates; centering each pixel coordinate relative to the centroid to construct a covariance matrix; and performing eigenvalue decomposition on the covariance matrix to obtain the direction vectors of the maximum and minimum axes; finding the two edge pixels farthest from the centroid on the defect contour along the direction of the maximum axis vector, and determining the distance between these two edge pixels as the maximum axis; the process of determining the minimum axis is the same as that of determining the maximum axis. If the length-to-diameter ratio is within the preset range, it indicates that the difference between the largest and smallest axes is small, meaning the contour shape is close to a circle, and the defect type can be identified as pitting. If the length-to-diameter ratio is not within the preset range, it indicates that the contour shape is irregular, and the defect type is identified as a crack. It is understandable that when the defect type of the target casting is determined to be a contour defect, the defect may be either pitting or a crack. To facilitate timely and targeted repairs by maintenance personnel, it is necessary to further determine the defect type based on the length-to-diameter ratio of the contour.

[0120] Based on the above embodiments, grayscale parameters are compared with a preset grayscale parameter threshold to determine edge pixels, and then the defect contour is determined based on the edge pixels, so as to further subdivide the category corresponding to the defect contour using the defect contour as a reference. The maximum axis and minimum axis are determined based on the defect contour and pixel coordinates, and the aspect ratio is determined based on the maximum axis and minimum axis. The aspect ratio is compared with a preset aspect ratio range. When the aspect ratio is within the preset aspect ratio range, it indicates that the defect contour is close to a circle, so the defect type is determined as pitting; otherwise, it indicates that the defect contour is irregular, so the defect type is determined as crack. By further refining the contour defect type through aspect ratio, the accuracy of contour defect type determination is effectively improved.

[0121] One possible implementation of this application embodiment, when the image feature parameters of all areas to be detected are greater than or equal to the first preset image feature parameter threshold corresponding to the areas to be detected, determines that the target casting has no defects, further includes:

[0122] The parameter difference is determined based on the image feature parameters of each region to be detected and the corresponding second preset image feature parameter threshold.

[0123] Obtain the number of regions in the area to be detected, and calculate the parameter variance based on the differences of each parameter and the number of regions;

[0124] The anomaly level of each region to be detected is determined based on the correspondence between parameter variance, parameter variance, and anomaly level.

[0125] Based on the area identifier and anomaly level of each area to be detected, an early warning signal is generated.

[0126] Specifically, the second preset image feature parameter threshold is the minimum image feature parameter in the set of image feature parameters corresponding to the casting area of ​​a casting in an abnormal state (an abnormal state is between a normal state and a defective state, i.e., the casting shows a tendency to develop defects). For each category of image feature parameters, the parameter difference between each image feature parameter and its corresponding minimum value is calculated, and the parameter difference is normalized. The parameter variance is calculated based on the number of regions to be detected, the variance calculation formula, and all parameter differences. This embodiment does not limit the specific calculation process of the parameter variance. For each region to be detected, the correspondence between the parameter variance, the anomaly level, and the parameter variance is matched to obtain the anomaly level corresponding to each region to be detected. In this embodiment, the anomaly level increases with the increase of the parameter variance. It is understood that the image feature parameters of a casting in an abnormal state are not within the normal parameter range, but are close to the normal parameters. Furthermore, the warning signal can be in text form or image form; when in text form, it can be "There is an anomaly in the area to be detected, and the anomaly level is 1"; when in image form, the area to be detected with an anomaly can be marked with the text "There is an anomaly in the area to be detected".

[0127] Based on the above embodiments, the parameter difference is determined according to the image feature parameters and the second preset image feature parameter threshold; and the parameter variance is obtained according to the parameter difference and the number of regions to be detected, so as to accurately measure the degree of parameter change through the parameter variance. When the parameter change is unstable, it indicates that although there is no defect in the casting, there is an anomaly that needs to be paid attention to. Therefore, the anomaly level is determined according to the parameter variance, and an early warning signal is generated according to the anomaly level to avoid misjudgment.

[0128] The above embodiments describe a method for detecting and identifying casting defects from the perspective of process flow. The following embodiments describe a device for detecting and identifying casting defects from the perspective of virtual modules or virtual units. For details, please refer to the following embodiments.

[0129] This application provides a casting defect detection and identification device, such as... Figure 3 As shown, the casting defect detection and identification device may specifically include:

[0130] The reference casting determination module 201 is used to acquire the casting image and casting information of the target casting, and match the target casting with multiple historical castings based on the casting information to determine several reference castings from the multiple historical castings.

[0131] The region division module 202 is used to divide each reference casting into multiple detection regions, wherein the number of detection regions for each reference casting is the same and their positions correspond.

[0132] The detection sequence determination module 203 is used to determine multiple areas to be detected in the target casting and the detection sequence of the multiple areas to be detected based on the defect frequency of each detection area of ​​each reference casting.

[0133] The extraction module 204 is used to extract image feature parameters of multiple regions to be detected sequentially from the casting image of the target casting according to the detection order of multiple regions to be detected in the target casting.

[0134] The defect information determination module 205 is used to determine the defect information of the target casting based on the image feature parameters of multiple areas to be detected. The defect information is used to characterize whether the target casting has defects and the type of defects.

[0135] Based on the above embodiments, the casting image and casting information of the target casting are obtained, and a reference casting is determined by matching the casting information with multiple historical castings, so as to quickly locate the defect area through the reference casting; the reference casting is divided into multiple detection areas, and the detection order of each detection area in the target casting is determined according to the defect frequency of the detection area. When the castings are the same, the probability of surface defects appearing in the same area is higher. Therefore, determining the detection order based on the reference casting can locate the defective area more quickly; according to the detection order of the detection area and the casting image, image feature parameters are extracted from the target casting in sequence, and analyzed in combination with the first preset image feature parameter threshold to achieve rapid location of defect information of the target casting. Compared with the related technology, which divides the casting into multiple areas and spends a long time to detect each area, the embodiments of this application can achieve rapid location of suspected defective areas based on the reference casting, and then determine the defect information based on the first preset image feature parameter threshold, so as to effectively improve the defect detection efficiency.

[0136] In one possible implementation of this application embodiment, when the defect information determination module 205 determines the defect information of the target casting based on image feature parameters of multiple areas to be detected, it is specifically used for:

[0137] For each region to be detected, determine whether the image feature parameters of the region to be detected are less than the first preset image feature parameter threshold corresponding to the region to be detected.

[0138] When the image feature parameters of the area to be detected are less than the first preset image feature parameter threshold corresponding to the area to be detected, it is determined that there is a defect in the target casting, and the type of defect in the target casting is determined according to the image feature parameters of all areas to be detected.

[0139] In one possible implementation of this application embodiment, the image feature parameters include: grayscale parameters and glossiness parameters. When the defect information determination module 205 determines the defect type of the target casting based on the image feature parameters of all areas to be detected, it is used to:

[0140] Obtain the number and coordinates of pixels in each region to be detected from the casting image;

[0141] The average grayscale parameter of each region to be detected is determined based on the number of pixels and the grayscale parameter of each pixel.

[0142] The three-dimensional coordinates of each pixel are constructed based on the coordinates and grayscale parameters of each pixel, and the curvature of each region to be detected is obtained by surface fitting based on the three-dimensional coordinates of each pixel.

[0143] The mean grayscale parameter, curvature, and gloss parameter of each area to be detected are input into multiple preset defect probability networks to obtain the existence probability of each type of defect.

[0144] The defect type corresponding to the maximum probability of existence is determined as the defect type of the target casting.

[0145] In one possible implementation of this application embodiment, when the defect type is a contour defect, the defect information determination module 205, when determining the defect type of the target casting based on the image feature parameters of all areas to be detected, is specifically used for:

[0146] For each region to be detected, the grayscale parameters of each pixel in the region to be detected are compared with the preset grayscale parameter threshold to determine a number of edge pixels. The grayscale parameters of the edge pixels are greater than the preset grayscale parameter threshold.

[0147] Determine the defect contour based on each edge pixel;

[0148] The maximum and minimum axes corresponding to the defect contour are determined based on the defect contour and the pixel coordinates of each edge pixel, and the aspect ratio is determined based on the maximum and minimum axes.

[0149] Determine whether the aspect ratio is within the preset aspect ratio range;

[0150] If the aspect ratio is within the preset aspect ratio range, the defect type is determined to be pitting;

[0151] If the aspect ratio is not within the preset aspect ratio range, the defect type is determined to be a crack.

[0152] In one possible implementation of this application embodiment, when the image feature parameters of all areas to be detected are greater than or equal to the first preset image feature parameter threshold corresponding to the areas to be detected, it is determined that the target casting has no defects. The casting defect detection and identification device further includes:

[0153] The exception alert module is used for:

[0154] The parameter difference is determined based on the image feature parameters of each region to be detected and the second preset image feature parameter threshold corresponding to each region to be detected;

[0155] Obtain the number of regions in the area to be detected, and calculate the parameter variance based on the differences of each parameter and the number of regions;

[0156] The anomaly level of each region to be detected is determined based on the preset correspondence between parameter variance, parameter variance, and anomaly level.

[0157] Based on the area identifier and anomaly level of each area to be detected, an early warning signal is generated.

[0158] In one possible implementation of this application embodiment, when the detection sequence determination module 203 determines multiple areas to be detected in the target casting and the detection order of the multiple areas to be detected based on the defect frequency of each detection area of ​​each reference casting, it is specifically used for:

[0159] Based on the defect frequency corresponding to the detection area in each reference casting, the statistical defect frequency corresponding to the detection area is calculated, where the statistical defect frequency is the average value of the defect frequency corresponding to the detection area in each reference casting.

[0160] Determine whether the statistical defect frequency corresponding to each detection area is less than the preset defect frequency threshold, and determine the detection area with the statistical defect frequency less than the preset defect frequency threshold as a non-reference area, and determine the detection area with the statistical defect frequency greater than or equal to the preset defect frequency threshold as a reference area.

[0161] Based on the statistical defect frequency corresponding to each reference area and the correspondence between detection priority and defect frequency, the detection priority corresponding to each reference area is determined.

[0162] The detection sequence of multiple areas to be detected in the target casting is determined based on the detection priority corresponding to each reference area.

[0163] One possible implementation of this application embodiment, the casting defect detection and identification device, further includes:

[0164] Related process early warning signals are used for:

[0165] The variation value of each defect type is determined based on the defect frequency corresponding to multiple preset durations;

[0166] Determine the changing trend of each defect type based on the change value of each defect type;

[0167] When the trend of any defect type is a preset trend, determine the associated process corresponding to the defect type;

[0168] Early warning signals are generated based on the associated processes and defect types, and then sent to the equipment on the maintenance personnel's side.

[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the casting defect detection and identification device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0170] This application provides an electronic device, such as... Figure 4 As shown, Figure 4 The illustrated electronic device includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, via a bus 302. Optionally, the electronic device may also include a transceiver 304. It should be noted that in practical applications, the transceiver 304 is not limited to one type, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.

[0171] Processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0172] Bus 302 may include a pathway for transmitting information between the aforementioned components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 302 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0173] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0174] The memory 303 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the foregoing method embodiments.

[0175] Electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Servers can also be included. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0176] This application provides a computer-readable storage medium storing a computer program. When the program is run on a computer, it enables the computer to execute the corresponding content in the aforementioned method embodiments. Compared with related technologies, this application acquires the casting image and casting information of the target casting, and determines a reference casting by matching the casting information with multiple historical castings, so as to quickly locate the defect area through the reference casting. The reference casting is divided into multiple detection areas, and the detection order of each detection area in the target casting is determined according to the defect frequency of the detection areas. When the castings are the same, the probability of surface defects appearing in the same area is higher. Therefore, determining the detection order based on the reference casting can locate the defective area more quickly. According to the detection order of the detection areas and the casting image, image feature parameters are extracted from the target casting in sequence, and analyzed in combination with a first preset image feature parameter threshold to achieve rapid location of defect information of the target casting. Compared with related technologies that divide the casting into multiple areas and spend a long time detecting each area, this application can achieve rapid location of suspected defective areas based on the reference casting, and then determine the defect information based on the first preset image feature parameter threshold, so as to effectively improve the defect detection efficiency.

[0177] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0178] The above description is only a partial embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for detecting and identifying defects in castings, characterized in that, include: The casting image and casting information of the target casting are obtained, and the target casting is matched with multiple historical castings based on the casting information. Several reference castings are determined from the multiple historical castings. The casting information includes the first casting model and the first production date of the target casting. Each of the reference castings is divided into multiple detection areas, wherein the number of detection areas for each reference casting is the same and their positions correspond; Based on the defect frequency of each detection area of ​​each reference casting, multiple detection areas of the target casting and the detection order of the multiple detection areas are determined. Based on the detection order of the plurality of areas to be detected in the target casting, image feature parameters of the plurality of areas to be detected are sequentially extracted from the casting image of the target casting. The image feature parameters include grayscale parameters and gloss parameters. The defect information of the target casting is determined based on the image feature parameters of the multiple areas to be detected. The defect information is used to characterize whether the target casting has defects and the type of defects. The step of determining multiple areas to be inspected in the target casting and the inspection order of the multiple areas to be inspected based on the defect frequency of each inspection area of ​​each reference casting includes: Based on the defect frequency corresponding to the detection area in each of the reference castings, the statistical defect frequency corresponding to the detection area is calculated, wherein the statistical defect frequency is the average value of the defect frequency corresponding to the detection area in each of the reference castings. Determine whether the statistical defect frequency corresponding to each detection area is less than a preset defect frequency threshold, and determine the detection area where the statistical defect frequency is less than the preset defect frequency threshold as a non-reference area, and determine the detection area where the statistical defect frequency is greater than or equal to the preset defect frequency threshold as a reference area. Based on the statistical defect frequency corresponding to each reference area and the correspondence between detection priority and defect frequency, the detection priority corresponding to each reference area is determined. The detection order of the plurality of areas to be detected in the target casting is determined according to the detection priority corresponding to each of the reference areas; The step of determining the defect information of the target casting based on the image feature parameters of the plurality of areas to be detected includes: For each region to be detected, determine whether the image feature parameters of the region to be detected are less than the first preset image feature parameter threshold corresponding to the region to be detected. When the image feature parameters of the area to be detected are less than the first preset image feature parameter threshold corresponding to the area to be detected, it is determined that the target casting has a defect, and the type of defect of the target casting is determined according to the image feature parameters of all the areas to be detected.

2. The method for detecting and identifying casting defects as described in claim 1, characterized in that, The image feature parameters include grayscale parameters and gloss parameters. Determining the defect type of the target casting based on the image feature parameters of all the areas to be detected includes: The number and coordinates of pixels in each of the regions to be detected are obtained from the image of the casting. The average grayscale parameter of each region to be detected is determined based on the number of pixels and the grayscale parameter of each pixel. The three-dimensional coordinates of each pixel are constructed based on the coordinates and grayscale parameters of each pixel, and the curvature of each region to be detected is obtained by surface fitting based on the three-dimensional coordinates of each pixel. The mean grayscale parameter, curvature and gloss parameter of each of the regions to be detected are input into multiple preset defect probability networks to obtain the existence probability of each defect type. The defect type corresponding to the maximum probability of existence is determined as the defect type of the target casting.

3. The method for detecting and identifying casting defects as described in claim 2, characterized in that, When the defect type is a contour defect, determining the defect type of the target casting based on the image feature parameters of all the areas to be detected further includes: For each of the regions to be detected, the grayscale parameters of each pixel in the region to be detected are compared with a preset grayscale parameter threshold to determine a number of edge pixels, wherein the grayscale parameters of the edge pixels are greater than the preset grayscale parameter threshold. Determine the defect contour based on each of the edge pixels; The maximum and minimum axes corresponding to the defect contour are determined based on the defect contour and the pixel coordinates of each edge pixel, and the aspect ratio is determined based on the maximum and minimum axes. Determine whether the aspect ratio is within a preset aspect ratio range; If the aspect ratio is within a preset aspect ratio range, then the defect type is determined to be pitting; If the aspect ratio is not within the preset aspect ratio range, the defect type is determined to be a crack.

4. The method for detecting and identifying casting defects as described in claim 1, characterized in that, When the image feature parameters of all the regions to be detected are greater than or equal to the first preset image feature parameter threshold corresponding to the regions to be detected, it is determined that the target casting has no defects. The method further includes: The parameter difference is determined based on the image feature parameters of each of the regions to be detected and the second preset image feature parameter threshold corresponding to each region to be detected; The number of regions in the region to be detected is obtained, and the parameter variance is calculated based on the differences between the parameters and the number of regions. The anomaly level of each region to be detected is determined according to the preset correspondence between the parameter variance, parameter variance, and anomaly level. Based on the area identifier and anomaly level of each area to be detected, an early warning signal is generated.

5. The method for detecting and identifying casting defects as described in claim 1, characterized in that, After determining the defect information of the target casting based on the image feature parameters of the multiple areas to be detected, the method further includes: The change value of each defect type is determined based on the defect frequency corresponding to multiple preset durations; Determine the changing trend of each of the aforementioned defect types based on the change values ​​of each defect type; When any of the defect types exhibits a trend that matches a preset trend, the associated process corresponding to the defect type is determined. An early warning signal is generated based on the associated process and the defect type, and the early warning signal is sent to the equipment on the maintenance personnel side.

6. A casting defect detection and identification device, characterized in that, include: The reference casting determination module is used to acquire the casting image and casting information of the target casting, and match the target casting with multiple historical castings according to the casting information, and determine a number of reference castings from the multiple historical castings. The casting information includes the first casting model and the first production date of the target casting. The region division module is used to divide each of the reference castings into multiple detection regions, wherein the number of detection regions of each of the reference castings is the same and their positions correspond; The detection sequence determination module is used to determine multiple areas to be detected in the target casting and the detection sequence of the multiple areas to be detected based on the defect frequency of each detection area of ​​each reference casting. An extraction module is used to extract image feature parameters of the plurality of regions to be detected from the casting image of the target casting in sequence according to the detection order of the plurality of regions to be detected of the target casting. The image feature parameters include grayscale parameters and gloss parameters. The defect information determination module is used to determine the defect information of the target casting based on the image feature parameters of the multiple areas to be detected. The defect information is used to characterize whether the target casting has defects and the type of defects. When the detection sequence determination module is executed, and when determining the multiple areas to be detected in the target casting and the detection order of the multiple areas to be detected based on the defect frequency of each detection area of ​​each reference casting, it is used for: Based on the defect frequency corresponding to the detection area in each of the reference castings, the statistical defect frequency corresponding to the detection area is calculated, wherein the statistical defect frequency is the average value of the defect frequency corresponding to the detection area in each of the reference castings. Determine whether the statistical defect frequency corresponding to each detection area is less than a preset defect frequency threshold, and determine the detection area where the statistical defect frequency is less than the preset defect frequency threshold as a non-reference area, and determine the detection area where the statistical defect frequency is greater than or equal to the preset defect frequency threshold as a reference area. Based on the statistical defect frequency corresponding to each reference area and the correspondence between detection priority and defect frequency, the detection priority corresponding to each reference area is determined. The detection order of the plurality of areas to be detected in the target casting is determined according to the detection priority corresponding to each of the reference areas; Wherein, when the defect information determination module performs the step of determining the defect information of the target casting based on the image feature parameters of the plurality of areas to be detected, it is used for: For each region to be detected, determine whether the image feature parameters of the region to be detected are less than the first preset image feature parameter threshold corresponding to the region to be detected. When the image feature parameters of the area to be detected are less than the first preset image feature parameter threshold corresponding to the area to be detected, it is determined that the target casting has a defect, and the type of defect of the target casting is determined according to the image feature parameters of all the areas to be detected.

7. An electronic device, characterized in that, include: At least one processor; Memory; At least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, causing the at least one processor to perform the casting defect detection and identification method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed in a computer, causes the computer to perform the casting defect detection and identification method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Wafer defect detection method and device, electronic equipment and nonvolatile storage medium

    CN117132583A