Measurement method, terminal equipment and computer readable storage medium

By setting up a specific environment in a tensile test to acquire high-definition images and perform pixel data analysis, the problem of insufficient measurement accuracy in existing technologies is solved, and higher precision instantaneous size measurement is achieved.

CN122089764APending Publication Date: 2026-05-26THE HONG KONG POLYTECHNIC UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
THE HONG KONG POLYTECHNIC UNIV
Filing Date
2024-11-26
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technologies cannot acquire high-definition digital images and perform accurate edge detection, resulting in low accuracy in the instantaneous dimension measurement of tensile specimens.

Method used

High-definition digital images are acquired by setting up a specific experimental environment, and the pixel data in the images is analyzed and processed to detect precise edges and determine the instantaneous size of the sample under test during the stretching process.

Benefits of technology

It improves the accuracy of instantaneous dimension measurement of tensile specimens, achieving the test accuracy required by relevant testing standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122089764A_ABST
    Figure CN122089764A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of measurement, and provides a measurement method, terminal equipment and a computer readable storage medium, and the method comprises the steps: obtaining an initial image of a to-be-tested sample before stretching and an instantaneous image in a stretching process; edge pixel points of the instantaneous image are detected; and determining the instantaneous diameter of the to-be-tested sample according to the position change of the edge pixel points of the instantaneous image and the initial image. According to the method, the measurement precision of the instantaneous size of the to-be-tested sample in the tensile experiment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of measurement technology, and in particular relates to a measurement method, terminal equipment, and computer-readable storage medium. Background Technology

[0002] Instantaneous dimensional measurements of standard tensile specimens are of great significance for research and applications in materials science and engineering. In tensile testing, these measurements provide highly accurate strain data, which is crucial for plotting stress-strain curves. The stress-strain relationship is fundamental to describing the mechanical properties of materials, helping us understand their mechanical behavior under external forces.

[0003] In related technologies, the inability to acquire high-definition digital images and the inability to perform accurate edge detection result in low instantaneous dimensional accuracy of the tensile specimens. Summary of the Invention

[0004] This application provides a measurement method that can improve the measurement accuracy of the instantaneous dimensions of the sample under test in a tensile specimen.

[0005] In a first aspect, embodiments of this application provide a measurement method, including:

[0006] Acquire initial images of the sample before stretching and instantaneous images during the stretching process;

[0007] Detect edge pixels in a momentary image;

[0008] The instantaneous diameter of the sample under test is determined based on the positional changes of edge pixels in the instantaneous image and the initial image.

[0009] In this embodiment, a momentary image of the test sample during the testing process is acquired. Pixel detection analysis is performed on the pixels in the momentary image to determine the edge position of the test sample. Based on this edge position, the momentary size (diameter) of the test sample is determined. Unlike related methods that directly use specific algorithms to perform edge detection on the image, this method, through detailed analysis of the pixels in the momentary image, improves the accuracy of edge position determination, thereby obtaining a more accurate diameter measurement result. The above method can improve the accuracy of measuring the momentary diameter of the test sample.

[0010] In one possible implementation of the first aspect, acquiring an initial image of the sample to be tested before stretching and a transient image during the stretching process includes:

[0011] A first environment is defined, wherein the image sharpness captured in the first environment is higher than a preset threshold;

[0012] Initial images of the test sample before stretching and instantaneous images during the stretching process were captured in the first environment.

[0013] In this embodiment of the application, by setting up a specific environment, the clarity of the instantaneous image of the sample to be tested can be improved, thereby improving the measurement accuracy of the instantaneous diameter of the tensile specimen in the subsequent image processing.

[0014] In one possible implementation of the first aspect, the edge pixels of the initial image include a plurality of first pixels on the left edge of the sample to be tested and a plurality of second pixels on the right edge of the sample to be tested, and the edge pixels of the instantaneous image include a plurality of third pixels on the left edge of the sample to be tested and a plurality of fourth pixels on the right edge of the sample to be tested. Determining the instantaneous diameter of the sample to be tested based on the positional changes of the edge pixels in the instantaneous image and the initial image includes:

[0015] Obtain a first distance between the first pixel and the second pixel, wherein the first distance is the initial size of the sample to be tested in the horizontal direction in the initial image before stretching;

[0016] Obtain the second distance between the third pixel and the fourth pixel, where the second distance is the instantaneous dimension of the sample under test in the horizontal direction in the instantaneous image during the stretching process;

[0017] The instantaneous diameter of the sample to be tested is determined based on the first distance and the second distance.

[0018] In this embodiment of the application, by tracking the distance change of edge pixels before and after image stretching, the diameter of the sample under test can be measured very accurately, thereby improving the measurement accuracy of the sample under test.

[0019] In one possible implementation of the first aspect, determining the instantaneous diameter of the sample to be tested based on a first distance and a second distance includes:

[0020] Obtain a preset ratio between the initial diameter of the sample to be tested and the first distance, wherein the initial diameter is the actual size of the sample to be tested in the horizontal direction;

[0021] The first parameter corresponding to the second distance is calculated according to the preset ratio to obtain the instantaneous diameter of the sample to be tested.

[0022] In this embodiment of the application, by using a preset ratio, the distance measurement in the image can be directly converted into the calculation of the sample diameter, which simplifies the calculation process. The preset ratio is derived based on the quantitative relationship between the actual size of the sample and the measured distance in the image, which can improve the accuracy of the calculation results.

[0023] In a possible implementation of the first aspect, the target pixel is the third pixel or the fourth pixel, and the steps of detecting the target pixel of the instantaneous image include:

[0024] Obtain the pixel intensities corresponding to multiple fifth pixels in the instantaneous image, where the fifth pixel is any pixel in the instantaneous image;

[0025] Determine a first color according to the pixel intensities of the multiple fifth pixels, where the first color is the color corresponding to the fifth pixel with the largest change in pixel intensity in the instantaneous image;

[0026] Determine the target pixel according to the first color.

[0027] In the above method, by comparing the pixel intensities of multiple pixels, the pixel with the largest color change can be accurately identified, thereby improving the recognition accuracy of the target pixel.

[0028] In a possible implementation of the first aspect, determining the target pixel according to the first color includes:

[0029] Generate a first matrix according to the multiple fifth pixels corresponding to the first color;

[0030] Obtain multiple first coefficients corresponding to the fifth pixels in each row of the first matrix, where the first coefficient is used to describe the dispersion degree of the fifth pixels in each row of the first matrix;

[0031] Determine the target pixel according to the multiple first coefficients.

[0032] In the embodiments of the present application, by constructing a feature matrix (the first matrix) and analyzing the dispersion degree of pixel points, the recognition accuracy and robustness of the target pixel are improved, and at the same time, the data processing flow is simplified.

[0033] In a possible implementation of the first aspect, obtaining multiple first coefficients corresponding to the fifth pixels in each row of the first matrix includes:

[0034] Divide the fifth pixels in each row into m1 groups of pixel data, where each group of pixel data includes n1 fifth pixels, where 0 < m1 < l, 0 < n1 < l, and l is the number of pixels corresponding to the fifth pixels in each row;

[0035] Obtain the average value and standard deviation corresponding to each group of pixel data;

[0036] Calculate the ratio of the standard deviation corresponding to each group of pixel data to the average value corresponding to each group of pixel data to obtain multiple first coefficients.

[0037] In this embodiment, grouping the fifth pixel of each row can better capture the pixel features of local areas. By calculating the average and standard deviation of each group of pixel data, the local brightness information and the dispersion of pixel values ​​can be obtained. These statistical characteristics help describe the local features of the pixels. By calculating the ratio between the standard deviation and the average, the obtained first coefficient can reflect the relative magnitude of the dispersion of each group of pixel data with respect to its average value. This helps to distinguish pixels with different features. These first coefficients can be used as feature quantities to help distinguish pixels in different areas of the image, thereby improving the recognition accuracy of target pixels.

[0038] In one possible implementation of the first aspect, determining the target pixel based on a plurality of first coefficients includes:

[0039] The second coefficient is determined from multiple first coefficients corresponding to the fifth pixel data in each row of the first matrix, wherein the second coefficient is the first first coefficient that is greater than the first threshold among multiple first coefficients obtained sequentially from the edge side corresponding to the target pixel;

[0040] The third pixel corresponding to the second coefficient of the fifth pixel data in each row of the first matrix is ​​determined as the target pixel.

[0041] In this embodiment, the edge of a target pixel can be detected by finding the first coefficient greater than a first threshold. This method helps to accurately identify the edge position in an image. Once the first coefficient greater than the threshold is detected on the edge side, the third pixel data corresponding to that coefficient can be identified as the target pixel, thereby improving the accuracy of localization.

[0042] In a second aspect, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the measurement method as described in any of the first aspects above.

[0043] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the measurement method as described in any of the first aspects above.

[0044] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute any of the measurement methods described in the first aspect above.

[0045] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a schematic flowchart of the measurement method provided in the embodiments of this application;

[0048] Figure 2 This is a schematic diagram of the test environment and test equipment provided in the embodiments of this application;

[0049] Figure 3 This is a schematic diagram of a momentary image provided in an embodiment of this application;

[0050] Figure 4 This is a schematic diagram of the process for obtaining the instantaneous diameter provided in an embodiment of this application;

[0051] Figure 5 This is a flowchart illustrating the detection of edge pixels provided in an embodiment of this application. Figure 1 ;

[0052] Figure 6 This is a flowchart illustrating the detection of edge pixels provided in an embodiment of this application. Figure 2 ;

[0053] Figure 7 This is a schematic diagram of pixel light intensity distribution curves provided in an embodiment of this application;

[0054] Figure 8 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. Detailed Implementation

[0055] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0056] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0057] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0058] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0059] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0060] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0061] Instantaneous dimension measurement of standard tensile specimens is of great significance for research and application in the fields of materials science and engineering. In tensile testing, instantaneous dimension measurement can obtain highly accurate strain data for precise mechanical stress and strain analysis. The mechanical stress-strain relationship is the basis for describing the mechanical properties of materials, and it can help us understand the mechanical behavior of materials under external forces.

[0062] In related technologies, conventional digital image processing methods are used to measure the size of objects, which typically include: acquiring digital images of the object under study; optimizing image quality; reducing lens distortion; separating the target object from the background; extracting features using edge detection methods; and measuring the size. However, the accuracy of the size measurement of the object under study may not reach the required accuracy due to factors such as camera resolution, lens quality and distortion, inaccurate calibration, and environmental factors. For example, it is difficult for conventional equipment to achieve an accuracy of 0.001 millimeters.

[0063] Furthermore, edge detection, a fundamental tool in image processing, is used to identify boundaries within an image. It is crucial for various applications such as object detection, image segmentation, and feature extraction. The main idea behind edge detection is to find regions where intensity (pixel values) changes significantly, which typically indicates the presence of an edge. The edge detection steps employed in conventional image processing methods are as follows: image smoothing to reduce image noise; gradient calculation to evaluate the intensity gradient changes of the three primary colors in a pixel, using operators such as Sobel, Prewitt, or Roberts; thresholding to determine key values ​​for the intensity gradient in edge detection; and edge continuity and hysteresis effects to connect edges into continuous lines or curves when necessary for subsequent pattern recognition. Based on these steps, the measurement accuracy for research is generally ±5mm, which does not meet the research precision required by the experimenters.

[0064] To address the aforementioned technical problems, this application provides a measurement method. In this application, a first environment is set up to obtain a high-definition digital image of the sample to be tested, replacing the current use of expensive imaging methods such as laser scanning. The pixel data in the high-definition digital image is analyzed and processed to detect precise image edges. Finally, the instantaneous size of the sample to be tested during the tensile process is determined based on the edge position of the digital image. This method can improve the measurement accuracy of the instantaneous size of the sample to be tested in the tensile test, so that the test accuracy meets the relevant test standards.

[0065] Figure 1 This is a flowchart illustrating the testing method provided in an embodiment of this application. It is intended as an example and not a limitation. The method may include the following steps:

[0066] S101, acquire the initial image of the sample to be tested before stretching and the instantaneous image during the stretching process.

[0067] In the embodiments of this application, before conducting mechanical tests on a metal specimen (sample to be tested), it is necessary to take an initial image of the metal specimen before the test, and to capture an image of the metal specimen during the test, such as a tensile process (instantaneous image). This image shows the state of the sample to be tested at a specific instant. The instantaneous image during the tensile process can capture the shape of the sample when subjected to tensile force, which helps to analyze the behavior of the sample under specific stress or strain.

[0068] In one embodiment, step S101 includes:

[0069] A first environment is set, wherein the image clarity captured in the first environment is higher than a preset threshold; an initial image of the test sample before stretching and an instantaneous image during the stretching process are captured in the first environment.

[0070] In the embodiments of this application, before the experiment is conducted, the researchers build a specific experimental environment, which may include the control of factors such as temperature, humidity, and lighting conditions, to ensure that high-definition images of the test samples can be obtained during the experiment. This is equivalent to using a low-cost environment construction method to obtain high-definition images instead of expensive laser scanning imaging technology, which can reduce the cost of experimental testing.

[0071] In one implementation, the experimental environment (first environment) established in this application is as follows:

[0072] 1) Light intensity: Darkroom operation

[0073] 2) The strain rate of the experiment was set to 5–10 × 10⁻⁶. -6 Between / seconds

[0074] Within a controlled strain rate range (based on the standard settings for high-definition images), the exposure time is controlled, allowing the camera to capture instantaneous, clear digital images within an appropriate time period, thus avoiding triggering the camera's automatic exposure compensation function and affecting the accuracy of the measurement.

[0075] 3) Provide LED backlighting to ensure the edges of the metal sample are glossy, such as... Figure 2 The diagram shown is a schematic of the testing environment and testing equipment provided in an embodiment of this application. Figure 2 As shown in Figure a, the metal sample is mounted on the experimental testing equipment. An LED backlight is placed at a preset position in front of the testing equipment to ensure the edges of the metal sample are glossy. A camera is placed in front of the testing equipment to capture images (instantaneous images), as shown below. Figure 2 Image b shows a momentary image of the captured metal sample during the tensile process.

[0076] 5) Prepare photographs of metal samples of appropriate size, such as... Figure 3 The image shown is a schematic diagram of a momentary image provided in an embodiment of this application. This metal sample image is used for subsequent image processing such as edge detection.

[0077] In the above method, by setting up a specific environment, the clarity of the initial and instantaneous images of the sample under test can be improved, thereby improving the measurement accuracy of the instantaneous diameter of the tensile specimen in subsequent image processing.

[0078] S102, detects edge pixels in a momentary image.

[0079] In this embodiment, edge detection can identify the boundary between the metal sample and its surrounding environment, thereby accurately obtaining the sample's contour, which is the basis for measuring the sample's diameter. The detected edge pixels represent locations in the metal sample image where brightness changes significantly.

[0080] It should be noted that the position of the edge pixels will also change as the metal sample deforms during the stretching process.

[0081] S103, determine the instantaneous diameter of the sample to be tested based on the positional changes of the edge pixels in the instantaneous image and the initial image.

[0082] In this embodiment, the diameter of the metal sample at various instants is calculated using the tracked edge pixel positions. This typically involves determining the distance between two opposing edge pixels, or using more complex geometric analysis methods to determine the diameter. The measured instantaneous diameter can be recorded and further analyzed, such as calculating physical quantities like strain and stress, or used to verify the accuracy of the material model.

[0083] In the above method, acquiring a momentary image of the test sample during the testing process and performing pixel detection analysis on the pixels in the momentary image to determine the edge position of the momentary image, and determining the momentary size (diameter) of the test sample based on the edge position and the edge position in the initial image, can improve the accuracy of edge position determination, thereby obtaining a more accurate diameter measurement result. The above method can improve the accuracy of measuring the momentary diameter of the test sample.

[0084] In one embodiment, the edge pixels of the initial image include a plurality of first pixels on the left edge of the test sample and a plurality of second pixels on the right edge of the test sample, and the edge pixels of the instantaneous image include a plurality of third pixels on the left edge of the test sample and a plurality of fourth pixels on the right edge of the test sample. Figure 4 This is a schematic diagram of the process for obtaining the instantaneous diameter provided in an embodiment of this application, as shown below. Figure 4 As shown, step S103 includes:

[0085] S201, obtain the first distance between the first pixel and the second pixel corresponding to the first pixel, the first distance being the initial size of the sample to be tested in the horizontal direction in the initial image before stretching.

[0086] In this embodiment of the application, the "initial image" is an initial reference image taken before the metal sample is tested, i.e. before it is stretched. The horizontal distance between each first pixel point on the left edge of the sample to be tested and its corresponding second pixel point on the right edge of the sample to be tested is obtained. By measuring and recording the distance between all first pixel points and their corresponding second pixel points, we can obtain the horizontal initial size of the initial image of the metal sample taken before the test.

[0087] S202, Obtain the second distance between the third pixel and the fourth pixel, the second distance being the instantaneous dimension of the test sample in the horizontal direction in the instantaneous image during the stretching process.

[0088] In this embodiment, the left and right edge pixels (third and fourth pixels) of the metal sample are identified from the instantaneous image by edge detection. Then, the horizontal distance (second distance) between these pixels is calculated and the minimum value is taken to determine the instantaneous diameter of the metal sample at a certain instant. The second distance refers to the horizontal straight-line distance between each third pixel on the left edge of the sample to the corresponding fourth pixel on the right edge of the sample. By measuring and recording the second distance between all third pixels and their corresponding fourth pixels, the diameter of the metal sample at a certain instant can be obtained based on the second distance.

[0089] S203, determine the instantaneous diameter of the sample to be tested based on the first distance and the second distance.

[0090] In this embodiment of the application, the instantaneous diameter of the sample under test is obtained by tracking the distance change of edge pixels before and after image stretching.

[0091] In the above method, by tracking the distance change of edge pixels before and after image stretching, the diameter of the sample under test can be measured very accurately, which can improve the measurement accuracy of the sample under test.

[0092] In one embodiment, step S203 is implemented by:

[0093] Obtain a preset ratio between the initial diameter of the sample to be tested and the first distance, wherein the initial diameter is the actual size of the sample to be tested in the horizontal direction;

[0094] The first parameter corresponding to the first distance is calculated according to the preset ratio to obtain the instantaneous diameter of the sample to be tested.

[0095] In this embodiment, before the experiment begins, the initial diameter of the metal sample (i.e., its size in the actual environment) is recorded. After obtaining the first distance between edge pixels in the initial image of the metal sample, the ratio between the initial diameter and the first distance is calculated. This ratio is set based on the measurement and understanding of the sample size and image resolution before the experiment. Then, using this ratio, a second distance is calculated to obtain a first parameter, namely the instantaneous diameter of the sample to be tested.

[0096] For example, if the first distance between edge pixels in the initial image corresponding to the metal sample is 300 pixels and the initial diameter is 60 mm, then the ratio of the initial diameter to the first distance corresponding to the initial image is 60:300 = 1:5. If the second distance corresponding to the instantaneous image obtained during the tensile test of the metal sample is 500 pixels, then according to the above ratio, the instantaneous diameter is 500 * 1 / 5 = 100 mm.

[0097] In the above method, by using a preset ratio, the distance measurement in the image can be directly converted into the calculation of the sample diameter, which simplifies the calculation process. The preset ratio is derived based on the quantitative relationship between the actual size of the sample and the measured distance in the image, which can improve the accuracy of the calculation results.

[0098] In one embodiment, the target pixel is the third pixel or the fourth pixel. Figure 5 This is a flowchart illustrating the process of detecting edge pixels in step S102 provided in the embodiments of this application. Figure 1 ,like Figure 5 As shown, the steps for detecting target pixels in a transient image include:

[0099] S301, obtain the pixel intensity corresponding to each of the multiple fifth pixels in the instantaneous image, where the fifth pixel is any pixel in the instantaneous image.

[0100] In this embodiment, the size of the image sample, i.e., the instantaneous image, is first determined. The image size is typically represented by the number of pixels. For example, an image 680 pixels wide and 480 pixels high contains 680 × 480 pixels. After determining the size of the instantaneous image, the intensity of each pixel (the third pixel) in the instantaneous image relative to the image sample is determined. The intensity of each pixel relative to the image sample refers to the color or grayscale level of that pixel in the image. In a color image, each pixel is typically represented by the values ​​of the three color channels: red, green, and blue (RGB). For example, the color intensity of a pixel could be (255, 0, 0), indicating that red is the strongest.

[0101] Specifically, by reading data from each pixel, we can obtain the pixel value, or pixel intensity, corresponding to each pixel.

[0102] S302, determine the first color based on the pixel intensity of multiple fifth pixels, the first color being the color corresponding to the fifth pixel with the largest change in pixel intensity in the instantaneous image.

[0103] In this embodiment, a first color is determined based on the pixel intensity of the third pixel. This first color refers to the color with the greatest intensity change among the fifth pixels in the image. The greatest intensity change may mean that in the area surrounding the fifth pixel, the pixel intensity change of this color is greater than that of other colors, which may be due to color transitions, edges, or local features.

[0104] Specifically, the intensity contrast values ​​of the three primary colors corresponding to all pixels in the fifth pixel are compared, and the color with the higher contrast value is taken as the first color for edge measurement calculation, i.e., the calculation of the target pixel.

[0105] For example, if a momentary image contains three pixels on the horizontal axis with RGB values ​​x1 = (250, 50, 50), x2 = (50, 200, 50), and x3 = (50, 200, 50), then the intensity contrast value corresponding to red (R) is the ratio between the highest and lowest pixel values, i.e., 250 / 50 = 5; the intensity contrast value corresponding to green (G) is the ratio between the highest and lowest pixel values, i.e., 200 / 50 = 4; and the intensity contrast value corresponding to blue (B) is the ratio between the highest and lowest pixel values, i.e., 50 / 50 = 1. By comparison, it can be seen that the color with the higher contrast value is red, i.e., red is the primary color.

[0106] S303, determine the target pixel based on the first color.

[0107] In this embodiment of the application, the region corresponding to the determined first color is used as the main detection region to determine the target pixel.

[0108] By comparing the pixel intensity of multiple pixels, the pixel with the greatest color change can be accurately identified, thereby improving the recognition accuracy of the target pixel.

[0109] In one embodiment, Figure 6 This is a flowchart illustrating the detection of edge pixels provided in an embodiment of this application. Figure 2 ,like Figure 6 As shown, step S303 includes:

[0110] S401, Generate a first matrix based on the multiple fifth pixels corresponding to the first color.

[0111] In this embodiment of the application, all the red pixels in the fifth pixel are extracted, and the fifth pixels corresponding to the red areas are combined into a first matrix.

[0112] S402, obtain multiple first coefficients corresponding to the fifth pixel in each row of the first matrix. The first coefficients are used to describe the discreteness of the fifth pixel in each row of the first matrix.

[0113] In an embodiment of the present application, in image processing, obtaining a plurality of first coefficients corresponding to the fifth pixel in each row of the first matrix, which is used to describe the dispersion degree of the fifth pixel in each row, involves statistical analysis of image data.

[0114] In one embodiment, step S402 includes:

[0115] Dividing the fifth pixel in each row into m1 groups of pixel data, each group of pixel data includes n1 fifth pixels, where 0 < m1 < l, 0 < n1 < l, and l is the number of pixels corresponding to the fifth pixel in each row. Obtain the average value and standard deviation corresponding to each group of pixel data respectively. Calculate the ratio between the standard deviation corresponding to each group of pixel data and the average value corresponding to each group of pixel data to obtain a plurality of first coefficients.

[0116] In an implementation manner of step S402 in an embodiment of the present application, if the target pixel is the third pixel, then perform an analysis on the light intensity of each pixel point row by row for the pixels in the first matrix. For example, a pixel point brightness distribution curve of each row can be drawn as shown in FIG. 7, which is a schematic diagram of the pixel light intensity distribution curve provided by an embodiment of the present application. Specifically, it is the brightness distribution curve of the pixel data in the first row of the first matrix. Then perform brightness comparison. The specific comparison steps are as follows:

[0117] Select the first 30 (n1) pixel data (pixel element 1 to pixel element 30) from left to right in the first row of the matrix

[0118] Perform statistical analysis on the evaluation group to obtain the following attributes:

[0119] The light intensity average value of this data group;

[0120] The standard deviation of the light intensity of this data group;

[0121] The coefficient of variation of the illumination intensity of this data group;

[0122]

[0123] Select the second evaluation group (i.e., pixel element 2 to pixel element 31) in the first row of the matrix, and perform light intensity statistical analysis, and so on, until m1 groups of pixel data are evaluated. The value of m1 is related to the value of n1 pixel data. For example, in the present application, n1 is 30. By passing through Figure 7 It can be seen that the total number of pixel data in the first row is 350 (l), then m1 is 321 groups. Therefore, the first row of pixel data corresponds to 321 first coefficients. Evaluate each row of pixel data in the first matrix in sequence according to the above method.

[0124] In another implementation manner, if the target pixel is the fourth pixel, that is, the pixel point on the right edge of the instantaneous image to be tested, the order of evaluating each row of pixel data is to select 30 data in sequence from right to left for evaluation.

[0125] S403 determines the target pixel based on multiple first coefficients.

[0126] In this embodiment of the application, by constructing a feature matrix (first matrix) and analyzing the discreteness of pixel points, the recognition accuracy and robustness of target pixel points are improved, while the data processing flow is simplified.

[0127] In one embodiment, step S403 is implemented as follows:

[0128] A second coefficient is determined from multiple first coefficients corresponding to the fifth pixel in each row of the first matrix, wherein the second coefficient is the first first coefficient greater than the first threshold among multiple first coefficients obtained sequentially from the edge side corresponding to the target pixel; the third pixel corresponding to the second coefficient of the fifth pixel data in each row of the first matrix is ​​determined as the target pixel.

[0129] In this embodiment, if the target pixel is the third pixel, then for each row in the first matrix, from left to right, the position of the first column with a "coefficient of variation" value greater than 20 is found. The pixel metadata at this position is marked in red to indicate the edge position of the tensile specimen. This value "20" is a feature value calibrated for the image (instantaneous image) obtained by the "imaging technology" in the first environment. If the tensile test is not conducted according to the "imaging technology", this feature value will not be equal to 20, and the data needs to be calibrated through additional big data analysis. Similarly, the left edge positions of all detected tensile specimens are marked in red, and the analyzed image will show the left edge position of the standard tensile specimen.

[0130] In another implementation, if the target pixel is the fourth pixel, the steps to obtain the third pixel are repeated to perform repeated analysis of the pixel matrix until all data is processed. Finally, the output image is exported. Therefore, the edges are highlighted as white and the background is completely dark.

[0131] In the above method, grouping the fifth pixel of each row can better capture the pixel features of local areas. By calculating the mean and standard deviation of each group of pixel data, the local brightness information and the dispersion of pixel values ​​can be obtained. These statistical characteristics help to describe the local features of pixels. By calculating the ratio between the standard deviation and the mean, the first coefficient can reflect the relative magnitude of the dispersion of each group of pixel data with respect to its mean. This helps to distinguish pixels with different features. These first coefficients can be used as feature quantities to help distinguish pixels in different regions of the image, thereby improving the recognition accuracy of target pixels.

[0132] In this application, a high-resolution digital image of the sample to be tested is obtained by setting up a first environment, instead of the current expensive imaging methods such as laser scanning. Edge detection is performed on the pixel data in the high-resolution digital image to determine the instantaneous diameter of the sample during the tensile test, so as to provide accurate data for subsequent mechanical strain and strain analysis of the material. The specific steps are as follows:

[0133] 1) Acquire high-resolution images

[0134] ① Establish the initial environment;

[0135] By setting up a first environment to obtain high-definition digital images of the sample to be tested, instead of using expensive imaging methods such as laser scanning, including light intensity and strain rate, see the implementation method of step S101 above for details.

[0136] ② Capture instantaneous images of the tensile specimen;

[0137] After setting up the initial environment, the sample to be tested (tensile specimen) is installed in the designated position on the testing equipment. The testing equipment is then started, and a camera is used to capture instantaneous images of the tensile specimen to obtain the instantaneous image.

[0138] 2) Determine the position of edge pixels

[0139] ① Determine the image sample size;

[0140] When analyzing instantaneous images (image samples), the first step is to determine the sample size in order to perform subsequent pixel detection.

[0141] ② Determine pixel intensity;

[0142] Obtain the pixel intensity of each pixel in the instantaneous image to determine the color (first color) corresponding to the fifth pixel with the largest pixel intensity change, as detailed in steps S301-S303 above.

[0143] ③ Develop the light intensity matrix;

[0144] The first color illumination intensity matrix (first matrix) is used to analyze the pixel data in the first matrix.

[0145] ④ Detect edge pixels;

[0146] Solve for the variation coefficient (first coefficient) of each row of pixel data in the first matrix, and determine the pixel edge based on the value of the first coefficient. See steps S402-S403 above for details.

[0147] ⑥ Determine the instantaneous diameter;

[0148] Based on the detected edge pixels on the left and right sides, the distance between the two sides (first distance) is calculated, and the instantaneous diameter of the tensile specimen during the tensile process is determined according to the preset ratio, as detailed in step S203 above.

[0149] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0150] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0151] Figure 8 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. For example... Figure 8 As shown, the terminal device 8 of this embodiment includes: at least one processor 80 ( Figure 8 (Only one is shown) a processor, a memory 81, and a computer program 82 stored in the memory 81 and executable on at least one processor 80, which executes the steps in any of the above measurement method embodiments when the processor 80 executes the computer program 82.

[0152] The terminal device can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. This terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 8 This is merely an example of terminal device 8 and does not constitute a limitation on terminal device 8. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0153] The processor 80 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0154] In some embodiments, memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. In other embodiments, memory 81 may be an external storage device of the terminal device 8, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 8. Furthermore, memory 81 may include both internal storage units and external storage devices of the terminal device 8. Memory 81 is used to store operating systems, applications, bootloaders, data, and other programs, such as program code of computer programs. Memory 81 can also be used to temporarily store data that has been output or will be output.

[0155] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the above-described method embodiments.

[0156] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.

[0157] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0158] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0159] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0160] In the embodiments provided in this application, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0161] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0162] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A measurement method, characterized in that, The method includes: Acquire initial images of the sample before stretching and instantaneous images during the stretching process; Detect the edge pixels of the instantaneous image; The instantaneous diameter of the sample under test is determined based on the positional changes of the edge pixels in the instantaneous image and the initial image.

2. The measurement method as described in claim 1, characterized in that, The acquisition of the initial image of the sample to be tested before stretching and the instantaneous image during the stretching process includes: A first environment is defined, wherein the image captured in the first environment has a higher resolution than a preset threshold; In the first environment, an initial image of the test sample before stretching and an instantaneous image during the stretching process are captured.

3. The measurement method as described in claim 1, characterized in that, The edge pixels of the initial image include multiple first pixels on the left edge of the sample to be tested and multiple second pixels on the right edge of the sample to be tested. The edge pixels of the instantaneous image include multiple third pixels on the left edge of the sample to be tested and multiple fourth pixels on the right edge of the sample to be tested. Determining the instantaneous diameter of the sample to be tested based on the positional changes of the edge pixels in the instantaneous image and the initial image includes: Obtain a first distance between the first pixel and the second pixel, wherein the first distance is the initial size of the sample to be tested in the horizontal direction in the initial image before stretching; Obtain the second distance between the third pixel and the fourth pixel, where the second distance is the instantaneous dimension of the sample under test in the horizontal direction in the instantaneous image during the stretching process; The instantaneous diameter of the sample to be tested is determined based on the first distance and the second distance.

4. The measurement method as described in claim 3, characterized in that, Determining the instantaneous diameter of the sample under test based on the first distance and the second distance includes: Obtain a preset ratio between the initial diameter of the sample to be tested and the first distance, wherein the initial diameter is the actual size of the sample to be tested in the horizontal direction; The first parameter corresponding to the second distance is calculated based on the preset ratio to obtain the instantaneous diameter of the sample to be tested.

5. The measurement method as described in claim 3, characterized in that, The target pixel is either the third or fourth pixel. The steps for detecting the target pixel in the instantaneous image include: Obtain the pixel intensity corresponding to each of the multiple fifth pixels in the instantaneous image, wherein the fifth pixel is any pixel in the instantaneous image; A first color is determined based on the pixel intensity of multiple fifth pixels, wherein the first color is the color corresponding to the fifth pixel with the largest change in pixel intensity in the instantaneous image; The target pixel is determined based on the first color.

6. The measurement method as described in claim 5, characterized in that, Determining the target pixel based on the first color includes: A first matrix is ​​generated based on the multiple fifth pixels corresponding to the first color; Obtain multiple first coefficients corresponding to the fifth pixel in each row of the first matrix. The first coefficients are used to describe the degree of dispersion of the fifth pixel in each row of the first matrix. The target pixel is determined based on a plurality of the first coefficients.

7. The measurement method as described in claim 6, characterized in that, The step of obtaining multiple first coefficients corresponding to the fifth pixel in each row of the first matrix includes: Divide each of the fifth pixels in each row into m1 groups of pixel data, where each group of pixel data includes n1 of the fifth pixels, where 0 < m1 < l, 0 < n1 < l, and l is the number of pixels corresponding to the fifth pixels in each row; Obtain the average value and standard deviation corresponding to each group of pixel data; Calculate the ratio between the standard deviation corresponding to each group of pixel data and the average value corresponding to each group of pixel data to obtain a plurality of first coefficients.

8. The measurement method as described in claim 6, characterized in that, The determining of the target pixel point according to the plurality of first coefficients includes: Determine a second coefficient from the plurality of first coefficients corresponding to the fifth pixel data in each row of the first matrix, where the second coefficient is the first first coefficient greater than the first threshold among the plurality of first coefficients sequentially obtained from the edge side corresponding to the target pixel; Determine the fifth pixel corresponding to the second coefficient of the fifth pixel data in each row of the first matrix as the target pixel point.

9. A terminal 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 method described in any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the method described in any one of claims 1 to 8 is implemented.