A method for measuring and counting grain size of a material by image recognition technique

By combining scanning electron microscopy and artificial intelligence technology, and using image recognition technology to identify grain boundary intersections, the problem of traditional methods being time-consuming, labor-intensive, or costly is solved, and efficient and accurate grain size measurement is achieved.

CN116165233BActive Publication Date: 2025-11-25ZHUZHOU HUARUI PRECISION CUTTINGS TOOLS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310218145.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-08
Publication Date
2025-11-25
Estimated Expiration
2043-03-08

AI Technical Summary

Technical Problem

Existing methods for measuring grain size are time-consuming, labor-intensive, and inaccurate, or while accurate, they are costly, making it difficult to improve detection efficiency and accuracy without increasing costs.

Method used

By combining scanning electron microscopy (SEM) technology with artificial intelligence, grain boundaries are processed and identified using image recognition technology. Semi-transparent line segments are drawn using OpenCV library functions to identify grain boundary intersections and calculate grain size.

Benefits of technology

Without increasing costs, it significantly improves the efficiency and accuracy of grain size detection, simplifies the sample preparation process, and is applicable to both conductive and non-conductive materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116165233B_ABST
    Figure CN116165233B_ABST
Patent Text Reader

Abstract

The application discloses a kind of through image recognition technology measurement statistics material grain size method, it is related to material characterization technical field;The method comprises the following steps: S1, preparation is measured material scanning electron microscope chart;S2, the contrast and sharpness of scanning electron microscope chart are adjusted, and first picture is prepared;S3, first picture is digitized processing, and the pixel RGB data in first picture is collected;S4, after the RGB data obtained in step S3 is adjusted as B1G1R1, second image is output;S5, using OpenCV built-in library function draws translucent line segment on second image, and gets intersection point coordinate;S6, using grain boundary size calculation formula and intersection point coordinate statistics grain boundary size, to obtain crystal size data.The application combines traditional electron microscope test result with artificial intelligence, through computer program to scanning electron microscope image is handled and write in intercept measurement method, realizes the quick identification and measurement statistics of material grain size.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of material characterization research, and particularly relates to a method for measuring and counting material grain size through image recognition technology. BACKGROUND

[0002] With the improvement of the performance of metal materials, the application range of metal materials has been unprecedentedly broadened, and the metal materials are widely used in the fields of petroleum chemical industry, aerospace and medical instruments. With the further development of different fields, the requirements for the selected materials in terms of strength, toughness and service life and other performances are also higher and higher. The classical chemical structure theory points out that the internal structure of a substance completely determines its typical chemical and physical properties. Therefore, exploring the relationship between crystal structure and performance is one of the important basic research topics in material science.

[0003] In the crystal structure, the size and shape of the crystal grain have a significant influence on the performance of the material. Generally speaking, the finer and more uniform the crystal grains are in the normal temperature state, the better the comprehensive performance of the material is, because the smaller the crystal grains are, the more the grain boundaries are, and the crystal arrangement at the grain boundary is usually very irregular, and the crystal faces are interlocked and bite each other, thereby strengthening the intermetallic bonding. In addition, grain refinement is also one of the common methods for improving the performance of materials, that is, the size of the crystal grains in the material forming process is artificially controlled to obtain the material with the desired performance. Therefore, the measurement and comparison of the grain size are indispensable links in the research of material performance.

[0004] There are two traditional methods for measuring the grain size. One method needs to prepare a metallographic backscattered electron image first, and then manually identify the grain boundaries using Photoshop software, and then use the intercept method to statistically measure the grain size. Although this method has low cost, it is time-consuming and laborious and is not accurate. The other method is to prepare an EBSD sample, and then directly measure the grain size of the sample in the testing process using software. Although this method improves the accuracy, it is not more convenient because the testing has high requirements for the surface precision of the sample, and the sample preparation is very difficult, not to mention the soaring cost of testing.

[0005] The research and development of materials cannot be separated from detection analysis and comparative evaluation. For example, different grain sizes of the outer coating of hard alloy can bring great differences in macroscopic performance. Therefore, at the present stage, it is urgent to develop a new grain size detection method to improve the detection efficiency and accuracy of the grain size without increasing the cost, and to provide support and guarantee for the modification and research of materials. SUMMARY

[0006] The application aims to provide a method for measuring and counting material grain size through image recognition technology, which aims to process and recognize the material grain boundaries through artificial intelligence, and then realize the statistical analysis of the grain size of the material.

[0007] Specifically, the application provides a method for measuring and counting the grain size of a material by using image recognition technology, comprising the following steps:

[0008] S1, using a scanning electron microscope to take a selected area photograph of the material to be measured, to obtain a scanning electron microscope image of the material to be measured;

[0009] S2, adjusting the contrast and sharpness of the scanning electron microscope image to obtain a first picture;

[0010] S3, digitizing the first picture and collecting the RGB data of each pixel in the first picture;

[0011] S4, adjusting the RGB data obtained in step S3 to B1G1R1 and outputting a second image;

[0012] S5, using the built-in library function of OpenCV to draw a semi-transparent line segment on the second image, identifying the intersection of the line segment and the grain boundary, and obtaining the intersection coordinates;

[0013] S6, using a grain boundary size calculation formula and the intersection coordinates to count the grain boundary size, thereby obtaining the grain size data;

[0014] The grain boundary size calculation method is as follows:

[0015] The horizontal coordinate difference of adjacent intersection coordinates is calculated, and the horizontal coordinate difference is then converted into grain boundary size according to the scale.

[0016] According to one of the technical solutions of the method of the application, at least the following beneficial effects are achieved:

[0017] The application combines scanning electron microscope testing technology with artificial intelligence, that is, after simple metallographic preparation of the sample to be measured, an electronic image is obtained in the scanning electron microscope inlens mode, the image is processed by writing a program and adding an intercept line segment, then the intersection of the grain boundary and the intercept line segment is identified and the result is counted, thereby realizing the measurement and counting of the grain size of the material to be measured.

[0018] The application can greatly save the time and effort of researchers by identifying and counting the grain size of the material in the scanning electron microscope image through artificial intelligence, and the accuracy of the counting result can even be comparable to that of the intercept method in the EBSD result without increasing the testing cost.

[0019] The sample preparation of the application is simple, and the grain size of both conductive metal materials and non-conductive ceramic materials (such as alumina) can be measured.

[0020] The present application combines the traditional electron microscope test results with artificial intelligence, processes the scanning electron microscope image through a computer program and writes in the intercept measurement method, and realizes the rapid identification and measurement statistics of the material grain size.

[0021] According to some embodiments of the present application, the contrast adjustment in step S2 is 100% to 300% of the scanning electron microscope image of the material to be tested.

[0022] According to some embodiments of the present application, the sharpness adjustment in step S2 is 100% to 300% of the scanning electron microscope image of the material to be tested.

[0023] According to some embodiments of the present application, the contrast adjustment in step S2 is 150% to 300% of the scanning electron microscope image of the material to be tested.

[0024] According to some embodiments of the present application, the sharpness adjustment in step S2 is 150% to 300% of the scanning electron microscope image of the material to be tested.

[0025] According to some embodiments of the present application, the contrast adjustment in step S2 is 150% to 200% of the scanning electron microscope image of the material to be tested.

[0026] According to some embodiments of the present application, the sharpness adjustment in step S2 is 150% to 200% of the scanning electron microscope image of the material to be tested.

[0027] According to some embodiments of the present application, the RGB data adjustment to BGR in step S4 is as follows:

[0028] After extracting the RGB data obtained in step S3, R value, G value and B value are obtained respectively;

[0029] Then R value is assigned to R1, G value is assigned to G1, and B value is assigned to B1; and B1G1R1 is output.

[0030] According to some embodiments of the present application, the number of translucent line segments is 3 to 10.

[0031] According to some embodiments of the present application, the drawing of translucent line segments in step S5 comprises the following steps:

[0032] S51, using a picture copy function to create a copy file of the second picture and assigning it to a variable overlay;

[0033] S52, using a for statement to iterate the OpenCV library function cv2.line(image1, point1, image2, point2, color, thickness) x times, where x is the number of lines to be drawn, to form an intercept.

[0034] S53, using the cv2.add Weighted(scr1,alpha,scr2,beta,gamma[,dst=None[,dtype=None]]) function in OpenCV to perform weighted synthesis of the overlay and the second picture using for iteration, with weights of 0.5, and assign the result to the variable result.

[0035] According to some embodiments of the present application, the method for measuring and counting the grain size of a material by image recognition technology comprises the following specific steps:

[0036] Step 1: using a scanning electron microscope to take a selected area photograph of the material to be measured to obtain the original picture required by the subsequent computer program;

[0037] Step 2: importing the PIL, cv2, and numpy libraries required by the algorithm in the Python IDE;

[0038] Step 3: importing the crystal scanning electron microscope image through the third-party PIL library in Python;

[0039] Step 4: adjusting the contrast and sharpness of the crystal scanning electron microscope image through the third-party PIL library in Python;

[0040] Step 5: digitizing the image through the third-party numpy library in Python and converting its color mode through the OpenCV library function;

[0041] Step 6: drawing a semi-transparent line segment on the image through the built-in library function of OpenCV;

[0042] Step 7: setting the left mouse click callback function and establishing two empty lists to store the horizontal and vertical coordinates of the pixels, respectively, identifying the line intersection on the image and returning the intersection coordinates;

[0043] Step 8: using the grain boundary size calculation formula to count the grain boundary size using the returned intersection coordinates, and finally obtaining the size data of the crystal.

[0044] According to some embodiments of the present application, the method for measuring and counting the grain size of a material by image recognition technology comprises the following specific steps:

[0045] (101) Polishing the coating system section to 2000# with water sandpaper and polishing, removing oil and water, and further polishing the sample surface with a GATAN ion polishing device;

[0046] (102) Using a scanning electron microscope, the grain size morphology of the material to be tested is observed in inlens mode, and selected area photography is performed.

[0047] According to some embodiments of the present application, the specific process of step 2 of the method for measuring the grain size of the statistical material by image recognition technology is as follows:

[0048] (201) In the Pycharm Python IDE, in the file-Settings-Project-Python interpreter window, add numpy (v1.23.4), opencv-python (v4.6.0.66) and opencv-contrib-python (v4.6.0.66) three software packages;

[0049] (202) Use the import command in Python to import the Python built-in library PIL and the third-party libraries numpy and cv2.

[0050] According to some embodiments of the present application, the specific process of step 3 of the method for measuring the grain size of the statistical material by image recognition technology is as follows:

[0051] (301) Use the Image.open(ImgPath) function in the Python built-in PIL library to import the scanning electron microscope image of the crystal and assign it to the variable img1. Pay special attention to the connection symbol / between the root directory and the subdirectory of the image path.

[0052] According to some embodiments of the present application, the specific process of step 4 of the method for measuring the grain size of the statistical material by image recognition technology is as follows:

[0053] (401) Use the Image Enhance.Contrast(image).enhance(param) function in the PIL library to adjust the contrast of the imported image and assign it to the variable img2.

[0054] (402) Use the Image Enhance.Sharpness(image).enhance(param) function in the PIL library to adjust the sharpness of the image with adjusted contrast and assign it to the variable img3.

[0055] According to some embodiments of the present application, the specific process of step 5 of the method for measuring the grain size of the statistical material by image recognition technology is as follows:

[0056] (501), the crystal scanning electron microscope image with adjusted sharpening effect and contrast is digitized using the asarray(image) function in the numpy library;

[0057] (502), the spatial color of the digitized crystal scanning electron microscope image is converted using the cv2.cvtColor(image, flag) function in the OpenCV library, and the result is assigned to the variable img4;

[0058] In step (502), since the color mode of the image is RGB when importing the color image using the PIL library, and the color mode of OpenCV is BGR, the picture function parameter flag should use cv2.COLOR_RGB2BGR.

[0059] According to some embodiments of the present application, the method for measuring and counting the grain size of the material by image recognition technology, the specific process of step 6 is as follows:

[0060] (601), a copy file of img4 is created using the Image.copy(image) function, and is assigned to the variable overlay;

[0061] (602), the OpenCV library function cv2.line(image1, point1, image2, point2, color, thickness) is iterated x times using the for statement, where x is the number of lines to be drawn, to form the intercept;

[0062] (603), the overlay and img4 iterated using for are weightedly synthesized with weights of 0.5 using the cv2.addWeighted(scr1, alpha, scr2, beta, gamma[, dst = None[, dtype = None]]) function in OpenCV, and the result is assigned to the variable result.

[0063] According to some embodiments of the present application, the method for measuring and counting the grain size of the material by image recognition technology, the specific process of step 7 is as follows:

[0064] (701), define a function named click with parameters event, x, y, flags, and param;

[0065] (702), the variable result is read and opened using the built-in function cv2.imread(filename[, flags]) in the OpenCV library;

[0066] (703), capture mouse event with if statement, when mouse event is mouse click, execute (704) and (706) to (709);

[0067] (704), record pixel coordinates of mouse click with variables x, y;

[0068] (705), establish two empty lists a and b for storing horizontal and vertical coordinates of function callback pixels;

[0069] (706), add recorded pixel coordinates to lists a and b respectively using Python built-in function ls.append(object);

[0070] (707), draw a circle with function callback coordinates as center using cv2.circle(image, center_coordinates, radius, color, thickness) in OpenCV;

[0071] (708), draw a text string of pixel coordinates of click on the upper right corner of the clicked pixel point using cv2.putText(image, text, org, font, fontScale, color, [thickness, lineType, boyYomLeftOrigin]) function in OpenCV;

[0072] (709), print the value of function callback coordinates using Python built-in function print({}.format(variable)).

[0073] According to some embodiments of the present application, in step (706), since the parameter thickness is -1 and the parameter radius is 1, the circle drawn is a solid circle with a radius of 1, which is represented as a point on the image being operated.

[0074] According to some embodiments of the present application, the specific process of step 8 is as follows:

[0075] (801), obtain horizontal coordinates of all adjacent pixel points clicked according to the returned list and calculate the difference;

[0076] (802), calculate the final statistical result according to the corresponding scale. BRIEF DESCRIPTION OF DRAWINGS

[0077] For the convenience of those skilled in the art, the present application will be further described below with reference to the accompanying drawings.

[0078] Figure 1 is a flow chart of measuring and counting the grain size of a material by using image recognition technology according to the present application.

[0079] Figure 2 is the original electron microscope image used in Example 1 of the present application.

[0080] Figure 3 is the result of image processing with the intercept method and line drawing in Example 1 of the present application.

[0081] Figure 4 is the grain size distribution histogram obtained by measurement and counting according to the present application.

[0082] Figure 5 is the image after adjusting the contrast in Example 1 of the present application.

[0083] Figure 6 is the image after adjusting the sharpness in Example 1 of the present application. DETAILED DESCRIPTION

[0084] The concept and the technical effects of the present application will be described in detail below in combination with the embodiments. Obviously, the described embodiments are only some of the embodiments of the present application but not all the embodiments. Based on the embodiments of the present application, other embodiments obtained by those skilled in the art without creative effort should fall within the scope of the present application.

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

[0086] The specific conditions not mentioned in the embodiments are carried out according to the conventional conditions or the conditions recommended by the manufacturer. The reagents or instruments not mentioned by the manufacturer are all conventional products that can be purchased on the market.

[0087] In the specific implementation process, the present application proposes a method for measuring and counting the grain size of a material by using image recognition technology, which comprises the following steps:

[0088] Step 1: using a scanning electron microscope to take a selected area photograph of the material to be measured to obtain the original picture required for subsequent computer program;

[0089] Step 2, import the required PIL, cv2, numpy library in the Python IDE;

[0090] Step 3, use the Python command to import the scanning electron microscope image of the material;

[0091] Step 4, adjust the contrast of the scanning electron microscope image through the built-in PIL library in Python;

[0092] Step 5, realize the sharpening effect of the scanning electron microscope image through the built-in PIL library in Python;

[0093] Step 6, use the OpenCV built-in library function to draw a semi-transparent line segment on the image;

[0094] Step 7, set the mouse left click callback function and establish two empty lists to store the horizontal and vertical coordinates of the pixels respectively, identify the intersection of the line and the grain boundary on the image, and return the intersection coordinates;

[0095] Step 8, use the returned intersection coordinates to calculate the grain size using the grain size calculation formula, and finally obtain the statistical result of the material grain size.

[0096] In the following, the present application is further described in detail through examples.

[0097] Example 1

[0098] This example is a method for measuring and counting the grain size of a material by image recognition technology, and the specific steps are as follows:

[0099] The material to be measured in this example is an aluminum oxide coating;

[0100] Step 1, prepare the sample for metallographic preparation, and use the inlens mode in the scanning electron microscope (SEM) to detect and take a picture of the surface morphology of the sample, providing original image data for subsequent image recognition;

[0101] (101), polish the coating system cross section to 2000# (100 mesh→200 mesh→400 mesh→600 mesh→800 mesh→1000 mesh→2000 mesh) and polish, remove oil and water, and use GATAN ion polishing equipment to further polish the sample surface, so that the sample surface roughness reaches Ra 0.012;

[0102] (102), use a scanning electron microscope to observe the grain size morphology of the material to be measured in inlens mode and take a selected area photograph.

[0103] As Figure 2As shown, the original electron microscope image used can be seen that the alumina grains deposited by chemical vapor deposition grow in the longitudinal direction, the grains become larger, and the grain size is micron level.

[0104] Step 2, import built-in libraries and third-party libraries in the Python integrated development environment to provide tools for subsequent image processing:

[0105] (201) In Pycharm, a Python IDE, add numpy (v1.23.4), opencv-python (v4.6.0.66), and opencv-contrib-python (v4.6.0.66) in the file -- settings -- project -- Python interpreter window;

[0106] (202) Import Python built-in library PIL and third-party libraries numpy and cv2 using the Python built-in import command;

[0107] Step 3, import the image to be recognized:

[0108] (301) Import the scanning electron microscope image of the crystal using the Image.open(ImgPath) function in the Python built-in PIL library and assign it to the variable img1. Pay special attention to the connection symbol / between the root directory and the subdirectory of the image path;

[0109] Step 4, adjust the contrast (contrast increased by 200% of the original image, see Figure 5 ) and sharpness (sharpness increased by 200% of the original image, see Figure 6 ) of the imported image to make the grain boundaries clearer:

[0110] (401) Adjust the contrast of the imported image using the Image Enhance.Contrast(image).enhance(param) function in the PIL library and assign it to the variable img2;

[0111] (402) Adjust the sharpness of the image with adjusted contrast using the Image Enhance.Sharpness(image).enhance(param) function in the PIL library and assign it to the variable img3;

[0112] Step 5, perform digital processing on the image to convert it into a form that Open Cv can handle:

[0113] (501), the crystal scanning electron microscope image with adjusted sharpening effect and contrast is digitized using the asarray(image) function in the numpy library;

[0114] (502), the spatial color of the digitized crystal scanning electron microscope image is converted using the cv2.cvtColor(image, flag) function in the OpenCV library, and is assigned to the variable img4; since the color mode of the image is RGB when importing a color image using the PIL library, and the color mode of OpenCV is BGR, the flag parameter of the picture function should use cv2.COLOR_RGB2BGR;

[0115] Step 6, create a copy image and make an intercept on the copy image, and then perform a weighted synthesis with the original image with a weight of 0.5 to form a semi-transparent effect of the intercept, so as to identify the intersection of the intercept and the grain boundary:

[0116] (601), use the Image.copy(image) function to create a copy file of img4, and assign it to the variable overlay;

[0117] (602), use the for statement to iterate the OpenCV library function cv2.line(image1, point1, image2, point2, color, thickness) for x times, where x is the number of lines to be drawn (x is 5 in this embodiment) to form the intercept;

[0118] (603), use the cv2.addWeighted(scr1, alpha, scr2, beta, gamma[, dst = None[, dtype = None]]) function in OpenCV to perform a weighted synthesis of overlay and img4 with a weight of 0.5, and assign the result to the variable result;

[0119] Figure 3 As shown in the result of the image processing and intercepting method, the number of lines drawn x = 5, the intersection of the intercept and the grain boundary is clear, and the corresponding coordinate values of the intersection of the grain boundary and the intercept appear after clicking.

[0120] Step 7, set the mouse click return function, record and return the coordinates of the point clicked on the image and mark it on the image to provide data for subsequent data processing:

[0121] (701), define a function named click, whose parameters are event, x, y, flags, and param;

[0122] (702) Use the OpenCV library built-in function cv2.imread(filename[,flags]) to read and open the variable result;

[0123] (703) Use an if statement to capture mouse events. When the mouse event is a mouse click, execute (704) and (706) to (709);

[0124] (704) Use variables x and y to record the pixel coordinates of mouse clicks;

[0125] (705) Create two empty lists a and b to store the x and y coordinates of the pixels in the function callback;

[0126] (706) Use the built-in Python function ls.append(object) to add the recorded pixel coordinates to lists a and b respectively;

[0127] (707) Use cv2.circle(image,center_coordinates,radius,color,thickness) in OpenCV to draw a circle with the coordinates of the function callback as the center;

[0128] (708) Use the cv2.putText(image,text,org,font,fontScale,color[,thickness[,lineType[,boyyomLeftOrigin]]]) function in OpenCV to draw the text string of the clicked pixel coordinates in the upper right corner of the clicked pixel;

[0129] (709) Use the built-in Python function print({}.format(variable)) to print the coordinates of the function callback; since the parameter thickness is -1 and the parameter radius is 1, the circle drawn is a solid circle with a radius of 1, which is represented as a point on the image being manipulated;

[0130] Step 8: Process the data returned in the previous step to obtain the statistical results of the grain size:

[0131] (801) Obtain the x-coordinates of all adjacent pixels clicked based on the returned list and calculate the difference;

[0132] (802) The final statistical results are calculated based on the corresponding scale.

[0133] like Figure 4 As shown ( Figure 4In the figure, the abscissa Diameter represents the grain diameter (μm), and the ordinate Relative Frequency represents the relative frequency (%). The grain size distribution histogram obtained by measurement statistics shows that the grain diameter of the alumina coating ranges from 0 μm to 1.6 μm, the most probable grain diameter ranges from 0.2 μm to 0.4 μm, and the average grain diameter is 0.67 μm.

[0134] Part of the intersection test results in Example 1 of the present application are shown in Table 1.

[0135] Table 1: Part of the intersection test results in Example 1 of the present application

[0136]

[0137]

[0138] The results show that, whether it is a conductive metal material or a non-conductive ceramic material, the present application can identify and statistically analyze the grain size. The present application ingeniously combines the original test technology with artificial intelligence, improves the detection efficiency and accuracy of the grain size without increasing the cost, and provides support and protection for the modification and research and development of materials.

[0139] In summary, the present application combines the scanning electron microscope test technology with artificial intelligence, that is, after simple metallographic preparation of the sample to be tested, an electron image is obtained under the scanning electron microscope inlens mode, the image is processed by writing a program and adding an intercept line segment, then the intersection of the grain boundary and the intercept line segment is identified and the results are obtained, and the measurement and statistics of the grain size of the material to be tested are realized. The present application identifies and statistically analyzes the grain size of the material in the scanning electron microscope image through artificial intelligence, which can greatly save the time and effort of researchers, and the statistical result accuracy is even comparable to that of the intercept method in the EBSD result without increasing the test cost. The sample preparation of the present application is simple, and whether it is a conductive metal material or a non-conductive ceramic material (such as alumina), the grain size can be measured. The present application combines the traditional electron microscope test result with artificial intelligence, processes the scanning electron microscope image through a computer program and writes an intercept measurement method, and realizes the rapid identification and measurement and statistics of the grain size of the material.

[0140] The above-described specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application, and it should be understood that the above-described embodiments are only specific embodiments of the present application and are not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. 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 for measuring statistical material grain size using image recognition technology, characterized in that, Includes the following steps: S1. Selective imaging of the material under test is performed using a scanning electron microscope to obtain a scanning electron microscope image of the material under test. S2. Adjust the contrast and sharpness of the scanning electron microscope image to obtain the first image; S3. Digitize the first image and collect the RGB data of each pixel in the first image; S4. After adjusting the RGB data obtained in step S3 to B1G1R1, output the second image; S5. After drawing semi-transparent line segments on the second image using OpenCV built-in library functions, identify the intersection points of the lines and grain boundaries, and obtain the coordinates of the intersection points; The number of the semi-transparent line segments is 3 to 10; Drawing the semi-transparent line segment as described in step S5 includes the following steps: S51. Use the image copy function to create a copy file of the second image and assign it to the variable overlay; S52. Use a for loop to iterate the OpenCV library function cv2.line(image1,point1,image2,point2,color,thickness) a number of times, where x is the number of lines to be drawn to form the intercept. S53. Use the OpenCV function cv2.addWeighted(scr1,alpha,scr2,beta,gamma[,dst=None[,dtype=None]]) to perform a weighted synthesis of the overlay and the second image, which have been iterated over using a for loop, with each weight being 0.5, and assign the result to the variable result. S6. Grain boundary dimensions are calculated using the grain boundary size calculation formula and the intersection point coordinates, thereby obtaining crystal size data; The grain boundary size is calculated as follows: Calculate the difference in the x-coordinates of adjacent intersection points, and then convert the difference in x-coordinates into grain boundary dimensions according to the scale.

2. The method for measuring statistical material grain size using image recognition technology according to claim 1, characterized in that, In step S2, the contrast is adjusted to 100% to 300% of the scanning electron microscope image of the material under test.

3. The method for measuring statistical material grain size using image recognition technology according to claim 1, characterized in that, In step S2, the sharpness is adjusted to 100% to 300% of the scanning electron microscope image of the material under test.

4. The method for measuring statistical material grain size using image recognition technology according to claim 1, characterized in that, The method for adjusting RGB data to BGR in step S4 is as follows: After extracting the RGB data obtained in step S3, the R value, G value and B value are obtained respectively; Then assign the R value to R1, the G value to G1, and the B value to B1; output B1G1R1.

Citation Information

Patent Citations

  • Ferrite grain size rating method based on deep learning network

    CN115410034A

  • Mean particle size measuring method with image

    JP1996101114A