A twin grain boundary identification method, device, equipment and readable storage medium
Through the pixel value region growing algorithm, CLAHE enhancement and multi-scale image pyramid representation combined with the probabilistic Hough transform and Markov chain algorithm, the problem of twin information extraction relying on subjective feelings is solved, and the precise identification and accuracy of twin grain boundaries are achieved. Improvement provides new methods for materials science research.
Patent Information
- Application Number
- CN202210232450.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-03-09
AI Technical Summary
The feature extraction of twin information in the existing technology relies on human subjective feelings and lacks unified detection and measurement rules, resulting in limited precision and accuracy, making it impossible to deeply explore the improvement of macroscopic properties of materials.
The region growing algorithm based on pixel values is used to segment multi-grain images, the CLAHE method adaptively enhances contrast, multi-scale image pyramid representation and probabilistic Hough transform are combined with the Markov chain algorithm to detect twin grain boundaries to achieve accurate identification and fusion of straight line segments. .
It improves the precise quantitative identification of twin information, avoids insufficient or excessive segmentation, enhances the accuracy of straight line detection, ensures the effective identification of line segments with unobvious features, and provides new ideas for material analysis.
Smart Images

Figure CN114581423B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the intersecting field of material science and computer image digital processing technology, and specifically relates to a twin grain boundary recognition method, device, equipment and readable storage medium. Background Art
[0002] With the development of society and the progress of science and technology, the requirements for reliability of advanced equipment are also increasing. As the basis for the development and application of modern advanced instruments and equipment, the performance of metal materials is directly related to the operational reliability of the equipment. Therefore, targeted improvement and optimization of existing metal materials has important scientific research significance and engineering value. Under the same composition, the macroscopic properties of materials are directly related to the microstructure, and the crystal interface is one of the key structures that affect the macroscopic properties of metal materials such as strength, plasticity and toughness. Among them, the influence of twin grain boundaries on the macroscopic properties of materials is much higher than that of general grain boundaries. Considering the importance of twin grain boundaries in studying and improving the macroscopic properties of materials, accurate characterization of twin grain boundaries has become an important and fundamental part of metal material science research.
[0003] EBSD is widely used in the characterization of material microstructure. The characterization of twins in metal materials through EBSD is currently one of the most common and effective analytical methods. The EBSD spectrum contains a large amount of twin visual information, mainly twin grain boundaries. However, the feature extraction of twin information at this stage still relies too much on people's subjective feelings and lacks unified detection measurement rules. Therefore, it is necessary to analyze and detect the twin information in the EBSD spectrum by means of image digital processing. Related research and applications are limited by the detection method, and there are problems such as limited precision caused by insufficient or excessive segmentation and limited accuracy caused by the loss of detailed information, and face the risk of being unable to continue in-depth exploration. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides a method, device, equipment and readable storage medium for identifying twin grain boundaries, which can accurately identify twin grain boundaries in multi-grain images.
[0005] In order to solve the above technical problems, the present invention is implemented by the following technical solutions:
[0006] A method for identifying a twin grain boundary comprises:
[0007] Acquire multi-grain images including twins;
[0008] Using a region growing algorithm based on pixel values to segment the multi-grain image to obtain a single grain image;
[0009] Adopting the CLAHE method to adaptively enhance the contrast between the twin and its surrounding in the single grain image to obtain an enhanced single grain image;
[0010] Using a multi-scale image pyramid space representation method to perform multi-scale representation on the enhanced single grain image to obtain single grain images of various scales;
[0011] Using probabilistic Hough transform and a standard dynamic programming algorithm based on Markov chain to detect the single grain images of each scale, and obtain a plurality of straight line segments located on the twin grain boundary in the single grain images of each scale;
[0012] A plurality of straight line segments located on the twin grain boundary in the single grain image of each scale are adaptively merged and fused, and finally the twin grain boundary information in the single grain image is obtained.
[0013] Furthermore, the multi-grain image containing twins is obtained by using EBSD.
[0014] Furthermore, the adopting of a region growing algorithm based on pixel values to segment the multi-grain image to obtain a single grain image specifically includes:
[0015] Binarizing the multi-grain image, and selecting a point in the target grain to be segmented in the binarized multi-grain image as a seed point;
[0016] The seed point is used as the growth starting point, and a 3×3 region consisting of the pixel position of the growth starting point and the 8 pixels around it is defined as the initial grown region R. The average value and variance of the grayscale values of all pixels in the grown region R are calculated according to formula (1) and formula (2), and the average value and variance are used as growth conditions. A regional growth criterion is constructed according to formula (3) and formula (4), and the pixels that meet the regional growth criterion are included in the grown region R, completing one iteration. Multiple iterations are performed until no neighboring pixels that meet the regional growth criterion are included in the grown region R, then the image segmentation is completed, and the single grain image is obtained.
[0017]
[0018]
[0019] |seedpoint(p)-f(p) mean | <th1 (23)
[0020] |seedpoint(p)-f(p) var | <th2 (24)
[0021] th1=10%×f(p) mean (25)
[0022] th2=10%×f(p) var (26)
[0023] In the formula, p is the pixel position of the seed point in the multi-grain image; q is the position of the pixels around the seed point; f(p) mean is the mean of the current neighborhood; f(p) var is the variance of the current neighborhood; seedpoint(p) is the grayscale value of the seed point; th1 and th2 are both thresholds for region growing.
[0024] Further, the CLAHE method is used to adaptively enhance the contrast between the twin and its surrounding in the single grain image to obtain the enhanced single grain image, specifically including:
[0025] Divide the single grain image into multiple sub-regions, obtain a pixel distribution histogram of each sub-region, calculate a shearing threshold δ of each sub-region according to formula (7), and shear the pixel distribution histogram of each sub-region;
[0026]
[0027] Where N subI is the number of pixels in each sub-area, 0≤N subI ≤85; L is the maximum gray level; C is the constant that determines the image contrast;
[0028] Redistribute the pixel distribution histogram of each sub-region after clipping, and calculate the number of pixels N exceeding the clipping threshold according to formula (8): total , evenly distribute the pixels exceeding the clipping threshold to the pixel distribution histograms of other sub-areas;
[0029]
[0030] Where k is the gray level, 0≤k≤L-1; l(k) is the pixel distribution histogram of each sub-region;
[0031] The degree of image contrast enhancement is limited by the contrast limiting function, and the final image histogram l'(k) is obtained according to equations (9), (10) and (11), thereby obtaining an enhanced single grain image;
[0032]
[0033] μ=δ-N sub (30)
[0034] N sub =Ntatal / L (31)
[0035] Where μ is the allocation threshold; N sub The average number of pixels added to each sub-region.
[0036] Furthermore, the multi-scale image pyramid spatial representation method is used to perform multi-scale representation on the enhanced single grain image to obtain single grain images of various scales, specifically including:
[0037] According to the multi-scale image pyramid spatial representation, the obtained grain image to be inspected is subjected to multi-scale up and down sampling. The up-sampling process is to use the cubic polynomial S(x) shown in formula (12) as the interpolation kernel on the basis of the original image pixels, and calculate the gray value f(M) of the inserted pixel point according to formula (13); the down-sampling process is to obtain the image pyramid of the image by continuously deleting the even rows and even columns of the image, and continuously repeating this process, thereby obtaining the multi-scale representation of a single grain image;
[0038]
[0039] f(M)=A*B*C (33)
[0040] A=[S(u+1),S(u),S(u-1),S(u-2)] (34)
[0041] B=Im[i-1:i+2,j-1:j+2] (35)
[0042] C=[S(v+1),S(v),S(v-1),S(v-2)] T (36)
[0043] Where u and v are points on the grayscale interval; Im is the grayscale matrix of the original image.
[0044] Furthermore, the probabilistic Hough transform and the standard dynamic programming algorithm based on the Markov chain are used to detect the single grain images of each scale to obtain a plurality of straight line segments located on the twin grain boundary in the single grain images of each scale, specifically including:
[0045] Construct a rectangular coordinate system XOY on the grain image, randomly obtain a point in the rectangular coordinate system, and map it to the polar coordinate system through formula (17);
[0046] ρ=xcos(θ)+ysin(θ) (37)
[0047] Among them, x is the rectangular abscissa of each observation point of the grain image; y is the rectangular ordinate of each observation point of the grain image; ρ is the polar coordinate of each observation point of the grain image, indicating the position information of the corresponding observation point; θ is also the polar coordinate of each observation point of the grain image, indicating the direction information of the corresponding observation point;
[0048] The covariance C of the observation point in Hough space is calculated using formula (18): h , and according to the BVN distribution description, use formula (19) to calculate the number of votes contributed by each observation line Vote(ρ,θ|x i ,y i ,θ i );
[0049]
[0050]
[0051] In the formula, ρ i is the position information of the i-th observation point in Hough space, θ i is the direction information of the i-th observation point in the Hough space. The votes of all observation results at each position are accumulated through formula (20) to realize the construction of the global probability Hough graph.
[0052]
[0053] According to the global probability Hough map constructed above, each peak in the Hough map is obtained in descending order of probability cumulative value. The position of the peak corresponds to the position and angle information of the straight line, and the size of the peak corresponds to the probability of observing the straight line.
[0054] Using the observation probability obtained in the global probability Hough map, the state probability of each pixel is calculated; for the relevant position pixels of position i, including x i ,d i and i These status information, y i Including e i and θ i , where x i Indicates whether the position i is part of the line segment to be checked. If so, then x i =ON, if not, then x i = OFF, d i represents the distance that point i deviates from the straight line to be tested, y i represents the probability observation value at point i, e i Indicates whether the pixel is part of the line to be checked, θ i It indicates the angular deviation between the observed straight line and the actual straight line when ei=1;
[0055] For edge pixels, their state probability p(y i |x i )∝p(e i =1|x i ,d i )p(θ i |x i ,e i =1), for non-edge pixels, its state probability is p(y i |x i )∝p(e i =0|x i ,d i ), where p(e i =1|x i =ON,d i ) represents the probability that a line segment is actually observed, p(e i =1|x i =OFF,d i ) represents the probability of observing a line segment when it does not actually exist, p(e i =0|x i =ON,d i ) represents the probability that a line segment actually exists but is not observed, p(e i =0|x i =OFF,d i ) represents the probability that the line segment does not actually exist and is not observed;
[0056] Construct a first-order Markov chain and mark each point of the line segment with the marginal posterior probability of the estimated expected value. Here, it is assumed that the state information between the observation positions is independent of each other, that is, the state of each position is only related to the state of the previous position, and then the straight line segment detection is transformed into Here, the standard dynamic programming algorithm is used to solve the above problem with the maximum a posteriori probability, and finally all line segments in a single grain image at a single scale are identified.
[0057] Furthermore, the adaptive merging and fusion of a plurality of straight line segments located on the twin grain boundary in the single grain image of each scale, and finally obtaining the twin grain boundary information in the single grain image, specifically includes:
[0058] The straight line segments at each scale are grouped according to the angle and spatial proximity. The straight line segments whose angle difference and spatial proximity difference are within the set threshold range are considered to meet the merging requirements. The straight line segments that meet the adaptive merging criteria in each group are merged into one straight line segment in turn. This step is repeated until no more merging is possible. Finally, the length and angle information of the merged straight line segments are obtained.
[0059] After normalizing the merged results at each scale, the normalized results are comprehensively screened in the same space to finally obtain the twin grain boundary information in a single grain image.
[0060] A twin grain boundary identification device, comprising:
[0061] An acquisition module, used for acquiring a multi-grain image including twin crystals;
[0062] A segmentation module, used for segmenting the multi-grain image by using a region growing algorithm based on pixel values to obtain a single grain image;
[0063] A contrast enhancement module, used for adaptively enhancing the contrast between the twin and its surroundings in the single grain image by using a CLAHE method to obtain an enhanced single grain image;
[0064] A multi-scale representation module, used for performing multi-scale representation on the enhanced single grain image by using a multi-scale image pyramid space representation method to obtain single grain images of various scales;
[0065] A straight line segment detection module is used to detect the single grain images of each scale by using a probabilistic Hough transform and a standard dynamic programming algorithm based on a Markov chain, and obtain a plurality of straight line segments located on the twin grain boundaries in the single grain images of each scale;
[0066] The fusion module is used to adaptively merge and fuse a number of straight line segments located on the twin grain boundary in the single grain image of each scale, and finally obtain the twin grain boundary information in the single grain image.
[0067] A device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a method for identifying a twin grain boundary when executing the computer program.
[0068] A computer-readable storage medium stores a computer program, which implements the steps of a method for identifying twin grain boundaries when executed by a processor.
[0069] Compared with the prior art, the present invention has at least the following beneficial effects: In view of the fact that the feature extraction of twin information at this stage still relies too much on human subjective feelings, lacks a unified quantitative measurement rule, and the current detection methods have limited precision and accuracy, the present invention proposes a method for identifying twin grain boundaries, segments multi-grain images through a regional growing algorithm based on pixel values to obtain a single grain image, adopts the CLAHE method to adaptively enhance the contrast between the twins and their surroundings in the single grain image and suppress noise, adopts the probabilistic Hough transform method to perform Gaussian modeling on each point in the parameter space one by one to obtain a global probability distribution, thereby correspondingly obtaining straight line information in the coordinate space, and then uses a standard dynamic programming algorithm based on Markov chains to accurately identify and detect straight line segments, and finally combines a multi-scale image pyramid space representation method, uses the above-mentioned straight line detection method to obtain multi-scale twin boundary straight line representation, and then adaptively groups and fuses the scale-normalized and integrated straight line representation according to the angle and spatial proximity, thereby obtaining the material twin grain boundary information quantitatively represented by the straight line. The feasibility and effectiveness of the present invention are verified by analyzing and processing the multi-grain image containing twins obtained by EBSD. The processing results show that the present invention can accurately identify the twin boundaries in the multi-grain image. The present invention has the following advantages. First, in the context that the feature extraction of twin information at this stage still relies too much on people's subjective feelings, the means of image digital processing are introduced into the EBSD spectrum analysis, and the accurate quantitative identification of twin information is achieved through the straight line detection of the twin boundary, which provides a new idea for material analysis. Secondly, the probabilistic Hough change method is combined with the Markov chain model to simplify the straight line detection problem in the two-dimensional space into a linear dynamic programming problem in the one-dimensional space, ensuring the accurate characterization of the straight line direction. Compared with the traditional gradient-based straight line detection method, it effectively avoids insufficient or excessive segmentation and improves the accuracy of straight line detection; combined with the multi-scale image pyramid space representation, a single grain image is multi-scale sampled to obtain the twin boundary edge at different scales, avoiding the loss of detail information, which can effectively improve the recognition and detection of line segments with unclear features.
[0070] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions in the specific implementation modes of the present invention, the drawings required for use in the description of the specific implementation modes will be briefly introduced below. Obviously, the drawings described below are some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0072] Figure 1 A flow chart of a method for identifying a twin grain boundary according to the present invention;
[0073] Figure 2 This is a multi-grain image including twins obtained by EBSD;
[0074] Figure 3 It is the position image of a single grain to be inspected;
[0075] Figure 4 The image of a single grain to be inspected is obtained;
[0076] Figure 5 This is the effect image after enhancing the single grain image;
[0077] Figure 6 The detection results of twin grain boundaries at a single scale for a single grain image are obtained;
[0078] Figure 7 The multi-scale comprehensive detection results of twin grain boundaries of a single grain image are obtained. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0080] As a specific embodiment of the present invention, Figure 1 As shown, a method for identifying a twin grain boundary specifically comprises the following steps:
[0081] Step 1: Use EBSD to obtain a multi-grain image containing twins, such as Figure 2 As shown;
[0082] Step 2: Segment the multi-grain image through a region growing algorithm based on pixel values to obtain a single grain image. The specific process is as follows:
[0083] Step 2.1: Binarize the multi-grain image, and select a point in the target grain to be segmented in the binarized multi-grain image as a seed point;
[0084] Step 2.2: Take the seed point as the starting point of growth, define the 3×3 area consisting of the pixel position of the growth starting point and the 8 pixels around it as the initial grown area R, calculate the mean and variance of the grayscale values of all pixels in the grown area R according to equations (1) and (2), and use the mean and variance as growth conditions, construct the regional growth criterion according to equations (3) and (4), and stipulate that the pixels that meet the regional growth criterion can be included in the grown area R, and complete one iteration. Use the growth rule as the standard to judge the neighborhood pixels of the grown area, and classify the pixels that meet the rule into the grown area, and complete one iteration. Repeat multiple iterations until no neighborhood pixels that meet the conditions are divided into the grown area, the image segmentation is completed, and the image of a single grain is obtained, such as Figure 3 As shown, the corresponding image of the grain to be inspected is as follows Figure 4 shown.
[0085]
[0086]
[0087] |seedpoint(p)-f(p) mean | <th1 (43)
[0088] |seedpoint(p)-f(p) var | <th2 (44)
[0089] th1=10%×f(p) mean (45)
[0090] th2=10%×f(p) var (46)
[0091] In the formula, p is the pixel position of the seed point in the multi-grain image; q is the position of the pixels around the seed point; f(p) mean is the mean of the current neighborhood; f(p) var is the variance of the current neighborhood; seedpoint(p) is the grayscale value of the seed point; th1 and th2 are both thresholds for region growing.
[0092] Step 3: Adopt the CLAHE method to adaptively enhance the image of a single grain, and obtain an image with a higher contrast between the twin and its surroundings in the single grain image, that is, obtain an enhanced single grain image. The specific process is as follows:
[0093] Step 3.1: Divide a single grain image into multiple sub-regions and obtain a pixel distribution histogram of each sub-region, calculate the clipping threshold of each sub-region according to formula (7), and clip the pixel distribution histogram in each sub-region;
[0094]
[0095] Where N subI is the number of pixels in each sub-area, 0≤N subI ≤85; L is the maximum gray level; C is a constant that determines the image contrast.
[0096] Step 3.2: Redistribute the pixel distribution histogram of each sub-region after clipping, and calculate the number of pixels N exceeding the clipping threshold according to formula (8): total , evenly distribute the pixels exceeding the clipping threshold to the pixel distribution histograms of other sub-areas;
[0097]
[0098] Where k is the gray level, 0≤k≤L-1; l(k) is the pixel distribution histogram of each sub-region.
[0099] Step 3.3: The contrast enhancement degree of the image is limited by the contrast limiting function. According to equations (9), (10) and (11), the final image histogram l'(k) is obtained, and then the enhanced single grain image is obtained. The image enhancement result is shown in Figure 5 As shown;
[0100]
[0101] μ=δ-N sub (50)
[0102] N sub =N tatal / L (51)
[0103] Where: μ is the allocation threshold; N sub The average number of pixels added to each sub-region.
[0104] Step 4: Use a multi-scale image pyramid space representation method to perform multi-scale representation on the enhanced single grain image to obtain single grain images of various scales, as follows:
[0105] According to the multi-scale image pyramid spatial representation, the obtained grain image to be inspected is subjected to multi-scale up and down sampling. In this embodiment, the sampling rates are: 0.5, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.5, 2. The up-sampling process is to use the cubic polynomial S(x) shown in formula (12) as the interpolation kernel on the basis of the original image pixels, and calculate the gray value f(M) of the inserted pixel point according to formula (13); the down-sampling process is to obtain the image pyramid of the image by continuously deleting the even rows and even columns of the image, and continuously repeating the process, thereby obtaining the multi-scale representation of the single grain image;
[0106]
[0107] f(M)=A*B*C (53)
[0108] A=[S(u+1),S(u),S(u-1),S(u-2)] (54)
[0109] B=Im[i-1:i+2,j-1:j+2] (55)
[0110] C=[S(v+1),S(v),S(v-1),S(v-2)] T (56)
[0111] Where u and v are points on the grayscale interval, and Im is the grayscale matrix of the original image.
[0112] Step 5: Use probabilistic Hough transform and standard dynamic programming algorithm based on Markov chain to detect single grain images of each scale, and obtain several straight line segments located on the twin grain boundary in the single grain images of each scale. The specific process is as follows:
[0113] Step 5.1: Use the probabilistic Hough transform method to construct the Hough space and obtain the global probability distribution, thereby obtaining the corresponding straight line information in the coordinate space.
[0114] Construct a rectangular coordinate system XOY on the grain image, randomly obtain a point in the coordinate system, and map it to the polar coordinate system through formula (17);
[0115] ρ=xcos(θ)+ysin(θ) (57)
[0116] Where x is the rectangular horizontal coordinate of each observation point in the grain image; y is the rectangular vertical coordinate of each observation point in the grain image; ρ is the polar coordinate of each observation point in the grain image, indicating the position information of the corresponding observation point; θ is also the polar coordinate of each observation point in the grain image, indicating the direction information of the corresponding observation point.
[0117] The covariance C of the observation point in Hough space is calculated using formula (18): h , and according to the BVN distribution description, use formula (19) to calculate the number of votes contributed by each observation line Vote(ρ,θ|x i ,y i ,θ i );
[0118]
[0119]
[0120] Among them, ρ i is the position information of the i-th observation point in Hough space, θ i is the direction information of the i-th observation point in the Hough space. The votes of all observation results at each position are accumulated through formula (20) to realize the construction of the global probability Hough graph.
[0121]
[0122] According to the global probability Hough map constructed above, each peak in the Hough map is obtained in descending order of probability cumulative value. The position of the peak corresponds to the position and angle information of the straight line, and the size of the peak corresponds to the probability of observing the straight line.
[0123] Step 5.2: Using the obtained straight line information and observation probability, a standard dynamic programming algorithm based on Markov chain is used to accurately identify and detect straight line segments.
[0124] Using the observation probability obtained in the global probability Hough map, the state probability of each pixel is calculated. For the relevant position pixel of position i, it contains x i ,d i and i These status information, y i Including e i and θ i , where x i Indicates whether the position i is part of the line segment to be checked. If so, then x i =ON, otherwise x i = OFF; d i represents the distance that point i deviates from the straight line to be tested; y i represents the probability observation value at point i, y i represents the probability observation value at point i, e i Indicates whether the pixel is part of the line to be checked, θ i Indicates when e i =1, the angular deviation between the observed straight line and the actual straight line.
[0125] For edge pixels, their state probability p(y i |x i )∝p(e i =1|x i ,d i )p(θ i |x i ,e i =1), for non-edge pixels, its state probability is p(y i |x i )∝p(e i =0|x i ,di ), where p(e i =1|x i =ON,d i ) represents the probability that a line segment is actually observed, p(e i =1|x i =OFF,d i ) represents the probability of observing a line segment when it does not actually exist, p(e i =0|x i =ON,d i ) represents the probability that a line segment actually exists but is not observed, p(e i =0|x i =OFF,d i ) represents the probability that the line segment does not actually exist and is not observed.
[0126] Construct a first-order Markov chain and mark each point of the line segment with the marginal posterior probability of the estimated expected value. Here, it is assumed that the state information between the observation positions is independent of each other, that is, the state of each position is only related to the state of the previous position, and then the straight line segment detection is transformed into Here, the standard dynamic programming algorithm is used to solve the above problem with the maximum a posteriori probability.
[0127] Through the above steps, all line segments at a single scale in a single grain image can be identified, such as Figure 6 shown.
[0128] Step 6: Adaptively merge and fuse several straight line segments located on the twin grain boundary in the single grain image of each scale, and finally obtain the twin grain boundary information in the single grain image. The specific process is as follows:
[0129] Step 6.1: Group the line segments at each scale according to the angle and spatial proximity, and stipulate that the line segments whose angle difference and spatial proximity difference are within a certain threshold range are considered to meet the merging requirements. In this embodiment, the threshold is set to 5°. Merge the line segments that meet the adaptive merging criteria in each group into one line segment in turn, and repeat this step until they cannot be merged, and finally obtain the length and angle information of the merged line segment.
[0130] Step 6.2: After normalizing the combined results at each scale, the normalized results are comprehensively screened in the same space to finally obtain the twin grain boundary information in a single grain image, such as Figure 7 shown.
[0131] As a specific embodiment of the present invention, the present invention further provides a twin grain boundary identification device, which is used to implement the above twin grain boundary identification method, specifically comprising:
[0132] An acquisition module, used for acquiring a multi-grain image including twin crystals;
[0133] A segmentation module, used for segmenting the multi-grain image by using a region growing algorithm based on pixel values to obtain a single grain image;
[0134] A contrast enhancement module, used for adaptively enhancing the contrast between the twin and its surroundings in the single grain image by using a CLAHE method to obtain an enhanced single grain image;
[0135] A multi-scale representation module, used for performing multi-scale representation on the enhanced single grain image by using a multi-scale image pyramid space representation method to obtain single grain images of various scales;
[0136] A straight line segment detection module is used to detect the single grain images of each scale by using a probabilistic Hough transform and a standard dynamic programming algorithm based on a Markov chain, and obtain a plurality of straight line segments located on the twin grain boundaries in the single grain images of each scale;
[0137] The fusion module is used to adaptively merge and fuse a number of straight line segments located on the twin grain boundary in the single grain image of each scale, and finally obtain the twin grain boundary information in the single grain image.
[0138] In one embodiment of the present invention, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding functions; the processor described in the embodiment of the present invention can be used for the operation of a method for identifying twin grain boundaries.
[0139] In one embodiment of the present invention, a method for identifying twin grain boundaries can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of each of the above-mentioned method embodiments when executed by a processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data.
[0140] The computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0145] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for identifying twin grain boundaries, characterized in that: include: Acquire multi-grain images including twins; Using a region growing algorithm based on pixel values to segment the multi-grain image to obtain a single grain image; Adopting the CLAHE method to adaptively enhance the contrast between the twin and its surrounding in the single grain image to obtain an enhanced single grain image; Using a multi-scale image pyramid space representation method to perform multi-scale representation on the enhanced single grain image to obtain single grain images of various scales; The single grain images of each scale are detected by using probabilistic Hough transform and a standard dynamic programming algorithm based on Markov chain to obtain a number of straight line segments located on the twin grain boundary in the single grain images of each scale. The specific process is as follows: Step 5.1: Use the probabilistic Hough transform method to construct the Hough space and obtain the global probability distribution, thereby obtaining the corresponding straight line information in the coordinate space; Construct a rectangular coordinate system XOY on the grain image, randomly obtain a point in the coordinate system, and map it to the polar coordinate system through formula (17); (17) in is the rectangular abscissa of each observation point of the grain image; is the rectangular ordinate of each observation point of the grain image; is the polar coordinate of each observation point in the grain image, indicating the position information of the corresponding observation point; It is also the polar coordinates of each observation point in the grain image, indicating the direction information of the corresponding observation point; The covariance of the observation point in Hough space is calculated using formula (18): , and according to the BVN distribution description, use formula (19) to calculate the number of votes contributed by each observation line ; (18) (19) in, is the first The location information of the observation points, is the first The direction information of each observation point is accumulated by voting for all observation results at each position through formula (20) to realize the construction of the global probability Hough map. (20) According to the global probability Hough map constructed above, each peak in the Hough map is obtained in descending order of probability cumulative value. The position of the peak corresponds to the position and angle information of the straight line, and the size of the peak corresponds to the probability of observing the straight line. Step 5.2: Using the obtained straight line information and observation probability, a standard dynamic programming algorithm based on Markov chain is used to accurately identify and detect straight line segments; Using the observation probability obtained in the global probability Hough map, the state probability of each pixel is calculated; for position The relevant position pixels include , and These status information, include and ,in, represent Is the position part of the line segment to be checked? If so, ,otherwise ; represent The distance that the point deviates from the straight line to be tested; Representatives in i The probability of observing the point, Representatives in i The probability of observing the value at point Indicates whether the pixel is part of the line to be checked. Indicates when When , the angle deviation between the observed straight line and the actual straight line; For edge pixels, their state probability , for non-edge pixels, the state probability is ,in, It indicates the probability that a line segment is actually present and observed. represents the probability of observing a line segment when there is no line segment in reality. represents the probability that a line segment actually exists but is not observed, Indicates the probability that there is no actual line segment and no observed line segment; Construct a first-order Markov chain and mark each point of the line segment with the marginal posterior probability of the estimated expected value; here, it is assumed that the state information between the observation positions is independent of each other, that is, the state of each position is only related to the state of the previous position, and then the straight line segment detection is transformed into Here, the standard dynamic programming algorithm is used to solve the above problem with the maximum a posteriori probability. A plurality of straight line segments located on the twin grain boundary in the single grain image of each scale are adaptively merged and fused, and finally the twin grain boundary information in the single grain image is obtained.
2. A twin grain boundary identification method according to claim 1, characterized in that: The multi-grain image containing twins is obtained by using EBSD.
3. A twin grain boundary identification method according to claim 1, characterized in that: The adopting of a region growing algorithm based on pixel values to segment the multi-grain image to obtain a single grain image specifically includes: Binarizing the multi-grain image, and selecting a point in the target grain to be segmented in the binarized multi-grain image as a seed point; The seed point is used as the growth starting point, and a 3×3 region consisting of the pixel position of the growth starting point and the 8 pixels around it is defined as the initial grown region R. The average value and variance of the grayscale values of all pixels in the grown region R are calculated according to formula (1) and formula (2), and the average value and variance are used as growth conditions. The regional growth criterion is constructed according to formula (3) and formula (4), and the pixels that meet the regional growth criterion are included in the grown region R, completing one iteration; multiple iterations are performed until no neighboring pixels that meet the regional growth criterion are included in the grown region R, then the image segmentation is completed, and the single grain image is obtained; (1) (2) (3) (4) (5) (6) In the formula, is the pixel position of the seed point in the multi-grain image; is the position of the pixels around the seed point; is the mean of the current neighborhood; is the variance of the current neighborhood; is the gray value of the seed point; and are the thresholds for region growing.
4. A twin grain boundary identification method according to claim 1, characterized in that: The method of adaptively enhancing the contrast between the twin and its surrounding in the single grain image by the CLAHE method to obtain the enhanced single grain image specifically includes: The single grain image is divided into multiple sub-regions, and the pixel distribution histogram of each sub-region is obtained. The shearing threshold of each sub-region is calculated according to formula (7): , and cut the pixel distribution histogram of each sub-region; (7) In the formula, is the number of pixels in each sub-region, ; is the maximum gray level; is a constant that determines the image contrast; Redistribute the pixel distribution histogram of each sub-region after clipping, and calculate the number of pixels exceeding the clipping threshold according to formula (8): , evenly distribute the pixels exceeding the clipping threshold to the pixel distribution histograms of other sub-areas; (8) In the formula, is the gray level, ; is the pixel distribution histogram of each sub-region; The degree of image contrast enhancement is limited by the contrast limiting function, and the final image histogram is obtained according to equations (9), (10) and (11): , and then obtain the enhanced single grain image; (9) (10) (11) In the formula, is the allocation threshold; The average number of pixels added to each sub-region.
5. A twin grain boundary identification method according to claim 4, characterized in that: The multi-scale image pyramid spatial representation method is used to perform multi-scale representation on the enhanced single grain image to obtain single grain images of various scales, specifically including: According to the multi-scale image pyramid space representation, the obtained grain image to be inspected is subjected to multi-scale up-down sampling. The up-sampling process is to use the cubic polynomial shown in formula (12) on the basis of the original image pixels. is the interpolation kernel, and the grayscale value of the inserted pixel is calculated according to formula (13): ; The downsampling process is obtained by continuously deleting the even rows and even columns of the image. By repeating this process, the image pyramid of the image can be obtained, and then the multi-scale representation of a single grain image can be obtained; (12) (13) (14) (15) (16) In the formula, are the points on the grayscale interval; is the grayscale matrix of the original image.
6. A twin grain boundary identification method according to claim 1, characterized in that: The step of adaptively merging and fusing a plurality of straight line segments located on the twin grain boundary in the single grain image of each scale, and finally obtaining the twin grain boundary information in the single grain image, specifically includes: The straight line segments at each scale are grouped according to the angle and spatial proximity. The straight line segments whose angle difference and spatial proximity difference are within the set threshold range are considered to meet the merging requirements. The straight line segments that meet the adaptive merging criteria in each group are merged into one straight line segment in turn. This step is repeated until no more merging is possible. Finally, the length and angle information of the merged straight line segments are obtained. After normalizing the merged results at each scale, the normalized results are comprehensively screened in the same space to finally obtain the twin grain boundary information in a single grain image.
7. A twin grain boundary identification device, characterized in that: A twin grain boundary recognition method for realizing any one of claims 1 to 6, wherein the twin grain boundary recognition device comprises: An acquisition module, used for acquiring a multi-grain image including twin crystals; A segmentation module, used for segmenting the multi-grain image by using a region growing algorithm based on pixel values to obtain a single grain image; A contrast enhancement module, used for adaptively enhancing the contrast between the twin and its surroundings in the single grain image by using a CLAHE method to obtain an enhanced single grain image; A multi-scale representation module, used for performing multi-scale representation on the enhanced single grain image by using a multi-scale image pyramid space representation method to obtain single grain images of various scales; A straight line segment detection module is used to detect the single grain images of each scale by using a probabilistic Hough transform and a standard dynamic programming algorithm based on a Markov chain, and obtain a plurality of straight line segments located on the twin grain boundaries in the single grain images of each scale; The fusion module is used to adaptively merge and fuse a number of straight line segments located on the twin grain boundary in the single grain image of each scale, and finally obtain the twin grain boundary information in the single grain image.
8. A device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for identifying a twin grain boundary as claimed in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a method for identifying a twin grain boundary according to any one of claims 1 to 6 are implemented.
