# Study on Bridge Displacement Monitoring Algorithms Based on Multi-Targets Tracking
## 3 Proposed Algorithm  
The digital image correlation method can calculate the whole field displacement. If it is used in bridge displacement monitoring, the actual environment is not suitable and the amount of calculation is very large so it is difficult to meet the monitoring speed. The algorithm proposed in this paper improves the specific target tracking technology to make it more meet the needs of actual bridge displacement monitoring. A flowchart of the proposed algorithm is shown in Figure 1. It is mainly composed of eight modules. In each module, the algorithm in this paper is optimized to meet the real-time, robustness, and adaptability as far as possible under the premise of monitoring accuracy. As mentioned earlier, current target tracking algorithms' cost of erecting detection equipment is too large for bridges with a large span that need to locate more multi-targets because of its tracking only one target on a camera, and DIC has difficulty guaranteeing the accuracy and real-time because of its complicated data processing. The proposed algorithm in this paper can meet the real-time and accuracy under the premise of monitoring multiple targets. The algorithm proceeds as follows. System calibration is acquiring the actual distance value represented by each pixel under the current monitoring distance before the displacement monitoring. The calibration method adopted in this paper is to separate two target boards by a known distance (preferably greater than 50 m), take photos, and run the algorithm to obtain the central coordinates of the two target boards in the image. Dividing the known distance by the coordinate difference between the two target boards is the actual distance respected by each pixel. Image capturing means using the image acquisition system of the Charge Coupled Device (CCD) camera to collect images. Color conversion means converting the collected images into gray images for processing. Image denoising, as its name implies, is to filter out the noise in the image with a filter. In this paper, an adaptive median filter is used for denoising. \(S_{xy}\) represents a sub-image whose center is at \((x,y)\). The adaptive median filter described in detail is as follows:  
\(z_{min}\) denotes the minimum brightness value in \(S_{xy}\). \(z_{max}\) denotes the maximum brightness value in \(S_{xy}\). \(z_{med}\) denotes the median brightness value in \(S_{xy}\). \(z_{xy}\) denotes the brightness value at coordinates \((x,y)\). This adaptive median filtering algorithm works in two levels, Level A and Level B:  
Level A: If \(z_{min}<z_{med}<z_{max}\), turn to Level B. Otherwise, increase window size. If the window size \(<\)=\(S_{max}\), repeat Level A. Otherwise, output \(z_{med}\). Level B: If \(z_{min}<z_{xy}<z_{max}\), output \(z_{xy}\). Figure 1: Flowchart of the proposed algorithm. Otherwise, output \(z_{med}\). \(S_{max}\) represents the allowable maximum adaptive filter windows size and \(S_{max}=5\) in this paper. Many denoising methods are applied to this algorithm and the denoising effect is similar. In this paper, the adaptive median filter is selected and other denoising methods also can be used instead. Image enhancement uses top-hat transformation to uniform background and histogram equalization to enhance the contrast. Assuming that \(f(x,y)\) is a grayscale image and \(b(x,y)\) is a structural element, \(b\) erosion of image \(f\) at \((x,y)\) is defined as Equation (2) and \(b\) dilation of image \(f\) at \((x,y)\) is defined as Equation (3). Top-hat transformation is defined as Equation (4):  
\[[f\odot b](x,y)=\min_{(s,t)\in b}\{f(x+s,y+t)\}, \tag{2}\]  
\[[f\odot b](x,y)=\max_{(s,t)\in b}\{f(x-s,y-t)\}, \tag{3}\]  
\[T_{hat}(f)=f-(f\odot b)\oplus b. \tag{4}\]  
Background simplification uses erosion and hole filling technology. The structural element size of erosion procedure is a disk structure with a radius of 1.