2017年3月3日星期五

LDR Camera in week5

In this week, we focused on further calibration to solve the problem found in the last week and also started to prepare the poster. Firstly, the linear relationship between voltage on the LED and the light intensity produced by LED was obtained through Arduino program. Hence, the light intensity variation in later calibration can be achieved by changing the voltage of LED. The process of altering light intensity can be observed in the video 1 given below.


Secondly, the voltages of 16 LDRs were recorded  while changing the light intensity of LED from the value 0 to 255. Totally 20 sample points of light intensity were collected, which were 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 80, 120, 170, 230, 255. The sample points were mainly distributed in the lower light intensity area since the voltage variation of LDR may reach saturation range when the light intensity is large enough. Specifically, the boards holding LEDs and LDRs were connected together to enable synchronization of sending and receiving data.

Under every specific light intensity,  the voltage on every LDR was measured 22 times and median value of variations was recorded. Then, the data recorded were inputted into MATLAB curve fitting tool for matching and the result is shown in Figure 1, with vertical axis representing light intensity while horizonal axis representing voltage. We used segment linear fitting at the very beginning. However, it was found quadratic exponential fitting can be a better method since some values experienced  large floating in segment linear fitting.  

Figure 1
From the curve fitting technique, the approximate methematical relationship between light intensity and voltage was obtained, which is y=a*exp(b*x)+c*exp(d*x). The corresponding coefficients were inputted into Arduino for computing.

At this point, we have prepared everything needed, hence, calibration can be conducted now. Under current light source, light intensity of all remaining pixels were assigned the same value as the first pixel (pixel 0). This calibration only runs for one time. After that, actual time light intensity was measured and the outputs were transmitted to UNITY. The images of 4*4 black-and-white pixels before and after calibration were shown in Figure 2 and Figure 3, respectively.

Figure 2
Figure 3
Further, similar calibration was conducted for 2 colour images which were comprised of 6 LDRs. The cabration process is given in the video 2 below.


Therefore, the problem we encountered in week 3 that two colour images were not exactly the same can be solved through this calibration method and the results are shown in Figure 3, 4, 5 for red, green and blue, respectively.
Figure 4-Red
Figure 5-Green
Figure 6-Blue
Further, we made some additional modifications to generate a more accurate image for green one and the circuit can be seen in Figure 7. The improved result is given in Figure 8.
Figure 7
Figure 8-improved green


没有评论:

发表评论