A Self-Adaptive Selection of Subset Size Method in Digital Image Correlation Based on Shannon Entropy

Digital image correlation (DIC) is a typical non-contact full-field deformation parameters measurement technique based on image processing technology and numerical computation methods. To obtain the displacements of each point of interrogation in DIC, subsets surrounding the point must be chosen in the reference image and deformed image before correlating. In the existing DIC techniques, the size of subset is always pre-defined by users manually according to their experiences. However, the subset size has proven to be a critical parameter for the accuracy of computed displacements. In the present paper, a self-adaptive selection of subset size method based on Shannon entropy is proposed to overcome the deficiency of existing DIC methods. To verify the effectiveness and accuracy of the proposed algorithm, a numerical translated test is performed on four actual speckle patterns with different entropies, and then another test is performed on four computer-generated speckle patterns with non-uniform displacement field. All the results successfully demonstrate that the proposed algorithm can significantly improve displacement measurement accuracy without reducing too much computational efficiency. Finally, a practical application of the proposed algorithm to micro-tensile of Q235 steel is conducted.


I. INTRODUCTION
In recent years, digital image correlation [1]- [3] has become a practical, cost-effective and frequently used method for estimation of object surface displacement and strain fields in various scientific and engineering fields. There is no need to state the importance, capabilities and advantages of DIC here due to the fact that these have been well mentioned in numerous literatures [4]- [6]. Generally, to perform the DIC, speckle images are divided into blocks (i.e., subsets or windows) containing a certain number of pixels first. The displacements are then solved by matching the subsets on reference images to the correlating the subsets on the deformed images. Consequently, this kind DIC is usually called subsetbased DIC. Owing to the merits of simple theories, high The associate editor coordinating the review of this manuscript and approving it for publication was Wuliang Yin . accuracy and efficiency, well-developed computer codes and so on, subset-based DIC has become a widely used algorithm in both academic as well as commercial DIC software packages [7], [8]. Up to now, the numerous home-made subsetbased DIC software or programs have been developed in many laboratories and some powerful commercial subsetbased DIC packages (such as the Vic-2D/3D system [9] and the XJTUDIC system [10]) are available in the market. In all these software packages, whether home-made or commercial, a subset size must be manually set before performing the main program by users according to their experiences. Once the subset size is chosen, calculations of all points (or pixels) in the image will use the same subset size in DIC measuring process. It is found that the subset size can strongly influence the accuracy of displacement measurement [11], [12]. In the correlation analysis of subset-based DIC, the demands for subset size are contradictory. On the one hand, a large size of subset is preferable because a large subset contains sufficiently information on stochastic intensity pattern to distinguish itself from others, which may effectively increase the matching accuracy. On the other hand, in the subset, the deformations of these points far away from the center point become large with the increase of subset size. Thus, a small subset can be more readily and accurately approximated by the given subset displacement functions. This means that a small subset is desired in subset-based DIC.
In addition, as is known to all, the specimen surface must be covered with stochastic speckle pattern which deforms along with test surface. In generally, we can obtain three types of speckle patterns named painted speckle patterns (see Fig.1(a) and (b)), laser speckle pattern (see Fig.1(c)) and texture speckle pattern (see Fig.1(d)), which are made by spraying black/white paints, illuminating the test surface by laser and deriving from natural texture of specimen surface, respectively. It can be observed clearly that the speckle patterns made by different methods or persons and captured under different magnification may produce different intensity distributions, contrasts, speckle sizes and other characteristics. In a speckle pattern, the intensity pattern of the subset centered different points is different. At the same point of a speckle pattern, a change of subset size may cause a change in intensity pattern of subset. Consequently, how to select a suitable size of subset for different speckle patterns is a very complicated problem. Moreover, the discussion above reveals that there must be an optimal size for each subset in a speckle image, not a fixed-size.
Currently, various investigations about subset size have been reported in the literature. Sun and Pang [13] pointed out that the subset size is closely related to the quality of subset image based on the study of assessment of subset image quality using subset entropy. They also pointed out that a lower limit of subset size should exist to suppress the influence of random errors. However, the subset size selection method has not been proposed in this work. Pan et al. [14] proposed a subset size selection algorithm based on the Sum of Square of Subset Intensity Gradients (SSSIG). However, the SSSIG was derived based on the Sum of Squared Differences (SSD) correlation coefficient as well as the assumption that the intensity gradients of speckle pattern are much larger than that of image noise. Wang et al. [15] designed a weighting factor according to the position of each point in the subset and defined the corresponding correlation function. Similarly, Huang et al. [12] defined a Gaussian window (i.e., subset) function and established a weighted SSD function. The above-mentioned two methods can minimize the influence of subset sizes by adjusting the weighting factor and Gaussian window through their corresponding procedure, respectively. However, the fixed-size subset is still used in these two methods. Xing et al. [16] and Wang et al. [17] proposed a spatial-temporal subset based DIC considering the temporal continuity of deformation. That is, they built a three-dimensional subset by introducing the time dimension. However, the spatial subset size is also fixed in this algorithm.
In this article, a self-adaptive selection of subset size algorithm based on Shannon entropy is proposed, which can chose a proper subset size at each measuring point for different speckle patterns in DIC analysis. In the proposed algorithm, an easy-to-compute parameter called Shannon entropy (SE) is employed as a key parameter for the self-adaptive selection of a subset size. In order to verify the effectiveness and accuracy of the proposed algorithm, numerical simulation experiments are implemented first. The results clearly illustrate that the proposed algorithm can obtain accurate measured displacements. Finally, as a practical application, the proposed algorithm is used in the micro-tensile test of Q235 steel.

II. FUNDAMENTAL PRINCIPLE OF SUBSET-BASED DIC
DIC deals with two images of specimen surface recorded before and after loading by CCD/CMOS camera to extract the deformation parameters. The image acquired before loading is defined as reference image, and the other image is defined as deformed image. Fig. 2 schematically shows the basic principle of the standard subset-based DIC. A small square referent subset of (2N + 1)×(2N + 1) pixels centered at the interrogation point P and a bigger searching subset of (2M + 1)×(2M + 1) pixels centered at the corresponding point are chosen from the reference and deformed image, respectively (see Fig. 2 (a)-(b)). A series of subsets of (2N +1) × (2N + 1) pixels centered at each point, which are defined as the deformed subsets, are chosen in searching subset. A correlation coefficient distribution map is then obtained, VOLUME 8, 2020 as shown in Fig. 2(c), by performing the correlation calculation between reference subset and each deformed subset using a predefined function of correlation coefficient. Afterwards, the peak position in the correlation coefficient distribution map is found using a certain optimization algorithm. The deformed subset, which corresponds to the peak position of the correlation coefficient map, is called as the target subset. The vector between the reference and target subset center is the displacement vector at P (shown in Fig. 2(d)). The fullfield displacement can be obtained easily by repeating the same procedure at other pixels of images (shown in Fig. 2(e)). More detailed descriptions of DIC technique can be found in [18].
It can be seen from above description that, in standard subset-based DIC, the reference and deformed subset of (2N + 1) × (2N + 1) pixels are chosen by user as fixed-size computation sub-images. As mentioned earlier, the subset size is critical to calculation accuracy of subset-based DIC. Consequently, it should build a proper algorithm, which can choose the subset size adaptively according to the quality of speckle pattern.
In practical application of DIC, the zero-mean normalized cross-correlation (ZNCC) coefficient, which is insensitive to the scale and offset changes in lighting of deformed image, is widely used [18], [19]. In this work, the following ZNCC correlation coefficient function is used. ( where f (x i , y i ) and g(x i , y i ) are the intensity values at (x i , y i ) in the reference subset and (x i , y i ) in the deformed subset respectively; f m and g m are the mean intensity values of the reference and deformed subsets; n denotes the number of pixels contained in the reference subset; X is the desired deformation vector, The classic Newton-Raphson iteration method is employed to optimize the correlation coefficient function.
where X k and X k+1 are the kth and (k + 1)th iteration values respectively; ∇C(X ) is the gradient of correlation coefficient; ∇∇C(X ) is the second-order derivative of correlation coefficient (i.e. Hessian matrix).

III. SHANNON ENTROPY
As a main pioneer of the mathematical formulation of information theory, Shannon introduced the concept of entropy firstly in 1948 [20]. Entropy (more specifically, Shannon entropy) is basically a measure of the disorder associated with a random variable in the information theory. That is, it quantifies the expected value of the information contained in a received message. Image Shannon entropy (ISE) is a measure of the information content of an image. For an image with dimension of M × N pixels, the ISE can be written as where H is image Shannon entropy, bits/pixel; β is the pixel depth of the image (Generally, the 8-bit image is used in actual practice, that is β = 8.); p j is the probability, or frequency, of the occurrence of each gray level, which can be compute by the histogram of the image; and

IV. SELECTION OF SUBSET SIZE
More recently, Shannon entropy was used by Liu et al [21] for assessing the quality of speckle pattern. From the results, it can be seen that the measurement accuracy of DIC is closely related to the SE of speckle pattern. Generally, high measurement accuracy can be obtained when the speckle pattern has large SE, which is explained that a speckle pattern with large SE has more feature information (i.e. greater degree of speckle uniqueness). The speckle pattern with large SE can be called good quality speckle pattern. However, the quality of a speckle pattern can not be improved further once the speckle pattern is captured by using a certain imaging system. Thus, the subset selected in the matching calculation of DIC should contain as much information as possible. Fig. 3 shows the plots of the mean subset Shannon entropy (SSE) with standard deviation bar as a function of subset size (The results obtained by using the traditional subset-based DIC method and the example speckle images in Fig. 1). It can be seen that: (1) the mean SSE increases as the subset size increases. That is, the large subset contains more unique feature information.
(2) The standard deviation of SSE decreases as the subset size increases. That means the smaller the subset is, the more scattered the subset Shannon entropies in a speckle pattern are. (3) The curve becomes considerably flat when the subset size approaches a certain value, and the maximum mean SSE is close to SE of speckle pattern (shown in Table 1). Based on the above observation, it is concluded that the measurement accuracy of DIC can be improved by adjusting the SSE, which can be decreased or increased by adjusting the subset size in a certain range. This is the basic idea of the proposed algorithm for self-adaptive selection of subset size in DIC technology. The detailed realization process of the proposed algorithm is illustrated by the flowchart program in Fig. 4. First, the reference image Shannon entropy (RISE) can be calculated for setting the threshold of SSE. Taking into account the relationship between measurement accuracy and ISE [21], the upper and lower limit of SSE can calculate as follows based on RISE.
where SSE up denotes the upper limit of SSE, SSE low denotes the lower limit of SSE, [RISE] denotes the Shannon entropy of the reference image constrained to only one digit after the decimal point. Then, the SSE is calculated to compare with the threshold. If the SSE is less than the lower limit value, the subset size will be increased by 2 pixels and an updated SSE will be obtained. Similarly, if the SSE is greater than the upper limit value, the subset size will be decreased by 2 pixels and an updated SSE will also be obtained. The cycle repeats until the SSE is in the range of upper and lower limit value, which indicated that the algorithm has detected the optimal subset size. After that, a common DIC procedure is implemented to compute the displacement at the current point.
Just as the existing standard DIC algorithm, the calculation of the proposed algorithm starts from the upper left point of the calculation area. Then, as shown in Fig. 5, the calculation routine is implemented point by point along each row and column. Owing to the fact that Shannon entropies of adjacent subsets are not generally drastic change, the subset size of the former calculation point optimized by above algorithm is used as the initial subset size of the current calculation point. This easy-to-operate scanning strategy may improve the computation efficiency. It should be note that the initial subset size of the first calculation point is set by user manual.

A. VERIFICATION USING DIFFERENT TYPES OF SPECKLE PATTERNS
To evaluate the proposed algorithm and eliminate the impact caused by image acquisition system and environment, numerical experiments are utilized in this work. Four sets of test speckle images (are shown in Fig. 6 along with their histograms) with the size of 416 × 416 pixels and a pixel depth of 8-bit grayscale are used in the experiments. Every reference image itself is a part of its original frame with a resolution of 656 × 494 pixels captured by a Guppy F-033B camera in our previous actual experiment. The speckle pattern A and B are made by randomly spraying white and black paints on the flat specimen captured under configurations of different magnification. The speckle pattern C is captured by illuminating the flat specimen surface with a laser diode. The output power of the laser diode is 5mW at λ = 650 nm wave length. The speckle pattern D is obtained directly from natural texture of a flat wood surface. The speckle pattern A, B and D are illuminated by LED light source. The Shannon entropy values of the above four reference speckle patterns are calculated and listed in Table 1.
In the following numerical studies, four deformed images are first generated by giving -0.2 pixel translation motion to four speckle patterns in v-direction according to the bicubic interpolation theorem [22]. Then the displacements between the reference and deformed images are calculated at regularly distributed 2601 (=51 × 51) points applied the traditional algorithm and the proposed algorithm in this work. The subsets used in the traditional algorithm are 15 × 15 pixels, 31 × 31 pixels and 61 × 61 pixels, respectively.    7 shows the distributions of displacements measured by the traditional algorithm with three different subset sizes and the proposed DIC algorithm. Four speckle images are numerically translated in the same way. The difference in displacements is therefore only related to the speckle pattern and the subset size. By comparison, we clearly see that the distributions of displacements measured by the proposed algorithm have higher and narrower central peaks than those measured by the traditional algorithm with three different subset sizes. It is evident that the proposed algorithm has the highest measurement accuracy. Moreover, we can also see that the smaller the Shannon entropy of speckle pattern is, the more obvious the advantage of the proposed algorithm is. It reveals that the proposed algorithm is quite satisfactory for the speckle pattern with very small Shannon entropy such as natural texture speckle pattern.
The mean subset sizes in calculation of four speckle patterns by the proposed algorithm are listed in Table 2. It can be seen from the table that the mean subset size is different for each of speckle patterns. It proves the effectiveness of the proposed algorithm. Additionally, the speckle pattern with big entropy can lead to relatively big mean subset size. Combining Fig. 7 and Table 2, we may conclude that it is not necessary to obtain the biggest possible entropy of speckle pattern when the proposed algorithm is used. An even speckle pattern as shown by Fig. 6 (D) can be sufficient for the proposed algorithm. Fig. 8 shows the statistical distributions of entropies of subsets used in the traditional and proposed algorithms for calculating the four speckle patterns. It is clear that the entropies of subset used in the proposed algorithm are located within a more narrow range and their distributions are more concentrated around the value of speckle pattern entropy. It illustrates that the self-adaptive selected subsets in the proposed algorithm contain almost the same and enough information. It is noteworthy that although the entropy of subset can be controlled by adjusting the size of subset, it can not be precisely controlled. Therefore, the distribution of subset entropies of the self-adaptive subset sizes for four speckle patterns is different.
In addition to the measurement accuracy, the computing time of DIC algorithm is another critical performance. The comparison of mean time consumption for the traditional DIC and the proposed algorithm are shown in Table 3. It should be noted that all the computations are conducted on the same    computer, and the computing time is relative time. It can be observed from Table 3 that the mean time consumption of the proposed algorithm is higher than traditional subsetbased DIC with the subset sizes of 15 × 15 pixels and 31 × 31 pixels, but it is much lower than that of the traditional subset-based DIC with the subset sizes of 61 × 61 pixels. Compared with traditional DIC using the subset size of 31 × 31 pixels, the mean computing time of the proposed algorithm is in the same order. In fact, the use of larger subset requires more computing time due to solving the Eq. (1) in subpixel displacement measurement [13]. Therefore, the calculation accuracy of the proposed algorithm is improved without increasing too much calculation time.

B. VERIFICATION USING SIMULATED SPECKLE PATTERNS WITH NON-UNIFORM DISPLACEMENT FIELD
To further validate the performance of the proposed algorithm in measuring the speckle patterns with non-uniform displacement field, four simulated speckle patterns and their corresponding non-uniform deformation speckle images are generated according to the simulated algorithm proposed by Zhou et.al. [23]. The detailed features of four simulated speckle patterns are listed as follows: the size of images is 256 × 256 pixels; the preassigned strain in x-direction is 1000µε (i.e., dudx=1000µε) and in y-direction is -2000µε (i.e., dvdy=-2000µε); the speckle size is 2.5 pixels; the numbers of speckles are 2000, 2400, 2800 and 3200, respectively. Four simulated speckle patterns are exhibited in Fig. 9, and their Shannon entropies are listed in Table 4.
Both the traditional DIC with the same subset sizes as above experiment and the proposed algorithm are still applied to calculate the displacements of four pairs of speckle patterns (the reference and deformed images). The displacements of each deformed speckle pattern are obtained at regularly distributed 1296 (=36 × 36) points. Fig.10 and Fig.11 show the distributions of measured errors in horizontal and vertical direction used the traditional DIC and proposed algorithm, respectively. It can be observed that the distributions of measurement errors in horizontal and vertical directions obtained by the proposed algorithm have higher and narrower central peaks than the traditional DIC with different subset sizes. The measurement errors of each deformed speckle pattern obtained by the proposed algorithm are located within a more narrow range. It is proved that the proposed algorithm has better accuracy than the traditional DIC. This clearly showed the effectiveness of the proposed algorithm once again.
At the same time of measuring displacements, the mean computing times of each deformed speckle pattern are recorded and listed in Table 5. It can also be seen that the calculation time of the proposed algorithm is less than that of the traditional DIC with 61 × 61 pixels subset, and is more than of the traditional DIC with 15 × 15 pixels and 31 × 31  pixels subsets. Therefore, the proposed algorithm is expected to be more suitable for practical applications.

VI. APPLICATION TO MICRO-TENSILE TEST
The proposed algorithm is also used to the micro-tensile test of Q235 steel. The flat specimen with specific geometry, which is prepared by an electrical discharge machine, is shown in Fig. 12. The natural texture of the specimen surface is used as the characteristics for matching calculations. The micro-tensile test machine shown in Fig. 13, which is developed by ourselves and reported in detail in our previous work [24], is adopted in this test experiment. The microtensile test machine mainly consists of a servo motor (Maxon Ecmax), a worm gear reducer, a ball screw with a left-and right-hand thread, load sensor (SM-609-A), and displacement sensor (Soway-SDV). Specific parameters of the microtensile test machine are listed as follows: the dimensions is 122 mm × 88 mm × 36 mm, the maximum tensile load is 1000 N, the tensile stroke is 10 mm, the load resolution is 0.1N, the displacement resolution is 1 µm. The specimen is tightly clamped at both gripping sections as shown in Fig. 13. Two grippers, who move in opposite directions, are driven by a ball screw with a left-and right-hand thread. The moving speed of one gripper is 5 µm/s. A commercial optical microscope (Olympus, DSX500) is used to obtain the microscopic images of the specimen surface. The recorded images have a size of 1600 × 1200 pixels. The basic experimental configuration is shown in Fig. 14.
The optimized DIC method proposed in this work is used to calculate the displacements of the region of interest (ROI),  and the elongation is calculated. Fig. 15 shows a direct comparison of the load-elongation diagram measured by the micro-tensile test machine and the proposed DIC method. It clearly exhibits that the results measured by two methods are in good agreement. The root mean square error (RMSE) of the results measured by the two methods is as low as 0.0214mm for displacement up to 1.012mm, and the mean deviation of two results is 0.0176mm. The small deviation may be caused by the change of the surface roughness. After loading, the distance between the specimen and the optical microscope may change due to the change of surface roughness (i.e. the out-of-plane displacement is produced). Furthermore, the factors of stiffness of micro-tensile test machine, gripper slippage, planeness of specimen, optical distortions and measurement error of the improved DIC method may also result in the deviation.

VII. CONCLUSION
A new subset size selection method of DIC is presented in this article. The method uses SE of subset as a simple criterion for selecting the subset size adaptively by comparing with the SE of whole speckle pattern. In addition, a simple scanning strategy is employed to ensure selected subset size of former subset transfer to its neighbor subset. The numerical experiments using four real speckle patterns with different Shannon entropies and four computer-generated speckle patterns with non-uniform displacement field demonstrate that the improved DIC method has better accuracy than the traditional method without increasing too much calculation time. It is also shown that the effect of proposed method is more obvious for the speckle pattern with very small Shannon entropy such as natural texture speckle pattern. Further, the validity and applicability of the proposed method is successfully validated by applying to micro-tensile test and comparing with microtensile test machine.