Crystal boundary sawtooth characterization method and device based on computer vision
Automatically extract and characterize grain boundary jagging characteristics through computer vision technology, solving the problems of low efficiency and subjective influence in the existing technology, achieving efficient and accurate characterization of grain boundary jagging, and being able to more comprehensively reflect the overall material Condition.
Patent Information
- Application Number
- CN202411055475.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-12
AI Technical Summary
The prior art is inefficient in grain boundary zigzag characterization and is affected by subjective factors, so it is unable to effectively automatically screen and characterize the degree of large grain boundary zigzag, resulting in insufficient sample size and inability to fully reflect the overall situation of the material.
Using a computer vision-based method, the grain boundary sawn characteristics are automatically extracted and characterized by image acquisition, preprocessing, filtering and miscellaneous processing, grain boundary network extraction, splitting single-segment grain boundary and fast Fourier transform, and the wavelength and amplitude are calculated. to obtain the zigzag index.
It realizes efficient and accurate characterization of a large number of grain boundaries, improves efficiency, can better reflect the overall zigzag degree of the material, and reduces subjective influence.
Smart Images

Figure CN118941540A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a method and device for characterizing grain boundary jaggedness based on computer vision. Background Art
[0002] Grain boundary serration is a method of transforming random grain boundaries in metal materials into serrated special grain boundaries through appropriate heat treatment processes. According to existing research, serrated grain boundaries have the characteristics of effectively preventing inter-grain boundary sliding, extending the grain boundary extension path along the grain, and inhibiting the generation and extension of inter-grain cracks. They can be used to improve the high-temperature mechanical properties of materials such as nickel-based alloys and austenitic heat-resistant steels. The characterization of grain boundary serration is mainly measured by measuring the amplitude of the serrated grain boundary in the material microstructure image to measure the degree of grain boundary serration. It is usually necessary to collect the material microstructure image, manually intercept the part with the serrated grain boundary characteristics, and manually measure the amplitude of the grain boundary, or use the grain boundary as a waveform for fast Fourier transform to obtain the wavelength and amplitude of the corresponding sine wave. However, such a manual interception method is inefficient and cannot perform a large number of grain boundary serration characterizations, which will result in a small number of selected grain boundary samples that cannot well characterize the overall situation of the material, and will be affected by subjective factors when selecting grain boundaries. Therefore, a method is needed that can automatically screen and extract grain boundaries from the microstructure image of the material and objectively characterize the degree of serration of each grain boundary. Summary of the invention
[0003] Purpose of the invention: The present invention provides a method and device for characterizing grain boundary serration based on computer vision, which can efficiently and accurately perform a large amount of grain boundary serration characterization.
[0004] Technical solution: The method for characterizing grain boundary serration based on computer vision described in the present invention comprises the following steps:
[0005] (1) Image acquisition: Obtain an image with jagged grain boundary features and determine its scale;
[0006] (2) Image pre-processing: filtering and binarization of the image to obtain a binary image;
[0007] (3) Filtering: denoising and removing burrs from the image;
[0008] (4) Grain boundary network extraction: After morphological operations on the image, the grain boundary network is extracted using a thinning algorithm;
[0009] (5) Splitting single grain boundaries: Splitting the grain boundary network into discontinuous single grain boundaries and extracting grain boundaries of specified length;
[0010] (6) Characterization of grain boundary serration: Fast Fourier transform is used to calculate the characteristic sine wave of each grain boundary segment and obtain its wavelength and amplitude.
[0011] Furthermore, the image pre-processing in step (2) includes:
[0012] Filtering: Filter the image through bilateral filtering;
[0013] Single channel processing: select the color channel with the strongest contrast between the grain boundary and the surrounding area and convert the image under this color channel into a grayscale image;
[0014] Histogram equalization: Enhance the image through adaptive histogram equalization;
[0015] Standardization: Through binarization, the value corresponding to the non-grain boundary part is adjusted to 0, and the value corresponding to the grain boundary part is adjusted to 255.
[0016] Furthermore, the impurity filtering process described in step (3) includes:
[0017] Connected domain segmentation: The image is segmented according to connected domains through the connected domain processing function, and the parameters of the serial number, position, and area corresponding to each connected domain are obtained, and a statistical diagram of the connected domain area distribution is drawn based on the obtained connected domain area;
[0018] Connected domain screening: Select an appropriate area threshold based on the connected domain area distribution statistics, redraw the connected domains with an area greater than the threshold on a new image with the same pixel size as the original image, and obtain the grain boundary contour after removing noise points and small discontinuous grain boundaries;
[0019] Morphological operation: Through morphological operation, the burrs on the grain boundary contour are removed.
[0020] Furthermore, the grain boundary network extraction in step (4) includes:
[0021] Dilation processing: select a convolution kernel of appropriate size according to the image size, and use the convolution kernel to dilate the image;
[0022] Refinement processing: The grain boundary network is extracted using a refinement algorithm for the expanded grain boundary contour. The size of the grain boundary network is the same as the pixel size of the original image, and the grain boundary width is 1 pixel.
[0023] Furthermore, the splitting of the single-segment grain boundary in step (5) comprises:
[0024] Intersection search: Use the 3×3 unit matrix as the convolution kernel, perform convolution operations on all non-zero pixels in the grain boundary network, and determine whether the pixel is an intersection based on the operation results;
[0025] Intersection break: check and filter the intersections, and set the pixel values corresponding to the filtered intersections to zero;
[0026] Length distribution statistics: Use the connected domain processing function to obtain the serial number, position, and area information of all single-segment grain boundaries, draw a single-segment grain boundary length distribution statistics chart based on the length information, and convert the pixel unit into the scale unit in combination with the original image scale information;
[0027] Screening grain boundaries: Preset the length threshold to screen the grain boundaries that meet the length requirements and obtain pixel coordinate information;
[0028] Single segment extraction: Create a new image of the corresponding size based on the obtained grain boundary pixel coordinate information, redraw the grain boundary segment, rotate and crop the image appropriately so that the grain boundary trend in the image tends to be horizontal, and the first column of pixels on both ends have non-zero pixels. Then save the image as a separate image file and record the grain boundary sequence number and length.
[0029] Furthermore, the grain boundary serration characterization in step (6) includes:
[0030] Waveform sampling: read the image of a single grain boundary and convert the image into a continuous waveform consisting of (x, y) coordinate points according to the position information of non-zero pixels;
[0031] Baseline correction: perform baseline correction on the waveform;
[0032] Fast Fourier Transform: Perform fast Fourier transform on the baseline-corrected waveform to obtain a series of sine waves;
[0033] Extract characteristic sine waves: According to the results obtained by fast Fourier transform, the amplitude-frequency spectrum and amplitude-wavelength spectrum are calculated. According to the peak value of the amplitude-frequency spectrum, the sine wave corresponding to the smallest cycle period is removed, and then the sine waves corresponding to the three peaks with the largest amplitudes are selected as the characteristic sine waves of this section of grain boundary;
[0034] Obtaining wavelength amplitude: Obtain the wavelength and amplitude of the three characteristic sinusoidal waves of the grain boundary according to the amplitude-wavelength spectrum, and multiply the wavelength and amplitude to obtain the grain boundary serration index.
[0035] Furthermore, the area threshold is 100.
[0036] Furthermore, the convolution kernel size is 3×3 or 5×5.
[0037] Furthermore, the length threshold is 10 μm.
[0038] A device according to the present invention includes a memory and a processor, wherein:
[0039] A memory for storing computer programs that can be run on the processor;
[0040] The processor is used to execute the steps of the above-mentioned method for characterizing grain boundary serration based on computer vision when running the computer program.
[0041] Beneficial effects: Compared with the prior art, the beneficial effects of the present invention are: the present invention can quickly characterize the sawtooth of a large number of grain boundaries, that is, it can extract and characterize multiple grain boundaries in the same microstructure image at a single time, the characterization efficiency is higher, and it can better reflect the overall sawtooth degree of the material; secondly, the use of fast Fourier transform to characterize the sawtooth degree is more accurate than manual measurement of amplitude and wavelength; in addition, the images used for characterization can use a variety of images such as light microscope images and scanning electron microscope images, and have good compatibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flowchart of the grain boundary jaggedness characterization method based on computer vision;
[0043] Figure 2 A microstructure image of austenitic heat-resistant steel used in the embodiment of the present invention;
[0044] Figure 3 This is a grayscale image of the microstructure of austenitic heat-resistant steel according to an embodiment of the present invention;
[0045] Figure 4 This is an enhanced grayscale image of the microstructure of austenitic heat-resistant steel according to an embodiment of the present invention;
[0046] Figure 5 This is a standardized image of the microstructure of austenitic heat-resistant steel according to an embodiment of the present invention;
[0047] Figure 6 A statistical diagram of the area distribution of connected domains after image pre-processing used in the embodiment of the present invention;
[0048] Figure 7 The result of redrawing the grain boundary contour of the austenitic heat-resistant steel microstructure in the embodiment of the present invention;
[0049] Figure 8 The grain boundary network of the microstructure of austenitic heat-resistant steel according to the embodiment of the present invention;
[0050] Fig. 9 A comparison diagram of the microstructure and grain boundary network of austenitic heat-resistant steel according to an embodiment of the present invention;
[0051] Fig.10 The results of the grain boundary network intersection detection of the austenitic heat-resistant steel microstructure in the embodiment of the present invention are as follows;
[0052] Fig.11This is a statistical diagram of the single-segment grain boundary length distribution of the grain boundary network of the microstructure of the austenitic heat-resistant steel according to the embodiment of the present invention;
[0053] Fig.12 The calculation result of the grain boundary serration index of the austenitic heat-resistant steel microstructure in the embodiment of the present invention;
[0054] Fig.13 This is a statistical diagram of grain boundary serration distribution in the microstructure of austenitic heat-resistant steel according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0056] like Figure 1 As shown, the present invention provides a method for characterizing grain boundaries based on computer vision. By using computer vision, the grain boundary network is extracted and the single-segment grain boundary is split from the collected material microstructure image, and the grain boundary is quickly characterized by the serration using the fast Fourier transform. Specifically, the method includes the following steps:
[0057] S1: Image acquisition: obtain images with jagged grain boundary features, Figure 2 The image used in this embodiment is the metallographic structure of austenitic heat-resistant steel under a 500x optical microscope, and the scale parameter is 0.111 μm / pixel.
[0058] S2: Image pre-processing: Obtain a binary image with a non-zero grain boundary contour.
[0059] S21: Filtering: The image is filtered by bilateral filtering. The diameter of the convolution kernel used is 9, the standard deviation of the color space is 25, and the standard deviation of the coordinate space is 25.
[0060] S22: Single channel processing: In this embodiment, the image is converted into a grayscale image. Figure 3 Grayscale image of the microstructure of austenitic heat-resistant steel.
[0061] S23: Histogram equalization: Enhance the image through adaptive histogram equalization. Figure 4 This is the enhanced grayscale image of the austenitic heat-resistant steel microstructure image used in this embodiment.
[0062] S24: Standardization: Through binarization, the value corresponding to the non-grain boundary part is adjusted to 0, and the value corresponding to the part that may be the grain boundary is adjusted to 255. Figure 5 This is the result of image standardization used in this example. It can be observed from the figure that there are more precipitates gathered in the upper left corner.
[0063] S3: Filtering: Obtain the grain boundary area contour after removing noise and burrs.
[0064] S31: Connected domain segmentation: The image is segmented according to connected domains through the connected domain processing function, and the serial number, position, area and other parameters corresponding to each connected domain are obtained, and a connected domain area distribution statistical diagram is drawn according to the obtained connected domain area. Figure 6 This is a statistical diagram of the area distribution of connected domains after image pre-processing used in this embodiment. It can be seen from the figure that the number of connected domains decreases significantly when the area increases from 100 pixels to 1000 pixels, so the area threshold should be between 100 pixels and 1000 pixels.
[0065] S32: Connected domain screening: Select a suitable area threshold according to the connected domain area distribution statistics, redraw the connected domains with an area greater than the threshold on a new image with the same pixel size as the original image, and obtain the grain boundary contour after removing noise points and small discontinuous grain boundaries. This step can be repeated to observe the results and adjust the area threshold. In this embodiment, the area threshold is set to 100. Figure 7 This is the result of redrawing the grain boundary contour in this embodiment.
[0066] S33: Morphological operation: Through appropriate morphological operations, the burrs on the grain boundary contour are removed and the smaller breakpoints are connected. This step can be repeated to observe the results and adjust the convolution kernel size and the number of morphological operation iterations. In this embodiment, the convolution kernel size is 3×3.
[0067] S4: Grain boundary network extraction: Obtain a grain boundary network with a width of 1 pixel.
[0068] S41: Dilation processing: Select a convolution kernel of appropriate size according to the image size and magnification, generally 3×3 or 5×5. When the image magnification is large and the grain boundaries are relatively dense and small, it is more suitable to use a convolution kernel of 3×3 size. When the grain boundaries are relatively sparse and the effect of using a convolution kernel of 3×3 size after more than 3 iterations is still not ideal, a convolution kernel of 5×5 size can be selected. The image is dilated using the convolution kernel. An appropriate number of iterations is selected according to the effect, generally 1 to 3 times. This step can be repeated to observe the results and adjust the convolution kernel size and the number of dilation processing iterations. There are three criteria for whether this step is appropriate. The first is to use as few iterations as possible and the smallest possible convolution kernel size. The second is that the width of the grain boundary contour after the dilation processing is uniform and there is no width mutation. The third is that the dilation processing using this parameter has no "fishbone" features after subsequent refinement processing. In this embodiment, the convolution kernel size is 3×3.
[0069] S42: Thinning: Use a thinning algorithm to extract the grain boundary network from the expanded grain boundary contour. The grain boundary network size is the same as the original image pixel size, and the grain boundary width is 1 pixel. Figure 8 is the refinement result in this embodiment, that is, the grain boundary network of the austenitic heat-resistant steel microstructure used in this embodiment, Fig. 9This is a comparison of the grain boundary network and the original image microstructure. The red part is the grain boundary network. It can be seen from the figure that the precipitates gathered in the upper left corner have been refined into part of the grain boundary network. In the subsequent steps, it is necessary to pay attention to whether this part is extracted and counted as a grain boundary.
[0070] S5: Split single-segment grain boundaries: Split the grain boundary network into discontinuous single-segment grain boundaries, and extract the grain boundaries that meet the length requirements.
[0071] S51: Intersection search: Use the 3×3 unit matrix as the convolution kernel, perform convolution operations on all non-zero pixel points of the grain boundary network, and determine whether the pixel point is an intersection point based on the operation result. When the value of the non-zero pixel point is N, the point is considered to be an intersection point when the convolution operation result of the point is greater than 3N. Fig.10 This is the result of grain boundary network intersection detection. All detected grain boundary intersections in the figure are marked with dots.
[0072] S52: Intersection point interruption: check and filter the intersection points, and set the pixel values corresponding to the filtered intersection points to zero.
[0073] S53: Length distribution statistics: Use the connected domain function to divide the single-segment grain boundary and obtain the serial number, position, area and other information of all single-segment grain boundaries. Since the width of the grain boundary in the grain boundary network is 1 pixel, the area is equivalent to the length. Draw a single-segment grain boundary length distribution statistics chart based on the length information, and convert the pixel unit into the scale unit based on the original image scale information. Fig.11 This is a statistical diagram of the distribution of single-segment grain boundary length in the grain boundary network of this embodiment.
[0074] S54: Screening grain boundaries: Selecting a suitable length threshold to screen grain boundaries that meet the length requirement and obtaining pixel coordinate information. In this embodiment, the length threshold is set to 10 μm.
[0075] S55: Single segment extraction: Create a new image of the corresponding size based on the obtained grain boundary pixel coordinate information, redraw the grain boundary segment, rotate and crop the image appropriately so that the grain boundary trend in the image tends to be horizontal, and the first column of pixels on both ends have non-zero pixels. Then save the image as a separate image file and record the grain boundary sequence number and length.
[0076] S6: Characterization of grain boundary serration: Extract the characteristic sinusoidal wave of a single grain boundary and obtain its wavelength and amplitude.
[0077] S61: Waveform sampling: read the image of a single grain boundary and convert the image into a continuous waveform composed of (x, y) coordinate points according to the position information of non-zero pixels.
[0078] S62: Baseline correction: perform baseline correction on the waveform, with the order being first order.
[0079] S63: Fast Fourier Transform: Perform fast Fourier transform on the baseline-corrected waveform to obtain a series of sine waves.
[0080] S64: Extract characteristic sine waves: Calculate the amplitude-frequency spectrum and amplitude-wavelength spectrum based on the results of fast Fourier transform, remove the sine wave corresponding to the smallest cycle period based on the peak value of the amplitude-frequency spectrum, and then select the sine waves corresponding to the three largest amplitude peaks as the characteristic sine waves of this section of the grain boundary.
[0081] S65: Obtain wavelength amplitude: Obtain the wavelength and amplitude of the three characteristic sinusoidal waves of this section of the grain boundary according to the amplitude-wavelength spectrum, and multiply the wavelength and amplitude to obtain the grain boundary serration index. Since the grain size in this embodiment is small, the original grain boundary serration index is multiplied by 100 as the grain boundary serration index of this embodiment.
[0082] Fig.12 The grain boundary serration index is calculated for the microstructure of the austenitic heat-resistant steel in this embodiment and is marked in the grain boundary network. It can be observed from the figure that the precipitate aggregation part in the upper left corner is mistakenly regarded as the grain boundary, and its grain boundary number is 259. This data can be removed from the calculation result according to the number. Fig.13 This is a distribution diagram of the grain boundary serration index of the austenitic heat-resistant steel microstructure image used in this embodiment. According to the results, a total of 175 grain boundaries with a length greater than 10 μm are counted in the figure, totaling 2654 μm, of which the maximum grain boundary serration index is 12.56, the minimum grain boundary serration index is 0.025, and the average grain boundary serration index is 1.92.
[0083] The present invention also provides a device, including a memory and a processor, wherein: the memory is used to store a computer program that can be run on the processor; the processor is used to execute the steps of the above-mentioned computer vision-based grain boundary serration characterization method when running the computer program.
[0084] The above embodiments only express the implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention.
Claims
1. A method for characterizing grain boundary jaggedness based on computer vision, characterized in that: The following steps are involved: (1) Image acquisition: Obtain an image with jagged grain boundary features and determine its scale; (2) Image pre-processing: filtering and binarization of the image to obtain a binary image; (3) Filtering: denoising and removing burrs from the image; (4) Grain boundary network extraction: After morphological operations on the image, the grain boundary network is extracted using a thinning algorithm; (5) Split single grain boundary: Split the grain boundary network into discontinuous single grain boundaries and extract grain boundaries of specified length; (6) Characterization of grain boundary serration: Fast Fourier transform is used to calculate the characteristic sine wave of each grain boundary segment and obtain its wavelength and amplitude.
2. The method for characterizing grain boundary jaggedness based on computer vision according to claim 1, characterized in that: The image pre-processing in step (2) includes: Filtering: Filter the image through bilateral filtering; Single channel processing: select the color channel with the strongest contrast between the grain boundary and the surrounding area and convert the image under this color channel into a grayscale image; Histogram equalization: Enhance the image through adaptive histogram equalization; Standardization: Through binarization, the value corresponding to the non-grain boundary part is adjusted to 0, and the value corresponding to the grain boundary part is adjusted to 255.
3. The method for characterizing grain boundary jaggedness based on computer vision according to claim 1, characterized in that: The impurity filtering process described in step (3) includes: Connected domain segmentation: The image is segmented according to connected domains through the connected domain processing function, and the parameters of the serial number, position, and area corresponding to each connected domain are obtained, and a statistical diagram of the connected domain area distribution is drawn based on the obtained connected domain area; Connected domain screening: Select an appropriate area threshold based on the connected domain area distribution statistics, redraw the connected domains with an area greater than the threshold on a new image with the same pixel size as the original image, and obtain the grain boundary contour after removing noise points and small discontinuous grain boundaries; Morphological operation: Through morphological operation, the burrs on the grain boundary contour are removed.
4. The method for characterizing grain boundary jaggedness based on computer vision according to claim 1, characterized in that: The grain boundary network extraction described in step (4) includes: Dilation processing: select a convolution kernel of appropriate size according to the image size, and use the convolution kernel to dilate the image; Refinement processing: The grain boundary network is extracted using a refinement algorithm for the expanded grain boundary contour. The size of the grain boundary network is the same as the pixel size of the original image, and the grain boundary width is 1 pixel.
5. The method for characterizing grain boundary jaggedness based on computer vision according to claim 1, characterized in that: The step (5) of splitting a single-segment grain boundary comprises: Intersection search: Use the 3×3 unit matrix as the convolution kernel, perform convolution operations on all non-zero pixels in the grain boundary network, and determine whether the pixel is an intersection based on the operation results; Intersection break: check and filter the intersections, and set the pixel values corresponding to the filtered intersections to zero; Length distribution statistics: Use the connected domain processing function to obtain the serial number, position, and area information of all single-segment grain boundaries, draw a single-segment grain boundary length distribution statistics chart based on the length information, and convert the pixel unit into the scale unit in combination with the original image scale information; Screening grain boundaries: Preset the length threshold to screen the grain boundaries that meet the length requirements and obtain pixel coordinate information; Single segment extraction: Create a new image of the corresponding size based on the obtained grain boundary pixel coordinate information, redraw the grain boundary segment, rotate and crop the image appropriately so that the grain boundary trend in the image tends to be horizontal, and the first column of pixels on both ends have non-zero pixels. Then save the image as a separate image file and record the grain boundary sequence number and length.
6. The method for characterizing grain boundary jaggedness based on computer vision according to claim 1, characterized in that: The grain boundary serration characterization in step (6) includes: Waveform sampling: read the image of a single grain boundary and convert the image into a continuous waveform consisting of (x, y) coordinate points according to the position information of non-zero pixels; Baseline correction: perform baseline correction on the waveform; Fast Fourier Transform: Perform fast Fourier transform on the baseline-corrected waveform to obtain a series of sine waves; Extract characteristic sine waves: According to the results obtained by fast Fourier transform, the amplitude-frequency spectrum and amplitude-wavelength spectrum are calculated. According to the peak value of the amplitude-frequency spectrum, the sine wave corresponding to the smallest cycle period is removed, and then the sine waves corresponding to the three peaks with the largest amplitudes are selected as the characteristic sine waves of this section of grain boundary; Obtaining wavelength amplitude: Obtain the wavelength and amplitude of the three characteristic sinusoidal waves of the grain boundary according to the amplitude-wavelength spectrum, and multiply the wavelength and amplitude to obtain the grain boundary serration index.
7. The method for characterizing grain boundary jaggedness based on computer vision according to claim 3, characterized in that: The area threshold is 100.
8. The method for characterizing grain boundary jaggedness based on computer vision according to claim 4, characterized in that: The convolution kernel size is 3×3 or 5×5.
9. The method for characterizing grain boundary jaggedness based on computer vision according to claim 5, characterized in that: The length threshold is 10 μm.
10. A device, characterized in that: comprising a memory and a processor, wherein: A memory for storing computer programs that can be run on the processor; A processor is used to execute the steps of a method for characterizing grain boundary serration based on computer vision as described in any one of claims 1 to 9 when running the computer program.
