## 2 Theory
### The Mean Shift Algorithm  
In some traditional VLP methods based on image recognition only, every image must be processed to locate the positioning terminal, where maximum allowable motion speed of the positioning terminal is confined by the blur effect caused by the high relative speed between LEDs and image sensors, whereas the blur effect has much less of an impact on the mean shift algorithm, relying on color histogram. Additionally, even if half of the LED is shielded in the image, the tracking process won't fail. In view of the wonderful robustness and real-time ability of the mean shift algorithm, it was used as the main part of our proposed VLP algorithm. Non-parametric density estimation is the basic concept in the mean shift algorithm, using kernel density estimation as the fundamental of the whole theory. One of the most popular density estimation methods is known as kernel density estimation. Given n points of data \(X_{\mathrm{i}}\), i = 1... n in the d-dimensional space \(R^{d}\), and the multivariate kernel density estimator whose kernel function K(x), together with a symmetric positive definite d \(\times\) d bandwidth matrix H, calculated in the point x, satisfying:  
\[\hat{\mathrm{f}}(\mathrm{x})=\frac{1}{n}\sum_{i=1}^{n}K_{\mathrm{H}}(\mathrm{ x}-\mathrm{x_{i}}) \tag{4}\]  
in which  
\[K_{\mathrm{H}}(\mathrm{x})=|H|^{-\frac{1}{2}}K\left(H^{-\frac{1}{2}}\mathrm{x}\right) \tag{5}\]  
The kernel function K(x) with d variates is combined with the following equations:  
\[\int_{R^{d}}K(\mathrm{x})d\mathrm{x}=1 \tag{6}\]  
\[\lim_{||\mathrm{x}||\rightarrow\infty}||\mathrm{x}||^{d}K(\mathrm{x})=0 \tag{7}\]  
\[\int_{R^{d}}xK(\mathrm{x})d\mathrm{x}=0 \tag{8}\]  
\[\int_{R^{d}}x\mathrm{x}^{T}K(\mathrm{x})d\mathrm{x}=c_{K}I \tag{9}\]  
where c\({}_{K}\) is a constant, and I is an Identity matrix. The multivariable kernel function can be generated by the following two methods. \[K^{P}(\mathrm{x})=\prod_{i=1}^{d}K_{1}(\mathrm{x_{i}}) \tag{10}\]  
\[K^{S}(\mathrm{x})=a_{k,d}K_{1}(||\mathrm{x}||) \tag{11}\]  
Figure 5: The transformation model of the camera coordinate system and the world’s coordinate system. in which \(K^{P}(x)\) is obtained from the univariate kernels and \(K^{S}(x)\) is the product of rotating \(K_{1}(x)\) in \(R^{d}\). Besides, \(K^{S}(x)\) is radially symmetric. The normalized constant \(a_{k,d}\) assures that the integral of function \(K^{S}(x)\) is one. We only need to focus on a special class of kernel functions satisfying  
\[K(x)=c_{k,d}k\Big{(}||x||^{2}\Big{)} \tag{12}\]  
where k(x) is called the profile function of the K(x). The normalized constant \(c_{k,d}\) is always positive, ensuring that the kernel function K(x) integrates to one. H is a \(d\times d\) bandwidth matrix which is often computed as diagonal \(H=diag[h_{1}^{2},\,\ldots\,\,h_{d}^{2}]\), or proportional identity matrix \(H=\,h^{2}I\). The proportional identity matrix has only one parameter, which can be computed more easily. If we use the equation \(H=h^{2}I\) for calculation, then Equation (4) can be rewritten as  
\[K_{\mathrm{H}}(\mathrm{x})=|H|^{-\frac{1}{2}}K\left(H^{-\frac{1}{2}}\mathrm{x}\right) \tag{5}\]0  
If the definition of one-dimension kernel function K(x) is brought into Equation (13), we can get the equation which the general mean shift algorithm uses to calculate the density estimate of eigenvalues. The distribution position with maximum density in the sample data group can be obtained by estimating the density gradient. The density gradient is defined as the gradient of kernel density estimation function, which can be calculated by Equation (14):  
\[