A method for detecting the grain size of silicon carbide based on image processing
Through image processing technology, the degree of edge chaos and internal consistency of silicon carbide grains is analyzed, and the equivalent circle diameter is adjusted, which solves the detection error caused by irregular shapes and adhesions in traditional detection methods, and achieves more accurate grain size calculations.
Patent Information
- Application Number
- CN202510748331.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-06-06
AI Technical Summary
The traditional silicon carbide grain size detection method has inaccurate calculation of equivalent circle diameter due to complex grain shape and irregularity and adhesion, which affects the accuracy of grain size calculation.
Using an image processing-based method, the edge chaos and internal consistency of the grain region are obtained through edge detection and grayscale symbiosis matrix analysis, and the equivalent circle diameter is adjusted to improve accuracy.
By adjusting the equivalent circle diameter, the accuracy of silicon carbide grain size detection is improved, and the errors caused by irregular shapes and adhesions in traditional methods are overcome.
Smart Images

Figure CN120259314B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and more specifically, to a method for detecting silicon carbide grain size based on image processing. Background Art
[0002] As a core representative of the third-generation semiconductor materials, silicon carbide is widely used in various fields such as new energy vehicles due to its wide bandgap, high breakdown field strength, and high thermal conductivity. The grain size of silicon carbide (grain size and distribution) is a key parameter that determines the mechanical properties of silicon carbide materials. Traditional grain size detection relies on microscopes combined with manual interpretation (such as the intercept method and the area method), which has problems such as low efficiency, strong subjectivity, and difficult data traceability.
[0003] Traditionally, silicon carbide grain size is detected by equivalent circle diameter. It is known that equivalent circle diameter is an indicator used to measure grain size. It assumes that the grain is a circle and calculates a diameter value by the area equivalence method. However, in reality, many silicon carbide grains have complex irregular shapes, such as long strips, polygons, etc. When using equivalent circle diameter to measure the size of these irregular grains, it may not accurately reflect their true size and morphological characteristics, resulting in inaccurate grain size calculation. In addition, when there is adhesion between grains, two grains may be mistaken for one grain, resulting in an overcalculated equivalent circle diameter, which in turn leads to inaccurate subsequent grain size calculation. Summary of the Invention
[0004] In order to solve the problem of low accuracy of equivalent circular diameter of silicon carbide due to the complex irregular shape and adhesion of silicon carbide grains, the present invention proposes a method for detecting silicon carbide grain size based on image processing, which includes the following steps:
[0005] Acquire a silicon carbide grayscale image; perform edge detection on the silicon carbide grayscale image to obtain a number of grain regions; and obtain the degree of edge disorder of each grain region;
[0006] Obtaining a transverse grayscale co-occurrence matrix and a longitudinal grayscale co-occurrence matrix of each grain region; obtaining the internal consistency of each grain region according to the frequency value of each texture in the transverse grayscale co-occurrence matrix and the longitudinal grayscale co-occurrence matrix of each grain region;
[0007] According to the internal consistency and edge disorder degree of each grain area, an adjustment factor of each grain area is obtained; the equivalent circle diameter of each grain area is adjusted according to the adjustment factor to obtain the final equivalent circle diameter of each grain area; and the grain size of each grain area is obtained according to the final equivalent circle diameter of each grain area.
[0008] The innovation of the present invention lies in that by analyzing the edge disorder degree of each grain area and the internal consistency of each grain area, it can evaluate whether the edge of the grain area is irregular or contains multiple grains. Then, based on the edge disorder degree and internal consistency, the adjustment factor of each grain area is obtained. The equivalent circle diameter of the grain area with irregular edges and the grain area containing multiple grains is adjusted to be smaller, thereby making the calculation of grain size more accurate.
[0009] Preferably, performing edge detection on the silicon carbide grayscale image to obtain a plurality of grain regions includes:
[0010] The Canny edge detection algorithm is used to perform edge detection on the silicon carbide grayscale image to obtain a silicon carbide edge image. A threshold value T for the number of edge points is preset, and a contour detection algorithm is used to extract several closed edges in the silicon carbide edge image. The number of edge points of each closed edge in the silicon carbide edge image is obtained, and closed edges with a number of edge points less than T are eliminated to obtain several final closed edges in the silicon carbide edge image. The area formed by each final closed edge is recorded as the grain area.
[0011] Obtaining the grain area facilitates subsequent analysis of the grain area.
[0012] Preferably, obtaining the edge disorder degree of each grain region includes:
[0013] Obtain the minimum diameter and maximum diameter in each grain region;
[0014] ;
[0015] Where, represents the degree of boundary disorder of the i-th grain region; represents the number of pixels in the i-th grain area; Represents the square of the number of edge pixels in the i-th grain area; represents the maximum diameter in the i-th grain region; represents the minimum diameter in the i-th grain region; exp() represents an exponential function with a natural constant as the base.
[0016] The greater the degree of edge disorder, the more irregular the edge of the grain area is, and the more necessary it is to adjust the equivalent circle diameter of the grain area.
[0017] Preferably, obtaining the minimum diameter and the maximum diameter in each grain region includes:
[0018] The centroid position of the i-th grain region is obtained; an angle parameter θ is preset, the vertical direction of the centroid position is used as the starting direction, and rays are drawn every θ with the centroid position as the origin, and the two intersection points of each ray with the edge pixel points of the i-th grain region are obtained, and both are recorded as the target intersection points of each ray; the Euclidean distance between the two target intersection points of each ray is recorded as the diameter length; the maximum value of all diameter lengths is obtained and recorded as the maximum diameter in the i-th grain region, and the minimum value of all diameter lengths is obtained and recorded as the minimum diameter in the i-th grain region.
[0019] Preferably, obtaining the transverse grayscale co-occurrence matrix and the longitudinal grayscale co-occurrence matrix of each grain region includes:
[0020] Obtain the gray level co-occurrence matrix of the i-th grain region in the horizontal direction, which is recorded as the lateral gray level co-occurrence matrix of the i-th grain region;
[0021] Obtain the gray level co-occurrence matrix of the i-th grain region in the vertical direction, which is recorded as the longitudinal gray level co-occurrence matrix of the i-th grain region.
[0022] Preferably, obtaining the internal consistency of each grain region includes:
[0023] ;
[0024] Where, represents the internal consistency of the i-th grain region; Represents the number of texture types in the lateral gray-level co-occurrence matrix of the i-th grain region; Represents the square of the frequency value of the mth texture in the lateral gray-level co-occurrence matrix of the i-th grain region; Represents the number of texture types in the longitudinal gray-level co-occurrence matrix of the i-th grain region; Represents the square of the frequency value of the nth texture in the longitudinal gray-level co-occurrence matrix of the i-th grain region; represents the number of pixels in the i-th grain area; represents the gray value of the jth pixel in the i-th grain area; represents the grayscale mean of all pixels in the i-th grain area; exp() represents the exponential function with a natural constant as the base.
[0025] The smaller the internal consistency is, the more it means that the grain region contains multiple grains, and the more it is necessary to adjust the equivalent circle diameter of the grain region.
[0026] Preferably, obtaining the adjustment factor of each grain region includes:
[0027] ;
[0028] Where, represents the adjustment factor of the i-th grain region; represents the internal consistency of the i-th grain region; Represents the degree of boundary disorder of the i-th grain region; min() represents the minimum function.
[0029] Preferably, obtaining the final equivalent circle diameter of each grain region includes:
[0030] Obtain the equivalent circle diameter of each grain area;
[0031] The product of the equivalent circle diameter of each grain region and the adjustment factor of each grain region is taken as the final equivalent circle diameter of each grain region.
[0032] The equivalent circle diameter of each grain area is corrected to improve the accuracy of the equivalent circle diameter.
[0033] Preferably, obtaining the grain size of each grain region includes:
[0034] The final equivalent circle diameter of each grain region is taken as the grain size of each grain region.
[0035] Preferably, the collecting of the silicon carbide grayscale image includes:
[0036] A microscope is used to collect a microscopic image of silicon carbide, and the microscopic image is converted into grayscale to obtain a silicon carbide grayscale image.
[0037] The present invention has the following beneficial effects: the purpose of the present invention is to evaluate whether the edge of a grain region is irregular or whether it contains multiple grains by analyzing the edge disorder degree of each grain region and the internal consistency of each grain region, and then obtain the adjustment factor of each grain region based on the edge disorder degree and internal consistency, and adjust the equivalent circle diameter of the grain region with irregular edges and the grain region containing multiple grains to be smaller, thereby making the calculation of the grain size more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an illustrative and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0039] Figure 1 This is a flowchart of the steps of a method for detecting silicon carbide grain size based on image processing according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0041] See also Figure 1 , which shows a flowchart of a method for detecting silicon carbide grain size based on image processing according to an embodiment of the present invention, the method comprising the following steps:
[0042] S001. Collect a grayscale image of silicon carbide.
[0043] In an embodiment of the present invention, a microscope is used to collect a microscopic image of silicon carbide, and the microscopic image is converted to grayscale to obtain a silicon carbide grayscale image.
[0044] S002. Perform edge detection on the silicon carbide grayscale image to obtain grain regions, and obtain the degree of edge disorder of each grain region.
[0045] It should be noted that there is an obvious grayscale difference between the silicon carbide grains in the silicon carbide grayscale image and the surrounding area. Therefore, the present invention first uses edge detection to detect the silicon carbide grains in the silicon carbide image to obtain several closed edges. However, since there may be noise points in the image, some false edges may be generated after edge detection. These false edges are usually composed of fewer edge points. Therefore, it is necessary to eliminate the closed edges with a smaller number of edge points to obtain the final closed edges. The area composed of the final closed edges is the grain area.
[0046] In an embodiment of the present invention, the Canny edge detection algorithm is used to perform edge detection on the silicon carbide grayscale image to obtain a silicon carbide edge image, a preset edge point number threshold T=50, and a contour detection algorithm is used to extract several closed edges in the silicon carbide edge image, and the number of edge points of each closed edge in the silicon carbide edge image is obtained. The closed edges with the number of edge points less than T are eliminated to obtain several final closed edges in the silicon carbide edge image; the area formed by each final closed edge is recorded as the grain area.
[0047] It should be noted that, for any grain region, the roundness of the edge shape of the grain region and the difference between the maximum diameter and the minimum diameter of the grain region can directly reflect the regularity of the grain region. Therefore, the present invention comprehensively considers the shape and diameter changes of the grain region, thereby more comprehensively and accurately reflecting the irregular characteristics of the edge of the grain region.
[0048] In an embodiment of the present invention, the centroid position of the i-th grain region is obtained; an angle parameter θ=2° is preset, and a ray is drawn every θ with the vertical direction of the centroid position as the starting direction and the centroid position as the origin, and two intersection points of each ray with the edge pixel point of the i-th grain region are obtained, and both are recorded as the target intersection points of each ray; the Euclidean distance between the two target intersection points of each ray is recorded as the diameter length; the maximum value of all diameter lengths is obtained and recorded as the maximum diameter in the i-th grain region, and the minimum value of all diameter lengths is obtained and recorded as the minimum diameter in the i-th grain region;
[0049] Get the degree of boundary disorder for each grain region:
[0050] ;
[0051] Where, represents the degree of boundary disorder of the i-th grain region; represents the number of pixels in the i-th grain area; Represents the square of the number of edge pixels in the i-th grain area; represents the maximum diameter in the i-th grain region; represents the minimum diameter in the i-th grain region; exp() represents an exponential function with a natural constant as the base;
[0052] Represents the difference between the maximum diameter and the minimum diameter in the i-th grain region. The larger the difference, the more irregular the edge of the i-th grain region. In this case, the more chaotic the boundary of the i-th grain region is.
[0053] It represents the circularity of the i-th grain region. The closer its value is to 1, the closer the shape of the i-th grain region is to a circle. The circular region is regular and has smooth edges, so the boundary chaos of the i-th grain region is less.
[0054] S003. According to the complexity of the grayscale distribution and the disorder of the texture distribution of each grain area, the internal consistency of each grain area is obtained. According to the internal consistency and the degree of edge disorder of each grain area, the adjustment factor of each grain area is obtained. According to the adjustment factor, the equivalent circle diameter of each grain area is adjusted to obtain the final equivalent circle diameter of each grain area.
[0055] It should be noted that for any grain region, in addition to the regularity of its edge shape affecting the accuracy of the equivalent circle diameter of the grain region, when adhesion occurs between silicon carbide grains in the silicon carbide grayscale image, two or more independent grains contact each other in the silicon carbide grayscale image, resulting in blurred boundaries, which may cause the acquired grain region to contain multiple silicon carbide grain individuals. If this mixed region is simply regarded as a single grain and the equivalent circle diameter is calculated, the obtained value will inevitably be significantly larger than the size of a single real grain, resulting in a systematic deviation in the grain size assessment result. Therefore, the present invention also needs to analyze the internal consistency of each grain region to determine whether each grain region is an erroneous merger of multiple grains, so as to correct the equivalent circle diameter and improve the overall accuracy of the grain size assessment.
[0056] It should be further explained that if the grayscale distribution in any grain area is more complex, it means that the area may be a mistaken merger of multiple grains, and the internal consistency of the grain area is smaller; and if the texture distribution in the grain area is messy, there is a phenomenon of interweaving and mixing of multiple different texture patterns, which means that the area may be a mistaken merger of multiple grains, and the internal consistency of the grain area is smaller.
[0057] In the embodiment of the present invention, the i-th grain region is obtained in the horizontal direction ( ), denoted as the lateral gray-level co-occurrence matrix of the i-th grain region;
[0058] Get the vertical direction of the i-th grain area ( ), denoted as the longitudinal gray-level co-occurrence matrix of the i-th grain region;
[0059] Get the internal consistency of each grain region:
[0060] ;
[0061] Where, represents the internal consistency of the i-th grain region; Represents the number of texture types in the lateral gray-level co-occurrence matrix of the i-th grain region; Represents the square of the frequency value of the mth texture in the lateral gray-level co-occurrence matrix of the i-th grain region; Represents the number of texture types in the longitudinal gray-level co-occurrence matrix of the i-th grain region; Represents the square of the frequency value of the nth texture in the longitudinal gray-level co-occurrence matrix of the i-th grain region; represents the number of pixels in the i-th grain area; represents the gray value of the jth pixel in the i-th grain area; represents the grayscale mean of all pixels in the i-th grain area; exp() represents the exponential function with a natural constant as the base;
[0062] It is known that if the texture of the i-th grain region is highly consistent in a certain direction, that is, the texture is relatively concentrated, then the texture frequency of the gray-level co-occurrence matrix of the i-th grain region in that direction will have a larger frequency value and other smaller frequency values; if the texture of the i-th grain region is not highly consistent in a certain direction, that is, the texture is relatively messy, then the texture frequency of the gray-level co-occurrence matrix of the i-th grain region in that direction will not have an obvious larger frequency value;
[0063] Therefore, when When the value of is larger, the weight of the larger frequency value in the lateral grayscale co-occurrence matrix of the i-th grain region is magnified, so that the contribution of the larger frequency to the total is significantly higher than that of other frequencies. At this time, it means that the texture of the i-th grain region is highly consistent in the horizontal direction, that is, the texture is more concentrated, that is, the i-th grain region has a repeated and stable grayscale pattern in the horizontal direction, then the internal consistency of the i-th grain region is high; similarly, when The larger the value of , the more consistent the texture of the i-th grain region is in the vertical direction, and the internal consistency of the i-th grain region is higher.
[0064] The sum of squares of the differences between the grayscale values of all pixels in the i-th grain region and the grayscale mean reflects the complexity of the grayscale distribution in the i-th grain region. The smaller its value is, the smaller the difference in grayscale values between the pixels in the i-th grain region is, and the higher the internal consistency of the i-th grain region is.
[0065] It should be noted that the degree of boundary chaos of the grain area describes whether the shape of the grain is regular, and the internal consistency of the grain area indicates whether the grain area is an erroneous merger of multiple grains. Therefore, the degree of boundary chaos and internal consistency of the grain area are comprehensively considered to obtain the adjustment factor of the grain area, and the adjustment factor is used to correct the equivalent circle diameter of the grain area.
[0066] In an embodiment of the present invention, the adjustment factor of each grain region is obtained:
[0067] ;
[0068] Where, represents the adjustment factor of the i-th grain region; represents the internal consistency of the i-th grain region; Represents the degree of boundary disorder of the i-th grain region; min() represents the minimum function, which ensures that the adjustment factor does not exceed 1 to avoid excessively amplifying the grain size adjustment coefficient;
[0069] If the internal consistency of the i-th grain region is smaller and the boundary disorder of the i-th grain region is greater, The value of is significantly less than 1, which means that the internal texture of the grain area is messy and the boundary is irregular, indicating that the grain has abnormal growth or structural defects, and is of poor quality. At this time, its equivalent circle diameter needs to be reduced, so the min() function is used to reduce the Assigned to , so that the adjustment factor of the i-th grain region is smaller, and the equivalent circle diameter is compressed;
[0070] If the internal consistency of the i-th grain region is larger and the boundary disorder of the i-th grain region is smaller, The value of is much greater than 1, indicating that the quality of the grain is good at this time. At this time, it is necessary not to adjust its equivalent circle diameter. Then, the min() function is used to Assigning a value of 1 ensures that the equivalent circle diameter remains unchanged.
[0071] The equivalent circular diameter of each grain region is obtained. It should be noted that the method for obtaining the equivalent circular diameter is a well-known technology and will not be described in detail in the embodiment of the present invention.
[0072] The product of the equivalent circle diameter of each grain region and the adjustment factor of each grain region is taken as the final equivalent circle diameter of each grain region.
[0073] S004. Obtain the grain size of each grain region according to the final equivalent circle diameter of each grain region.
[0074] It should be noted that the equivalent circle diameter can intuitively reflect the size of the grain region on a two-dimensional plane. Therefore, in the embodiment of the present invention, the final equivalent circle diameter of each grain region is used as the grain size of each grain region.
[0075] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for detecting silicon carbide grain size based on image processing, characterized in that: include: Acquire silicon carbide grayscale images; Perform edge detection on the silicon carbide grayscale image to obtain several grain regions; Obtaining the edge disorder degree of each grain region, including: obtaining the minimum diameter and the maximum diameter in each grain region; , represents the degree of boundary disorder of the i-th grain region, represents the number of pixels in the i-th grain area, Represents the square of the number of edge pixels in the i-th grain area, represents the maximum diameter in the i-th grain region, represents the minimum diameter in the i-th grain region, exp() represents the exponential function with the natural constant as the base; Obtaining the transverse gray-level co-occurrence matrix and the longitudinal gray-level co-occurrence matrix of each grain region; According to the frequency value of each texture in the transverse gray-level co-occurrence matrix and the longitudinal gray-level co-occurrence matrix of each grain region, the internal consistency of each grain region is obtained, including: , represents the internal consistency of the i-th grain region, Represents the number of texture types of the lateral gray-level co-occurrence matrix of the i-th grain region, Represents the square of the frequency value of the mth texture in the lateral gray-level co-occurrence matrix of the i-th grain region, Represents the number of texture types of the longitudinal gray-level co-occurrence matrix of the i-th grain region, Represents the square of the frequency value of the nth texture in the longitudinal gray-level co-occurrence matrix of the i-th grain region, represents the gray value of the jth pixel in the i-th grain area, Represents the grayscale mean of all pixels in the i-th grain area; According to the internal consistency and edge disorder degree of each grain area, an adjustment factor of each grain area is obtained; the equivalent circle diameter of each grain area is adjusted according to the adjustment factor to obtain the final equivalent circle diameter of each grain area; and the grain size of each grain area is obtained according to the final equivalent circle diameter of each grain area.
2. The method for detecting silicon carbide grain size based on image processing according to claim 1, characterized in that: The edge detection is performed on the silicon carbide grayscale image to obtain a plurality of grain regions, including: The Canny edge detection algorithm is used to perform edge detection on the silicon carbide grayscale image to obtain a silicon carbide edge image. A threshold value T for the number of edge points is preset, and a contour detection algorithm is used to extract several closed edges in the silicon carbide edge image. The number of edge points of each closed edge in the silicon carbide edge image is obtained, and closed edges with a number of edge points less than T are eliminated to obtain several final closed edges in the silicon carbide edge image. The area formed by each final closed edge is recorded as the grain area.
3. The method for detecting silicon carbide grain size based on image processing according to claim 1, characterized in that: The obtaining of the minimum diameter and the maximum diameter in each grain region includes: The centroid position of the i-th grain region is obtained; an angle parameter θ is preset, the vertical direction of the centroid position is used as the starting direction, and rays are drawn every θ with the centroid position as the origin, and the two intersection points of each ray with the edge pixel points of the i-th grain region are obtained, and both are recorded as the target intersection points of each ray; the Euclidean distance between the two target intersection points of each ray is recorded as the diameter length; the maximum value of all diameter lengths is obtained and recorded as the maximum diameter in the i-th grain region, and the minimum value of all diameter lengths is obtained and recorded as the minimum diameter in the i-th grain region.
4. The method for detecting silicon carbide grain size based on image processing according to claim 1, characterized in that: The obtaining of the transverse grayscale co-occurrence matrix and the longitudinal grayscale co-occurrence matrix of each grain region includes: Obtain the gray level co-occurrence matrix of the i-th grain region in the horizontal direction, which is recorded as the lateral gray level co-occurrence matrix of the i-th grain region; Obtain the gray level co-occurrence matrix of the i-th grain region in the vertical direction, which is recorded as the longitudinal gray level co-occurrence matrix of the i-th grain region.
5. The method for detecting silicon carbide grain size based on image processing according to claim 1, characterized in that: The obtaining of the adjustment factor of each grain region includes: ; Where, represents the adjustment factor of the i-th grain region; represents the internal consistency of the i-th grain region; Represents the degree of boundary disorder of the i-th grain region; min() represents the minimum function.
6. The method for detecting silicon carbide grain size based on image processing according to claim 1, characterized in that: The step of obtaining the final equivalent circle diameter of each grain region includes: Obtain the equivalent circle diameter of each grain area; The product of the equivalent circle diameter of each grain region and the adjustment factor of each grain region is taken as the final equivalent circle diameter of each grain region.
7. The method for detecting silicon carbide grain size based on image processing according to claim 1, characterized in that: The obtaining of the grain size of each grain region includes: The final equivalent circle diameter of each grain region is taken as the grain size of each grain region.
8. The method for detecting silicon carbide grain size based on image processing according to claim 1, characterized in that: The collecting of the silicon carbide grayscale image comprises: A microscope is used to collect a microscopic image of silicon carbide, and the microscopic image is converted into grayscale to obtain a silicon carbide grayscale image.
Citation Information
Patent Citations
Method for detecting grain size of 6-series aluminum alloy
CN111562202A
6-series aluminum alloy grain boundary corrosive agent and grain size display method
CN112553629A