Vibration extraction based on fast NCC algorithm and high...

9
Vibration extraction based on fast NCC algorithm and high-speed camera XIUJUN LEI,YI JIN,* JIE GUO, AND CHANGAN ZHU Department of Precision Machinery and Precision Instrumentation, University of Science and Technology of China, Hefei, Anhui 230027, China *Corresponding author: [email protected] Received 6 July 2015; revised 26 August 2015; accepted 28 August 2015; posted 31 August 2015 (Doc. ID 245402); published 17 September 2015 In this study, a high-speed camera system is developed to complete the vibration measurement in real time and to overcome the mass introduced by conventional contact measurements. The proposed system consists of a note- book computer and a high-speed camera which can capture the images as many as 1000 frames per second. In order to process the captured images in the computer, the normalized cross-correlation (NCC) template tracking algorithm with subpixel accuracy is introduced. Additionally, a modified local search algorithm based on the NCC is proposed to reduce the computation time and to increase efficiency significantly. The modified algorithm can rapidly accomplish one displacement extraction 10 times faster than the traditional template matching without installing any target panel onto the structures. Two experiments were carried out under labo- ratory and outdoor conditions to validate the accuracy and efficiency of the system performance in practice. The results demonstrated the high accuracy and efficiency of the camera system in extracting vibrating signals. © 2015 Optical Society of America OCIS codes: (100.2000) Digital image processing; (120.0120) Instrumentation, measurement, and metrology; (120.7280) Vibration analysis; (150.1135) Algorithms. http://dx.doi.org/10.1364/AO.54.008198 1. INTRODUCTION With the advent of the multimedia age, high-pixel and high- frame-rate cameras can record the location information of structures vibration and accomplish the reappearance of dy- namic characteristics through the digital image processing technology [1,2]. Comparing with conventional measurement devices, such as accelerometers [3] and global positioning sys- tems [4,5] widely used in industry, the vision measurement can not only obtain vibration acceleration information but also provide an intuitionistic exhibition of the actual vibra- tion. Moreover, it can avoid the limitation that restricts the application range of traditional contact-type measurement. Noncontact sensors may not change the behavior of structures and can be used in special situations, such as remote measure- ment, high temperature, and magnetic fields, where the mea- surement results may be interfered with. Owing to these advantages, research interest is growing in the development of noncontact displacement measurement techniques, such as speckle photography [6], global positioning systems [4], and laser Doppler vibrometers [7]. However, the wide applications of these techniques are hampered due to the high total costs of the systems. Optical cameras are effective alternatives to the noncon- tact measurement because the remote measurement and noninterference introduction are feasible. With these devices, all movement information can be shown visually, regardless of whether such movement can be seen or not. Nowadays, vision systems are widely used in engineering monitoring [810], underwater measurement [11], and sound passive recovery [12]. A vision technique has been widely developed for struc- tural displacement measurement. Quan et al. [13] realized three-dimensional displacement using two-dimensional digital image correlation. Mudassar and Butt [14] applied improved digital image correlation for in-plane displacement measure- ment. Fukuda et al. [15] proposed a camera-based sensor sys- tem that uses a robust object search algorithm to measure the dynamic displacements of large-scale structures. However, commercial digital cameras have low sample rates, and the movement information cannot be obtain completely if the vibration frequency is more than half of the sample rates according to the sampling principle. Fortunately, high-speed vision systems that can capture images at 1000 frames per second (fps) or even faster have been developed to overcome these restrictions. Davis et al. [12] showed that the vibrations of many everyday objects in response to sound can be extracted to recover audio through high-speed videos. Kirugulige et al. [16] even developed speckle patterns in the crack tip vicinity at rates of 225,000 frames per second, but it is limited. 8198 Vol. 54, No. 27 / September 20 2015 / Applied Optics Research Article 1559-128X/15/278198-09$15/0$15.00 © 2015 Optical Society of America

Transcript of Vibration extraction based on fast NCC algorithm and high...

Page 1: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

Vibration extraction based on fast NCC algorithmand high-speed cameraXIUJUN LEI, YI JIN,* JIE GUO, AND CHANG’AN ZHU

Department of Precision Machinery and Precision Instrumentation, University of Science and Technology of China, Hefei, Anhui 230027, China*Corresponding author: [email protected]

Received 6 July 2015; revised 26 August 2015; accepted 28 August 2015; posted 31 August 2015 (Doc. ID 245402); published 17 September 2015

In this study, a high-speed camera system is developed to complete the vibration measurement in real time and toovercome the mass introduced by conventional contact measurements. The proposed system consists of a note-book computer and a high-speed camera which can capture the images as many as 1000 frames per second.In order to process the captured images in the computer, the normalized cross-correlation (NCC) templatetracking algorithm with subpixel accuracy is introduced. Additionally, a modified local search algorithm basedon the NCC is proposed to reduce the computation time and to increase efficiency significantly. The modifiedalgorithm can rapidly accomplish one displacement extraction 10 times faster than the traditional templatematching without installing any target panel onto the structures. Two experiments were carried out under labo-ratory and outdoor conditions to validate the accuracy and efficiency of the system performance in practice.The results demonstrated the high accuracy and efficiency of the camera system in extracting vibratingsignals. © 2015 Optical Society of America

OCIS codes: (100.2000) Digital image processing; (120.0120) Instrumentation, measurement, and metrology; (120.7280) Vibration

analysis; (150.1135) Algorithms.

http://dx.doi.org/10.1364/AO.54.008198

1. INTRODUCTION

With the advent of the multimedia age, high-pixel and high-frame-rate cameras can record the location information ofstructures vibration and accomplish the reappearance of dy-namic characteristics through the digital image processingtechnology [1,2]. Comparing with conventional measurementdevices, such as accelerometers [3] and global positioning sys-tems [4,5] widely used in industry, the vision measurementcan not only obtain vibration acceleration information butalso provide an intuitionistic exhibition of the actual vibra-tion. Moreover, it can avoid the limitation that restricts theapplication range of traditional contact-type measurement.Noncontact sensors may not change the behavior of structuresand can be used in special situations, such as remote measure-ment, high temperature, and magnetic fields, where the mea-surement results may be interfered with. Owing to theseadvantages, research interest is growing in the developmentof noncontact displacement measurement techniques, such asspeckle photography [6], global positioning systems [4], andlaser Doppler vibrometers [7]. However, the wide applicationsof these techniques are hampered due to the high total costsof the systems.

Optical cameras are effective alternatives to the noncon-tact measurement because the remote measurement and

noninterference introduction are feasible. With these devices,all movement information can be shown visually, regardless ofwhether such movement can be seen or not. Nowadays, visionsystems are widely used in engineering monitoring [8–10],underwater measurement [11], and sound passive recovery[12]. A vision technique has been widely developed for struc-tural displacement measurement. Quan et al. [13] realizedthree-dimensional displacement using two-dimensional digitalimage correlation. Mudassar and Butt [14] applied improveddigital image correlation for in-plane displacement measure-ment. Fukuda et al. [15] proposed a camera-based sensor sys-tem that uses a robust object search algorithm to measurethe dynamic displacements of large-scale structures. However,commercial digital cameras have low sample rates, and themovement information cannot be obtain completely if thevibration frequency is more than half of the sample ratesaccording to the sampling principle. Fortunately, high-speedvision systems that can capture images at 1000 frames persecond (fps) or even faster have been developed to overcomethese restrictions. Davis et al. [12] showed that the vibrationsof many everyday objects in response to sound can be extractedto recover audio through high-speed videos. Kirugulige et al.[16] even developed speckle patterns in the crack tip vicinityat rates of 225,000 frames per second, but it is limited.

8198 Vol. 54, No. 27 / September 20 2015 / Applied Optics Research Article

1559-128X/15/278198-09$15/0$15.00 © 2015 Optical Society of America

Page 2: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

Conventional image-processing techniques are used forhigh-speed cameras, which have high requirements for motion-tracking algorithms, but these techniques are complex andcumbersome [16,17]. The standard way to track featuresbetween two images is through the template matching in com-puter vision. The basic template-matching algorithm calculateseach position by a distortion function which measures the de-gree of similarity between the template and the image. Thearea-based algorithm consists of calculating the correlationfunction at each position of the search image in a raster scanfashion. Various area-based methods include mean absolutedifference, product cross correlation (CC), sequential similaritydetection algorithm, sum of absolute difference (SAD), andsum of squared differences (SSD) similarity measure [18].After template matching is concerned, normalized cross corre-lation (NCC) is often adopted in similarity measure due to itsbetter robustness [19–21]. Comparing with the other algo-rithms, NCC is less sensitive to linear changes in the amplitudeof illumination in the two compared images. Furthermore, theNCC is confined in the range between 0 and 1; the setting ofdetection threshold value is much easier than the CC.

However, NCC cannot be directly computed using themore efficient fast Fourier transform in the spectral domain.The efficiency of the NCC algorithm is very low because mostcomputationally expensive and resource-hungry operations re-quire exhaustive search (ES). On the video compression field,various types of block-matching algorithms are proposed to in-crease the efficiency based on ES [22,23]. These algorithmsinclude three-step search, new three-step search, simple andefficient search, four-step search, diamond search, and adaptiverood pattern search. New NCC-based optimization algorithmshave been developed to measure mass movements [24–27].

The sampling frequency of the structure vibration by high-speed camera is relatively high, and the displacement betweeneach frame of the image is only a few pixels or even one pixel.Thus the matching position can be found only from a verysmall range on the basis of the previous frame in templatematching. Because of these characteristics, the local search nor-malized cross correlation (LNCC) is proposed in this study onthe displacement measurement to solve the problems of con-ventional image-processing techniques. The modified algo-rithm can obtain the same results of vibration extraction, butthe computation time of one extraction is far less than that ofthe NCC algorithm, which provides the potential for onlineextraction on the high-speed captured video. This algorithmcan be used for a point-by-point in displacement extractionand in-plane displacement testing. Finally, the proposed algo-rithm is applied in the high-speed camera system to realize thevibration measurement. Two experiments were carried outunder laboratory and outdoor conditions for performance veri-fication. The results demonstrated the accuracy and efficiencyof the camera system in extracting the vibrating signals ofstructures.

This paper is organized as follows. Section 2 introduces thecomponents and capability parameters of the high-speed cam-era system. Section 3 presents the NCC-based extraction algo-rithm and the subpixel accuracy improvement. It then describesthe modified LNCC algorithm for template matching and

provides a simulation example. Section 4 presents two experi-ments for performance verification. Section 5 concludes andoutlooks.

2. HIGH-SPEED CAMERA SYSTEM

This developed high-speed camera system is shown in Fig. 1(a),which consists of a notebook computer (Intel Core processor2.9 GHz; 2.75 GB RAM) connected to a camera head withtelescopic lenses. The telescopic lenses with large optical zoom-ing capability shown in Fig. 1(b) can be adjusted appropriatelyto perceive structural motion at different distances. The camerahead uses a CCD sensor as the image receiver and can capture8-bit gray-scale images at high speed. These images are thenstreamed into the notebook computer through a USB 3.0 inter-face. The image-processing software on the notebook computercan use the template-tracking algorithm to track a particularfast-moving object and extract motion information. The cam-era frame rate can reach 1000 fps when the image resolution isset as 300 pixels × 300 pixels.

To measure the displacement of remote structures, a targetpanel may be installed in advance or specific features are se-lected on the measuring location of the structure. Then thecamera system is ready to capture images from a remote loca-tion, and the displacement time history of the structure can beobtained by applying the template-tracking algorithm to thedigital video images. If the target panel is unavailable due tothe limitation of the measurement environment, the distinctsurface patterns of the structure, such as textures or edges,can also be used as matching templates.

3. METHODOLOGY OF THE VIBRATIONEXTRACTION ALGORITHM

NCC is a well-known similarity criterion that is more robustthan SAD and SSD under uniform illumination changes.A correlation matrix is calculated by shifting a given templatepixel-by-pixel across a source image, which provides the infor-mation on the degree of matching between the template andthe image. The maximum absolute value of the correlationmatrix, whose location describes the best matching of the tem-plate, is then sought. The NCC coefficients are defined asfollows,

Fig. 1. High-speed camera system: (a) Compositions of the high-speed camera system, (b) the high-speed camera head.

Research Article Vol. 54, No. 27 / September 20 2015 / Applied Optics 8199

Page 3: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

γ�u; v� �P

x;y�f �x; y� − f u;v ��t�x − u; y − v� − t�ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiPx;y �f �x; y� − f u;v �2

Px;y �t�x − u; y − v� − t �2

q ;

(1)

where f is the source image, t is the template, t is the mean ofthe template, and f u;v is the mean of f �x; y� in the regionunder the template.

As shown in Eq. (1), the NCC calculation consists of twooperations: correlation operation, which has the effect of noisereduction, and normalized operation, which reduces the influ-ence of lighting. According to the research of Tsai and Lin [28]and Li et al. [29], the NCC method is insensitive to noise androbust to different lighting conditions. As a result, the NCCsimilarity criterion has been widely used in motion extractionand industrial inspection.

A. NCC-based Extraction AlgorithmThe NCC-based extraction algorithm is a method founded onthe NCC similarity criterion in template matching. In theMATLAB software, the function normxcorr2 realizes the rapidcalculation of the NCC method and can be conveniently in-voked. Figure 2(a) shows an example that an image containsa black circle on a white background. The radius of the blackcircle is 80 pixels, and the gray-scale increases from the center 0to the edge 1. In Fig. 2(b), the black circle moves a few pixels.Based on these two images, the movement of the black circlecan be recovered by applying the NCCmethod. The first image

is used as the source image, and a small scope instead of thewhole shifted image is selected as the template. The templatein the red box (50 × 50) is cut out from Fig. 2(b), as shown inFig. 2(c), and the coefficient matrix obtained by performingnormxcorr2 is shown in Fig. 2(d), which is displayed as an im-age. In the coefficient matrix, the location corresponding to themaximum absolute value meets the best matching, which canbe used to determine the movement.

The NCC method provides a simple and intuitive way tofind the movement between two images. For a vibration videocontaining a series of images, the vibration signals can be easilyextracted when the NCC operation is repeated between everytwo images. This method is called the NCC-based extractionalgorithm. The algorithm procedure is listed as follows:

1. A fixed scope in which the video images are all focusedon the moving object is selected.

2. The video images in this scope are truncated as templateseries and the first video frame is used as the source image.

3. The coefficient matrix between the source image andeach template is calculated, and the location correspondingto the maximum absolute value is considered as the best match.

Finally, the x and y coordinates of these locations representthe movements in the horizontal and vertical directions.Notably, the movements obtained by applying this algorithmactually represent pixels. The real displacement can be obtainedwhen the distance a pixel represents is known. Thus, the NCC-based extraction algorithm provides an effective approach torealize displacement measurement.

A simple simulation example is provided to validate the per-formance of the NCC-based algorithm. In the simulation, letthe black circle in Fig. 2(a) move along a predetermined path.The NCC-based algorithm is then applied to extract thepath coordinates. For conciseness, the motion equations, whoseshape is an ellipse, are expressed as follows:

x�t� � 10 cos�2πf t�; y�t� � 6 sin�2πf t�; (2)

where the vibration frequency f � 1 Hz and the sampling fre-quency f s � 50 Hz. In this study, black circle simulation ex-periments are introduced in order to verify the speed andaccuracy of the algorithm. The mean time cost of each iterationswas introduced to evaluate the computation efficiency of thealgorithms because the efficiency is only determined by eachframe processing time cost. In other words, the high-speed sys-tem requested each frame processing time cost short enough tosatisfy the high sample frequency. 1 Hz is randomly selected andhigh-frequency vibration simulation should be more accurate.

The implementation procedure of the NCC-based algo-rithm is illustrated in Fig. 3. The extracted results are shownin Fig. 4. The NCC-based algorithm successfully extracted themotion signals in the horizontal and vertical directions. Thehorizontal signal has a wave shape similar to the simulation in-put x, whereas the vertical signal is similar to input y. Thus, theresults of the NCC-based algorithm match well with thereal input.

The only deficiency of this method is that the extracted val-ues are always integers because the result is decided by the lo-cation of the best-matching element in the coefficient matrix.This deficiency may affect the extracting accuracy and obtain a

Fig. 2. Example to explain NCC: (a) a black circle on white back-ground, whose center is marked by cross “+”; (b) the black circle movesfrom “+” to “o” and the red frame is selected as the cutting scope;(c) the template cut out from the moving circle; (d) the coefficientmatrix by performing normxcorr2, from which the movement canbe read out.

8200 Vol. 54, No. 27 / September 20 2015 / Applied Optics Research Article

Page 4: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

step-type wave shape. The step-type effect is especially obviouswhen the vibration is small, such as when only several pixelmovements occur. Tracking results are with an average trackingerror of 0.5 pixel, which is relatively large considering the10-pixel amplitude. To address this deficiency, filtering or fit-ting methods can be employed to wipe off the steps and smooththe wave shape. In this study, a subpixel localization algorithmis proposed to improve the extracting accuracy.

B. Subpixel Accuracy ImprovementIn template matching, the NCC coefficients describe the cor-relation between the template and the source image. Given the

limitation of matrix operations, the template is shifted pixel-by-pixel. Thus, the coefficient matrix calculated by NCC isonly a sampling of the correlation plane, and the location cor-responding to the maximum absolute value is a simple andrough estimation of the best matching. The best-matchingpoint is located in the region around the maximum absolutevalue. Therefore, the region can be used for a more accuratesubpixel localization and obtain decimal-level accuracy.

The subpixel localization algorithm is realized by cutting outa 3 × 3 region around the maximum absolute value to fit a two-dimensional quadratic surface, whose extreme point is consid-ered the desired estimation. A region bigger than 3 × 3 mayobtain more accurate estimation, but the complexity and quan-tity of computation also increase. Suppose the equation of thequadratic surface is expressed as Eq. (3) and the 3 × 3 matrix Ais described as Eq. (4):

f �x; y� � a0 � a1x � a2y � a3xy � a4x2 � a5y2; (3)

A �

264

f �−1; 1� f �0; 1� f �1; 1�f �−1; 0� f �0; 0� f �1; 0�f �−1; −1� f �0; −1� f �1; −1�

375

×

0B@�

2640.30 0.62 0.30

0.75 0.97 0.51

0.65 0.78 0.20

375

1CA: (4)

The coefficients ai�i � 0;…; 5� can be estimated by substi-tuting the matrix values into Eq. (3). The extreme point canthen be easily calculated by solving the following equations,

a1 � a3y � 2a4x � 0; a2 � a3x � 2a5y � 0; (5)

where x and y are the coordinates of the extreme point, which isregarded as a better estimation of the best-matching location.

As a simple example, suppose that the 3 × 3 matrix A takesthe values in Eq. (4), as shown in image form in Fig. 5(a). Theabove subpixel localization algorithm is then applied to fit thequadratic surface and calculate the extreme point. In Fig. 5(b),the fitting surface is displayed as an image form and the extremepoint is marked by the triangle marker. The extreme point isa better estimation of the best-matching location. This im-provement is used on the simulation in Subsection 3.A, andthe results are shown in Fig. 4. The obtained wave shapes

Fig. 3. Procedure illustration of the NCC-based algorithm to thesimulation example.

0 0.5 1 1.5 2

−10

−5

0

5

10

NC

C w

ithou

t im

prov

emen

t

x direction

Actual inputNo improvement

0 0.5 1 1.5 2

−6

−4

−2

0

2

4

6

y direction

0 0.5 1 1.5 2

−10

−5

0

5

10

NC

C w

ith im

prov

emen

t

t/s

Actual inputWith improvement

0 0.5 1 1.5 2

−6

−4

−2

0

2

4

6

t/s

Fig. 4. Simulation results by applying the NCC-based algorithm.

Fig. 5. Example of the quadratic surface fitting: (a) a matrix aroundthe best-matching location; (b) the fitting quadratic surface is dis-played in the image form and the triangle marker is the better estima-tion of the best-matching location.

Research Article Vol. 54, No. 27 / September 20 2015 / Applied Optics 8201

Page 5: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

are much smoother and match well with the actual inputscompared with the simulation conducted without using the im-provement, and the average tracking error reduces to 0.1 pixelwith the same vibration amplitude. At slight cost, the subpixellocalization algorithm obtains a significant promotion.

Therefore, the NCC-based extraction algorithm is simple,effective, and requires less expert interference. The extractedresults have clear physical meanings that represent the coordi-nate values in the horizontal and vertical directions. The sub-pixel localization algorithm improves the extracting accuracyfurther.

C. Modified AlgorithmAlthough the accuracy and robustness of the NCC-based algo-rithm perform well in image matching, the action principle isto calculate the correlation coefficients between the matchingtemplate and the whole image in all positions for the optimalmatching point. Computational quantity will rapidly increasealong with the increase of the target image size. The large com-putational time needed is one of main causes to restrict the ap-plications of the image matching process in high-speed camerasystems. Figure 6 shows the special relationship that existsbetween each adjacent frame of the high-speed camera inwhich the characteristics of small-scale displacement determinethat the useful search range is only within a small region aroundthe previous frame-matching position. Therefore, a local searchalgorithm based on gradient descent search theory is proposed.This optimization algorithm only needs to calculate the corre-lation coefficient of several positions which are close to theprevious frame image matching place between the searchingimage and the matching template. Such closeness greatly sup-presses the number of search points, which reduces the com-putational cost to a large extent. The modified algorithm is alsoimplemented by MATLAB language for this work.

1. Implementation of the Modified AlgorithmThe distribution map of cross-correlation coefficients betweenthe template and the search image is a contour map, which is agradient descent graph with the matching position as the centerin the template image matching process. In this contour map[Fig. 5(b)], the essence of the modified algorithm is to findthe local optimal method. A judging matrix is built as shownin Eq. (6):

A�i�1� �

264γ�xi − 1; yi � 1� γ�xi; yi � 1� γ�xi � 1; yi � 1�γ�xi − 1; yi� γ�xi; yi� γ�xi � 1; yi�

γ�xi − 1; yi − 1� γ�xi; yi − 1� γ�xi � 1; yi − 1�

375:

(6)

Ai�1 is as the same as matrix A in Subsection 3.B; it is the firststep matched detection matrix. �xi; yi� is the location of theprevious frame template matching. γ�x; y� is the correlation co-efficient between the matching template and the searching im-age in position �x; y�. It needs to be noticed that the matchingtemplate is selected from the first frame so that the matchingposition of the first frame is known. Each step of search direc-tion is determined by the motion vector of gradient raise. Thesteps of the algorithm are listed as follows:

1. With the position of the previous frame templatematching �xi; yi� taken as the search window center, A matrixis used to judge whether Ai�1�2; 2� � max�Ai�1�. If yes, findthe matching position, end the search, and process to Step 3;otherwise, go to Step 2.

2. With the position ofmax�Ai�1;k� (k indicates the num-ber of iterations) in step 1 taken as the search window center,three or five search points are added and the A matrix is appliedto judge whether Ai�1;k�2; 2� � max�Ai�1;k�. If yes, find thematching position, end the search, and process to Step 3; oth-erwise, continue to Step 2.

3. Return the match position �xi�1; yi�1� and the matrixAi�1, calculate the subpixel accuracy location by matrix Ai�1

according the method in Subsection 3.B. Thus, the precise dis-placement of the search image can be obtained from the match-ing position and the subpixel location.

Figure 7 shows a search procedure of the algorithm, wherethe points of the numbers 1, 2, 3, and 4 are the additionalsearch points in each iterative process, and the direction wherethe color deepening is the increasing direction of the distribu-tion map of the cross-correlation coefficients. The entire iter-ative process begins from the start position and finishes at theend position.

2. Performance Analysis of the Modified AlgorithmTo verify stability and speed of the modified algorithm, blackcircle experiments that adopted the same test conditions inSubsection 3.A were improved and conducted. The experimen-tal results are shown in Fig. 8 and Table 1.

A comparison of the extraction results shown in Fig. 8 in-dicates that the effect of the modified algorithm is the same asthat of the NCC-based algorithm. The similarity is attributed

Search Image

Current Search Area

Previous Frame Matching Position

Matching Template

Fig. 6. Matching schematic diagram between search image and tem-plate image.

Fig. 7. Search procedure of the LNCC algorithm: a four-step dem-onstration with vector �3; −2�.

8202 Vol. 54, No. 27 / September 20 2015 / Applied Optics Research Article

Page 6: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

to the almost identical calculation methods, as well as the samejudging criterion and the same correlation coefficient matrix.Thus, the same location positioning of the pixel and the sameresults in subpixel precision are obtained. Moreover, the sub-pixel localization is realized by cutting out a 3 × 3 matrixaround the maximum absolute value to fit a quadratic surfaceand calculate the extreme point, and this matrix is existed inpixel localization. Only twice matrix divisions are calculated forsubpixel localization. So the proposed modifications for sub-pixel localization influence the computational load weakly.

Displacement between adjacent frames is quite small whensuch faint vibrations are sampled by a high-speed digital cam-era. In the Table 1, each row of the LNCC column shows thenumber of frames (N ) that needed n (1, 2, or 3) iterations.tmean indicates the mean time cost for each iteration, andt total indicates the total amount of time cost for N frames.It clearly shows that each frame extracts the position only byonce or twice iteration. In other words, the majority of the cor-relation coefficient calculations of the needed positions are only12 or 14, which greatly improves the computational efficiency.tmean of the NCC column indicates each frame processingtime needed, and N indicates the whole image stack is 251.Comparing the time spent on integer pixel extraction of thetwo algorithms, LNCC is 0.6359s and NCC is 6.1266s in totaltime cost, and the modified algorithm is 10 times higher thanthe conventional NCC-based algorithm for single position dis-placement extraction. In summary, the modified algorithminherits the robustness and accuracy of the NCC-based algo-rithm and far exceeds the rapidity of the latter. The potential

applications of the modified algorithm used in high-speed dig-ital camera vibrations extraction are numerous.

3. Selection of Algorithm ParametersSeveral parameters must be chosen in applying the modifiedalgorithm, and the most important is how the template areais selected. The selection of the parameters influences the per-formance and computing time. The extent of the influence ofthe parameter m is discussed in this section.

Consider the simulation in Subsection 3.C.2 as an example.By performing the modified algorithm in the case of the param-eter of template size m varying from 10 × 10 to 60 × 60, thissquare scope taking feature as center is simple and suitable. Thealgorithm performance along the varying parameter is obtained.The curve of the performance provides an idea on the selectionof algorithm parameter. The results are shown in Fig. 9(a). Thered curves are the average error of the x direction, whereas theblue curves are the average error of the y direction. Figure 9(b)displays the computing time of different m.

When m is small, the average tracking error decreases gradu-ally. Below a value of about 20 × 20, the average tracking errorgets close to 0.2 pixel and tends toward stability, which indi-cates that a large matching template is needed to ensure goodperformance. Figure 9(b) shows the computing time exponen-tial growth along with m. In conclusion, large m is helpful forextracting the vibration signals accurately, but it also increasescomputing time. Thus, the selection of m needs the balancebetween the computing time and the algorithm performance.

4. EXPERIMENTAL VERIFICATION

A. Moving Platform ExperimentThe performance of the LNCC-based algorithm in vibrationextraction, the pixel-level accuracy, and the target-track abilityin dynamic response were evaluated. A laboratory test was car-ried out using a grating ruler, which is a high-accuracy displace-ment measurement tool that uses the moiré fringe technologyof grating and photoelectric conversion. This tool is also calledthe incremental grating displacement sensor. In this experi-ment, the grating ruler was fixed in the moving platform soto accurately track the motion signals of the moving platform.The sampling frequency of the grating ruler was 20 Hz and thegrating pitch was 0.02 mm with 1 um resolving power. Onecross target was fixed on the platform which could be pro-grammed to move with an arbitrary amplitude and frequencyin one direction. Li [29] has proved that NCC algorithm is not

Time/s0 0.5 1 1.5 2

Pix

el d

ispl

acem

ent

-10

-8

-6

-4

-2

0

2

4

6

8

10Actual inputNCC-basedLNCC-based

Time/s0 0.5 1 1.5 2

-6

-4

-2

0

2

4

6Actual inputNCC-basedLNCC-based

Fig. 8. Performance comparison of the results extracted by NCC-based and LNCC-based algorithms.

Table 1. Time Cost Comparison Between NCC andLNCC

LNCC NCC

n(iterate)

N(frame) tmean t total tmean

N(frame)

1 25 0.0013 0.0325 0.0244 2512 203 0.0025 0.51703 23 0.0038 0.0865Total time: 0.6359s Total time: 6.1266s

m

Ave

rage

Tra

ckin

g E

rror

0

0.5

1

1.5

2

2.5

x-inputy-input

(a)m

10 15 20 25 30 35 40 45 50 55 60 10 15 20 25 30 35 40 45 50 55 60

Com

putin

g T

ime/

s

0.5

0.55

0.6

0.65

0.7

0.75

0.8

0.85

0.9

(b)

Fig. 9. Influence of the template size: (a) average tracking error tox and y direction, (b) computing time of different template size.

Research Article Vol. 54, No. 27 / September 20 2015 / Applied Optics 8203

Page 7: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

sensitive to noise and visibility, and the modified algorithminherits the characteristics of NCC except for efficiency so itis insensitive to noise and robust to different lighting conditionstoo. Thus, as shown in Fig. 10, the object surface and crosstarget were illuminated by a white light source that uses opticalfiber, and the video camera was placed at about 1 m away fromthe table and along the optical axis so the shake table can existin the camera plane. Recorded images were digitized and storedin a computer for further processing.

Camera calibration of the system was necessary before thetests. The camera captured the target panel at 200 fps and de-tected the motion of the target on a connected computer, asshown in Fig. 10(b). Figure 11(a) revealed that the size ofthe captured image was 400 × 300. The actual size of the pre-designed target panel was calculated, and results showed that20 mm corresponds to 135 pixels in the captured image.Therefore, 1 pixel corresponded to about 0.148 mm. A cross

target captured by the camera was displayed in Fig. 11(b), inwhich the selected template for the scope was an 80 × 80square. To evaluate the performance of the LNCC-based algo-rithm in vibration extraction with nontarget, an 80 × 80 struc-tural feature image was captured by the camera [Fig. 11(c)].This image was also selected as the matching template.

The guide screw was driven by a manual control input, andthe measurement was taken for 10 s. The displacement timehistory measured by the high-speed camera system was com-pared with that measured by the grating ruler, as shown inFig. 12. The cross target tracking results agreed with the gratingruler perfectly, with an average tracking error of 0.035 mm,which was relatively small considering the 3 mm amplitude.Only a slight difference in vibration extraction was observedbetween target and nontarget tracking. The time spent on theinteger pixel extraction by the two algorithms and two tem-plates was shown in Table 2. The mean time needed for eachframes processing by NCC was 0.2011s and the LNCC wasonly 0.0037s when the vibration was extracted with the target.Compared with the simulation results in Table 1, the averagetime cost increases because of the increase in size of the match-ing template. Furthermore, the modified algorithm is 54 timesfaster than the traditional NCC-based algorithm. The effi-ciency of LNCC would be more obvious with the increase

Fig. 10. Moving platform experiment: (a) grating ruler table, (b) testconfiguration.

Fig. 11. Object image in moving platform experiment: (a) imagecaptured by the high-speed camera, (b) cross-target, (c) structural fea-ture target.

Time/s

disp

lace

men

t/mm

-4

-3

-2

-1

0

1

2

3

4

LNCC-TargetGrating Ruler

(a)

Time/s

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

disp

lace

men

t/mm

-4

-3

-2

-1

0

1

2

3

4LNCC-NonTargetGrating Ruler

(b)

Fig. 12. Comparison of results from the video camera: (a) resultsbetween target tracking and grating ruler, (b) results between nontargettracking and grating ruler.

Table 2. Time Cost Comparison of Two Algorithms andTwo Templates

Mean time(s) LNCC NCC

With target 0.0037 0.2011Nontarget 0.0029 0.1538

8204 Vol. 54, No. 27 / September 20 2015 / Applied Optics Research Article

Page 8: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

in the size of the searching image. The extraction time cost bythe target was also similar to that of the nontarget.

B. Sound Barrier ExperimentAn attempt to extract the vibration of the sound barrier is re-ported to validate the effectiveness of the proposed algorithmsin the field. The sound barrier, also called sound-wall or noisebarrier, is a platy structure designed to protect inhabitants onboth sides of the railway from noise pollution. It is the mosteffective method of mitigating roadway, railway, and industrialnoise sources. However, with the increase in train speed, strongsuction and impact are introduced when high-speed trains passby the sections installed with sound barriers, leading to violentvibrations of the barriers; such vibrations may cause materialfatigue and loose assembly. In addition, when the sound bar-riers are damaged and fall on the railway track, disastrous con-sequences may occur. Thus, to improve the performance ofsound barriers, the vibration course when the high-speed trainpasses should be first measured. However, traditional measure-ment methods are difficult to use because of the inconvenienceof installing the barriers at the working train line. Therefore,vision-based measurement has been put forward to solve sucha problem.

The viaduct installed with sound barriers is located inKunShan City of China, as shown in Fig. 13(a). The experi-ment was set up below the viaduct, as shown in Fig. 13(b). Thedistance between the camera and the barrier is about 30 m. Thesetup mainly includes a PC and a high-speed camera, which areused to capture the displacement vibration video. When a high-speed train passes by, a video containing the vibration of thesound barrier can be shot at 232 fps. One video image is dis-played in Fig. 13(c). In practice, the assumption that the barrierdeformation is negligible relative to the vibration is acceptable.Although the barrier was shot at a certain elevation, the vibra-tion in the video can be considered as the projection of theactual movements on the imaging plane of the camera, whichhas no effect on the extraction of vibration properties.

The position of the 50 × 50 template is displayed as the redbox in Fig. 13(c). The actual size of per pixel is 0.78 mm, whichis calculated by using the known physical size of the barrier.

This high image resolution in the case of remote measurementis attributed mainly to the use of a telephoto lens. The vibrationdisplacement and its Fourier spectrum extraction by the modi-fied algorithm applied to the barrier video are shown in Fig. 14.The y direction is the train direction, and x is the vertical di-rection of the train, which has an airflow to impact soundbarrier. The vibration time history is clearly displayed when thetrain passes, and the moment of train arrival is marked in red.Three obvious spectral peaks can be observed at 10.42, 21.07,and 45.77 Hz, which can be considered as the characteristicfrequencies of the sound barrier. Based on these results, the dy-namic characteristic of the sound barrier, which was previouslydifficult to detect, can be grasped now.

5. CONCLUSIONS

This paper describes a modified method based on the NCCtechnique to measure structural vibration using a high-speeddigital camera. To meet real-time requirements, the NCC tem-plate tracking algorithm in the field of computer vision wasintroduced and a modified LNCC algorithm was proposedto reduce the required calculation time. Through the optimi-zation, the computation of one iteration that is mainly com-prised by a collection of images could be performed rapidlywithin 0.2 ms even in a common computer. The propertiesof high efficiency, high precision, and good robustness of themodified algorithm were contributed to its application in thehigh-speed camera measurement system.

Two experimental studies validated the performance of theproposed algorithm. The motion platform experiment demon-strated the accuracy of the vibration measurement by compar-ing the results of the high-speed camera system with those ofa conventional sensor, namely a grating ruler. The nontargettracking test can also obtain almost the same results, whichproved that the measurement method has the strong practi-cability even without a target. The proposed method greatlyincreased the potential applications of the high-speed camerasystem. An experiment on a sound barrier on a high-speed rail

Fig. 13. Sound barrier experiment setup: (a) viaduct installed withsound barriers, (b) experimental setup, (c) one image of the shot video.

Fig. 14. Extraction results from the application of the modifiedalgorithm.

Research Article Vol. 54, No. 27 / September 20 2015 / Applied Optics 8205

Page 9: Vibration extraction based on fast NCC algorithm and high ...staff.ustc.edu.cn/~guojiegj/document/LXJ_NCC.pdf · Vibration extraction based on fast NCC algorithm and high-speed camera

further displayed the reliability and accurately of extracting thevibrating signals of real-life structures.

The algorithm can only meet the real-time calculationsunder a frequency sampling below 500 Hz and is still unableto meet the real-time calculations under a super-high-frequencysampling (more than 500 Hz). Further works are improving theefficiency of the algorithm so that vibration extraction onlinecan be realized.

Funding. China Postdoctoral Science Foundation(2014M551820); National Basic Research Program of China(2014CB049500); Natural Science Foundation of AnhuiProvince (Anhui Provincial Natural Science Foundation)(1508085QE83).

REFERENCES1. M. Malesa and M. Kujawinska, “Deformation measurements by digital

image correlation with automatic merging of data distributed in time,”Appl. Opt. 52, 4681–4692 (2013).

2. Y. Fu, H. Shi, and H. Miao, “Vibration measurement of a miniaturecomponent by high-speed image-plane digital holographic micros-copy,” Appl. Opt. 48, 1990–1997 (2009).

3. W. Zhou and D. Chelidze, “Blind source separation based vibrationmode identification,” Mech. Syst. Signal Process. 21, 3072–3087(2007).

4. M. Meo, G. Zumpano, X. Meng, E. Cosser, G. Roberts, and A.Dodson, “Measurements of dynamic properties of a medium spansuspension bridge by using the wavelet transforms,” Mech. Syst.Signal Process. 20, 1112–1133 (2006).

5. L. Xu, J. Guo, and J. Jiang, “Time-frequency analysis of a suspensionbridge based on gps,” J. Sound Vib. 254, 105–116 (2002).

6. Y. Zhang, H. Zhu, W. Zhou, and H. Liu, “Application of the Fouriertransform in electronic speckle photography,” Exp. Mech. 42, 18–24 (2002).

7. H. H. Nassif, M. Gindy, and J. Davis, “Comparison of laser Dopplervibrometer with contact sensors for monitoring bridge deflectionand vibration,” NDT&E Int. 38, 213–218 (2005).

8. D. Jurjo, C. Magluta, N. Roitman, and P. Gonçalves, “Experimentalmethodology for the dynamic analysis of slender structures basedon digital image processing techniques,” Mech. Syst. SignalProcess. 24, 1369–1382 (2010).

9. T. Wu, Y. Peng, H. Wu, X. Zhang, and J. Wang, “Full-life dynamicidentification of wear state based on on-line wear debris image fea-tures,” Mech. Syst. Signal Process. 42, 404–414 (2014).

10. D. You, X. Gao, and S. Katayama, “Monitoring of high-power laserwelding using high-speed photographing and image processing,”Mech. Syst. Signal Process. 49, 39–52 (2014).

11. F. C. Trigo, F. P. R. Martins, A. D. T. Fleury, and H. Silva,“Identification of a scaled-model riser dynamics through a combined

computer vision and adaptive Kalman filter approach,” Mech. Syst.Signal Process. 43, 124–140 (2014).

12. A. Davis, M. Rubinstein, N. Wadhwa, G. J. Mysore, F. Durand, andW. T. Freeman, “The visual microphone: Passive recovery of soundfrom video,” ACM Trans. Graph. 33, 1–10 (2014).

13. C. Quan, C. J. Tay, W. Sun, and X. He, “Determination of three-dimen-sional displacement using two-dimensional digital image correlation,”Appl. Opt. 47, 583–593 (2008).

14. A. A. Mudassar and S. Butt, “Improved digital image correlation forin-plane displacement measurement,” Appl. Opt. 53, 960–970(2014).

15. Y. Fukuda, M. Q. Feng, Y. Narita, S. Kaneko, and T. Tanaka, “Vision-based displacement sensor for monitoring dynamic response usingrobust object search algorithm,” IEEE Sens. J. 13, 4725–4732 (2013).

16. M. S. Kirugulige, H. V. Tippur, and T. S. Denney, “Measurementof transient deformations using digital image correlation methodand high-speed photography: application to dynamic fracture,”Appl. Opt. 46, 5083–5096 (2007).

17. T. Fricke-Begemann, “Three-dimensional deformation field measure-ment with digital speckle correlation,” Appl. Opt. 42, 6783–6796(2003).

18. S. K. Sahani, G. Adhikari, and B. Das, “A fast template matching al-gorithm for aerial object tracking,” in 2011 International Conferenceon Image Information Processing (ICIIP) (IEEE, 2011), pp. 1–6.

19. J. P. Lewis, “Fast template matching,” Vision Interface 95, 15–19(1995).

20. L. Di Stefano and S. Mattoccia, “A sufficient condition based onthe Cauchy-Schwarz inequality for efficient template matching,” inProceedings of the 2003 International Conference on ImageProcessing, 2003 (IEEE, 2003), Vol. 1, pp. 1–269.

21. L. Di Stefano and S. Mattoccia, “Fast template matching usingbounded partial correlation,” Mach. Vis. Appl. 13, 213–221 (2003).

22. A. Barjatya, “Block matching algorithms for motion estimation,” IEEETrans. Evol. Comput. 8, 225–239 (2004).

23. B. Pan, H. Xie, and Z. Wang, “Equivalence of digital image correlationcriteria for pattern matching,” Appl. Opt. 49, 5501–5509 (2010).

24. M. Debella-Gilo and A. Kääb, “Sub-pixel precision image matchingfor measuring surface displacements on mass movements usingnormalized cross-correlation,” Remote Sens. Environ. 115, 130–142 (2011).

25. J. Kortbek and J. A. Jensen, “Estimation of velocity vector angles us-ing the directional cross-correlation method,” IEEE Trans. Ultrason.Ferroelectr. Freq. Control 53, 2036–2049 (2006).

26. X. Shen and W. Bao, “The remote sensing image matching algorithmbased on the normalized cross-correlation and sift,” J. Indian Soc.Remote Sens. 42, 417–422 (2014).

27. B. Pan, “Reliability-guided digital image correlation for image defor-mation measurement,” Appl. Opt. 48, 1535–1542 (2009).

28. D.-M. Tsai and C.-T. Lin, “Fast normalized cross correlation for defectdetection,” Pattern Recognit. Lett. 24, 2625–2631 (2003).

29. Z. Li, B. Xu, and L. Chen, “Normalized cross correlation image match-ing algorithm based on adaptive step size,” Opto-Electron. Eng. 10,77–84 (2013).

8206 Vol. 54, No. 27 / September 20 2015 / Applied Optics Research Article