Investigation and optimization of factors affecting the accuracy of strain measurement via digital image processing

Digital image processing is used to create an optical extensometer to measure deformation in materials under quasi-static loading. The optical extensometer setup created in the present work is a single camera setup which is a two-dimensional system. The main objective of this work is to create an optical extensometer system by digital image processing to measure the deformation and strain in materials under tensile and compressive loading and to calculate the properties of these materials. Furthermore, the aim is to optimize the parameters used in digital image processing by studying the effect of different parameters on the quality of the digital images and performing statistical analysis in order to attain the best configuration of the camera setup. The setup is implemented by acquiring digital images of the tested specimens simultaneously with the load recorded by the load cell, and user-friendly software is developed to analyze the acquired images and measure deformation and strain. Subsequently, the loads can be inserted, and the mechanical properties of the materials tested can be calculated.


Introduction
Identification of mechanical properties of materials in materials science and solid mechanics is essential.Mechanical testing is an experimental way to determine the mechanical properties of materials such as elastic modulus, Poisson's ratio, elastic limit, maximum elongation, shear strength, and ultimate strength.This is performed through the implementation of various types of testing, e.g., uniaxial tensile loading, compressive loading, and flexural loading.The precise measurement of the properties of the testing materials needs the determination of many variables during testing such as load, displacement, and strain.
The computation and acquisition of the strain of the loaded specimen is a challenging task as it needs a sensor and a computational method to accurately determine the strain at the corresponding load.Strain data can be acquired using sensors such as strain gauges or extensometers.However, these sensors are costly and not appropriate for some testing conditions and materials.Strain gauges could be useful as they can fit at different points on the specimen [1], but they need a special preparation for the specimen surface and a suitable adhesive to attach it to the tested sample.Also, it is only a single-use sensor, and it can spall off at high mechanical loads.Mechanical extensometers, however, can be used repeatedly at every single test and can be fixed on the tested sample.On the other hand, these contact measurements can have some downsides in practicality and limited applicability [2,3].First, these sensors have a limited range of travel and should be removed at high strains to avoid sensor failure or drop-off.Second, the weight of the sensor and the way of attachment on the specimen can affect the strain data during testing.Finally, clip-on gauges usually measure one directional strain and over a fixed gauge length.
In order to overcome these disadvantages, non-contact measurements have been established which promise more practical and thoroughgoing way of measuring strain and deformation [4][5][6][7][8][9].Non-contact video extensometers use image processing algorithms or digital video to analyze the acquired data of the specimen during testing to calculate strain and displacement.Digital image processing is categorized by two techniques: intensity-based [10][11][12][13][14][15] and feature-based [2,[16][17][18][19] image analysis methods.Intensity-based algorithms use digital image correlation to measure the surface strain of the tested specimen, while feature-based algorithms track certain features over the specimen to calculate strain and displacement such as circle dots, lines, and speckles.Digital image processing is also used in fracture mechanics as it is utilized to detect and analyze cracks in various materials during testing [20][21][22].In the present work, a feature-based algorithm is proposed and implemented using a digital image processing technique to measure strain at different gauge lengths.This method promises a simple and fast way in preparing and testing materials, also a straightforward tool for analyzing data [23].
Although non-contact optical extensometers using a single camera seem straightforward and uncomplicated, as it is based upon tracking gauge marks over the specimen and measurement of deformation, it is challenging in its practical implementation.The challenge of this methodology is to set up and maintain the correct camera configuration and lighting environment for acquiring images of good quality throughout the length of the test and to adjust the suitable luminance threshold for transforming the images into binary with minimal errors.Most of the work done in the literature is concerned with enhancing the acquired image quality by performing image filtration processing [24][25][26] but the camera configuration and the suitable lighting environment are not concerned.The second challenge is related to strain computation accuracy and computation efficiency.The accuracy of strain measurement is influenced by various factors that induce considerable errors in strain.These errors arise due to many aspects such as out-of-plane movement [27], lens distortion [28], marker dots tracking efficiency [29,30], the effect of ambient lighting [31], temperature rising of the camera [32], and surface discoloration of some materials during loading.Furthermore, there were methods proposed in order to overcome the inaccuracy in strain measurements by filtration of acquired images by the camera [33].
In the current paper, an optical extensometer is established, that has the capability to acquire images by a digital camera of the testing specimens of various materials and calculate strain and displacement and reduce measurement errors to a minimal in the aspects of ambient lighting, data processing, and image quality enhancement by filtration and de-noising.In addition, a parametric investigation is performed over the digital images acquired to examine the influence of the camera settings, optical lens, and external effects such as ambient lighting effect and light sensitivity.This study helps to select the convenient set of parameters for testing according to the requirements and the environment of testing for the accuracy of results and the least errors in calculation.The current methodology has been developed to be user-friendly in setting the input parameters and uses simple tools to measure strain and deformation in many materials successfully under axial static loading.To validate the accuracy and credibility of the current methodology, the axial strain calculated from the developed scheme is compared to the strain measured by the Digital Image Correlation scheme.Moreover, the data analyzed by the created optical extensometer is used to measure the elastic properties of the tested materials to further prove the credibility of the application.

Materials
A wide variety of materials are used to test and verify the created program by finding the deformation and calculation of the elastic properties.The materials used in this paper are steel, wood, white foam, concrete, and silicone rubber.
First, S420 structural high-strength steel grade plates are tested and have mechanical properties as shown in Table 1 according to EN 1993-1-1 Eurocode 3 [34].The tested specimens are 200 mm in length, 25 mm in width, and 2 mm in thickness and are prepared by painting in black using spray paint and the black surface is marked by white lines.The plates are loaded by axial tensile quasi-static loading with a displacement rate of 2 mm/min using an Instron machine with a load cell capacity of 50 kN.The applied stresses are calculated using the applied load and the cross-sectional area of the tested specimen.Secondly, the silicone rubber samples are cut from a sheet 1 mm thick as dog-bone shaped specimens according to ASTM D412 standard and have mechanical properties as listed in Table 2 according to [35], the tested specimens are marked with white dots to be clearly detected by the camera.The rubber samples are tested under uniaxial quasi-static tensile loading on a tensile machine with a load cell of 2500 N capacity.The tensile test is performed at a displacement rate of 10 mm/ min until reaching a load of 10 N and displacement of the upper clamp of 30 mm to keep the specimen marks inside the field of view.Thirdly, white foam EPS specimens with dimensions of 100 × 100 × 100 mm 3 were prepared according to ASTM D681 and have mechanical properties as stated in Table 3.The specimens are tested under axial compression loading using a 2500-N load cell capacity machine.Prior to testing, the specimens were marked with black dots at regular intervals to measure deformation.The compressive loading was applied at a constant strain rate of 2 mm/min until the peak load of ~ 2000 N was reached, which corresponds to a stress level of ~ 2 MPa.Fourthly, yellow pine wood specimens were prepared by cutting them to dimensions of 150 × 75 × 75 mm 3 and have mechanical properties as shown in Table 4 according to [36].The specimens were then painted black with white dots.Axial compressive loading was applied to the specimens in a direction parallel to grains using a 500 kN capacity loadcell machine at a rate of 2 mm/min until the specimens were cracked.Finally, M20 grade concrete specimens in dimensions of 150 × 75 × 75 mm 3 were tested under axial compression loading and have mechanical properties as shown in Table 5 according to [37].The loading is done using a 500-kN capacity UTM machine with a displacement rate of 2 mm/min until the samples are fractured.Figure 1 presents a visual compilation of the surface-treated specimens for all materials prior to testing.

Equipment
A digital Canon camera with 24-105 mm f/4L IS USM lens is mounted to acquire images of the testing sample with resolution of 6240 × 4160 pixels 2 .The camera is fixed on a rail over a tripod stand in a perfectly horizontal position and it is adjusted by a spirit level at an adequate distance from the specimen which is installed in the machine as presented in Fig. 2. The tests are performed at uniform illumination using LED light source at intensity of 80 cd.

Methodology
The digital camera is set in manual settings mode to provide the best exposure conditions for the acquired images.The ISO of the camera, which is the sensitivity to light, is set to 800 to get minimum noise effects, the shutter speed is set to 50 fps, and the aperture to f/4.A parametric study is conducted by varying these parameters to identify the exposure and a good-quality image with the least pixel value which will be discussed lengthily in the next section.A telephoto lens with a wide focal length 24-105 mm and a fixed aperture is used, and it is operated on a 95 mm focal length throughout all performed work.The digital images are acquired with software

Principle
The methodology principle based on digital image processing is developed by detecting the white marks of a sequence of acquired images of the reference state and the tested deformed specimens, with suitable camera and image analysis parameters mentioned in the main article for the best contrast spatial resolution.The program is set to determine the position of the marks in pixels and track them to calculate the specimen deformation and computation of strain.The strain measurement is done by calculating the relative variation of the length of the target points during deformation as described in Fig. 3.The linear in-plane strain between the reference state (0) and the deformed state (t) configuration can be estimated by the following equation: Where L i,i+1 0−t represents the change in length between two adjacent marks, L i,i+1 0 is the initial length in the reference state, and i = 1, . . ., n − 1 with n representing the total number of target points.To solve Eq. ( 1) the in-plane coordinates of the marks should be determined by image processing.

Digital image processing methodology
The software developed for image processing and analysis is designed to accurately detect target marks and calculate their coordinates within each image.The underlying algorithm driving this detection process is characterized by high precision.
(1)  The image processing tool implemented in this study efficiently determines the centroid coordinates of each target point in the captured images.To ensure accurate measurements, the software is initially calibrated using a calibration ruler tool, as Fig. 3 Schema of the target marks Fig. 4 Calibration ruler tool for finding the conversion factor from pixels to mm illustrated in Fig. 4 to establish the conversion factor between pixels and length in mm.However, when it comes to strain calculation, the conversion step is unnecessary as the strain can be directly computed using pixel values.
Next, the images undergo a conversion into binary images through the application of a specific luminance threshold.This threshold is carefully selected based on the camera parameters to achieve optimal contrast between white and black pixels.This determination is extensively discussed in the parametric study and optimization section.Subsequently, a region of interest (ROI) is defined to select the specimen region while excluding the surrounding area.
Within the binary image, pixels labeled as 1 correspond to the detected target points, which are marked on the specimen.Conversely, pixels labeled as 0 represent the background.This binary image approach, as opposed to geometric shape detection in MATLAB, proves to be a better way for target marks detection.By detecting the targets and measuring the centroid coordinates of the targets, this procedure facilitates the calculation of the deformation and strain of the testing specimen under any kind of loadings.For a visual representation of the algorithm's workflow, please refer to the flowchart depicted in Fig. 5.

Parametric study and optimization
The influence of the digital camera parameters on the acquired images and processing tools of the image analysis are discussed in this section.The choice of the camera parameters and adequate lighting over the tested specimen is necessary to maintain the perfect exposure and good quality images for analysis.There are several parameters in the digital camera that affect the exposure and the quality of the image: the shutter speed, the aperture, and the ISO.The shutter speed is the speed at which the shutter closes, the aperture is the opening of the lens at which the light passes, and the ISO is the sensitivity of the lens to light.These three parameters affect the exposure of taken images and should be well selected according to the conditions of testing and the ambient light in the surrounding environment.The digital images, while processing, are transformed into binary images with a certain luminance threshold level that is chosen to give the finest contrast for pixel detection.
In the current work, a parametric study is done between the mentioned parameters to examine their influence on the processing images and to adjudicate the best combination of parameters for analyzing the images.To conduct a comprehensive analysis, we systematically altered each parameter in conjunction with the others, resulting in the capture of 625 distinct images.For each variation, we meticulously measured the pixel size using the calibration ruler tool, with all measurements performed at a fixed focal length of 105 mm on the camera lens.The acquired images are processed by transforming them into binary images and filtered before analysis using mean filtration [33] to remove noises and to maintain the best quality before processing, then the length of the black mark is measured horizontally and vertically by a created ruler in the software; accordingly, the pixel size is calculated.When the ISO is increased the noise in the image increases and can cause loss in the black pixels, and when it is decreased to the minimum the image becomes darker and the black pixels dominate.On the other hand, the smaller the aperture is the greater the depth of field, but the images are less bright leading to the domination of black pixels.Moreover, a higher shutter speed could take faster shots but less bright images.
Our prior experimental calibration confirmed that at 105 mm focal length, the pixel size is precisely 0.0213 mm.We conducted a statistical analysis on the pixel dimensions derived from our comprehensive suite of parameters, benchmarking them against the established mean value.The analysis yielded a standard deviation of 0.00414.This deviation signifies the presence of noise within the pixel size measurements, suggesting that certain images may contain aberrations due to suboptimal parameter configurations.These suboptimal settings could lead to the omission of essential black pixels or the erroneous inclusion of spurious black pixels.Consequently, it is essential to examine the image dataset to identify and discard those that do not meet the requisite standards of accuracy, as previously delineated (Fig. 6).
Upon a more granular comparison of the images and the values derived from the parameter adjustments against the experimentally ascertained mean pixel size, we identified four specific sets of parameters that yielded pixel sizes congruent with the mean, underscoring their potential suitability for accurate image analysis in our optical extensometer application.The four sets of parameters, as listed in Table 6, that yielded pixel sizes closest to the mean value were identified through this thresholding process.These four sets were further verified for consistency across multiple trials and compared against additional performance metrics, such as image clarity, contrast, and the ability to discern fine details, which are crucial for effective strain measurement and deformation analysis.Figure 7 displays the binary transformation of the calibration mark image obtained using the specified parameter set.Conversely, incorrect selection of parameters could cause the appearance of false black/white pixels or disappearance of those pixels, or even inaccurate contrast between black and white pixels, as shown in Fig. 8, which could be fatal in calculations.
The digital camera employed in this study undergoes calibration prior to each testing session, employing a checkerboard pattern and utilizing the camera calibrator tool within the MATLAB toolbox.This meticulous procedure enables the measurement of all essential camera parameters, with a particular focus on lens distortion.To ensure accurate and reliable subsequent analyses, lens distortion is eliminated in the software during image analysis through a function to avoid potential errors.By applying the undistortion function, the image pixels are repositioned according to the distortion model, effectively removing the lens distortion and the result is an undistorted image that more accurately represents the true scene.This lens distortion correction process is crucial for obtaining accurate and reliable image data in subsequent analyses.In the present study, this critical procedure is diligently executed to safeguard against the presence of errors that could compromise the accuracy of calculations.
Furthermore, the focal length of the lens, which is the distance between the point of convergence of the lens and the sensor of the camera, has a major influence on the  size of the pixel which is a crucial property in the current work [38,39].The pixel size of the digital image is an important parameter in digital image processing as all measurements are done in pixels.By increasing the focal length, the field of view and the pixel size decrease, and the less the pixel size the higher the accuracy in strain

Validation with digital image correlation
The comparison between the developed extensometer using digital image processing and the digital image correlation method is done on rubber, steel, and wood specimens.A testing setup is arranged by comprising two digital cameras positioned both in front of and on the back side of the specimen as shown in Fig. 9.These two cameras operate synchronously with a shared triggering input.The images captured by the front camera are subjected to analysis using the existing optical extensometer program, while the rear camera is dedicated to the digital image correlation (DIC) technique.The specimens are prepared for testing by painting the front side of the specimens with target marks, and the necessary speckles for DIC are meticulously painted on the back side, as illustrated in Fig. 10.The test is conducted using quasi-static tensile force for steel and rubber samples, while compressive loading is applied to the wood specimens.The loading process continues until reaching 18% strain for rubber, 0.18% strain for steel, and 0.47% strain for wood.The focus of the test is not on material yielding and fracture, but rather on assessing the accuracy of strain computation using the optical extensometer in conjunction with digital image correlation.
The computed strains for the three specimens are plotted against the index of the acquired images, as depicted in Fig. 11.The strain measurements obtained from the two methodologies demonstrate a strong correlation, thereby substantiating the validity of the current optical extensometer technique.This congruence in results reinforces the reliability of the optical method for accurate strain evaluation.To evaluate the precision and accuracy of the developed methodology, the average error between the strain values obtained from both methodologies is calculated.The results indicate an average error of 4% for rubber samples, 5% for steel samples, and 5% for wood samples, thereby confirming the precision and accuracy of the proposed methodology.

Optical extensometer results
The results of deformation and the elastic modulus obtained from the materials tested under quasi-static loading will be stated and discussed.The displacement and strain of the tested samples are calculated using the created digital image processing software and the elastic modulus of the tested specimens is measured.The results are compared and verified by the documented properties of steel, rubber, white foam, wood, and concrete materials.All tested samples were marked by marks at equal intervals to compute strain.The quasi-static loading is performed until the yielding point as only the elastic region is of interest to contribute to the efficiency of the current methodology.The stress applied to the specimens is calculated from the load measured by the load cell of the testing machine, which is acquired at the exact time of shooting the images by the digital camera.The deformation of S420 steel plates under quasi-static tensile loading is calculated to assure the effectiveness of the created program.A reference image is obtained at no-load conditions to calculate the measurements accordingly.The coordinates of the marks are measured and saved in pixels and converted into mm according to the scale automatically calculated from the acquired calibration images.The data acquisition is started at loading of 35 MPa where the strain level is computed to be 0.001% and is continued to the yielding point.The yield stress calculated in all samples is 425 MPa and a strain of 0.2%.The elastic modulus (Young's modulus) is calculated by the slope of stress-strain curve obtained from the measurements where the stress level is limited to 370 MPa to avoid the depletion of elasticity at points close to the yielding point.The measured stress-strain curves of five samples are presented in Fig. 12.The elastic modulus is calculated average between all tested specimens to be 206 GPa which is very good equivalent to the documented value.
The silicone rubber specimens were tested under axial quasi-static tensile loading.The samples are loaded up to 0.6 MPa and measure a strain of an average of 15%.The test was not completed to yield points due to the high strain of the region of interest going out of the field.The stress-strain curve of five samples is plotted as shown in Fig. 13 and Young's modulus is measured to be an average of 2.75 MPa.
White foam specimens were tested under axial compressive loading and were loaded up to 0.2 MPa and corresponding strain levels of approximately 5%.The loading is done with displacement control at a rate of 2 mm/min.The stress-strain curve of the tested samples is plotted in Fig. 14 and Young's modulus is calculated to be an average of 8.4 MPa.After reaching a stress level of 0.1 MPa the material lost its stiffness, and the strain levels increased at a rate more than from the start as shown in Fig. 14.
Yellow pine wood is tested under axial compressive loading in parallel to grain to measure its elastic properties.The loading is performed by displacement control at a rate of 2 mm/min and images are captured by the digital camera during the whole test to calculate strain.The stress levels measured from the load reach up to 65 MPa during the test and correspond to approximately 0.5% strain.The stress-strain curve is plotted for the tested samples and the elastic modulus is calculated to be 18 GPa and presented in Fig. 15.
Finally, tests were performed on concrete by compressive loading to measure the elastic modulus.The loading is done by displacement control at a rate of 2 mm/min and images were acquired by the camera to analyze and calculate the strain.The compression testing is done up to 22 MPa where the samples were fractured.The stress-strain curve of the tested specimens is plotted as presented in Fig. 16 and Young's modulus of the concrete is measured to be 22 GPa.

Conclusions
This paper has shown and demonstrated a new software and methodology for measuring the deformation of different materials during quasi-static testing.The software uses digital image processing to determine displacement and strain and to calculate the properties of various materials.The software was developed by following a specific procedure to optimize the parameters of the digital camera, the lens, and the software.This parametric study was essential to understand the input parameters of the digital camera Fig. 13 Stress-strain curve of silicone rubber under quasi-static tensile loading in the elastic region until 0.5 MPa Fig. 12 Stress-strain curve of St420 grade steel under quasi-static tensile loading until 370 MPa and the lens for image acquisition, and to choose the convenient image sensitivity of the software for image analysis.This study was very important in decreasing the noise level in calculations of strain and displacement, and to raise the accuracy to measure very low levels of strains and displacement.The optimization process of these parameters was done by taking images of a created calibration mark at the stationary position under constant LED lights at five values of three camera parameters (ISO, Aperture, Shutter Fig. 14 Stress-strain curve of white foam under quasi-static compression loading until 0.2 MPa Fig. 15 Stress-strain curve of yellow pine wood under quasi-static compression loading in grain direction speed) and the luminance threshold of the software.As a result, it was found the best choice of the parameters of the camera and the software which give the correct pixel size of the acquired image and the most accurate contrast of black and white pixels in the processing binary image.The optimization process and parametric study performed in the current work are distinctive and necessary for the success of the methodology and for performing the analysis at high accuracy levels to get the best results.
A single camera system is used with convenient lighting to acquire images of the specimens during quasi-static loading.The camera system is synchronized with the testing machine which measures the load applied to the specimens.A calibration tool is used before testing to calibrate the system and to calculate the pixel size of a minimum of 0.0225 mm.The developed software can measure strains as low as 250 micro-strains and it offers an image filtration tool to enhance the quality of the images and to remove the noise and the lens distortion.The created system was inspected and tested on wellknown materials under quasi-static loading to measure the elastic properties of the materials.The system quantified the strain for steel, rubber, and wood, and these measurements were subsequently cross-verified with digital image correlation data to validate the results, achieving a high degree of accuracy.Steel S420 plates, silicone rubber, white foam EPS, yellow pine wood, and concrete were used to test and identify the methodology.The steel plates of S420 grade were tested under axial tensile static loading, and the strain was measured simultaneously with the load and a well-accepted result was achieved.Then, rubber samples were tested under axial quasi-static tensile loading, and strain was measured as well to calculate the elastic properties.Afterward, axial compression was applied on white foam, yellow pine wood, and concrete to identify the strain and calculate its elastic properties.
All in all, the developed program has proved to be a good and reliable technique for measuring the deformation and properties of many materials under static loading.The performed analysis and study on the parameters of testing and image processing ease the choice of the perfect settings for precise results according to the environment of the testing.This data analysis is very valuable for the development of digital image processing methodology to measure the deformation of materials and to calculate the elastic properties.The outcomes attained from the tested materials prove the credibility of the produced system to measure the deformation and properties of the various materials.Moreover, the methodology and produced system are implemented using simple tools and need simple inputs to calibrate and set up.However, the developed software has some limitations in some respects in quantification.For example, it is not able to measure very low strains under 250 micro-strains and very high strains as of the window size of the camera.An upgrade and further development could be done by adding one more camera to have stereo-imaging and to reduce the noise due to out-of-plane movement during testing.

Fig. 1
Fig. 1 Images of the specimens were prepared for testing by surface treatment for detection by the optical extensometer.a S420 Grade Steel.b Silicone rubber.c White foam EPS.d Yellow pine wood.e Concrete 0

Fig. 2
Fig. 2 Camera setup showing the camera and the specimen installed in the machine

Fig. 6
Fig. 6 Binary transformation of the digital image of the calibration mark with the best fit of parameters at ISO 800, F/4 aperture, 50 fps shutter speed, and 0.1 light sensitivity

Fig. 7
Fig. 7 Calibration marking is captured and processed by different parameters showing defects in the markings.a Disappearance of black pixels due to the choice of the wrong sensitivity factor.b Appearance of extra black pixels causes noise in calculations

Fig. 8 Fig. 9
Fig. 8 Pixel size of the digital image at different focal lengths of the lens

Fig. 10 Fig. 11
Fig. 10 Testing specimen painted for Digital Image Correlation analysis.a Steel.b Silicone rubber, c Concrete

Fig. 16
Fig. 16 Stress-strain curve of concrete under quasi-static compression loading

Table 1
Mechanical properties of S420 steel plates

Table 2
Mechanical properties of silicone rubber

Table 3
Mechanical properties of white foam EPS

Table 6
Set of parameters chosen for giving precisely the same pixel size and the best contrast in binary images