Chapter 4 Dynamic Auto-focusing System
4.6 Finite State Machine Approach
In the previous section, we describe each element in our dynamic auto-focusing algorithms separately and then integrate all of them into a system. The finite state machine is a popular model for running a software simulation or a hardware implementation.
Table 4.3 State transition table parameter is not set, 1 means set, and x means don’t care. The parameter setting is as follow:
fs_neg: Set when the focus value is decreasing. The detail is discussed in section 4.3.
fs_pos: Set when the focus value is increasing. The detail is discussed in section 4.3.
fs_max: Set when the current focus value is the maximum.
fs_out: Set when the focus position is overflow.
fs_cha: Set when the scene change or zoom change happens. All the parameter and data will be reset when it is set. The detail is discussed in section 4.2.
The focus position increases (far) when the state number is odd. The focus position decreases when the state number is even. The state S is a special state that means the auto-focusing process is done tentatively. The initial state is determined to state 1.
Figure 4.27 Flowchart of our auto-focusing system with a finite state machine approach.
Fig 4.27 shows flowchart of our auto-focusing system with a finite state machine approach. The original part of search algorithm is replaced with the state machines that each state has a unique action for adjusting the focus position. In order to handle the dynamic issues, the system computes much more parameters and translates these parameters into the state condition form. A new state S that locks the focus position helps the system to maintain the focus position temporarily, which allows our algorithm works as well as the traditional ones for the still image. If the algorithm cannot be satisfied, we can revise the state transition table with a more complex state condition form or add new states.
Figure 4.28 The state diagram for our auto-focusing system.
Figure 4.28 shows the state diagram derived from Table 4.6. The states are designed based on the basic climbing algorithm logics with the enhance transition conditions. Here we can understand our algorithm more clearly. For example, focusing a still image from a near initial position works as moving state 1 -> 5 -> 4 -> S sequentially. Considering a scene change case, the state moves as state 1 -> 5 -> 4 -> S ->(scene change happens) 1 -> 2 -> 6 ->
3 ->S. The robust state table maintains the search algorithm working under the dynamic situations.
Chapter 5
Simulation Results
In this chapter, we provide the experimental results of our proposed algorithm. We roughly examine our dynamic auto-focusing algorithm in the previous chapter. For checking the robustness of our algorithms, we give a series of experiments with our overall auto-focusing system. We choose the Sobel operator as our focus value metrics and divide our focus window into 16 rectangles with maximum value selection. The search algorithm is integrated with a finite state machine approach. The captured image data type is 24-bit BMP and the size is 720x480. Because we only compute our algorithm in gray level, we do a color transform in our algorithm first.
In the previous chapter, we mainly analyze the output response to show the efficiency of our auto-focusing algorithm. In order to help understanding our algorithm performance and results, the following section will show the captured images at certain process segment.
5.1 Simulation for Still Image
The still image is the basic and common auto-focusing case. It is merited that our auto-focusing system can handle this problem. Figures 5.1, 5.2, and 5.3 show our auto-focusing algorithm is capable of focusing the still image under different situation. The initial point is set at the most far focus position that makes the picture very blur. We can see that the initial pictures (a) are very blurred and the focused results (b) are quite clear. The time it costs is average 16 cycles.
(a) The initial picture.
(b) The focused picture after 13 cycles.
Figure 5.1 The test image “scarecrow.”
(a) The initial picture
(b) The focused picture after 17 cycles.
Figure 5.2 The test image “paper.”
(a) The initial picture
(b) The focused picture after 17 cycles.
Figure 5.3 The test image “fan.”
5.2 Simulation for Scene Change:
The scene change is a dynamic auto-focusing case. Figure 5.4 shows a simulation procedure. We simulate the scene change by switching the reading database. It takes two kinds of image data to simulate the scene change case.
(a) The initial picture.
(b) The focused picture.
(c) The new picture with the same focus position.
(d) The new focused picture after 7 cycles.
Figure 5.4 The four test frames for a scene change simulation
The first two pictures (a) and (b) are the similar segment as the still image simulation.
When the scene change happens, the new picture (c) seems a little blur. Our auto-focusing algorithm detects this change and corrects the picture to a focused one. The final picture (d) is still clear after the scene change occurs. It costs fewer cycles to focus the changed picture because the default initial focus position is the worst case.
5.3 Simulation for Local Object Motion
The object motion is a critical dynamic auto-focusing problem. Figure 5.5 shows a simulation procedure. We capture every motion separately and build them up into a motion database. We simulate the local object motion by switching the motion database with a regular routine.
(a) The initial picture.
(b) The picture at cycle 5.
(c) The picture at cycle 10.
(d) The focused picture at cycle 17
Figure 5.5 The four test frames for a local object motion simulation.
We can see the pictures shown in Figure 5.5 become more and more clear even the fan is rotating. Our algorithm does not take extra time for focusing a motion object but costs nearly the same time as focusing the still one. The reason is that the search algorithm handles the motion problem and the still image the same. Our threshold search algorithm is reliable and efficiency for a local object motion case.
5.4 Simulation for Zoom Tracking
The zoom tracking is a prediction method. Figure 5.6 shows a zoom tracking procedures.
The simulation for zoom tracking case is very similar to the scene change case but it adds a prediction step when the zoom change occurs.
(a) The initial picture.
(b) The focused picture at cycle 22.
(c) The zoom-in picture with zoom tracking at cycle 25.
(d) The focused zoom-in picture at cycle 36.
Figure 5.6 The four test frames for zoom tracking.
Our algorithm predicts the new focus position simultaneously when the zoom position changes. Although it is not very accurate, the picture shown in figure 5.6 (c) is quite clear. The zoom tracking method spends less time on focusing the changed picture than the scene change approach. It also has better performance at the auto-focusing process. Figure 5.7 shows the comparison between the zoom tracking and no zoom tracking. The zoom tracking keeps the picture much clearer than without it.
Figure 5.7 The comparison of the zoom changed picture between no zoom tracking and zoom tracking.
Chapter 6 Conclusions
6.1 Conclusions
In this thesis, we design a dynamic auto-focusing algorithm for digital camera systems.
Our algorithm is an extension of the existing auto-focusing algorithm for still image cameras.
The mainly modify the search algorithm to match the dynamic requirements. Instead of
The search algorithm is the most important part of our dynamic auto-focusing algorithm.
We implement our search algorithm using a finite state machine, which is flexible to insert new function states or update the current ones. We first propose a luminance-based measurement for detecting scene changes. It evaluates the mean value of the picture luminance and is quite reliable. Next, we consider the local object motion problem, where the pictures change the contents somewhat but not the focus position. We propose new metrics and thresholds to solve this local motion problem. The results are reasonably successful. Yet the third problem is the zoom tracking. We design the zoom tracking table that predicts the focus position with the zoom position. We also consider the delay effect in the system. Finally, we construct an overall system that integrates all the above into it. We take some experimental
results to verify our algorithm. Our dynamic auto-focusing algorithm can handle these problems pretty well.
6.2 Future Work
There are still many research topics for future work.
Real-time implementation
Our experiment is only an offline simulation because of the simulation environment limit. A real-time system can easily verify the algorithm directly and helps adjusting the algorithms.
Robust focus value metrics
In chapter 3, we introduce a few metrics and this topic is quite popular in the current auto-focusing research literature. Although we do not put emphasis on this part, it still plays an important role in the auto-focusing system.
A complete 3A system
Auto-focus is a part of the 3A algorithm. Both Auto white balance and auto exposure have a certain amount of impact on auto-focusing. Therefore, it is desirable to design a complete 3A system for digital cameras.
References
[1] J. -S. Lee, Y. –Y. Jung, B. –S. Kim, and S. –J. Ko, “An advanced video camera system with robust AF, AE, and AWB control,” IEEE Transactions on Consumer Electronics, Vol. 47, No. 3, pp.694-699, Aug. 2001.
[2] Y. Lee, S. –L Jang, K. Chung, D. Lee, W. Kim, and C. –W. Lee, “A fuzzy-control processor for automatic focusing,” IEEE Transactions on Consumer Electronics, Vol. 40, No. 2, pp.138-144, May. 1994.
[3] http://www.wikipedia.com
[4] F. Li and H. Jin, “A fast auto-focusing method for digital still camera,” Proceedings of the Fourth International Conference on Machine Learning and Cybernetics, Guangzhou,
pp.5001-5005, Aug. 2005.
[5] D. –E. Seborg, T. –F. Edgar, and D. –A. Mellichamp, Process Dynamics and Control, second edition, Prentice Hall, 2002.
[6] C. -Y. Chen, C. -Y. Tseng, C. -H. Hung, I. -C. Yin, and S. -J. Wang, “Combinational AE-AF system with fuzzy climbing search servo,” Proceedings of SPIE-IS&T Electronic Imaging Vol. 6069, pp.60690B1-7, 2004.
[7] T. Okajima and K. Sugimoto, “Automatic focusing device of image pickup device and method of correcting zoom tracking curve,” U.S. Patent No. 6,624,851, Sanyo Electric Company, 2003.
[8] P. Hoad and J. Illingworth, “Automatic control of camera pan, zoom and focus for improving object recognition,” Fifth IEE International Conference on Image Processing and its Applications, No. 410, pp. 291-295, July. 1995.
[9] J. –S. Lee, S. –J. Ko, Y. Kim, and A. Morales, “A video camera system with adaptive zoom tracking,” International Conference on Consumer Electronics, pp. 56-57, June
2002.
[10] V. Peddogari and N. Kehtarnavaz, “A relational approach to zoom tracking for digital still cameras”, IEEE Trans on Consumer Electronics, Vol. 51, No. 4, Nov 2005.
[11] I. –S. Suh, “Apparatus and method for controlling a focus position for a digital still camera,” U.S. Patent No. 6,977,687, Samsung Techwin Co., 2005.
[12] W. Na, “Apparatus and method for controlling focus using adaptive filter,” U.S. Patent No. 6,545,715, Samsung Electronics Co., 2003.
[13] S. –E. Lee, J. –S. Park, and M. –K. Yeo, “Camera apparatus for detecting focus value engaged to output picture,” U.S. Patent No. 6,239,838, LG Electronics Inc., 2001.
[14] C. –M. Chen, C. –M. Hong, and H. –C. Chuang, ”Efficient auto-focus algorithm utilizing discrete difference equation prediction model for digital still cameras,” IEEE Transactions on Consumer Electronics, Vol. 52, No. 4, pp.1135-1143, Nov. 2006.
[15] J. –T. Huang, C. –H. Shen, S. –M. Phoong, and H. Chen, “Robust measure of image focus in the wavelet domain,” Proceedings of 2005 International Symposium on Intelligent Signal Processing and Communication Systems, pp.157-160, Dec. 2005.
[16] C. –H. Shen and H. Chen, “Robust focus measure for low-contrast images,”
International Conference on Consumer Electronics, 2006. ICCE '06. 2006 Digest of Technical Papers, pp.69-70, Jan. 2006.
[17] R. –C. Gonzalez and R. –E. Woods, Digital Imaging Processing, second edition, Prentice Hall, 2001.
[18] http://msdn2.microsoft.com/default.aspx
[19] J. He, R. Zhou, and Z. Hong, “Modified fast climbing search auto-focus algorithm with adaptive step size searching technique for digital camera,” IEEE Transactions on Consumer Electronics, Vol. 49, No. 2, pp.257-262, May 2003.
[20] K. –Ooi etc. “An advanced autofocus system for video camera using quasi condition reasoning,” IEEE Trans. an Consumer Electronics, Vo1.36, No.3, pp526-530, Aug. 1990
作者簡歷
林耀仚,男,民國七十三年八月二十四日出生於台北市。民國九十五年二月畢業於國立 交通大學電子工程學系。同年進入國立交通大學電子研究所碩士班就讀。從事影像處理 相關的研究。