Application Notes

APN02V10-0892

Introduction
Fuzzy Inference
Objective
Definition of Input/Output Variables
Fuzzy Rules
Source Code of FIU
Input/Output Response
Comments


Automatic Focusing System

INTRODUCTION

Cameras with automatic focusing systems usually measure the distance to the center of a finder's view. This method, however, is inaccurate when the object of interest is not at the center of the view (Figure 1). Measuring more than one distance is an approach that may solve this problem. The following example shows the application of fuzzy inference as a means of automatically determining correct focus distance.

 Figure 1 Center Based Focusing

Back to Top

FUZZY INFERENCE

Objective

Determine the object distance using three distance measures for an automatic camera focusing system.

Back to Top

Definition of Input/Out Variables

Inputs to the FIU (Fuzzy Inference Unit) are three distance measures at left, center and right points in the finder view. Outputs are the plausibility values associated with these three points (Figure 2). The point with the highest plausibility is deemed to be the object of interest. Its distance is then forwarded to the automatic focusing system.

 Figure 2a Three Distance Measures

  

 Figure 2b Fuzzy Inference Unit

Each input variable, representing distance, has three labels: Near, Medium, and Far. Each output variable, representing plausibility, has four labels: Low, Medium, High, and VeryHigh. Membership functions corresponding to these labels are shown in Figures 3a and 3b.

 Figure 3a Labels and Membership Functions of Input Distance

 

 Figure 3b Labels and Membership Functions of Output Plausibility

Back to Top

Fuzzy Rules

The guiding principle for establishing rules of this automatic focusing system is that the likelihood of an object being at medium distance (typically 10 meters) is high, and becomes very low as distance increases (say, more than 40 meters).

Back to Top

To Source Code of Fuzzy Inference Unit

Input/Output Response

Now let us compile the FIU source code given above and use the FIDE analyzer to see how this unit works. Figures 4a and 4b provides two input/output response surfaces of the FIU. From Figure 4a, we see that Plausibility_of_Center becomes high when the distance at the center is around 10 meters, a distance we defined to be Medium in the definition of input variables. It becomes lower when the distance increases, especially when the distance on the left is Medium. Figure 4b shows the Plausibility_of_Left is high when the distance on the left is around 10 meters, except in the case when the distance at the center is also around 10 meters. In this case, when the distance at the center is about the same as that on the left, we choose center as the desired object. The Plausibility_of_Right is similar to the Plausibility_of_Left. The three outputs of the FIU are compared to identify the point with highest plausibility. The distance at this point is the focus distance.

By adjusting the membership functions of the distance labels, we can achieve different response surfaces for different purposes.

 Figure 4a I/O Response : Plausibility_of_Center

 

 Figure 4b I/O Response : Plausibility_of_Left

 Back to Top

COMMENTS

Remember that this example is provided only for easy-to-use compact cameras targeted for the mass market. For professional photographers it may be inappropriate to provide strictly automatic camera focusing using the three distance measures method. However, if suitable manual overrides were available, it would still be useful as an option in some situations (e.g. when speed is important). Besides automatic focusing(AF), fuzzy logic can be used in automatic exposure(AE) and automatic zooming(AZ). For AE and AZ, the input/output variables and rules of FIU will be different from those shown above for AF, but the design process is very similar.

 Back to Top

 For Further Information Please Contact:

 Aptronix Incorporated
2040 Kington Place
Santa Clara, CA 95051
Tel (408) 261-1898
Fax (408) 490-2729
FuzzyNet http://www.aptronix.com/fuzzynet
Email: fuzzynet@aptronix.com

Back to Home 


Weijing Zhang, Applications Engineer.
Copyright © 1992 by Aptronix Inc.
Revised: October 21, 1996.