Quantitative metallographic analysis method and system, electronic equipment and storage medium
By processing and chemical inspection and comparison of the digital images of high-temperature alloys, the parameters of the analysis software are adjusted, and quantitative analysis of the γ’ phase is achieved, solving the problem of insufficient analysis accuracy in the prior art and improving the accuracy of the analysis.
Patent Information
- Application Number
- CN202411902855.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art is difficult to realize quantitative analysis of the γ’ phase in high-temperature alloys, resulting in insufficient analysis accuracy and ineffective judgment of whether the blades are overheated.
By obtaining the digital image of the analysis object, using preset metallographic analysis software for image processing, comparing it with chemical detection results, and adjusting the operating parameters of the software to achieve quantitative analysis of the γ’ phase.
The accuracy of metallographic analysis is improved, and the content and rounding degree of γ’ phase can be more accurately judged, thereby determining whether the blade is overheated.
Smart Images

Figure CN119991557A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of metal material analysis, and in particular to a quantitative metallographic analysis method and system, electronic equipment, and storage medium. Background Art
[0002] At present, metallographic detection technology is relatively mature, but there are few technical means for quantitative analysis of various phase components in high-temperature alloys (especially the important phase such as γ' phase), which is almost a technical blank area.
[0003] γ' phase (a Ni3Al-based intermetallic compound) is an important phase in high-temperature alloys. As the use temperature rises, it begins to gradually round and melt back, and its content is closely related to temperature. Therefore, its content and roundness are often considered to be important bases for engine overheating inspection. Since the dissolution and precipitation of γ' phase are extremely sensitive to temperature, it is often necessary to measure the dissolution, focusing and growth of γ' phase at different temperatures above the use temperature of the blade alloy to determine whether the blade is overheated.
[0004] Therefore, how to realize the analysis of various phase components in the alloy and improve the analysis accuracy is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In order to solve the above technical problems, the embodiments of the present application provide a quantitative metallographic analysis method and system, an electronic device, a computer-readable storage medium, and a computer program product.
[0006] In the first aspect, in order to solve the above technical problems, the present application provides a quantitative metallographic analysis method, comprising:
[0007] acquiring a digital image of the object to be analyzed;
[0008] Processing the digital image using a preset metallographic analysis software to obtain an image recognition result for a target metallographic phase in the analysis object;
[0009] Obtaining a chemical detection result of the target metallographic structure in the analysis object, and obtaining a comparison result between the chemical detection result and the image recognition result;
[0010] The operating parameters of the metallographic analysis software are adjusted based on the comparison result, so as to use the adjusted metallographic analysis software to process the image to be measured of the object to be measured, and obtain the quantitative analysis result of the target metallographic structure in the object to be measured.
[0011] The beneficial effects are:
[0012] In the technical solution provided in the embodiments of the present application, the acquired digital image of the analysis object is processed using the preset metallographic analysis software to obtain an image recognition result for the target metallographic phase in the analysis object; then, the chemical detection result of the target metallographic phase in the analysis object is obtained, the chemical detection result is relatively accurate, and a comparison result between the chemical detection result and the image recognition result is obtained; finally, based on the comparison result, the operating parameters of the metallographic analysis software are adjusted to achieve the optimization of the preset metallographic analysis software, so that the adjusted metallographic analysis software is used to process the image to be tested of the object to be tested, and the quantitative analysis result of the target metallographic phase in the object to be tested is obtained, thereby improving the accuracy of the metallographic analysis.
[0013] In a second aspect, the present invention provides a quantitative metallographic analysis system, comprising a software processing unit and a chemical detection unit, wherein the software processing unit comprises an acquisition module, a preprocessing module, a comparison module and a parameter adjustment module;
[0014] The acquisition module is used to acquire a digital image of the analysis object;
[0015] The preprocessing module is used to process the digital image using a preset metallographic analysis software to obtain an image recognition result for a target metallographic phase in the analysis object;
[0016] The comparison module is used to obtain the chemical detection result of the target metallographic phase in the analysis object transmitted by the chemical detection unit, and to obtain the comparison result between the chemical detection result and the image recognition result;
[0017] The parameter adjustment module is used to adjust the operating parameters of the metallographic analysis software based on the comparison result, so as to use the adjusted metallographic analysis software to process the image to be tested of the object to be tested, and obtain the quantitative analysis result of the target metallographic structure in the object to be tested.
[0018] In a third aspect, the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the quantitative metallographic analysis method as described above.
[0019] In a fourth aspect, the present application further provides a computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, enables the computer to execute the quantitative metallographic analysis method as described above.
[0020] In a fifth aspect, the present application further provides a computer program product or a computer program, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the quantitative metallographic analysis method provided in the above-mentioned various optional embodiments.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0023] Figure 1 It is a process of a quantitative metallographic analysis method shown in an exemplary embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of the interface of the preset metallographic analysis software in an exemplary embodiment of the present application;
[0025] Figure 3 It is a comparison diagram of the effect after grayscale processing is performed on a digital image in an exemplary embodiment of the present application;
[0026] Figure 4 is a grayscale histogram corresponding to the cropped intermediate image in an exemplary embodiment of the present application;
[0027] Figure 5 This is a comparison diagram of the effect after median filtering is performed on the intermediate image in an exemplary embodiment of the present application;
[0028] Figure 6 is a comparison diagram of the effects of Gaussian filtering of the intermediate image in an exemplary embodiment of the present application;
[0029] Figure 7 is a comparison diagram of the effect after bilateral filtering is performed on the intermediate image in an exemplary embodiment of the present application;
[0030] Figure 8 is a comparison diagram of the effect after bilateral filtering is performed on the intermediate image in an exemplary embodiment of the present application;
[0031] Fig. 9This is a comparison diagram of the effect of using the Otsu threshold to binarize the pre-processed image in an exemplary embodiment of the present application;
[0032] Fig.10 This is a comparison diagram of the effect of using Mean threshold to binarize the pre-processed image in an exemplary embodiment of the present application;
[0033] Fig.11 This is a comparison diagram of the effect of binarizing the pre-processed image using the Guassian threshold in an exemplary embodiment of the present application;
[0034] Fig.12 is a block diagram of a quantitative metallographic analysis system shown in an exemplary embodiment of the present application;
[0035] Fig.13 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0036] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of systems and methods consistent with some aspects of the present application as detailed in the attached claims.
[0037] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0038] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0039] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0040] In order to solve the problem of how to analyze various phase components in alloys and improve the accuracy of analysis, the embodiments of the present application propose a quantitative metallographic analysis method and system, electronic equipment, and computer-readable storage medium, which mainly involve quantitative metallographic analysis technology for γ' phase included in metal material analysis technology. These embodiments will be described in detail below.
[0041] First see Figure 1 , Figure 1 This is a flowchart of a quantitative metallographic analysis method shown in an exemplary embodiment of the present application. The method can be specifically performed by a server, which can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, etc., and is not limited here.
[0042] like Figure 1 As shown, in an exemplary embodiment, the quantitative metallographic analysis method may include steps S101 to S104, which are described in detail as follows:
[0043] Step S101, obtaining a digital image of an analysis object.
[0044] In this embodiment, the analysis object is an object composed of a high-temperature alloy, such as an engine blade. A photograph of the high-temperature alloy taken with a scanning electron microscope at a high magnification is used as a digital image of the analysis object for quantitative analysis of the target metallographic phase, and the target metallographic phase may be a γ' phase (a Ni3Al-based intermetallic compound).
[0045] Step S102, using a preset metallographic analysis software to process the digital image to obtain an image recognition result for the target metallographic structure in the analysis object.
[0046] The design of the preset metallographic analysis software is implemented using C++ language, and the digital image processing is carried out with the help of OpenCv library containing a large number of image processing algorithms. OpenCv is a powerful visual function library with a large number of API interfaces that can be directly called to perform pixel operations, and can be widely used in many computer vision fields. The GUI interface of the software is implemented using the Qt framework, and a cross-platform graphical user interface application can be designed. In this embodiment, the digital image is processed using the preset metallographic analysis software to obtain an image recognition result for the target metallographic phase in the analysis object.
[0047] Step S103, obtaining chemical detection results of the target metallographic structure in the analysis object, and obtaining comparison results between the chemical detection results and the image recognition results.
[0048] In this embodiment, the chemical detection results are obtained by chemical extraction. Preferably, after the percentage of the γ' phase is determined by chemical extraction, it is converted into a volume percentage as the chemical detection result, and then the comparison result between the chemical detection result and the target metallographic content represented by the image recognition result is calculated.
[0049] Step S104, adjusting the operating parameters of the metallographic analysis software based on the comparison result, so as to use the adjusted metallographic analysis software to process the image of the object to be measured, and obtain the quantitative analysis result of the target metallographic structure in the object to be measured.
[0050] In this embodiment, the operating parameters of the metallographic analysis software are adjusted and optimized based on the comparison results so that the output results can be more accurate. The adjusted metallographic analysis software is then used to process the image of the analysis object or other object to be tested to obtain the quantitative analysis results of the target metallographic structure in the object to be tested. That is, the object to be tested can be the above-mentioned analysis object or other high-temperature alloy devices.
[0051] As can be seen from the above, in the method provided in this embodiment, the acquired digital image of the analysis object is processed using the preset metallographic analysis software to obtain an image recognition result for the target metallographic phase in the analysis object; then, the chemical detection result of the target metallographic phase in the analysis object is obtained, the chemical detection result is relatively accurate, and a comparison result between the chemical detection result and the image recognition result is obtained; finally, based on the comparison result, the operating parameters of the metallographic analysis software are adjusted to achieve the optimization of the preset metallographic analysis software, so as to use the adjusted metallographic analysis software to process the image to be tested of the object to be tested, and obtain the quantitative analysis result of the target metallographic phase in the object to be tested, thereby improving the accuracy of the metallographic analysis.
[0052] In an exemplary embodiment provided in the present application, the specific steps of processing a digital image using a preset metallographic analysis software to obtain an image recognition result for a target metallographic phase in the analysis object include:
[0053] Using the preset metallographic analysis software, the digital image is gray-scaled to obtain an intermediate image;
[0054] Perform filtering on the intermediate image to obtain a preprocessed image;
[0055] The preprocessed image is binarized to obtain the image recognition result of the target metallographic structure in the analysis object.
[0056] This embodiment uses a preset metallographic analysis software to first grayscale the digital image to obtain an intermediate image. Grayscale the image not only reduces the amount of calculation, but also retains important information and features in the original image. The intermediate image is then filtered to obtain a preprocessed image, aiming to eliminate image noise as much as possible while retaining image details, thereby making subsequent image processing more convenient and accurate. Finally, the preprocessed image is binarized to obtain an image recognition result for the target metallographic phase in the analysis object, so as to judge and distinguish the regional features with different grayscales in the image, thereby clarifying the content of the target metallographic phase.
[0057] See also Figure 2 , Figure 2 FIG. 1 is a schematic diagram of the interface of the preset metallographic analysis software in an exemplary embodiment of the present application. Figure 2 As shown, the interface of the metallographic analysis software can be mainly divided into six areas, which can be divided from top to bottom and from left to right into the upper right corner interface control button, menu bar, data area, image display area, result display area and status bar.
[0058] The interface control buttons in the upper right corner are minimize, maximize and close buttons from left to right. Each function option in the menu bar corresponds to the menu bar one by one. The first four in the menu bar correspond to the function controls of creating a new file, opening a file, saving and saving as functions.
[0059] The data area contains some controls for binding with digital images, intermediate images, preprocessed images and binary image data, mainly used for data control and selection. The data tree area contains some established data to be saved areas. You can add new areas, add child nodes, delete the data area, and rename the data area in each area of the data tree through the drop-down menu that pops up by right-clicking the mouse. In addition, the data tree area also implements a three-state, that is, when the mouse does not enter the data area, the controls in the data tree display their original colors; when the mouse hovers over a control in the data area, the controls in the data tree appear maroon; after the mouse clicks the control to select it, the control appears slate blue.
[0060] The middle area of the metallographic analysis software interface is the image display area, which is used to display and refresh the processed image. The image display area is mainly used to display pictures. After a series of grayscale processing, filtering processing and binarization operations are performed on the picture, the results displayed in this area will change continuously. After completing the binarization of the pre-processed image or adjusting the operating parameters of the metallographic analysis software based on the comparison results, click the calculation button. While the button is jumping, the data display area above it will display the proportion of black pixels in the image.
[0061] In another exemplary embodiment provided by the present application, the grayscale processing adopts the weighted average method, so the specific steps of grayscale processing the digital image to obtain the intermediate image include:
[0062] Determine the weighted parameters corresponding to the weighted average method;
[0063] The cvtColor function is used to convert the digital image into a grayscale image based on the weighted parameters as an intermediate image.
[0064] Each pixel in a color image generally includes three color channels: R, G, and B. If the image is directly processed and operated, the amount of calculation is relatively large. After the color image is grayed, the color of the image will become quite monotonous, but the grayscale image can still reflect the distribution and characteristics of the overall and local chromaticity and highlight levels. Therefore, graying the image can not only reduce the amount of calculation, but also retain the important information and features of the original image.
[0065] In this embodiment, by clicking Figure 2 The sixth button in the menu bar of the software interface shown can use the weighted average method to grayscale the digital image of the analysis object. Preferably, the weighted average method used by the cvtColor() function implemented by the cvtColor() function in OpenCv is first determined by R ,ω G ,ω B , the weighted parameter values can be 0.299, 0.587, and 0.114 respectively; according to the relationship between the gray value and the values of R, G, and B, Gray = ω R R+ω G G+ω B B, we can know that the grayscale calculation formula of the digital image is: Gray = 0.299R + 0.587G + 0.114B, which realizes the conversion from color image to grayscale image and obtains the intermediate image.
[0066] like Figure 3 As shown, Figure 3 This is a comparison diagram of the effect of grayscale processing of digital images in an exemplary embodiment of the present application. There are blue scales and symbols in the figure. After grayscale processing, the color image is converted into a grayscale image, which is convenient for continuing the next step of image processing.
[0067] In an exemplary embodiment provided by the present application, after obtaining the intermediate image after grayscale processing, the intermediate image can also be cropped as required, and the specific steps include:
[0068] A cropping instruction is obtained, and the intermediate image is cropped based on the cropping instruction to obtain a cropped intermediate image for filtering processing.
[0069] In this embodiment, a trimming instruction is formed based on the operation in the interface of the metallographic analysis software, and by clicking Figure 2 The seventh button in the menu bar of the software interface shown can generate a cropping instruction, and the intermediate image is cropped based on the cropping instruction to obtain a cropped intermediate image. The cropped intermediate image removes irrelevant information such as instrument parameters or shooting time recorded in the image.
[0070] After the middle image is cropped, click Figure 2 The histogram button represented by the eighth button in the menu bar of the software interface shown in the figure can count the histogram information of the number of pixels in each grayscale range in the image and display it in the image display area, such as Figure 4 As shown, Figure 4 It is a grayscale histogram corresponding to the cropped intermediate image in an exemplary embodiment of the present application. In the figure, the horizontal axis of the histogram is the grayscale value, and the vertical axis is the number of pixels. The left side of the horizontal axis is 0, representing a pure black pixel, and the right side of the horizontal axis is 255, representing a pure white pixel.
[0071] In an exemplary embodiment provided by the present application, the specific steps of filtering the intermediate image to obtain the pre-processed image include:
[0072] Determining filtering parameters of a filtering algorithm;
[0073] The intermediate image is filtered based on the filtering parameters to obtain a preprocessed image. The filtering algorithm is median filtering, Gaussian filtering or bilateral filtering.
[0074] Before image processing, it is often necessary to filter the image. The main purpose of image filtering is to eliminate the image noise as much as possible while retaining the image details, so as to make the subsequent image processing more convenient and accurate.
[0075] In this embodiment, the filtering algorithm is median filtering, Gaussian filtering or bilateral filtering. The filtering parameter of median filtering is the convolution kernel size, the filtering parameter of Gaussian filtering is the standard deviation σ (sigma) of the Gaussian filter, and the filtering parameter of bilateral filtering is σ C and σ S (sigmaColor and sigmaSpace are two parameters of the Gaussian bilateral filter, which control the smoothness of the color space and spatial domain respectively).
[0076] Median filtering is to use the median value of all pixel values in the convolution kernel as the pixel value of the pixel at the center of the filter. When the median filter is used to filter the intermediate image to obtain the pre-processed image, in the interface of the metallographic analysis software, click Figure 2The ninth button in the menu bar of the software interface will pop up the parameter setting dialog box. Users can set the convolution kernel size to achieve image noise reduction. It is not recommended to design the convolution kernel too large, otherwise it will easily cause serious image distortion. Figure 5 As shown, Figure 5 This is a comparison diagram of the effects of median filtering on the intermediate image in an exemplary embodiment of the present application.
[0077] The median filter function provided in the metallographic analysis software OpenCv is MedianBlur (InputArraysrc, OutputArraydst, Sizeksize, Pointanchor = Point(-1, -1), intBORDER_DEFAULT), where the more important parameters are src, dst, and ksize, which represent the image to be filtered, the image after mean filtering, and the convolution kernel size, respectively. Among them, src and dst should have the same size and data type, and the convolution kernel size ksize is an odd pair. For example, for each pixel point (x, y) in the figure, the set of pixel points of the image covered by the convolution kernel Kernel centered at position (x, y) is denoted as G(x, y), then the middle value of each pixel value in G is taken as the corresponding pixel value at (x, y). There should be the following formula (where mid means taking the middle value): dst(x, y) = mid(G(x, y)). That is, the pixel value obtained after the convolution kernel matrix and the pixel values of the corresponding image area where the convolution kernel slides are convolved (matrix multiplication) to replace the pixel point pixel in the center area of the convolution kernel. This operation is completed one by one for each pixel point in the input image to achieve the convolution operation of the image.
[0078] Gaussian filtering also uses the sliding of the convolution kernel to perform convolution operations on the image, but the convolution kernel matrix here is no longer a mean matrix. When using Gaussian filtering to filter the intermediate image to obtain the pre-processed image, in the interface of the metallographic analysis software, click Figure 2 The tenth button in the menu bar of the software interface shown in the figure pops up the parameter selection dialog box to set the convolution kernel size and the Gaussian distribution parameter σ along the two-dimensional direction. X , σ Y , the image can be Gaussian filtered. When σ is fixed, the larger the convolution kernel, the blurrier the image, and the smaller the kernel, the smaller the image change. Figure 6 As shown, Figure 6 This is a comparison diagram of the effects of Gaussian filtering on the intermediate image in an exemplary embodiment of the present application.
[0079] The Gaussian filter function provided in the preset metallographic analysis software OpenCV is GaussianBlur(InputArraysrc, OutputArraydst, Sizeksize, doublesigmaX, doublesigmaY, intborderType=BORDER_DEFAULT), where sigmaX and sigmaY correspond to σ X and σ Y The values in the kernel are centered in the convolution kernel, satisfying a two-dimensional normal distribution (also called a Gaussian distribution) and are normalized (i.e., the sum of the values in the kernel is 1). The two-dimensional Gaussian function is:
[0080]
[0081] Among them, σ can be regarded as two values, namely, the component along the x-axis is σ X and the component along the y-axis is σ Y . Gaussian filtering is to apply the above two-dimensional Gaussian distribution to the convolution kernel matrix, and then replace the pixel value of the central pixel after the convolution kernel is convolved with the corresponding area of the image to achieve Gaussian filtering. The weights are distributed in a pattern of high in the middle and low around, and the farther away from the center point, the smaller the influence on the center point and the smaller the weight. For example, if a 3*3 convolution kernel is taken, σ is 1.5, and its normalized values are 0.09470.11830.0947, Kernel=0.11830.14780.1183, 0.09470.11830.0947.
[0082] Bilateral filtering is a nonlinear filtering that takes into account both spatial proximity and pixel similarity. It can filter out noise while sharpening edges. It can be simply regarded as a combination of two Gaussian filters, one for calculating the weight of spatial proximity and the other for calculating the weight of similar pixel values. The two weights are then multiplied and brought into the convolution kernel to continue the convolution operation. When using bilateral filtering to filter the intermediate image to obtain the preprocessed image, in the interface of the metallographic analysis software, click Figure 2 The eleventh button in the menu bar of the software interface will pop up the parameter setting dialog box, and the user can set the pixel neighborhood diameter, σColor, σSpace and other related parameters to achieve bilateral filtering of the image. Figure 7 As shown, Figure 7 is a comparison diagram of the effect of bilateral filtering on the intermediate image in an exemplary embodiment of the present application. It can be found that when σ S When the same, σ C The larger the value, the blurrier the image, because σ CThe larger the value, the higher the tolerance of the convolution kernel to color similarity.
[0083] The bilateral filtering function provided in the preset metallographic analysis software OpenCV is bilaterFilter(Matsrc, Matdst, intd, doublesigmaColor, doublesigmaSpace), where sigmaColor and sigmaSpace correspond to σ C and σ S Taking the center (i, j) of the convolution kernel as the origin, the weight of the pixel point (k, l) in the kernel is Kernel(i, j, k, l), then for each point (k, l) in the convolution kernel, Kernel = Kernel S *Kernel C , where Kernel S is the location proximity, Kernel C is the color similarity. If f(i,j) represents the pixel value at the pixel point (i,j), then Kernel S =e; Kernel C =e. So, Kernel is Kernel S and Kernel C The product of |f(i,j)-f(k,l)| and the pixel position at the pixel point (k,l) in the convolution kernel are closely related. The farther the position and the greater the color difference (i.e., the larger |f(i,j)-f(k,l)|), the smaller the weight at that point.
[0084] For example, if g(i,j) represents the pixel value of the image after bilateral filtering at the pixel point at position (i,j), and S(i,j) represents the set of pixels in the convolution kernel centered at the pixel point (i,j), then the following relationship should exist:
[0085]
[0086] Because Kernel is related to both position proximity and color similarity, compared with other noise reduction operations, bilateral filtering not only reduces image noise through blurring operations, but also maintains (or even highlights) the edge features of the image.
[0087] In this way, the present application uses the above embodiments to filter the intermediate image by selecting a suitable filtering processing method to improve the image processing efficiency and the accuracy of the results.
[0088] In an exemplary embodiment provided in the present application, the specific steps of binarizing the pre-processed image to obtain the image recognition result of the target metallographic phase in the analysis object include:
[0089] Determine the target binarization method, which is global thresholding or local thresholding;
[0090] The target threshold corresponding to the target binarization method is determined, and the preprocessed image is binarized based on the target threshold to obtain an image recognition result for the target metallographic structure in the analysis object.
[0091] After eliminating the noise in the image through filtering, binarization should be further performed to distinguish the pixels in the image so as to determine and distinguish the regional features with different grayscales in the image. In this embodiment, there are four methods for binarizing the image, which can be divided into two categories according to the selection method of the threshold, namely, the global threshold method and the local threshold method. The global threshold includes a fixed threshold and an Otsu threshold, and the local threshold includes a MEAN threshold and a GAUSSIAN threshold.
[0092] The ordinary binarization corresponding to the fixed threshold is to artificially select a threshold (generally the grayscale value is 127 as the threshold), and the pixel values exceeding the threshold are set to white, while the pixel values less than the pixel value are set to black. If the threshold is set to Thresh, each pixel in the image belongs to the set I, src(i,j) is recorded as the pixel value at the position (i,j) of the input image, and dst(i,j) is recorded as the pixel value after binarization at the position (i,j). Then for each point (x,y) in the image, the relationship between the input and output of the ordinary binarization is as follows:
[0093]
[0094] Preferably, in this embodiment, when binarizing the pre-processed image based on the fixed threshold included in the global threshold, in the interface of the metallographic analysis software, by clicking Figure 2 Click the fifteenth button in the menu bar of the software interface shown in the figure, and a dialog box for selecting parameters will pop up. Select an appropriate threshold to complete the binary segmentation of the image. Figure 8 As shown, Figure 8 This is a comparison diagram of the effects of binarizing the pre-processed image using a fixed threshold in an exemplary embodiment of the present application. Figure 8 The image comparison before and after the fixed threshold is shown. The grayscale value of 127 (the grayscale pixel value range is 0 to 255, and the middle value is taken here) is used as the threshold to binary distinguish the γ' phase image.
[0095] The Otsu threshold method is also known as the Otsu binary method or the maximum inter-class variance method. It divides the data into two classes by setting a threshold. If the variance between the two classes is the largest, then this threshold is the optimal threshold. The pixel value distribution in the original image of the γ' phase has a "double-peak" characteristic, because the main phases in the electron microscope photograph of the high-temperature alloy dendrite trunk taken at high magnification are the relatively "bright white" γ phase and the "black" γ' phase. The pixel values of the corresponding pixels of the γ phase are mainly distributed around a peak on the right side of the grayscale distribution histogram, while the grayscale value of the γ' phase is low due to its "blackness", and most of them are on both sides of a peak on the left side of the grayscale distribution histogram. Therefore, the original intention of the Otsu threshold to divide the data into two categories is highly consistent with the bimodal distribution of the γ phase and the γ' phase. For example Figure 4 The value 138 marked by a white line in the grayscale distribution histogram image is the Otsu threshold of the image.
[0096] Preferably, when the pre-processed image is binarized based on the Otsu threshold in this embodiment, an interface for calculating the Otsu threshold is provided in the metallographic analysis software, and the Otsu threshold can be calculated by clicking Figure 2 The fourteenth button in the menu bar of the software interface shown will automatically calculate the Otsu threshold. The preset metallographic analysis software OpenCV provides a simple algorithm for calculating the Otsu threshold. Let this threshold be Otsu (I), then there should be the following relationship:
[0097]
[0098] like Fig. 9 As shown, Fig. 9 This is a comparison diagram of the effects of binarizing the pre-processed image using the Otsu threshold in an exemplary embodiment of the present application.
[0099] Mean threshold is similar to median filtering for image noise reduction. It uses a convolution kernel with a mean value to slide over the image, calculates the average value of each pixel in the convolution kernel and uses it as the threshold of this local area to perform binary segmentation on the image. For example, if the mean value of each pixel in a local area G of an image I is Mean(G), then the input and output of an image before and after binarization should satisfy the following relationship:
[0100]
[0101] Preferably, in this embodiment, when the pre-processed image is binarized based on the Mean threshold, in the interface of the metallographic analysis software, by clicking Figure 2 The twelfth button in the menu bar of the software interface shown in the figure will pop up the parameter selection dialog box. After setting the neighborhood block size and offset, the image can be Mean binarized. Fig.10 As shown, Fig.10 This is a comparison diagram of the effects of binarizing the preprocessed image using the Mean threshold in an exemplary embodiment of the present application, where the convolution kernel size is 39 pixels.
[0102] The Guassian threshold is similar to the Mean threshold, except that the local threshold value is obtained using a Gaussian distributed convolution kernel, and its input and output should satisfy:
[0103]
[0104] Preferably, in this embodiment, when binarizing the pre-processed image based on the Guassian threshold, in the interface of the metallographic analysis software, by clicking Figure 2 The Gaussian Threshold button represented by the thirteenth button in the menu bar of the software interface shown above will pop up the parameter selection dialog box. You can set the neighborhood block size and offset to perform Gaussian threshold binarization on the image. Fig.11 As shown, Fig.11 This is a comparison diagram of the effects of binarizing the preprocessed image using a Guassian threshold in an exemplary embodiment of the present application, wherein the Gaussian threshold convolution kernel size is 51.
[0105] Thus, the present application uses the above-mentioned embodiments to binarize the intermediate image by selecting a suitable binarization threshold to improve the image processing efficiency and the accuracy of the result.
[0106] In an exemplary embodiment provided in the present application, the specific steps of adjusting the operating parameters of the metallographic analysis software based on the comparison results include:
[0107] Obtain the content difference of the target metallographic phase represented by the comparison result;
[0108] The filter parameters and binarization parameters of the metallographic analysis software are adjusted based on the content difference to obtain the adjusted metallographic analysis software.
[0109] In this embodiment, the filter parameters and binarization parameters of the metallographic analysis software are adjusted based on the content difference through automatic control or manual adjustment in the window to obtain the adjusted metallographic analysis software.
[0110] Preferably, when the filtering process is median filtering, the filtering parameter to be adjusted is the convolution kernel size; when the filtering process is Gaussian filtering, the filtering parameter to be adjusted is the convolution kernel size and the Gaussian distribution parameter σ along the two-dimensional direction. X , σ Y ; When the filtering process is bilateral filtering, the filtering parameters to be adjusted are pixel neighborhood diameter, σColor, and σSpace.
[0111] When the threshold used for binarization is a fixed threshold, the binarization parameter to be adjusted is the artificially set threshold range; when the threshold used for binarization is the Otsu threshold, the binarization parameter to be adjusted is the grayscale value of the white color marked in the grayscale histogram; when the threshold used for binarization is the Mean threshold, the binarization parameter to be adjusted is the neighborhood block size and offset; when the threshold used for binarization is the Guassian threshold, the binarization parameter to be adjusted is the neighborhood block size and offset.
[0112] In this way, the present application uses the above-mentioned embodiments to take the chemical detection results as the standard to judge the deviation between the results measured by the software and the standard value, so that the results obtained by the two methods are compared and analyzed, and the errors are judged. On this basis, the parameters used in the image processing process are modified to make the results more accurate or the errors within an acceptable range.
[0113] Fig.12 FIG. 1 is a block diagram of a quantitative metallographic analysis system 1200 shown in an exemplary embodiment of the present application. Fig.12 As shown, the system includes a software processing unit 1210 and a chemical detection unit 1220, and the software processing unit 1210 includes an acquisition module 1211, a preprocessing module 1212, a comparison module 1213 and a parameter adjustment module 1214;
[0114] An acquisition module 1211 is used to acquire a digital image of an analysis object;
[0115] The preprocessing module 1212 is used to process the digital image using the preset metallographic analysis software to obtain the image recognition result for the target metallographic phase in the analysis object;
[0116] The comparison module 1213 is used to obtain the chemical detection result of the target metallographic phase in the analysis object transmitted by the chemical detection unit 1220, and obtain the comparison result between the chemical detection result and the image recognition result;
[0117] The parameter adjustment module 1214 is used to adjust the operating parameters of the metallographic analysis software based on the comparison result, so as to use the adjusted metallographic analysis software to process the image of the object to be tested and obtain the quantitative analysis result of the target metallographic structure in the object to be tested.
[0118] The system applies the quantitative metallographic analysis method provided in the present application, and processes the acquired digital image of the analysis object by using the preset metallographic analysis software through the preprocessing module 1212 to obtain the image recognition result of the target metallographic phase in the analysis object; then obtains the chemical detection result of the target metallographic phase in the analysis object through the comparison module 1213, the chemical detection result is relatively accurate, and obtains the comparison result between the chemical detection result and the image recognition result; finally, the parameter adjustment module 1214 adjusts the operating parameters of the metallographic analysis software based on the comparison result, thereby optimizing the preset metallographic analysis software, so as to use the adjusted metallographic analysis software to process the image to be tested of the object to be tested, and obtain the quantitative analysis result of the target metallographic phase in the object to be tested, thereby improving the accuracy of the metallographic analysis.
[0119] In another exemplary embodiment, the preprocessing module 1212 is also used to use preset metallographic analysis software to grayscale the digital image to obtain an intermediate image; filter the intermediate image to obtain a preprocessed image; and binarize the preprocessed image to obtain an image recognition result for the target metallographic structure in the analysis object.
[0120] In another exemplary embodiment, the grayscale processing adopts the weighted average method; the preprocessing module 1212 is also used to determine the weighted parameters corresponding to the weighted average method; and the cvtColor function is used to convert the digital image into a grayscale image based on the weighted parameters as an intermediate image.
[0121] In another exemplary embodiment, the preprocessing module 1212 is further used to obtain a cropping instruction, crop the intermediate image based on the cropping instruction, and obtain a cropped intermediate image for filtering processing.
[0122] In another exemplary embodiment, the preprocessing module 1212 is further used to determine the filtering parameters of the filtering algorithm; filter the intermediate image based on the filtering parameters to obtain a preprocessed image, and the filtering algorithm is median filtering, Gaussian filtering or bilateral filtering.
[0123] In another exemplary embodiment, the preprocessing module 1212 is also used to determine a target binarization method, which is global thresholding or local thresholding; determine a target threshold corresponding to the target binarization method, and binarize the preprocessed image based on the target threshold to obtain an image recognition result for the target metallographic phase in the analysis object.
[0124] In another exemplary embodiment, the parameter adjustment module 1214 is also used to obtain the content difference of the target metallographic phase represented by the comparison result; and adjust the filtering parameters and binarization parameters of the metallographic analysis software based on the content difference to obtain the adjusted metallographic analysis software.
[0125] It should be noted that the quantitative metallographic analysis system provided in the above embodiment and the quantitative metallographic analysis method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In practical applications, the quantitative metallographic analysis system provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the system into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0126] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the quantitative metallographic analysis method provided in the above-mentioned embodiments.
[0127] Fig.13 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.13 The computer system 1300 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0128] like Fig.13 As shown, the computer system 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1302 or the program loaded from the storage part 1308 to the random access memory (RAM) 1303, such as executing the method in the above embodiment. In the RAM 1303, various programs and data required for system operation are also stored. The CPU 1301, the ROM 1302 and the RAM 1303 are connected to each other through the bus 1304. The input / output (I / O) interface 1305 is also connected to the bus 1304.
[0129] The following components are connected to the I / O interface 1305: an input section 1306 including a keyboard, a mouse, etc.; an output section 1307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed so that a computer program read therefrom is installed into the storage section 1308 as needed.
[0130] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1309, and / or installed from a removable medium 1311. When the computer program is executed by a central processing unit (CPU) 1301, various functions defined in the system of the present application are executed.
[0131] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, system or device. A computer program contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0132] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0134] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the road condition refreshing method as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0135] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the quantitative metallographic analysis method provided in each of the above embodiments.
[0136] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A quantitative metallographic analysis method, characterized in that: The method comprises: acquiring a digital image of the object to be analyzed; Processing the digital image using a preset metallographic analysis software to obtain an image recognition result for a target metallographic phase in the analysis object; Obtaining a chemical detection result of the target metallographic structure in the analysis object, and obtaining a comparison result between the chemical detection result and the image recognition result; The operating parameters of the metallographic analysis software are adjusted based on the comparison result, so as to use the adjusted metallographic analysis software to process the image to be measured of the object to be measured, and obtain the quantitative analysis result of the target metallographic structure in the object to be measured.
2. The method according to claim 1, characterized in that The method of processing the digital image using a preset metallographic analysis software to obtain an image recognition result for a target metallographic phase in the analysis object includes: Using a preset metallographic analysis software, grayscale processing is performed on the digital image to obtain an intermediate image; Performing filtering processing on the intermediate image to obtain a preprocessed image; The preprocessed image is binarized to obtain an image recognition result for the target metallographic phase in the analysis object.
3. The method according to claim 2, characterized in that The grayscale processing adopts a weighted average method; the grayscale processing of the digital image to obtain an intermediate image includes: Determining a weighted parameter corresponding to the weighted average method; The digital image is converted into a grayscale image based on the weighting parameters using a cvtColor function as an intermediate image.
4. The method according to claim 2, characterized in that: After graying the digital image to obtain an intermediate image, the method further includes: A cropping instruction is obtained, and the intermediate image is cropped based on the cropping instruction to obtain a cropped intermediate image for filtering processing.
5. The method according to claim 2, characterized in that: The filtering process is performed on the intermediate image to obtain a pre-processed image, comprising: Determining filtering parameters of a filtering algorithm; The intermediate image is filtered based on the filtering parameters to obtain a preprocessed image, and the filtering algorithm is median filtering, Gaussian filtering or bilateral filtering.
6. The method according to claim 2, characterized in that The binarization of the preprocessed image to obtain an image recognition result for a target metallographic phase in the analysis object includes: Determine a target binarization method, wherein the target binarization method is global thresholding or local thresholding; A target threshold corresponding to the target binarization method is determined, and the preprocessed image is binarized based on the target threshold to obtain an image recognition result for the target metallographic phase in the analysis object.
7. The method according to claim 6, characterized in that The adjusting the operating parameters of the metallographic analysis software based on the comparison result includes: Obtaining a content difference of the target metallographic phase represented by the comparison result; The filtering parameters and binarization parameters of the metallographic analysis software are adjusted based on the content difference to obtain the adjusted metallographic analysis software.
8. A quantitative metallographic analysis system, characterized in that: The quantitative metallographic analysis system comprises a software processing unit and a chemical detection unit, wherein the software processing unit comprises an acquisition module, a preprocessing module, a comparison module and a parameter adjustment module; The acquisition module is used to acquire a digital image of the analysis object; The preprocessing module is used to process the digital image using a preset metallographic analysis software to obtain an image recognition result for a target metallographic phase in the analysis object; The comparison module is used to obtain the chemical detection result of the target metallographic phase in the analysis object transmitted by the chemical detection unit, and obtain the comparison result between the chemical detection result and the image recognition result; The parameter adjustment module is used to adjust the operating parameters of the metallographic analysis software based on the comparison result, so as to use the adjusted metallographic analysis software to process the image to be tested of the object to be tested, and obtain the quantitative analysis result of the target metallographic structure in the object to be tested.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the quantitative metallographic analysis method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the quantitative metallographic analysis method according to any one of claims 1 to 7.