A method and system for optimizing the quality of microscale natural speckle based on image information parameters
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]人工散斑在数字图像相关法测量中存在两个核心问题:在微观尺度上制作适用于数字图像相关法实验的人工散斑具有很大的挑战性,以及人工散斑在微观尺度对于试件变形有所影响
[0101]1、本发明的一种基于图像信息参数的微尺度自然散斑质量优化方法及系统,该方法基于方向梯度香农熵方法的神经网络模型对自然散斑质量进行优化,能大幅提高自然散斑的质量。
Smart Images

Figure CN118710578B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of image processing and numerical computation, specifically to a method and system for optimizing the quality of microscale natural speckle based on image information parameters. Background Technology
[0002] Digital Image Correlation (DIC) is a non-invasive full-field stress-strain measurement technique that stands out for its relaxed experimental environment requirements, strong anti-interference capabilities, and excellent measurement accuracy.
[0003] Artificial speckle patterns in digital image correlation (DIR) measurements face two core challenges: fabricating suitable artificial speckles at the microscale is extremely difficult, and artificial speckles significantly affect specimen deformation at the microscale. Natural speckle patterns, with their superior randomness and stability, have successfully overcome the difficulty of artificial speckles deforming synchronously with the sample surface after attachment. However, the quality of natural speckles varies considerably; therefore, a technique to effectively improve their quality is urgently needed. Summary of the Invention
[0004] To address the aforementioned problems, this invention provides a microscale natural speckle quality optimization method based on image information parameters, which can significantly improve the quality of natural speckle.
[0005] The specific solution of the present invention is as follows:
[0006] A method for optimizing the quality of natural speckle at the microscale based on image information parameters includes the following steps:
[0007] Step 1: Obtain the speckle pattern that needs to be optimized and evaluate the quality information of the speckle pattern;
[0008] Step 2: Obtain the features of the speckle pattern before optimization;
[0009] Step 3: Optimize the speckle pattern;
[0010] Step 4: Obtain the optimized features of the speckle pattern;
[0011] Step 5: Compare the error calculated in Step 4 with that in Step 2 to draw a conclusion.
[0012] Further, step 1, obtaining the speckle pattern to be optimized and evaluating the quality information of the speckle pattern, is based on a neural network model using the Shannon entropy method with directional gradient, specifically including:
[0013] Step 11: After grayscale processing, the surface texture of the microscopic sample is obtained as a speckle pattern;
[0014] Step 12: Augment the natural speckle pattern samples to form a dataset, specifically including:
[0015] By randomly shifting a small pixel window across each sample, multiple small samples are extracted, thus constructing a comprehensive dataset.
[0016] Step 13: Randomly select speckle patterns from the dataset as a validation set. The neural network model based on the Shannon entropy method of directional gradient needs to be trained, and the validation set is used to conduct a preliminary evaluation of the model's capabilities.
[0017] Step 14: Extract features from the speckle patterns in the validation set; use Python to extract grayscale values from the speckle patterns that have already been grayscaled, and convert them into a grayscale matrix, where each element of the matrix represents the grayscale value of the corresponding pixel.
[0018] Step 15: Calculate the Shannon entropy of the directional gradient in different directions for each speckle pattern; different directions refer to traversing all directions to obtain the minimum value of the Shannon entropy of the directional gradient.
[0019] Step 16: If the directional gradient Shannon entropy value of the speckle pattern is less than the standard value, the speckle pattern is considered to be of acceptable quality; if the directional gradient Shannon entropy value of the speckle pattern is greater than the standard value, the speckle pattern is considered to be of unacceptable quality and needs to be optimized.
[0020] Further, in step 15, the directional gradient Shannon entropy of each speckle pattern is calculated in different directions. The formula for calculating the directional gradient Shannon entropy is as follows:
[0021]
[0022] g of the gray gradient of the subset ij The calculation formula is as follows:
[0023]
[0024] Among them, DGSE x DGSE is the directional gradient Shannon entropy in the X direction. y The directional gradient of Shannon entropy in the Y direction. This is the sum of the grayscale gradients of the subset;
[0025] g ijx and g ijy The calculation method is as follows:
[0026] Step 151: Define the Sobel operator: The Sobel operator contains two kernels, one for detecting horizontal edges (gradient in the X direction) and the other for detecting vertical edges (gradient in the Y direction).
[0027] Step 152, Image Convolution: Perform a convolution operation between the Sobel operator and the image subset, calculating the gradient values in the X and Y directions respectively. For the gradient in the X direction, convolve the image subset with the kernel of the Sobel operator in the X direction to obtain the gradient value in the X direction. For the gradient in the Y direction, convolve the image subset with the kernel of the Sobel operator in the Y direction to obtain the gradient value in the Y direction.
[0028] Step 153: Gradient Calculation: Calculate the gradient value of each pixel in the X and Y directions respectively. These gradient values will represent the first-order grayscale gradient of each pixel in the image.
[0029] Step 154, Gradient Magnitude and Direction: Based on the calculated gradient values in the X and Y directions, calculate the gradient magnitude and direction for each pixel.
[0030] W is the total width of the speckle image, and H is the total height of the speckle image; g ijx and g ijy Let X be the first-order gray-level gradient of the subset in the direction X and Y; i = 1, 2, 3…M x M x This represents the total number of rows of pixels in the speckle image, j = 1, 2, 3…M Y M Y This represents the total number of columns of pixels in a speckle image.
[0031] Further, step 2, obtaining the features of the speckle pattern before optimization, specifically includes:
[0032] Step 21: Using finite element simulation software, the composite displacement field f(x) for deformation conditions such as uniaxial compression, three-point bending, and type I crack tip is obtained. These simulations simulate different scenarios of constant, linear, and singular strain fields, ensuring the universality and applicability of the research results.
[0033] Step 22: For the unoptimized front speckle map, apply a synthetic displacement field f(x) to it using image processing software to obtain the back speckle map. The specific steps are as follows:
[0034] Step 221: Use image processing software to apply a predefined synthetic displacement field f(x) to each pixel in the front speckle image;
[0035] Step 222: Calculate the new position of each pixel in the image after the displacement is applied, based on the synthesized displacement field f(x);
[0036] Step 223: Map the grayscale value or color value of each pixel to its new location;
[0037] Step 224: After completing the displacement and remapping of all pixels, the resulting new image is the "post-speckle map". This new image reflects the change of the original speckle map under the action of the synthetic displacement field f(x).
[0038] Step 23: Calculate the deformation displacement field g(x) of the speckle pattern before optimization using DIC. The specific steps are as follows:
[0039] Step 231: Perform necessary preprocessing on the two images before and after deformation, including noise reduction, brightness and contrast adjustment, and image sharpening, to improve image quality and enhance the accuracy of correlation analysis.
[0040] Step 232: Select one or more regions of interest (ROIs) in the reference image. These regions contain the target areas for displacement and deformation analysis.
[0041] Step 233: In the deformed image, for each subset of the reference image, search for the best matching position, that is, the position where the correlation metric reaches the optimal position.
[0042] Step 234: For each subset, calculate its displacement vector relative to the reference image in the deformed image. These vectors together form the deformation displacement field g(x) for the entire region of interest or the whole image.
[0043] Step 24: Calculate the errors of the composite displacement field f(x) and the deformed displacement field g(x). The errors of the composite displacement field f(x) and the deformed displacement field g(x) can be obtained by averaging or summing the errors over all points. The specific steps are as follows:
[0044] Step 241, Data Preparation: Determine the displacement value of each speckle under the synthetic displacement field f(x) and the deformation displacement field g(x).
[0045] Step 242: Calculate the error, e.g., Mean Squared Error (MSE)
[0046]
[0047] Mean squared error is one of the most commonly used error measures. It calculates the square of the error at each point and then averages these squared values.
[0048] Furthermore, in step 3, the speckle pattern is optimized. Since the speckle image contains different speckle regions, and the contact between different speckle regions significantly increases the gradient value of the speckle image, thus increasing the directional gradient Shannon entropy of the speckle image, the optimization scheme is to reduce the types of regions contained in the speckle image, specifically including:
[0049] Step 31: For speckle maps with Shannon entropy values greater than the standard value, divide the regions according to different speckle characteristics;
[0050] Step 32: Perform precise image segmentation on the speckle map that has already been divided into regions. The specific steps are as follows:
[0051] Step 321: Use methods such as increasing contrast and noise reduction to make speckle features easier to identify;
[0052] Step 322: Analyze the texture features of the speckle region, such as using the Gray-Level Co-occurrence Matrix (GLCM) or Local Binary Pattern (LBP) to describe the texture attributes of the speckle.
[0053] Step 323: Based on the gray values of the speckle features, select an appropriate threshold to binarize the image and separate the speckle from the background.
[0054] Step 324: Use region-based segmentation methods such as region growing and watershed algorithm to segment the image into different speckle regions based on the continuity and similarity of speckle.
[0055] Step 325: Perform morphological operations such as erosion, dilation, opening and closing operations on the segmented image to remove pinholes and noise generated during the segmentation process and optimize the boundaries of speckle regions.
[0056] Step 326: Visually inspect the segmentation results to ensure that the speckle area is accurately identified and segmented.
[0057] Step 33: Calculate the directional gradient Shannon entropy for different regions of the precisely segmented image to obtain the directional gradient Shannon entropy value for each region. If the directional gradient Shannon entropy calculation result for some regions is less than the standard value, the optimization step can continue. If the directional gradient Shannon entropy calculation result for no region is less than the standard value, the regions with smaller directional gradient Shannon entropy calculation results can be further subdivided to obtain the regions where the directional gradient Shannon entropy calculation result is less than the standard value.
[0058] Step 34: Using image processing techniques, randomly sample the region with the minimum Shannon entropy of the directional gradient, and then randomly overwrite the unfilled region with the sampled data. The specific steps are as follows:
[0059] Step 341: In the region with the minimum Shannon entropy of the directional gradient, select a region with obvious speckle features as a sample. This sample should contain enough texture details to fill in the missing regions.
[0060] Step 342: Extract speckle samples, either through manual selection or automatic detection. In automatic detection, image segmentation algorithms are used to identify and extract regions with rich texture.
[0061] Step 343: Identify which areas in the target image need to be filled.
[0062] Step 344: Randomly select small fragments from the extracted speckle samples. This step is to ensure the diversity of the synthesized texture and avoid the repetitive patterns.
[0063] Step 345: Based on the size and shape of the unfilled area, scale, rotate, or otherwise adjust the selected sample fragment to fit the target area.
[0064] Step 346: Place the adjusted sample fragments into the unfilled areas. During placement, pay attention to the boundary treatment between samples to ensure the continuity and natural transition of the speckle pattern.
[0065] Step 347: In order to reduce the visibility of the seams between samples, edge blending techniques, such as Poisson blending and gradient blending, can be used to make the transition between speckles more natural.
[0066] Step 35: Process the sample edges in the filled speckle map to obtain the optimized front speckle map.
[0067] To fill in the sample edges in the complete speckle map, suitable filling techniques can be used, such as interpolation and texture synthesis.
[0068] Interpolation methods: If the missing region is small, bilinear or bicubic interpolation methods can be used. These methods are effective when dealing with small-scale missing regions.
[0069] Texture synthesis: For larger missing areas, texture-based image inpainting techniques, such as patch-based texture synthesis, can be used to learn and replicate speckle textures from the surrounding area.
[0070] Further, step 4, obtaining the optimized features of the speckle pattern, specifically includes:
[0071] Step 41: For the optimized front speckle map, use image processing techniques to obtain the back speckle map after applying the synthetic displacement field f(x) from step 2. The specific steps are as follows:
[0072] Step 411: Use image processing software to apply a predefined synthetic displacement field f(x) to each pixel in the front speckle image.
[0073] Step 412: Calculate the new position of each pixel in the optimized front speckle image after the displacement is applied, based on the synthetic displacement field f(x).
[0074] Step 413: Map the grayscale or color value of each pixel to its new location.
[0075] Step 414: After completing the displacement and remapping of all pixels, the resulting new image is the "post-speckle map". This new image reflects the changes in the optimized speckle map under the action of the synthetic displacement field f(x).
[0076] Step 42: Calculate the deformation displacement field g(x) of the optimized speckle pattern using DIC. The specific steps are as follows:
[0077] Step 421: Preprocess the two images before and after deformation, including denoising, adjusting brightness and contrast, and image sharpening, to improve image quality and enhance the accuracy of correlation analysis.
[0078] Step 422: Select one or more regions of interest (ROIs) in the reference image. These regions contain the target areas for displacement and deformation analysis.
[0079] Step 423: In the deformed image, for each subset of the reference image, search for the best matching position, that is, the position where the correlation metric reaches the optimal position.
[0080] Step 424: For each subset, calculate its displacement vector relative to the reference image in the deformed image. These vectors together form the deformation displacement field g(x) for the entire region of interest or the whole image.
[0081] Step 43: Calculate the errors of the synthesized displacement field f(x) and deformed displacement field g(x) of the optimized speckle pattern. The errors of the synthesized displacement field f(x) and deformed displacement field g(x) can be calculated by averaging or summing the errors over all points. The specific steps are as follows:
[0082] Step 431, Data Preparation: Determine the displacement value of each speckle under the synthetic displacement field f(x) and the deformation displacement field g(x).
[0083] Step 432: Calculate the error, e.g., Mean Squared Error (MSE)
[0084]
[0085] Mean squared error is one of the most commonly used error measures. It calculates the square of the error at each point and then averages these squared values.
[0086] Furthermore, in step 5, the error calculated in step 4 is compared with that in step 2 to draw conclusions, including:
[0087] If the error obtained in step 4 is less than the error obtained in step 2, then the optimization is considered successful.
[0088] Recalculate the optimized directional gradient Shannon entropy of the natural speckle pattern;
[0089] If the directional gradient Shannon entropy value of the optimized speckle map is less than the standard value, the quality of the optimized speckle map is considered to be acceptable.
[0090] If the directional gradient Shannon entropy value of the optimized speckle map is greater than the standard value, the quality of the optimized speckle map is considered unqualified, and other methods (such as artificial speckle) need to be adopted.
[0091] This invention also provides a microscale natural speckle quality optimization system based on image information parameters, characterized in that it includes:
[0092] The speckle pattern quality evaluation module obtains the speckle pattern that needs to be optimized and is used to evaluate speckle quality information.
[0093] The feature acquisition module for speckle pattern before optimization is used to acquire the features of the speckle pattern before optimization.
[0094] The speckle pattern optimization module optimizes the speckle pattern.
[0095] The feature acquisition module for optimized speckle pattern is used to acquire the features of the optimized speckle pattern.
[0096] The error comparison module compares the error calculated by the feature acquisition module after speckle pattern optimization with that before speckle pattern optimization, and draws a conclusion.
[0097] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor runs the computer program, it performs the steps of the method described above.
[0098] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0099] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described above.
[0100] The present invention has the following beneficial technical effects:
[0101] 1. The present invention provides a method and system for optimizing the quality of natural speckle at the microscale based on image information parameters. This method optimizes the quality of natural speckle based on a neural network model using the directional gradient Shannon entropy method, which can significantly improve the quality of natural speckle.
[0102] 2. The present invention provides a method and system for optimizing the quality of microscale natural speckle based on image information parameters, which can significantly reduce the manpower, financial resources, and material resources required for artificial speckle.
[0103] 3. The present invention provides a method and system for optimizing the quality of microscale natural speckle based on image information parameters, which can ensure that the deformation of the experimental object is not affected while meeting the requirements of DIC calculation. Attached Figure Description
[0104] Figure 1 This is a schematic diagram of image data annotation provided by the present invention;
[0105] Figure 2 This is a schematic diagram of natural speckle feature recognition and extraction provided by the present invention. Detailed Implementation
[0106] To make the objectives, technical solutions, and advantages of this invention clearer, the following description is provided in conjunction with the appendix. Figure 1-2 The technical solution of the present invention will be described in detail below.
[0107] A method for optimizing the quality of natural speckle at the microscale based on image information parameters includes the following steps:
[0108] Step 1: Obtain the speckle pattern to be optimized and evaluate its quality information. This is based on a neural network model using the Shannon entropy method with directional gradient, and specifically includes the following steps:
[0109] Step 11: After grayscale processing, the surface texture of the microscopic sample is obtained as a speckle pattern;
[0110] Step 12: Augment the natural speckle pattern samples to form a dataset, specifically including:
[0111] By randomly shifting a small pixel window across each sample, multiple small samples are extracted, thus constructing a comprehensive dataset.
[0112] The dataset of this invention covers a variety of speckle types, specifically including second-phase speckle of etched additive-manufactured AZ31, conventional grain speckle of etched 316L stainless steel, and natural speckle of etched additive-manufactured 316L stainless steel.
[0113] The speckle images were mainly derived from 16 grayscale images of the microscopic sample surface texture with a resolution of 2580*1944 pixels.
[0114] To enhance the diversity and richness of the dataset, the 16 natural speckle samples were augmented. Specifically, 50 smaller samples of 512*512 pixels were randomly extracted from each sample, resulting in a dataset containing 800 samples.
[0115] Step 13: Randomly select speckle images from the dataset as the validation set. The neural network model based on the Shannon entropy method of directional gradient needs to be trained, and the validation set is used to conduct an initial evaluation of the model's capabilities. Eighty images were randomly selected from the 800 natural speckle images in the dataset as the validation set. By testing and analyzing these images, the accuracy and reliability of the model can be evaluated.
[0116] Step 14: Extract features from the speckle map in the dataset. See details below. Figure 2 As shown;
[0117] Step 15: Calculate the Shannon entropy of the directional gradient in different directions for each speckle map. "Different directions" means traversing all directions. Obtain the minimum value of the Shannon entropy of the directional gradient. The formula for calculating the Shannon entropy of the directional gradient is:
[0118]
[0119] g of the gray gradient of the subset ij The calculation formula is as follows:
[0120]
[0121] Among them, DGSE x DGSE is the directional gradient Shannon entropy in the X direction. y The directional gradient of Shannon entropy in the Y direction. The sum of gray-level gradients of this subset, W is the total width of the speckle image, and H is the total height of the speckle image; g ijx and g ijy Let i be the first-order gray-level gradient of the subset in directions X and Y; i = 1, 2, 3…M x M x This represents the total number of rows of pixels in the speckle image, j = 1, 2, 3…M Y M Y This represents the total number of columns of pixels in a speckle image.
[0122] Step 16: If the Shannon entropy value of the directional gradient of the speckle pattern is less than the standard value, the speckle pattern is considered to be of acceptable quality; if the Shannon entropy value of the directional gradient of the speckle pattern is greater than the standard value, the speckle pattern is considered to be of unacceptable quality and needs to be optimized. The standard value is determined empirically, and is usually between 8 and 8.5.
[0123] Step 2: Obtain the features of the speckle pattern before optimization, specifically including:
[0124] Step 21: Using finite element simulation software, the composite displacement field f(x) for deformation conditions such as uniaxial compression, three-point bending, and type I crack tip is obtained. These simulations simulate different scenarios of constant, linear, and singular strain fields, ensuring the universality and applicability of the research results.
[0125] Step 22: For the unoptimized front speckle map, apply a synthetic displacement field f(x) to it using image processing software to obtain the back speckle map. The specific steps are as follows:
[0126] Step 221: Use image processing software to apply a predefined synthetic displacement field f(x) to each pixel in the front speckle image;
[0127] Step 222: Calculate the new position of each pixel in the image after the displacement is applied, based on the synthesized displacement field f(x);
[0128] Step 223: Map the grayscale value or color value of each pixel to its new location;
[0129] Step 224: After completing the displacement and remapping of all pixels, the resulting new image is the "post-speckle map". This new image reflects the change of the original speckle map under the action of the synthetic displacement field f(x).
[0130] Step 23: Calculate the deformation displacement field g(x) of the speckle pattern before optimization using DIC. The specific steps are as follows:
[0131] Step 231: Perform necessary preprocessing on the two images before and after deformation, including noise reduction, brightness and contrast adjustment, and image sharpening, to improve image quality and enhance the accuracy of correlation analysis.
[0132] Step 232: Select one or more regions of interest (ROIs) in the reference image (referring to the original speckle image), which contain the target areas for displacement and deformation analysis.
[0133] Step 233: In the deformed image, for each subset of the reference image, search for the best matching position. Even if the least squares correlation function reaches its minimum value, the method finds the best matching position by minimizing the sum of squares of the gray-level differences between the reference subset and the deformed subset.
[0134] Step 234: For each subset, calculate its displacement vector relative to the reference image in the deformed image. These vectors together form the deformation displacement field g(x) for the entire region of interest or the whole image.
[0135] Step 24: Calculate the errors of the composite displacement field f(x) and the deformed displacement field g(x). The errors of the composite displacement field f(x) and the deformed displacement field g(x) can be obtained by averaging or summing the errors over all points, including the following steps:
[0136] Step 241, Data Preparation: Determine the displacement value of each speckle under the synthetic displacement field f(x) and the deformation displacement field g(x).
[0137] Step 242: Calculate the error, e.g., Mean Squared Error (MSE)
[0138]
[0139] Mean squared error is one of the most commonly used error measures. It calculates the square of the error at each point and then averages these squared values.
[0140] Step 3: Optimize the speckle pattern. Since the speckle image contains different speckle regions, and the contact between different speckle regions significantly increases the gradient value of the speckle image, thus increasing the directional gradient Shannon entropy of the speckle image, the optimization scheme is to reduce the types of regions contained in the speckle image, specifically including:
[0141] Step 31: For speckle maps with Shannon entropy values greater than the standard value, perform region division based on different speckle characteristics, i.e., image data annotation;
[0142] The image data was annotated in detail using image labeling software tools (e.g.) Figure 1 The annotation process involves clearly classifying and labeling the main speckle features in the image, including cellular speckle (…). Figure 1 (b) marked in red), dendritic speckle ( Figure 1 (b) marked in green), streaky speckle ( Figure 1 (b) marked in yellow), and amorphous speckle ( Figure 1 (b) is marked in blue).
[0143] Step 32: Perform precise image segmentation on the speckle map that has already been divided into regions. The specific steps are as follows:
[0144] Step 321: Use methods such as increasing contrast and noise reduction to make speckle features easier to identify;
[0145] Step 322: Analyze the texture features of the speckle region, such as using the Gray-Level Co-occurrence Matrix (GLCM) or Local Binary Pattern (LBP) to describe the texture attributes of the speckle.
[0146] Step 323: Based on the gray values of the speckle features, select an appropriate threshold to binarize the image and separate the speckle from the background.
[0147] Step 324: Use region-based segmentation methods such as region growing and watershed algorithm to segment the image into different speckle regions based on the continuity and similarity of speckle.
[0148] Step 325: Perform morphological operations such as erosion, dilation, opening and closing operations on the segmented image to remove pinholes and noise generated during the segmentation process and optimize the boundaries of speckle regions.
[0149] Step 326: Visually inspect the segmentation results to ensure that the speckle area is accurately identified and segmented.
[0150] Step 33: Calculate the directional gradient Shannon entropy for different regions of the precisely segmented image to obtain the directional gradient Shannon entropy value for each region. If the directional gradient Shannon entropy calculation result for some regions is less than the standard value, the optimization step can continue. If the directional gradient Shannon entropy calculation result for no region is less than the standard value, the regions with smaller directional gradient Shannon entropy calculation results can be further subdivided to obtain the regions where the directional gradient Shannon entropy calculation result is less than the standard value.
[0151] Step 34: Using image processing techniques, randomly sample the region with the minimum Shannon entropy of the directional gradient. Then, randomly overwrite the unfilled region with the sampled data. The unfilled region refers to the region in the speckle image other than the region with the minimum Shannon entropy of the directional gradient. The specific steps are as follows:
[0152] Step 341: In the region with the minimum Shannon entropy of the directional gradient, select a region with obvious speckle features as a sample. This sample should contain enough texture details to fill in the missing regions.
[0153] Step 342: Extract speckle samples, either through manual selection or automatic detection. In automatic detection, image segmentation algorithms are used to identify and extract regions with rich texture.
[0154] Step 343: Identify which areas in the target image need to be filled.
[0155] Step 344: Randomly select small fragments from the extracted speckle samples. This step is to ensure the diversity of the synthesized texture and avoid the repetitive patterns.
[0156] Step 345: Based on the size and shape of the unfilled area, scale, rotate, or otherwise adjust the selected sample fragment to fit the target area.
[0157] Step 346: Place the adjusted sample fragments into the unfilled areas. During placement, pay attention to the boundary treatment between samples to ensure the continuity and natural transition of the speckle pattern.
[0158] Step 347: In order to reduce the visibility of the seams between samples, edge blending techniques, such as Poisson blending and gradient blending, can be used to make the transition between speckles more natural.
[0159] Step 35: Process the sample edges in the filled speckle map to obtain the optimized front speckle map.
[0160] To fill in the sample edges in the complete speckle map, suitable filling techniques can be used, such as interpolation and texture synthesis.
[0161] Interpolation methods: If the missing region is small, bilinear or bicubic interpolation methods can be used. These methods are effective when dealing with small-scale missing regions.
[0162] Texture synthesis: For larger missing areas, texture-based image inpainting techniques, such as patch-based texture synthesis, can be used to learn and replicate speckle textures from the surrounding area.
[0163] Step 4: Obtain the optimized features of the speckle pattern, specifically including:
[0164] Step 41: For the optimized front speckle map, use image processing techniques to obtain the back speckle map after applying the deformation function f(x) from step 2. The specific steps are as follows:
[0165] Step 411: Use image processing software to apply a predefined synthetic displacement field f(x) to each pixel in the front speckle image.
[0166] Step 412: Calculate the new position of each pixel in the optimized front speckle image after the displacement is applied, based on the synthetic displacement field f(x).
[0167] Step 413: Map the grayscale or color value of each pixel to its new location.
[0168] Step 414: After completing the displacement and remapping of all pixels, the resulting new image is the "post-speckle map". This new image reflects the changes in the optimized speckle map under the action of the synthetic displacement field f(x).
[0169] Step 42: Calculate the deformation displacement field g(x) of the optimized speckle pattern using DIC. The specific steps are as follows:
[0170] Step 421: Preprocess the two images before and after deformation (the two images before and after deformation refer to the two images before and after applying the synthetic displacement field f(x)) including denoising, adjusting brightness and contrast, and image sharpening to improve image quality and enhance the accuracy of correlation analysis.
[0171] Step 422: Select one or more regions of interest (ROIs) in the reference image. These regions contain the target areas for displacement and deformation analysis.
[0172] Step 423: In the deformed image, for each subset of the reference image, search for the best matching position. Even if the least squares correlation function reaches its minimum value, the method finds the best matching position by minimizing the sum of squares of the gray-level differences between the reference subset and the deformed subset.
[0173] Step 424: For each subset, calculate its displacement vector relative to the reference image in the deformed image. These vectors together form the deformation displacement field g(x) for the entire region of interest or the whole image.
[0174] Step 43: Calculate the errors of the synthesized displacement field f(x) and deformed displacement field g(x) of the optimized speckle pattern. The errors of the synthesized displacement field f(x) and deformed displacement field g(x) can be calculated by averaging or summing the errors over all points, including the following steps:
[0175] Step 431, Data Preparation: Determine the displacement value of each speckle under the synthetic displacement field f(x) and the deformation displacement field g(x);
[0176] Step 432: Calculate the error, e.g., Mean Squared Error (MSE)
[0177]
[0178] Mean squared error is one of the most commonly used error measures. It calculates the square of the error at each point and then averages these squared values.
[0179] Step 5: Compare the error calculated in Step 4 with that in Step 2, and draw conclusions, including:
[0180] If the error obtained in step 4 is less than the error obtained in step 2, then the optimization is considered successful.
[0181] Recalculate the optimized directional gradient Shannon entropy of the natural speckle pattern;
[0182] If the directional gradient Shannon entropy value of the optimized speckle map is less than the standard value, the quality of the optimized speckle map is considered to be acceptable.
[0183] If the directional gradient Shannon entropy value of the optimized speckle map is greater than the standard value, the quality of the optimized speckle map is considered unqualified, and other methods (such as artificial speckle) need to be adopted.
[0184] This invention also provides a microscale natural speckle quality optimization system based on image information parameters, comprising:
[0185] The speckle pattern quality evaluation module obtains the speckle pattern that needs to be optimized and is used to evaluate speckle quality information.
[0186] The feature acquisition module for speckle pattern before optimization is used to acquire the features of the speckle pattern before optimization.
[0187] The speckle pattern optimization module optimizes the speckle pattern.
[0188] The feature acquisition module for optimized speckle pattern is used to acquire the features of the optimized speckle pattern.
[0189] The error comparison module compares the error calculated by the feature acquisition module after speckle pattern optimization with that before speckle pattern optimization, and draws a conclusion.
[0190] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor runs the computer program, it performs the steps of the method described above.
[0191] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0192] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described above.
[0193] The above description is merely a preferred embodiment of the present invention and is not intended to limit this application. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for optimizing the quality of microscale natural speckle based on image information parameters, characterized in that, Includes the following steps: Step 1: Obtain the speckle pattern to be optimized and evaluate its quality information. This is based on a neural network model using the Shannon entropy method with directional gradient, specifically including: Step 11: After grayscale processing, the surface texture of the microscopic sample is obtained as a speckle pattern; Step 12: Augment the natural speckle pattern samples to form a dataset; Step 13: Randomly select speckle patterns from the dataset as the validation set; Step 14: Extract features from the speckle pattern in the dataset; Step 15: Calculate the Shannon entropy of the directional gradient in different directions for each speckle pattern. The formula for calculating the Shannon entropy of the directional gradient is: gray gradient of subset The calculation formula is as follows: in, for X The directional gradient of the direction, Shannon entropy. for Y The directional gradient of the direction, Shannon entropy. , , which is the sum of the gray-level gradients of this subset. The total width of the speckle image. The total height of the speckle image; and The direction of the subset in that direction and direction The first-order grayscale gradient; =1,2,3… , This represents the total number of rows of pixels in the speckle image. =1,2,3… , This represents the total number of columns of pixels in the speckle image; Step 16: If the directional gradient Shannon entropy value of the speckle pattern is less than the standard value, the speckle pattern is considered to be of acceptable quality; if the directional gradient Shannon entropy value of the speckle pattern is greater than the standard value, the speckle pattern is considered to be of unacceptable quality and needs to be optimized. Step 2: Obtain the features of the speckle pattern before optimization; Step 3: Optimize the speckle pattern, specifically including: Step 31: For speckle maps with directional gradient Shannon entropy values greater than the standard value, divide the regions according to different types of speckle characteristics; Step 32: Perform further image segmentation on the speckle map that has already been divided into regions; Step 33: Calculate the directional gradient Shannon entropy for different regions of the further segmented image to obtain the directional gradient Shannon entropy value for each region; Step 34: Using image processing techniques, randomly sample the region with the minimum directional gradient Shannon entropy, and then randomly cover the unfilled region with the sampled sample. The unfilled region refers to the region in the speckle image other than the region with the minimum directional gradient Shannon entropy. Step 35: Process the sample edges in the filled speckle map to obtain the optimized front speckle map; Step 4: Obtain the optimized features of the speckle pattern; Step 5: Compare the error calculated in Step 4 with that in Step 2. If the error obtained in Step 4 is smaller than the error obtained in Step 2, then the optimization is considered successful. Recalculate the optimized directional gradient Shannon entropy of the natural speckle pattern; If the directional gradient Shannon entropy value of the optimized speckle map is less than the standard value, the quality of the optimized speckle map is considered acceptable.
2. The method for optimizing the quality of microscale natural speckle based on image information parameters according to claim 1, characterized in that, Step 2: Obtain the features of the speckle pattern before optimization, specifically including: Step 21: Use finite element simulation software to obtain the composite displacement field f(x) for deformation conditions such as uniaxial compression, three-point bending and type I crack tip. These simulate different scenarios of constant, linear and singular strain fields, respectively. Step 22: For the unoptimized front speckle pattern, apply a synthetic displacement field f(x) to it using image processing software to obtain the back speckle pattern; Step 23: Calculate the deformation displacement field g(x) of the speckle pattern before optimization using the digital image correlation method; Step 24: Calculate the error of the synthesized displacement field f(x) and the deformed displacement field g(x).
3. The method for optimizing the quality of microscale natural speckle based on image information parameters according to claim 1, characterized in that, Step 4: Obtain the optimized features of the speckle pattern, specifically including: Step 41: For the optimized front speckle map, use image processing techniques to obtain the back speckle map after applying the deformation function f(x) in step 2; Step 42: Calculate the deformation displacement field g(x) of the optimized speckle pattern using the digital image correlation method; Step 43: Calculate the error of the synthesized displacement field f(x) and the deformed displacement field g(x) of the optimized speckle pattern.
4. A microscale natural speckle quality optimization system based on image information parameters, characterized in that, include: The speckle map quality assessment module acquires the speckle map to be optimized and is used to evaluate speckle quality information. It is based on a neural network model using the directional gradient Shannon entropy method, and specifically includes: Step 11: After grayscale processing, the surface texture of the microscopic sample is obtained as a speckle pattern; Step 12: Augment the natural speckle pattern samples to form a dataset; Step 13: Randomly select speckle patterns from the dataset as the validation set; Step 14: Extract features from the speckle pattern in the dataset; Step 15: Calculate the Shannon entropy of the directional gradient in different directions for each speckle pattern. The formula for calculating the Shannon entropy of the directional gradient is: gray gradient of subset The calculation formula is as follows: in, for X The directional gradient of the direction, Shannon entropy. for Y The directional gradient of the direction, Shannon entropy. , , which is the sum of the gray-level gradients of this subset. The total width of the speckle image. The total height of the speckle image; and The direction of the subset in that direction and direction The first-order grayscale gradient; =1,2,3… , This represents the total number of rows of pixels in the speckle image. =1,2,3… , This represents the total number of columns of pixels in the speckle image; Step 16: If the directional gradient Shannon entropy value of the speckle pattern is less than the standard value, the speckle pattern is considered to be of acceptable quality; if the directional gradient Shannon entropy value of the speckle pattern is greater than the standard value, the speckle pattern is considered to be of unacceptable quality and needs to be optimized. The feature acquisition module for speckle pattern before optimization is used to acquire the features of the speckle pattern before optimization. The speckle pattern optimization module optimizes speckle patterns, specifically including: Step 31: For speckle maps with directional gradient Shannon entropy values greater than the standard value, divide the regions according to different types of speckle characteristics; Step 32: Perform further image segmentation on the speckle map that has already been divided into regions; Step 33: Calculate the directional gradient Shannon entropy for different regions of the further segmented image to obtain the directional gradient Shannon entropy value for each region; Step 34: Using image processing techniques, randomly sample the region with the minimum directional gradient Shannon entropy, and then randomly cover the unfilled region with the sampled sample. The unfilled region refers to the region in the speckle image other than the region with the minimum directional gradient Shannon entropy. Step 35: Process the sample edges in the filled speckle map to obtain the optimized front speckle map; The feature acquisition module for optimized speckle pattern is used to acquire the features of the optimized speckle pattern. The error comparison module compares the error calculated by the feature acquisition module after speckle pattern optimization with that before speckle pattern optimization. If the error obtained in the process of acquiring the features after speckle pattern optimization is smaller than the error obtained in the process of acquiring the features before speckle pattern optimization, then the optimization is considered successful. Recalculate the optimized directional gradient Shannon entropy of the natural speckle pattern; If the directional gradient Shannon entropy value of the optimized speckle map is less than the standard value, the quality of the optimized speckle map is considered acceptable.
5. An electronic device, characterized in that: The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it performs the steps of the method according to any one of claims 1-3.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-3.
Citation Information
Patent Citations
Speckle preparation method for deformation test of shaped refractory material
CN110986811A