A method for classifying pores and low-density inclusions based on multi-dimensional feature analysis

By using a multidimensional feature analysis method combined with weighted solutions based on indicators such as edge curvature, the problem of mixed judgment of porosity and low-density inclusion defects in casting inspection was solved, achieving higher discrimination accuracy and reliability.

CN116452873BActive Publication Date: 2025-12-12HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310419719.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-13
Publication Date
2025-12-12
Estimated Expiration
2043-04-13

AI Technical Summary

Technical Problem

In existing technologies, porosity and low-density inclusion defects are easily confused or misjudged in casting inspection, leading to inaccurate casting quality assessment and a lack of effective differentiation methods.

Method used

A multidimensional feature analysis method was adopted, including edge curvature, gray scale distribution, aspect ratio of defect outline, defect area and its maximum perimeter square ratio and dispersion, to construct a multidimensional feature discrimination index. By weighted solving of the discrimination results of each dimension, the final category of pores and low-density inclusions was determined.

Benefits of technology

It improves the accuracy and reliability of distinguishing between pores and low-density inclusions, eliminates potential interference factors, reduces misjudgments, and provides a more reliable basis for defect differentiation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452873B_ABST
    Figure CN116452873B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of defect detection, and provides a pore and low-density inclusion classification method based on multi-dimensional feature analysis, comprising the following steps: collecting sub-images of an area to be analyzed; constructing a multi-dimensional feature discrimination index, and obtaining a defect discrimination result of the sub-images under each dimension based on the multi-dimensional feature discrimination index, the feature discrimination index comprising edge curvature, gray distribution, defect outer frame length-width ratio, and defect area and its maximum perimeter square ratio, and the defect discrimination result being a pore or a low-density inclusion; classifying and summarizing the defect discrimination results corresponding to all dimensions to obtain pore-type defects and low-density inclusion-type defects, assigning specific weights to each dimension, and respectively calculating discrimination coefficients of the pore-type defects and the low-density inclusion-type defects based on the specific weights; and comparing the discrimination coefficients, and the defect category with a larger discrimination coefficient being the final defect category of the area to be analyzed. The present application has higher defect discrimination accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of defect detection, and more particularly relates to a gas hole and low-density inclusion classification method based on multi-dimensional feature analysis. 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, which leads to the fact that the reliability and service life of major equipment cannot meet the application requirements.

[0003] In the production process of castings, many kinds of casting defects are easily produced, such as inclusions, gas holes, shrinkage holes and shrinkage porosity. In the existing casting defect detection process, gas hole defects and low-density inclusion defects are easily misjudged or even misjudged in the existing manual film evaluation and machine film evaluation due to their high similarity, resulting in inaccurate overall evaluation results of casting quality. Among them, manual film evaluation mostly depends on experience to judge defects, and machine film evaluation mostly relies on neural network for model training, and the training set required for model training needs to be artificially labeled and made, which may cause defects to be mixed in the training set due to insufficient experience of the maker, and thus cause the machine film evaluation to be misjudged or even misjudged.

[0004] Therefore, there is an urgent need for a more effective gas hole and low-density inclusion defect classification method to provide more reliable judgment basis for manual film evaluation and machine film evaluation, which helps to obtain more accurate classification results of the two defects. SUMMARY

[0005] In view of the defects of the prior art, the purpose of the present application is to provide a gas hole and low-density inclusion classification method based on multi-dimensional feature analysis to solve the problem of poor reliability of the existing defect detection method.

[0006] To achieve the above purpose, the present application provides a gas hole and low-density inclusion classification method based on multi-dimensional feature analysis, which comprises the following steps:

[0007] S1, collecting a sub-image of a region to be analyzed;

[0008] S2, constructing a multi-dimensional feature discrimination index, and obtaining a defect discrimination result of the sub-image under each dimension based on the multi-dimensional feature discrimination index, wherein the multi-dimensional feature discrimination index comprises edge curvature, gray distribution, defect outer frame length-width ratio and square ratio of defect area and maximum perimeter, and the defect discrimination result comprises whether the defect is a gas hole or a low-density inclusion;

[0009] S3 classifies the defect discrimination results corresponding to all dimensions, obtains the porosity defects and low-density inclusion defects, assigns specific weights to each dimension, and respectively calculates the discrimination coefficients corresponding to each type of defect based on the specific weights. By comparing the sizes of the discrimination coefficients, the defect category with a larger discrimination coefficient is the final defect category of the region to be analyzed.

[0010] Further, in step S2, the method for discriminating the defect category of the sub-image based on the edge curvature includes the following steps:

[0011] S211 performs inverse color processing on the pixels of the sub-image to obtain a gray-scale image;

[0012] S212 performs threshold segmentation on the gray-scale image using an adaptive threshold algorithm;

[0013] S213 converts the segmented gray-scale image into a binary image and calculates the curvature feature value of the edge of the binary image at each pixel point;

[0014] S214 calculates the ratio Q of the maximum length of a plurality of consecutive equal values in the curvature feature value to the total length of the image contour edge, and judges the defect category based on the ratio Q.

[0015] Further, the method for judging the defect category based on the ratio Q is:

[0016] If Q < 0.2, it is judged as a non-defect region; if 0.2≤Q≤0.3, it is judged as a low-density inclusion; and if Q>0.3, it is judged as a porosity.

[0017] Further, in step S2, the method for discriminating the defect category of the sub-image based on the gray-scale distribution includes the following steps:

[0018] S221 obtains a gray-scale histogram of the sub-image;

[0019] S222 judges the number of peaks in the gray-scale histogram, and judges the defect category based on the number of peaks.

[0020] Further, in step S2, the method for discriminating the defect category of the sub-image based on the length-width ratio of the defect outer frame includes the following steps:

[0021] S231 frames the defect region in the sub-image with a minimum circumscribed rectangle;

[0022] S232 calculates the length-width ratio Y of the minimum circumscribed rectangle, and judges the defect category based on the length-width ratio Y.

[0023] Further, the method for judging the defect category of the sub-image based on the square ratio of the defect area and its maximum perimeter in step S2 comprises the following steps:

[0024] S241 extracting the defect morphology in the sub-image;

[0025] S242 calculating the ratio T of the area S of the defect morphology and its perimeter L square, and judging the defect category based on the ratio T.

[0026] Further, in step S2, when there are multiple defects in the sub-image, the multi-dimensional feature judgment index further comprises a dispersion degree, the dispersion degree of each defect in the sub-image needs to be calculated, and the defect category of the sub-image is judged based on the dispersion degree.

[0027] Further, the method for judging the defect category of the sub-image based on the dispersion degree comprises the following steps:

[0028] S251 extracting the contour of each discrete defect in the sub-image and calculating the respective centroid position;

[0029] S252 obtaining the spacing L between the nearest centroids of adjacent centroids n , calculating the ratio P of the spacing L n and the length L of the longest side of the sub-image, and judging the defect category based on the ratio P.

[0030] Further, in step S3, the allocation method for respectively assigning specific weights to the defect judgment results in each dimension is: the weight of the edge curvature > the weight of the dispersion degree > the weight of the gray scale distribution > the weight of the defect frame length-width ratio = the weight of the square ratio of the defect area and its maximum perimeter.

[0031] Further, in step S3, the weight assigned to the edge curvature is 0.35, the weight assigned to the dispersion degree is 0.25, the weight assigned to the gray scale distribution is 0.2, the weight assigned to the defect frame length-width ratio is 0.1, and the weight assigned to the square ratio of the defect area and its maximum perimeter is 0.1.

[0032] Compared with the prior art, the above technical scheme conceived by the present application mainly has the following advantages:

[0033] 1. The present application constructs multi-dimensional feature discrimination indicators, calculates the defect discrimination results in the sub-image corresponding to each dimension of the feature discrimination indicators, and obtains the discrimination coefficients corresponding to the discrimination results of the defects as pores and the defects as low-density inclusions respectively by weighting all discrimination results, and compares the corresponding discrimination coefficients of the pore defects and the corresponding discrimination coefficients of the low-density inclusion defects, and the larger discrimination coefficient is the final defect discrimination result, and the overall defect discrimination accuracy and reliability are improved through comprehensive defect discrimination in multiple dimensions.

[0034] 2. The multi-dimensional feature discrimination indicators in the present application respectively include edge curvature, gray scale distribution, defect outer frame aspect ratio, and the ratio of defect area to maximum perimeter square, and when there are multiple suspected defects in the sub-image, a dispersion degree feature discrimination indicator can also be constructed, so that defect discrimination is performed from 5 dimensions, so that a more reliable comprehensive discrimination coefficient is obtained for final discrimination, and compared with single dimension discrimination, the discrimination result of this kind of discrimination method excludes potential interference factors such as human calibration errors in machine discrimination.

[0035] 3. In the present application, weights are allocated according to the discrimination effectiveness in different dimensions, higher weights are allocated to feature discrimination indicators with higher discrimination effectiveness, and correspondingly, lower weights are allocated to feature discrimination indicators with lower discrimination effectiveness, so that the discrimination coefficient finally calculated is more accurate. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 is a flowchart of a pore and low-density inclusion classification method based on multi-dimensional feature analysis provided by the present application;

[0037] Figure 2 is a method flowchart for discriminating the defect category of a sub-image based on edge curvature in an embodiment of the present application;

[0038] Figure 3 is a method flowchart for discriminating the defect category of a sub-image based on gray scale distribution in an embodiment of the present application;

[0039] Figure 4 is a method flowchart for discriminating the defect category of a sub-image based on defect outer frame aspect ratio in an embodiment of the present application;

[0040] Figure 5 is a method flowchart for discriminating the defect category of a sub-image based on the ratio of defect area to maximum perimeter square in an embodiment of the present application;

[0041] Figure 6 is a method flowchart for discriminating the defect category of a sub-image based on dispersion degree in an embodiment of the present application. DETAILED DESCRIPTION

[0042] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.

[0043] As shown in Figure 1 Fig. 1 is a flowchart of a pore and low-density inclusion classification method based on multi-dimensional feature analysis provided by the present application. The steps of the classification method include:

[0044] S1: collecting sub-images of a region to be analyzed; specifically, first, an image of the surface of a workpiece to be analyzed is collected, and then an image having a suspected defect in the image is extracted as a sub-image to be analyzed (hereinafter, the suspected defect is collectively referred to as a defect);

[0045] S2: constructing a multi-dimensional feature discrimination index, and obtaining a defect discrimination result of the sub-image under each dimension based on the multi-dimensional feature discrimination index; wherein the multi-dimensional feature discrimination index includes edge curvature, gray distribution, length-width ratio of the outer frame of the defect, and square ratio of the area of the defect and the maximum perimeter thereof, and the defect discrimination result includes whether the defect is a pore or a low-density inclusion;

[0046] Specifically, the contour edge curvature eigenvalue of the sub-image is calculated, and whether the defect is a pore or a low-density inclusion is determined according to the edge curvature eigenvalue; the gray distribution of the sub-image is calculated, and whether the defect is a pore or a low-density inclusion is determined by the calculated gray histogram; whether the defect is a pore or a low-density inclusion is determined by calculating the length-width size ratio of the outer frame of the defect; and whether the defect is a pore or a low-density inclusion is determined by calculating the ratio of the area of the defect and the square of the maximum perimeter of the defect;

[0047] S3: classifying and summarizing the defect discrimination results corresponding to all dimensions to obtain pore-type defects and low-density inclusion-type defects, assigning specific weights to each dimension, and calculating discrimination coefficients corresponding to the pore-type defects and the low-density inclusion-type defects based on the specific weights, comparing the discrimination coefficients, and determining that the defect category with a larger discrimination coefficient is the final defect category of the region to be analyzed;

[0048] Specifically, each dimension of the feature discrimination index can correspond to a judgment parameter, and the type of the defect is determined based on each judgment parameter. Then, all judgment parameters corresponding to defects of the same type are multiplied by their corresponding weights and summed to obtain the final discrimination coefficient of each type of defect. The discrimination coefficients corresponding to the two types of defects are compared, and the defect type corresponding to the larger discrimination coefficient is the actual defect type. For example, if the discrimination coefficient corresponding to the pore defect is larger than the discrimination coefficient corresponding to the low-density inclusion, then the defect of the region to be analyzed is a pore defect.

[0049] In the preferred embodiment, in step S2, Figure 2As shown, the method for determining the defect category of the sub-image based on the edge curvature comprises the following steps:

[0050] S211 performs inverse color processing on the sub-image pixels to obtain a gray-scale image;

[0051] S212 performs threshold segmentation on the gray-scale image using an adaptive threshold algorithm;

[0052] S213 converts the segmented gray-scale image into a binary image and calculates the curvature characteristic value of the binary image contour edge at each pixel point;

[0053] S214 calculates the ratio Q of the maximum length of a plurality of continuous equal values in the curvature characteristic value to the total image contour edge length, and determines the defect category based on the ratio Q.

[0054] In a more preferred embodiment, in step S214, the method for determining the defect category based on the ratio Q is:

[0055] If Q < 0.2, it is determined that there is no defect region in the sub-image; if 0.2 ≤ Q ≤ 0.3, it is determined that the defect is a low-density inclusion; and if Q > 0.3, it is determined that the defect is a pore.

[0056] In a preferred embodiment, in the aforementioned step S2, as shown, Figure 3 the method for determining the defect category of the sub-image based on the gray-scale distribution comprises the following steps:

[0057] S221 obtains the gray-scale histogram of the sub-image, i.e., counts the frequency of each pixel value according to the size of the gray-scale value in the sub-image, and obtains the horizontal coordinate corresponding to the gray-scale value (0 for black and 255 for white) in the obtained gray-scale histogram, and the vertical coordinate corresponds to the number of times each pixel appears.

[0058] S222 determines the number of peaks in the gray-scale histogram, and determines the defect category based on the number of peaks. When the number of peaks is greater than or equal to a first preset value, it is determined that the defect is a low-density inclusion, and when the number of peaks is less than or equal to a second preset value, it is determined that the defect is a pore, and the first preset value is less than the second preset value.

[0059] The reason for using the peak of the gray-scale histogram to determine the defect category is that the pore defect region and the background color are distinguished more obviously, and there are basically no other pixel points outside the background and the defect region, while the low-density inclusion defect region and the background usually have a color lighter than the transition layer, and this part of the region pixels are different from the defect region and the background region, and the range is large, so an additional peak will appear on the gray-scale histogram.

[0060] In a more preferred embodiment, the method for determining the defect category based on the number of peaks in the aforementioned step S222 is: if the number of peaks of the pattern in the grayscale histogram is less than or equal to a first preset value 3, it is determined that the defect is a pinhole; if the number of peaks is greater than or equal to 4, it is determined that the defect is a low-density inclusion.

[0061] In a preferred embodiment, as shown in the aforementioned step S2, the method for determining the defect category of the sub-image based on the length-width ratio of the outer frame of the defect includes the following steps: Figure 4

[0062] S231 frames the defect area in the sub-image with the smallest circumscribed rectangle;

[0063] S232 calculates the length-width ratio Y of the smallest circumscribed rectangle, and determines the defect category based on the length-width ratio Y.

[0064] In a more preferred embodiment, the method for determining the defect category based on the length-width ratio Y in the aforementioned step S232 is: if Y≥1.3, it is determined that the defect is a low-density inclusion; if Y<1.3, it is determined that the defect is a pinhole.

[0065] In a preferred embodiment, as shown in the aforementioned step S2, the method for determining the defect category of the sub-image based on the ratio of the defect area to the square of its maximum perimeter includes the following steps: Figure 5

[0066] S241 extracts the defect topography in the sub-image;

[0067] S242 calculates the ratio T of the area S of the defect topography to the square of its perimeter L, and determines the defect category based on the ratio T.

[0068] In a more preferred embodiment, in the aforementioned step S242, the method for determining the defect category based on the ratio T is: if 0.7

[0069] In a preferred embodiment, in the aforementioned step S2, when there are multiple defects in the sub-image, the multi-dimensional feature discrimination index further includes a dispersion feature discrimination index, which determines the defect category in the sub-image by calculating the dispersion of each defect in the sub-image and based on the dispersion.

[0070] In a preferred embodiment, as shown in the aforementioned step S2, the method for determining the defect category of the sub-image based on the dispersion includes the following steps: Figure 6

[0071] S251 extracts the contour of each discrete defect in the sub-image and calculates the respective centroid position;

[0072] ​​​S252 obtains the distance L between the nearest centroids of adjacent centroids. n Calculate the spacing L n The ratio P between the length L of the longest side of the sub-image and the defect type is determined based on this ratio P. This is because low-density inclusion defects often appear in patches, while porosity defects are usually scattered individual defects. Therefore, the defect type can be accurately determined by judging the ratio between the centroid spacing of the defects and the longest side of the sub-image.

[0073] In a more preferred embodiment, the method for determining the defect type based on the ratio P is as follows: if P ≥ 0.5, the defect is determined to be pores; if P < 0.5, the defect is determined to be low-density inclusions.

[0074] In a preferred embodiment, in step S3, the defect discrimination results under each dimension are assigned specific weights based on their different discrimination effects. The specific allocation method is as follows: weight of edge curvature > weight of dispersion > weight of gray distribution > weight of the aspect ratio of the defect outer frame = weight of the ratio of the square of the defect area and its maximum perimeter. The weight allocation ensures that the discrimination coefficients corresponding to pore defects under all dimensions obtained each time are not equal to the discrimination coefficients corresponding to low-density inclusion defects.

[0075] In a preferred embodiment, in step S3, the weights are allocated from strongest to weakest according to the different discriminative power of each discriminative dimension. Specifically, the weight allocated to edge curvature is 0.35, the weight allocated to dispersion is 0.25, the weight allocated to grayscale distribution is 0.2, the weight allocated to the aspect ratio of the defect outline is 0.1, and the weight allocated to the ratio of the square of the defect area and its maximum perimeter is 0.1. The sum of all weights is 1.

[0076] To better illustrate the implementation details of the present invention, the following embodiments are provided to further illustrate the present invention. It should be understood that the following embodiments are only preferred implementation methods and are not intended to limit the scope of protection of the present invention in any way.

[0077] Example 1

[0078] This embodiment provides a method for classifying pores and low-density inclusions based on multidimensional feature analysis, including the following steps:

[0079] Step 1: First, obtain an image of the casting surface, and then extract the area image with multiple suspected defects from the image as the sub-image to be analyzed;

[0080] Step two involves constructing multidimensional feature discrimination indices, including edge curvature, dispersion, grayscale distribution, defect aspect ratio, and the ratio of defect area to the square of its perimeter. Then, it analyzes whether the defect category corresponding to each feature discrimination index is a porosity defect or a low-density inclusion defect.

[0081] 1. Edge curvature calculation

[0082] (1) Anti-color processing of pixels in sub-image to obtain anti-color image

[0083] Anti-color processing of pixels in sub-image is performed by the following operation:

[0084] R' ij = 255 - R ij (1)

[0085] wherein R ij represents the pixel value of the i-th row and j-th column in the independent region R, and R' ij is the corresponding pixel value after anti-color processing.

[0086] (2) Threshold segmentation of the anti-color processed image using an adaptive threshold algorithm, the pixel size is divided into several levels by setting the threshold, and then the value relationship between each pixel point in the image and the threshold is judged to determine whether the pixel point belongs to the target region or the background region, thereby realizing the conversion from the gray-scale image to the binary image.

[0087] In the relative coordinates of the target region, it is assumed that the edge of the casting can be represented by the following parametric equation:

[0088]

[0089] Then, the curvature K is obtained by deriving the parametric equation (2):

[0090]

[0091] wherein t is an unknown quantity, and for the pixel points on the anti-color image, the first-order and second-order differences of the casting edge profile in the X direction and Y direction in the coordinate system need to be calculated correspondingly, and the specific difference expression is as follows:

[0092]

[0093] The discrete values in formula (4) are substituted into the curvature calculation formula (3), and the curvature eigenvalue of the anti-color image profile edge at each pixel point can be obtained.

[0094] (3) The maximum length of the continuous equal curvature eigenvalues on the anti-color image profile edge is recorded, and this maximum length value is divided by the total edge length value of the anti-color image profile, thereby obtaining a ratio Q:

[0095] If Q is less than 0.2, the region is judged as the body structure of the casting without defects; if Q is between 0.2 and 0.3 (including 0.2 and 0.3), the region defect is judged as low-density inclusion; if Q is greater than 0.3, the region defect is judged as air hole.

[0096] 2. Dispersity calculation for multiple suspected defects existing in the sub-image

[0097] (1) Extract the contour of each discrete defect and calculate the centroid position of each;

[0098] (2) Because low-density inclusion defects often appear in patches, and air hole defects are usually scattered single defects, first calculate the distance between the centroid positions of adjacent defects, and obtain the minimum value of the distance, denoted as L n , and then calculate the ratio of L n to the length L of the longest side of the sub-image to determine the defect type, if L n / L≥0.5, the defect is judged as air hole; if L n / L<0.5, the defect is judged as low-density inclusion.

[0099] 3. Gray scale distribution calculation

[0100] Calculate and obtain the gray scale histogram of the sub-image, if only 3 or fewer peaks appear in the obtained gray scale histogram, the defect is judged as air hole, if the number of peaks in the gray scale histogram is 4 or more, the defect is judged as low-density inclusion.

[0101] 4. Aspect ratio calculation of the bounding box of the defect

[0102] Each defect in the sub-image is framed with the smallest bounding rectangle, the aspect ratio Y of the corresponding rectangular frame is calculated, if the ratio Y≥1.3, the region is judged as low-density inclusion; if the ratio Y is less than 1.3, the region is judged as air hole.

[0103] 5. Calculation of the ratio of the area of the defect to the square of its maximum perimeter

[0104] Extract the topography of each defect in the sub-image, calculate the area S of each defect region and its maximum perimeter L, and calculate the judgment parameter T using the following formula:

[0105] T=S / (L 2 ) (5)

[0106] If 0.7<T<0.9, the defect is judged as air hole, otherwise it is low-density inclusion.

[0107] Step three: all the discrimination results corresponding to the single defect in the above five dimensions are classified into the pore defect class and the low-density inclusion class, and each feature discrimination dimension is given a specific weight, in the embodiment, the weight assigned to the edge curvature is 0.35, the weight assigned to the dispersion is 0.25, the weight assigned to the gray scale distribution is 0.2, the weight assigned to the defect outer frame length-width ratio is 0.1, and the weight assigned to the square ratio of the defect area and the maximum perimeter is 0.1; then the judgment parameters (such as the L n The ratio of the length L of the longest side of the sub-image to the length of the longest side of the sub-image is equal to the corresponding weight, and the pore defect discrimination coefficient and the low-density inclusion defect discrimination coefficient of the single defect are obtained by weighted summation, and the discrimination coefficients of the two defects are compared, and the single defect is the corresponding defect category if the discrimination coefficient is large.

[0108] Step four: repeat step three until the categories of all defects in the area to be analyzed are discriminated.

[0109] Overall, the method conceived by the present application can achieve the following beneficial effects for the existing casting defect division:

[0110] 1. The present application judges the relevant features of pores and low-density inclusions from five dimensions such as edge curvature, which eliminates potential interference factors.

[0111] 2. The present application distributes weights to the technical parameters of the five dimensions such as edge curvature, which eliminates the contradictory situation of the final judgment result, and makes the reliability of the discrimination result of the present application for pores and low-density inclusions higher.

[0112] The above only describes the preferred embodiments of the present application and is not intended to limit the present application, and any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method of classifying porosity and low-density inclusions based on multi-dimensional feature analysis, characterized by, The method comprises the following steps: S1: collecting a sub-image of a region to be analyzed; S2: constructing a multi-dimensional feature discrimination index, and obtaining a defect discrimination result of the sub-image under each dimension based on the multi-dimensional feature discrimination index, wherein the multi-dimensional feature discrimination index comprises edge curvature, gray distribution, defect outer frame aspect ratio, and a ratio of defect area to square of maximum perimeter, and the defect discrimination result comprises that the defect is a pore or a low-density inclusion; when there are multiple defects in the sub-image, the dispersion of each defect in the sub-image needs to be calculated, and the defect category of the sub-image is discriminated based on the dispersion; S251: extracting the contour of each discrete defect in the sub-image and calculating the respective centroid positions; S252 obtaining the distance L between the closest neighboring centroids n , calculating the distance L n and the ratio P of the length L of the longest side of the sub-image, and determining the defect category based on the ratio P; S3: classifying and summarizing the defect discrimination results corresponding to all dimensions to obtain pore-type defects and low-density inclusion-type defects, assigning specific weights to each dimension, and the assignment method is: weight of edge curvature > weight of dispersion > weight of gray distribution > weight of defect outer frame aspect ratio = weight of ratio of defect area to square of maximum perimeter; and respectively calculating the discrimination coefficients corresponding to each type of defect based on the specific weights, and comparing the sizes of the discrimination coefficients, the defect category with a larger discrimination coefficient is the final defect category of the region to be analyzed.

2. A method of classifying porosity and low density inclusions based on multi-dimensional feature analysis as claimed in claim 1, wherein, In step S2, the method for discriminating the defect category of the sub-image based on the edge curvature comprises the following steps: S211: performing inverse color processing on the pixels of the sub-image to obtain a gray image; S212: performing threshold segmentation on the gray image using an adaptive threshold algorithm; S213: converting the segmented gray image into a binary image, and calculating the curvature characteristic value of the binary image contour edge at each pixel point; S214: calculating the ratio Q of the maximum length of multiple consecutive equal values in the curvature characteristic value to the total image contour edge length, and judging the defect category based on the ratio Q.

3. A method of classifying porosity and low density inclusions based on multi-dimensional feature analysis as claimed in claim 2, wherein, The method for judging the defect category based on the ratio Q is: If Q < 0.2, it is judged as a non-defect region; if 0.2 ≤ Q ≤ 0.3, it is judged that the defect is a low-density inclusion; and if Q > 0.3, it is judged that the defect is a pore.

4. A method of classifying porosity and low density inclusions based on multi-dimensional feature analysis as claimed in claim 1, wherein, In step S2, the method for discriminating the defect category of the sub-image based on the gray distribution comprises the following steps: S221: obtaining a gray histogram of the sub-image; S222: judging the number of peaks in the gray histogram, and judging the defect category based on the number of peaks.

5. A method of classifying porosity and low density inclusions based on multi-dimensional feature analysis as claimed in claim 1, wherein, In step S2, the method for discriminating the defect category of the sub-image based on the defect outer frame aspect ratio comprises the following steps: S231: using a minimum circumscribed rectangle to frame the defect region in the sub-image; S232: calculating the aspect ratio Y of the minimum circumscribed rectangle, and judging the defect category based on the aspect ratio Y.

6. A method of classifying porosity and low density inclusions based on multi-dimensional feature analysis as claimed in claim 1, wherein, In step S2, the method for discriminating the defect category of the sub-image based on the ratio of defect area to square of maximum perimeter comprises the following steps: S241: extracting the defect topography in the sub-image; S242: calculating the ratio T of the area S of the defect topography to the square of its perimeter L, and judging the defect category based on the ratio T.

7. A method of classifying porosity and low density inclusions based on multi-dimensional feature analysis as claimed in claim 1, wherein, In step S3, the weight assigned to the edge curvature is 0.35, the weight assigned to the dispersion is 0.25, the weight assigned to the gray scale distribution is 0.2, the weight assigned to the defect outer frame length-width ratio is 0.1, and the weight assigned to the ratio of the defect area to the square of the maximum perimeter is 0.1.

Citation Information

Patent Citations

  • Casting defect identification model training method, defect identification method, device and system

    CN115661572A

  • Defect rating method and system based on casting X-ray image

    CN115908261A