## 3 Positioning Method  
### CMOS Image Sensor and LED Light Distance  
The general functions of the camera image sensor and the projection of a detected LED light infrastructure with a transmitter and receiver are illustrated in Figure 7, where  
Figure 6: The multilateration operation diagram, where \(T_{1}\), \(T_{2}\), \(T_{3}\), \(T_{4}\), and \(R\) are the LED transmitter–receiver, respectively, and \(L_{1}\), \(L_{2}\), \(L_{3}\), and \(L_{4}\) are the calculated distances between transmitters and receiver.  
multiple detected LED light signals pass through the camera lens, and they are incident to the image sensor (IS) surface. The detected image on the image surface is in the opposite position of the LED light signal. Consider \(f\) as the camera focal length, which is the intrinsic parameter of every CMOS image sensor; the distance between the target \(i\)-th LED light (\(x_{i}\), \(y_{i}\)) to the camera lens is \(L\), and the distance between the focal length to the projected image on the image sensor is \(l\). Therefore, the fundamental equation of the lens can be written in the following form:  
\[\frac{l}{L}=\frac{f}{L-f} \tag{4}\]  
The magnification parameter \(H\) of the camera lens is defined as the ratio of the projected image size to the area of the LED geometrical size. Therefore, we can express the magnification as:  
\[H=\sqrt{\frac{k_{ij}}{K_{ij}}}=\frac{l}{L} \tag{5}\]  
where \(k_{ij}\) is the area of detected image on the image sensor, and \(K_{ij}\) is the actual area of LED light (\(x_{i}\), \(y_{i}\)). It is clear that \(f<<L\). Therefore, by combining Equations (4) and (5) we obtain:  
\[k_{ij}=H^{2}K_{ij} \tag{6}\]  
Therefore, the number of pixels of the image sensor is the ratio of the projected image size on the image sensor to the unit pixel area of the image sensor. If the number of pixels is \(\alpha_{p}\) on the sensor, \(\mu\) is the unit pixel area of the IS, and \(K\) is the area of detected LED ceiling light, then their relationship can be expressed as follows:  
\[\alpha_{p}=\frac{f^{2}K}{\mu^{2}L^{2}} \tag{7}\]  
Figure 7: Positioning system infrastructure installed with ceiling LED lights as a transmitter and smartphone image sensor as a receiver.  
Currently, LEDs of different shapes and configurations are available in the marketplace. LEDs are typically manufactured in rectangular, square, or circular shapes to satisfy customer demand. In our experiment, we used a circular-shaped LED. For the circular-shaped LEDs, if \(r\) is the radius of the circle, then the total area of the LED shape will be \(K=\pi r^{2}\), as shown in Figure 8a. The distance from the ceiling LEDs and camera image sensor within the camera FOV is unique for every LED light produced during the communication with multiple light signals. The focal length and unit of the pixel area for every smartphone camera are not variable. Meanwhile, if the real-physical area of the ceiling LEDs is known, we can calculate the distance measured by the corresponding pixel value in the image area of the image sensor from the equation.  
We can rewrite the Equation (7) as follows:  
\[L=v\sqrt{\frac{1}{\alpha_{p}}} \tag{8}\]  
where \(v=f\sqrt{K}/\mu\) is a constant for each camera image sensor and LED light. As indicated in (8), the distance between the LEDs to the camera lens is inversely proportional to the square root of the camera image sensor area.