Automatic Measurement in Metallography

Quantitative analysis of the structure of metals and alloys is an important part of modern metal science. To obtain quantitative data and build dependencies, metallographic image processing programs are used, oriented both for scientific research and for use in industry. Programs capable of automatically perform - ing metallographic analysis are of great interest to consumers. When advertising such programs, it is often claimed that they allow quantitative analysis of the structure with virtually no time. The purpose of this work was to determine the time spent on quantitative metallographic analysis in some image processing programs presented on the Belarusian market. Connected and unconnected metallographic objects were considered. It is shown that automatic quantitative analysis is possible for unconnected objects (powders, cast iron graphite). The time required is within a minute. For connected objects (structures of metals and alloys after metallographic etching), the time required to detect objects and obtain digital data is 10–40 min or more, depending on the complexity of the object, which is unacceptable for factory laboratories that analyze a large number of samples per shift. Therefore, it is recommended that potential users of metallographic image processing software always require a substantive demonstration of the automatic measurement capabilities of the proposed software.


Introduction
Quantitative imaging of microstructures is an important part of modern materials science.It allows the linear dimensions and areas of structural units to be measured and, based on this, various dependencies to be established, graphs to be created, etc.In the past, quantitative metallography was based on manual measurements, which has been the subject of extensive research.In some cases, where possible, analogue equipment was used [1], which is still prescribed in the standards in force, in particular GOST 21073.4-75"Non-ferrous metals.Determination of grain size by the planimetric method".
At present, there are numerous image processing programs that automate the work of a metallurgist and provide ample opportunities for quantitative materials science.Metallurgical laboratories are equipped with metallographic complexes for analyzing the structure of metals and alloys, of which computer analysis tools are an important part [2].At the same time, any possibility that allows to automate the work of the operator and to minimize the influence of the human factor in the analysis of the structure of metals and alloys is very attractive.Therefore, development in this direction is quite active [3], not only in materials science, but also in other branches of sciences [4].Quantitative parameters of microstructure, such as grain size, can also be obtained by methods based on other principles, in particular electron backscatter diffraction (EBSD) [5].
Not only is the number of software products increasing, but the number of companies and intermediaries involved in selling them is also growing.Various organizations, especially factories, are offered to purchase programs for quantitative metallographic analysis of the structure.At the same time, it is claimed that the software allows automatic processing of images of structures and obtaining results in a minimum of time.After the purchase of such software, it is often the case that the claimed automation is not true.
The purpose of this work was to determine the time spent on quantitative metallographic analysis in some image processing programs presented on the Belarusian market.

Materials and methods of experiment
Scale image No. 4 according to GOST 5639-82 "Steels and alloys.Methods of detecting and deter-mining grain size", as well as images of microstructures of high strength cast iron and carbon steel and photographs of structures obtained by scanning electron microscopy were selected as objects of study.
A metallographic complex based on an MI-1 inverted metallographic microscope was used for photography and quantitative processing.The image was captured using a video camera with output to a personal computer monitor.Image processing was carried out using the IMAGE-SP program [6], which allows to measure the area, minimum and maximum diameter, length, width and average grain size, as well as some other parameters.The program was calibrated using a certified object micrometer (GOST 7513-55).The illustrations available on the Internet for the SIAMS 700 program [7] are also included in the consideration.Both programs -SIAMS and IMAGE-SP -belong to reliable software traditionally offered for purchase as part of metallographic complexes for studying the structure of metals and alloys.

Main part
In order to take measurements in any image processing program, the program must specify which objects are to be processed.To do this, these objects must be detected and painted in conditional colors (creating a so-called mask) according to their size.Detection is done by selecting parts of the image and adjusting the brightness range.
When studying so-called unconnected objects, it is possible to automatically detect objects for analysis [8].Examples of such objects are powders, chemical crystals, granules and so on, i.e. a set of objects in the field of view of a microscope, each of which can be considered as an individual object.For them, the position of some structural elements in relation to others is not important; only their presence, quantity, size and distribution in space are of interest.Unconnected objects can be quantitatively analyzed in image processing programs in a minimum of time [9].Figure 1 shows an example of unconnected objects (commercial diamond crystals) for which the dimensions were measured in an image processing program.The object detection is almost automatic because the objects and the substrate (slide) differ significantly in brightness.In principle, an image of such an object obtained in a bright or dark field can be considered as binarized, which does not require any additional processing for quantitative processing.Figure 1 shows the "mask" after the "object de-  1), which shows their linear dimensions, area and some functions derived from them (perimeter, conditional diameter, shape factor, etc.).The analysis was carried out "in a few mouse clicks" and the time required was minimal.The same applies to the possibility of measuring the size of graphite inclusions in gray cast iron (Figure 2a), if the section is not etched to the microstructure.Due to the large difference in brightness between graphite and the metal matrix, graphite inclusions can be considered unconnected objects.The image in Figure 2a is presented with a blue mask already applied.The convenience of detecting such objects makes it possible to create industry-oriented image processing programs [10].The situation changes radically when metallographic etching is performed.For connected objects, their position relative to each other and how they change within the sample is important.In metallography, connected objects are the structures of mul-tiphase alloys, single-phase materials with a grain structure, etc.In particular, inclusions of graphite in gray cast iron on a thin section after etching can only be considered connected objects (Figure 2b).Therefore, analysis of the structure in automatic mode is Real images of the structure are always imperfect.A fairly good image of the structure of Steel 3 is shown in Figure 3.The image contains relatively few defects and the etching shows the structure well for qualitative analysis.However, the brightness of the image is uneven and there are areas where the grain boundaries are not sufficiently developed by the etchant.These seemingly minor imperfections do not allow automatic grain selection.The stages of image selection are shown in Figure 4 as the colouring is changed in different brightness ranges.The left, brightest part of the image is painted first.The grain boundaries are not coloured and the grains are not fully coloured.On further attempts to colour all the grains on the left side of the image, the grains merge with the boundaries to form a single object, and on the right side, the grains are separated by the boundaries but are not fully coloured.The best result for object selection is shown in Figure 5a.In practice, there are two objects in the image: red and yellow."Cutting" into the grains to get a satisfactory result has to be done manually (Figure 5b).The time required to process the image was more than 30 min.In such a situation, it is sometimes quicker to create the image Figure 5 by manually "outlining" each grain, which is far from automatic.When advertising ordinary software products, dealers and representatives of development companies often omit required manual steps.However, in order to attract a customer, a result similar to that shown in Figure 5b is usually presented.Image processing software recognizes objects by their brightness [11].Black and white (binarized) images are best suited for this purpose.Figure 6a shows a black and white image of standard No. 4 GOST 5639-82, for which the "object detection" operation was performed in the "IMAGE-SP" program.Under the condition of ideal image quality (no "garbage", open grain boundary lines), the detection of objects (grains) is automatic and the analysis can be performed "in two clicks".There are, however, certain peculiarities.The reference structure is indicated by a circle.This used to be done to facilitate comparison, as we see the structure on a circular field due to the design of the equipment in the microscope objective.The grains that are cut off by a circle are perceived by the program as separate objects.In addition, although it is technically possible to introduce the rejection of such objects in automatic mode, it can be time consuming.The same situation occurs with any other structure containing, for example, scratches, which are also perceived by the program as lines delimiting the object.It should be remembered that the quality of real structures obtained in the laboratory depends significantly on many factors: staff qualifications, capabilities of the equipment used, properties of the sample itself, time allotted for sample preparation, significance of the results of the analysis, customer requirements, etc.As a rule, the quality of the section is neglected as much as possible in urgent analyses, especially in factory production, when the metallographic laboratory must give an answer within 10-20 min.An example of such a section is shown in Figure 6b.Improvement by any method is out of the question in this case.In this case, there is no question of improving it by any methods.
Therefore, we have to admit that the simplest and most reliable way to determine the grain size is the comparison method according to GOST 5639-82.The human eye is quite accurate in determining whether a structure belongs to a certain value.An error (or discrepancy) of 1 point declared by GOST is enough to confirm the correctness of the results.As a rule, the operator is rarely mistaken in this case.
When processing images, various filters can be applied.Here is a partial list: median, white balance, edge detection, maximum filter, low and high pass filters, detail enhancement, smoothing, brightness, differential, etc.
Figure 7 shows some stages of image processing of a single-phase grain structure in the SIAMS 700 program [7] using various filters.Despite the fact that this program is a well-known and reliable software product, it took 15 steps to restore the grain boundary mesh, including: local contrast, threshold segmentation, skeletonization, skeleton decoupling, fine particle removal, closure, skeletonization, inversion, transformation , restoration, inversion, closure, topological skeletonization, masking.Thus, "automatic" structure analysis requires a certain amount of time to carry out preparatory operations.As a result of the processing, each grain of the structure is marked and ready for measurement [12], Figure 8.In [13] the problems of the use of different options for the processing of a scanning electron microscope image were considered.An automated method was developed to analyze the shape and size of ductile pits formed during fracture of VT23 and VT23M titanium alloys.The method is based on the analysis of the image topology and includes the operations of smoothing the original fractographic image, convolution with a filter to detect topological ridges, determination of the threshold value with subsequent skeletonization to identify the boundaries between the pits, and clustering to isolate connected areas.Considering the listed sequence of operations, such image processing also takes a lot of time.

Conclusion
It is noted that the software market offers automatic data processing programs for quantitative analysis in metallography.
The possibilities of automatic analysis of connected and unconnected metallographic objects are considered.It is shown that the time required for detecting unconnected objects (powders, gray cast iron graphite) is minimal and can practically be attributed to automatic measurements.The time spent on data processing for connected objects in some image processing programs is analyzed.It is shown that on average the time spent on detecting objects (grains or phases of metal alloys) is 10-40 minutes, which is unacceptable for industrial metallographic laboratories.
Potential users of image processing software are encouraged to always request a substantive demonstration of the automatic measurement capabilities of the offered software.

Figure 1 -
Figure 1 -Detection of unconnected objects (diamond crystals) in an image processing program

Figure 2 -
Figure 2 -Detection of unconnected (a) and connected (b) objects (iron graphite) in an image processing program

Figure 3 -Figure 4 -
Figure 3 -IMAGE-SP program window, the initial stage of image selection

Figure 5 -
Figure 5 -Masks of objects obtained in the image processing program: a -automatic execution; b -manual execution

Figure 8 -
Figure 8 -Images demonstrating the capabilities of the SIAMS 700 program

Figure 9
Figure9shows the result of identifying objects in such an image, performed manually within 40 min.