TWI454940B - Method for designining fuzzy membership functions of of fuzzy controller auto focus - Google Patents

Method for designining fuzzy membership functions of of fuzzy controller auto focus Download PDF

Info

Publication number
TWI454940B
TWI454940B TW100103399A TW100103399A TWI454940B TW I454940 B TWI454940 B TW I454940B TW 100103399 A TW100103399 A TW 100103399A TW 100103399 A TW100103399 A TW 100103399A TW I454940 B TWI454940 B TW I454940B
Authority
TW
Taiwan
Prior art keywords
fuzzy
language
attribution function
autofocus
designing
Prior art date
Application number
TW100103399A
Other languages
Chinese (zh)
Other versions
TW201232291A (en
Inventor
Chung Feng Kuo
Chin Hsun Chiu
Original Assignee
Univ Nat Taiwan Science Tech
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Univ Nat Taiwan Science Tech filed Critical Univ Nat Taiwan Science Tech
Priority to TW100103399A priority Critical patent/TWI454940B/en
Publication of TW201232291A publication Critical patent/TW201232291A/en
Application granted granted Critical
Publication of TWI454940B publication Critical patent/TWI454940B/en

Links

Description

用於自動對焦之模糊控制器的模糊歸屬函數的設計方法Design method of fuzzy attribution function for fuzzy controller of autofocus

本發明係與一種自動對焦方法有關,特別係與一種用於自動對焦之模糊控制器之歸屬函數設計方法有關。The present invention relates to an autofocus method, and more particularly to a home function design method for a fuzzy controller for autofocus.

自動對焦技術係被廣泛運用於數位相機領域中,而對焦的快慢在消費者考慮購買相機的理由中佔有很大的因素。一般習知的自動對焦的步驟是將擷取到之數位影像,透過電腦計算其清晰度後,再做為自動對焦控制器改變焦距或物距之依據,以呈現最清楚之影像。Autofocus technology is widely used in the field of digital cameras, and the speed of focusing is a big factor in the reasons consumers consider buying a camera. The conventional autofocus step is to take the digital image captured, calculate the sharpness through the computer, and then use the autofocus controller to change the focal length or object distance to present the clearest image.

請參照第1圖,第1圖為習知技術之鏡頭對焦方式示意圖。以下介紹現今自動對焦之搜尋方法,全域搜尋法是採用最小步距做全域性之清晰度值搜尋,全域全部搜尋完後鏡頭再回到清晰度值最大之點,以完成對焦。二分搜尋法是一開始採用大步距做搜尋,一旦搜尋到清晰度值小於前一次時,則回頭採用一半的步距搜尋,如此反覆搜尋達到對焦之目的。規則式搜尋法則為取兩點之清晰度值差做固定移動間距的比例,當其差值越大時移動步距越大,反之則縮減步距,最後在回到清晰度值最大之點。Please refer to FIG. 1 , which is a schematic diagram of a lens focusing method according to a conventional technique. The following describes the current auto-focusing search method. The global search method uses the minimum step size to perform the global-wide sharpness value search. After all the search is completed, the lens returns to the point where the sharpness value is the largest to complete the focus. The binary search method is to start searching with a large step. Once the search for the sharpness value is less than the previous time, the search is repeated with half of the step search, so that the search for the focus is repeated. The rule-based search rule is to take the ratio of the difference value of the two points to the fixed moving distance. When the difference is larger, the moving step is larger, otherwise the step is reduced, and finally, the point where the sharpness value is maximum is returned.

然而,上述方法皆屬於採用定量移動的方式,由於擷取過多影像,造成計算量龐大,或者鏡頭必須來回伸縮移動,藉以縮小搜尋間距,導致總移動距離過大,皆為費時,故自動對焦搜尋技術仍有改善空間。However, the above methods all belong to the method of quantitative movement. Because of the excessive amount of images captured, the calculation amount is huge, or the lens must be moved back and forth, so as to narrow the search pitch, and the total moving distance is too large, which is time consuming, so the auto focus search technology There is still room for improvement.

因此,有人提出了利用智慧型控制理論之模糊理論來設計自動對焦系統之控制器,以改善上述對焦次數過多的問題。台灣專利公開第200712594號揭露可將輸入的信號模糊化之模糊化裝置,再將模糊化的值輸入具有推 論規則的推論引擎庫,然後再將推論值解模糊化至對應的輸出裝置,並藉以控制會使得鏡頭移動的馬達。Therefore, it has been proposed to use the fuzzy theory of intelligent control theory to design the controller of the autofocus system to improve the above-mentioned problem of too many focus times. Taiwan Patent Publication No. 200712594 discloses a fuzzing device capable of blurring an input signal, and then inputting the fuzzified value with a push On the rule inference engine library, then the inference value is defuzzified to the corresponding output device, and the motor that will make the lens move is controlled.

請參考第2圖,第2圖為現有模糊控制器之架構方塊圖。第2圖中的標號100是代表習知的模糊控制器(Fuzzy Controller),模糊控制器100包括模糊化機構(Fuzzifier)120、模糊規則庫(Fuzzy Rule Base)140、模糊推論引擎(Fuzzy Inference Engine)160、及解模糊化機構(Defuzzifier)180。模糊化機構120係用於將外界的輸入資料(例如前述的清晰度值)轉化成適當的模糊化資訊,其通常係利用歸屬函數(Membership function)來將該輸入資料,轉換成模糊計算可以接受的模糊量,例如語言項。模糊推論引擎160則是模糊控制器100的核心,其會根據所得到的模糊資訊以及在模糊規則庫140中預先存放解決問題所需的模糊規則,並模擬人類思考決策的方式,來解決問題。最後解模糊化機構180則會將模糊推論引擎160所推論出的模糊資訊,轉化為外界所能接受的明確資訊,例如鏡頭馬達移動所需得電壓或移動位置等。Please refer to Figure 2, which is a block diagram of the architecture of the existing fuzzy controller. The reference numeral 100 in FIG. 2 represents a conventional fuzzy controller. The fuzzy controller 100 includes a fuzzifier 120, a fuzzy rule base 140, and a fuzzy inference engine (Fuzzy Inference Engine). 160, and Defuzzifier 180. The fuzzification mechanism 120 is configured to convert external input data (such as the aforementioned sharpness value) into appropriate fuzzification information, which is usually converted into a fuzzy calculation by using a membership function. The amount of blur, such as a language item. The fuzzy inference engine 160 is the core of the fuzzy controller 100, which solves the problem according to the obtained fuzzy information and pre-stores the fuzzy rules needed to solve the problem in the fuzzy rule base 140, and simulates the way human thinking decisions are made. Finally, the defuzzification mechanism 180 converts the fuzzy information inferred by the fuzzy inference engine 160 into clear information that is acceptable to the outside world, such as the voltage or moving position required for the lens motor to move.

惟,模糊控制器之歸屬函數都係以試誤法(Try and Error)來進行設計,其常常需要耗費大量時間,且得出之歸屬函數亦無法確定可以達到最佳效果,往往使得自動對焦所耗費時間仍然太久。However, the fuzzy controller's attribution function is designed with Try and Error, which often takes a lot of time, and the resulting attribution function can not be determined to achieve the best results, often making the auto focus It takes too long.

有鑑於此,有必要對現有技術進行改良,以克服習知技術中的缺點。In view of this, it is necessary to improve the prior art to overcome the shortcomings of the prior art.

本發明之目的在於提供一種模糊歸屬函數的設計方法,其係利用田口方法(Taguchi method)並配合基因演算法來進行歸屬函數之最佳化設計,以獲得自動對焦系統之模糊控制器的最佳歸屬函數之組合,進而解決上述問 題。The object of the present invention is to provide a method for designing a fuzzy attribution function, which utilizes the Taguchi method and a genetic algorithm to optimize the attribution function to obtain the best fuzzy controller of the autofocus system. Combination of attribution functions to solve the above problem question.

為達成上述之目的,本發明提供一種用於自動對焦之模糊歸屬函數的設計方法,其係用於設計自動對焦之模糊控制器的歸屬函數,其包括下列步驟: (A)選定複數個第一語言項、複數個第二語言項以及複數個第三語言項;(B)選定該些第二語言項以及該些第三語言項之各別對應的複數個水準值;(C)建立該些水準值之一田口直交表;(D)根據該田口直交表進行實驗以得出複數個實驗結果,並計算各該些實驗結果之各別的信號雜音比;(E)根據該些信號雜音比來計算出對應該些第二語言項及該些第三語言項之一回應表;以及(F)根據該回應表來選擇該些第二語言項各別對應的該些水準值之一者,以及該些第三語言項各別對應的該些水準值之一者,以作為歸屬函數之複數個參數。To achieve the above object, the present invention provides a method for designing a fuzzy attribution function for autofocus, which is used to design a home function of a fuzzy controller for autofocus, which includes the following steps: (A) selecting a plurality of first language items, a plurality of second language items, and a plurality of third language items; (B) selecting a plurality of levels corresponding to the second language items and the respective third language items (C) establish one of the level values of the Taguchi orthogonal table; (D) conduct an experiment according to the Taguchi orthogonal table to obtain a plurality of experimental results, and calculate respective signal to noise ratios of the respective experimental results; E) calculating, according to the signal noise ratios, a response table corresponding to one of the second language items and the third language items; and (F) selecting, according to the response table, the respective corresponding corresponding to the second language items. One of the level values, and one of the level values corresponding to the third language items, respectively, is used as a plurality of parameters of the attribution function.

在步驟A中包括建立一模糊規則庫,在步驟A中尚包括建立一模糊規則庫,以建立輸入至輸出所對應的規則。具體來說,即為建立將該些第一語言項與該些第二語言項之結合映射至該些第三語言項的規則。具體而言,該些第一語言項係對應一清晰度值,該些第二語言項係對應一清晰度值變化量,而該些第三語言項則對應於一鏡頭焦距變化量。In step A, a fuzzy rule base is established, and in step A, a fuzzy rule base is further included to establish a rule corresponding to the input to the output. Specifically, a rule for mapping the combination of the first language items and the second language items to the third language items is established. Specifically, the first language items correspond to a sharpness value, and the second language items correspond to a sharpness value change amount, and the third language items correspond to a lens focal length change amount.

在一較佳實施例中,該些第一語言項各為近似零、正小及正大等等數值,該些第二及第三語言項各為負大、負小、近似零、正小及正大等等數值。據此,該田口直交表係為L18 (21 ×37 )直交表,並且該些實驗結果係為平均對焦次數。此外,各個該些實驗結果之各別的信號雜音比之計算,係根據望小特性公式來進行。需注意的是,在步驟F中係選擇該回應表中數值 較大者所對應之水準值以作為歸屬函數之參數。In a preferred embodiment, the first language items are each a value of approximately zero, a small and a positive, and the second and third language terms are each negative, negative, approximately zero, positive, and Zhengda and so on. Accordingly, the Taguchi straight line table is an L 18 (2 1 × 3 7 ) orthogonal table, and the results of these experiments are the average number of focusing times. In addition, the calculation of the respective signal murmur ratios of the results of the respective experiments is performed according to the formula of the small characteristic. It should be noted that in step F, the level value corresponding to the larger value in the response table is selected as the parameter of the attribution function.

除此之外,步驟F之後進一步包括步驟G:對該些參數進行一基因演算法,其中包括複製、交配及突變步驟。In addition to this, step F further comprises a step G of performing a genetic algorithm on the parameters, including replication, mating and mutation steps.

依據本發明之用於自動對焦之模糊歸屬函數的設計方法,可解決習知使用試誤法所得出之歸屬函數無法最佳化的缺點。透過田口直交表以該些水準值進行實驗,以求得各別的信號雜音比。最後再透過建立回應表,並根據回應表中數值較大者,所對應之水準值以作為歸屬函數之參數。另外透過基因演算法對該些參數進行更精確的計算,以對歸屬函數之參數做出最佳化。透過此方法所設計出之自動對焦控制器,可達到快速擷取清晰影像之目的。According to the design method of the fuzzy attribution function for autofocus according to the present invention, the disadvantage that the attribution function obtained by the trial and error method cannot be optimized can be solved. Experiments were conducted at these level values through the Taguchi Direct Meter to obtain individual signal to noise ratios. Finally, through the establishment of the response table, and according to the larger value in the response table, the corresponding level value is used as the parameter of the attribution function. In addition, these parameters are more accurately calculated by the genetic algorithm to optimize the parameters of the attribution function. The autofocus controller designed by this method can achieve fast capture of clear images.

為讓本發明之上述內容能更明顯易懂,下文特舉較佳實施例,並配合所附圖式,作詳細說明如下。In order to make the above description of the present invention more comprehensible, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings.

以下將配合附圖來詳細說明本發明之模糊歸屬函數的設計方法的一較佳實施例。本方法係較佳地用於設計自動對焦之模糊控制器之歸屬函數,然而本發明並不限於此,本方法亦可用於設計其他應用模糊理論之模糊控制器,所具有的歸屬函數。請參照第3圖,第3圖繪示本發明的較佳實施例之模糊歸屬函數的設計方法之流程圖;該方法開始於步驟S10。A preferred embodiment of the method for designing the fuzzy attribution function of the present invention will be described in detail below with reference to the accompanying drawings. The method is preferably used to design the attribution function of the fuzzy controller of the autofocus. However, the present invention is not limited thereto, and the method can also be used to design other fuzzy functions of the fuzzy theory, which has a attribution function. Referring to FIG. 3, FIG. 3 is a flow chart showing a method for designing a fuzzy attribution function according to a preferred embodiment of the present invention; the method begins in step S10.

請參照第4圖,第4圖繪示一清晰度值、一清晰度值變化量,以及一鏡頭焦距變化量之歸屬函數。在此較佳實施例中,定義該清晰度值、該清晰度值變化量,以及該鏡頭焦距變化量之歸屬函數,分別為各為三角形之歸屬函數MTF 10、歸屬函數dMTF 20及歸屬函數Output 30,且歸屬度為1。 此外,定義兩個輸入變數為該清晰度值及該清晰度值變化量,並定義輸出為該鏡頭焦距變化量。Referring to FIG. 4, FIG. 4 illustrates a definition value of a sharpness value, a sharpness value change, and a lens focal length change amount. In the preferred embodiment, the definition value, the change amount of the sharpness value, and the attribution function of the focal length change of the lens are defined as a belonging function MTF 10, a belonging function dMTF 20, and a attribution function Output, respectively. 30, and the degree of attribution is 1. In addition, two input variables are defined as the sharpness value and the sharpness value change amount, and the output is defined as the lens focal length change amount.

在步驟S10中,選定複數個第一語言項、複數個第二語言項及複數個第三語言項。具體而言,該些第一語言項係對應於該清晰度值,該些第二語言項係對應於該清晰度值變化量,而該些第三語言項則對應於該鏡頭焦距變化量。簡言之,該清晰度值、該清晰度值變化量係透過上述模糊化機構120進行模糊化。其中因清晰度值並無負值,因此選定清晰度值對應之該些第一語言項各為近似零(Approximately Zero,ZR)、正小(Positive small,PS)及正大(Positive Big,PB),其中ZR代表最不清楚、PS代表稍微清楚、PB代表十分清楚。而選定清晰度值變化量對應之該些第二語言項各為負大(Negative Big,NB)、負小(Negative Small,NS)、近似零ZR、正小PS及正大PB,其中ZR代表變化量最小、NB代表變化量為較大負值、NS代表變化量為較小負值、PB代表變化量為較大正值、PS代表變化量為較小正值。而選定鏡頭焦距變化量所對應之該些第三語言項,則各為負大NB、負小NS、近似零ZR、正小PS及正大PB,其中ZR代表需移動的步距最小、NB代表需移動的步階為反方向大步距、NS代表需移動的步階為反方向小步距、PB代表需移動的步階為正方向大步距、PS代表需移動的步階為正方向小步距。In step S10, a plurality of first language items, a plurality of second language items, and a plurality of third language items are selected. Specifically, the first language items correspond to the sharpness value, the second language items correspond to the sharpness value change amount, and the third language items correspond to the lens focal length change amount. In short, the sharpness value and the sharpness value change amount are blurred by the blurring means 120. Since the resolution value has no negative value, the first language terms corresponding to the selected sharpness value are each approximately zero (Approximately Zero, ZR), Positive small (PS), and Positive Big (PB). , where ZR stands for the least, PS stands for a little clarity, and PB stands for it. The second language terms corresponding to the selected change in the value of the sharpness value are negative Big (NB), Negative Small (NS), approximate zero ZR, positive small PS, and Zhengda PB, wherein ZR represents a change. The minimum amount, NB represents the larger negative value, NS represents the smaller negative value, PB represents the larger positive value, and PS represents the smaller positive value. The third language terms corresponding to the selected focal length change of the lens are negative NB, negative small NS, approximate zero ZR, positive small PS and positive large PB, wherein ZR represents the minimum step size to be moved, and NB represents The steps to be moved are the large step in the opposite direction, the step in which NS represents the moving step is the small step in the opposite direction, the step in which PB represents the moving step is the large step in the positive direction, and the step in which PS represents the moving direction is the positive direction. Small step.

請參考第5圖,第5圖為本發明較佳實施例之一模糊規則庫。在步驟S10中尚包括建立一模糊規則庫,該模糊規則庫係用以建立輸入至輸出所對應的複數條規則,該輸入藉由該些規則而產生輸出(即輸入經過模糊推論引擎作用後而產生的模糊語言項)。在此則為建立將該些第一語言項與該些 第二語言項結合之輸入值映射至該些第三語言項之規則。在此較佳實施例中,該模糊規則庫表示兩輸入變數(該歸屬函數MTF 10及該歸屬函數dMTF 20)輸出至該歸屬函數Output 30的規則,其中該些下標僅代表規則的標號。 舉例而言,當輸入之歸屬函數MTF 10之第一語言項為PB且歸屬函數dMTF 20之第二語言項為NS時,則輸出之歸屬函數Output 30之第三語言項為該模糊規則庫之第2條規則,即ZR2 。以白話來說,即當該清晰度值十分清楚(PB),且該清晰度值的變化量不大(NS),則下一步鏡頭變化量應為接近零(ZR)時,即已十分靠近焦點。Please refer to FIG. 5, which is a fuzzy rule base according to a preferred embodiment of the present invention. In step S10, a fuzzy rule base is further included, which is used to establish a plurality of rules corresponding to the input to the output, and the input generates an output by using the rules (ie, the input is subjected to the fuzzy inference engine) The resulting fuzzy language item). Here, a rule for mapping the input values of the first language items combined with the second language items to the third language items is established. In the preferred embodiment, the fuzzy rule base represents a rule for outputting two input variables (the attribution function MTF 10 and the attribution function dMTF 20) to the attribution function Output 30, wherein the subscripts only represent the labels of the rules. For example, when the first language item of the input attribution function MTF 10 is PB and the second language item of the attribution function dMTF 20 is NS, the third language item of the output attribution function Output 30 is the fuzzy rule base. Rule 2, ie ZR 2 . In vernacular, when the sharpness value is very clear (PB) and the change in the sharpness value is not large (NS), the next shot change should be close to zero (ZR), ie it is very close focus.

在步驟S20中,選定該些第二語言項及該些第三語言項所各別對應的複數個水準值。具體而言,即選定清晰度值變化量dMTF 20與鏡頭焦距變化量Output 30之NB、NS、PS及PB為控制因子,其餘為固定值。為清楚表示其等係各以控制因子A至H表示之。如第4圖所示,在此較佳實施例中,第一語言項之ZR、PS及PB之參數值係固定為0.3、0.6及0.9,而第二語言項之ZR與第三語言項之ZR之參數固定為0。然而,本發明並不限於此種選定方式。第6圖為本發明較佳實施例所選定之複數個水準值,請參考第6圖。舉例而言,該些控制因子之該些水準值選定係如第6圖所示。In step S20, a plurality of level values corresponding to the second language items and the third language items are selected. Specifically, NB, NS, PS, and PB of the selected sharpness value change amount dMTF 20 and the lens focal length change amount Output 30 are control factors, and the rest are fixed values. In order to clearly indicate that they are each represented by control factors A to H. As shown in FIG. 4, in the preferred embodiment, the parameter values of the ZR, PS, and PB of the first language item are fixed to 0.3, 0.6, and 0.9, and the ZR of the second language item and the third language item are The ZR parameter is fixed to zero. However, the invention is not limited to this selected mode. Figure 6 is a plurality of level values selected in accordance with a preferred embodiment of the present invention. Please refer to Figure 6. For example, the level values of the control factors are selected as shown in FIG. 6.

在步驟S30中,建立該些水準值之一田口直交表(Orthogonal array)。第7圖為本發明的較佳實施例之該些水準值的田口直交表。請參考第7圖,在此較佳實施例中,該田口直交表係選用L18 (21 ×37 )直交表,其中下標18代表進行18組實驗,上標表示控制因子個數(此即為第二語言項與第三語言項之NB、NS、PS及PB共8個),數字則代表控制因子之水準值的個數。In step S30, one of the level values is established as an Orthogonal array. Figure 7 is a diagram of the Taguchi orthogonal table of the level values of the preferred embodiment of the present invention. Please refer to FIG. 7. In the preferred embodiment, the field line orthogonal table adopts an L 18 (2 1 × 3 7 ) orthogonal table, wherein the subscript 18 represents 18 sets of experiments, and the superscript indicates the number of control factors ( This is 8 of the NB, NS, PS and PB of the second language item and the third language item, and the number represents the number of the level of the control factor.

在步驟S40中,根據該田口直交表進行實驗以得出複數個實驗結果, 並計算各該些實驗結果之各別的信號雜音比(Signal Noise Ratio,S/N Ratio)。在此較佳實施例中,該些實驗結果係為平均對焦次數,即帶入該田口直交表之參數所選定之該歸屬函數MTF 10、該歸屬函數dMTF 20及該歸屬函數Output 30後,利用此模糊控制器進行對焦實驗,並將對焦完成所需之次數加以平均。此外,並根據望小(Smaller the better)特性公式來計算該各該些實驗結果之各別的S/N比。In step S40, an experiment is performed according to the Taguchi orthogonal table to obtain a plurality of experimental results, And calculate the respective Signal Noise Ratio (S/N Ratio) of each of the experimental results. In the preferred embodiment, the experimental results are the average number of focusing times, that is, the attribution function MTF 10 selected by the parameters of the field intersection table, the attribution function dMTF 20, and the attribution function Output 30 are utilized. This fuzzy controller performs a focus experiment and averages the number of times the focus is completed. In addition, the respective S/N ratios of the respective experimental results are calculated according to the Smaller the Better characteristic formula.

在步驟S50中,根據該些信號雜音比來計算出對應於該些第二語言項及該些第三語言項之一回應表。具體而言,此即是利用S/N比之特性,來求得品質特性之平均最佳值及最小變異數,S/N比越大,其損失越小,則代表此參數水準組合及品質特性是最佳的。請參照第8圖,第8圖是根據第7圖之S/N比所計算出之回應表。In step S50, a response table corresponding to the second language items and the third language items is calculated according to the signal noise ratios. Specifically, this is to use the characteristics of the S/N ratio to obtain the average optimal value and the minimum variation of the quality characteristics. The larger the S/N ratio, the smaller the loss, the level combination and quality of the parameter. The characteristics are optimal. Please refer to Fig. 8. Fig. 8 is a response table calculated according to the S/N ratio of Fig. 7.

在步驟S60中,根據該回應表選擇該些第二語言項所各別對應之該些水準值之一者,以及該些第三語言項所各別對應之該些水準值之一者,以作為歸屬函數之複數個參數。具體而言,如第8圖所示,控制因子A之水準值1係較水準值2更大,因此控制因子A係被選定為水準值1,即歸屬函數dMTF 20之NB為-0.18。控制因子B之水準值1係較水準值2與3更大,因此控制因子B係被選定為水準值1,即歸屬函數dMTF 20之NS為-0.1。同理,歸屬函數dMTF 20之PS及PB各為0.08及0.23。相同地,歸屬函數Output 30之NB、NS、PS及PB各為-20、-15、20及40。In step S60, selecting one of the level values corresponding to each of the second language items according to the response table, and one of the level values corresponding to each of the third language items, A plurality of parameters as a attribution function. Specifically, as shown in FIG. 8, the level value 1 of the control factor A is larger than the level value 2, so the control factor A is selected as the level value 1, that is, the NB of the attribution function dMTF 20 is -0.18. The level value 1 of the control factor B is greater than the level values 2 and 3, so the control factor B is selected as the level value 1, i.e., the NS of the attribution function dMTF 20 is -0.1. Similarly, the PS and PB of the attribution function dMTF 20 are 0.08 and 0.23, respectively. Similarly, the NB, NS, PS, and PB of the attribution function Output 30 are -20, -15, 20, and 40, respectively.

據此,由本發明之較佳實施例所設計的歸屬函數則將如第9圖所示,第9圖繪示本發明的較佳實施例之設計方法所設計出的歸屬函數。即根據上述所選擇出之第二語言項及第三語言項之水準值,來重新設計出歸屬函 數dMTF 20及歸屬函數Output 30,並透過具有此歸屬函數之模糊控制器而可以達到快速對焦之目的。Accordingly, the attribution function designed by the preferred embodiment of the present invention will be as shown in FIG. 9, and FIG. 9 illustrates the attribution function designed by the design method of the preferred embodiment of the present invention. That is, the attribution letter is redesigned according to the level values of the selected second language item and the third language item. The number dMTF 20 and the attribution function Output 30, and through the fuzzy controller having this attribution function, can achieve the purpose of fast focusing.

值得注意的是,本發明所設計出之第二語言項及第三語言項之水準值,還可進行本領域技術人員所熟悉之基因演算法的處理流程,其中基因演算法所包括之複製、交配及突變步驟,在此則不予贅述。透過此基因演算法使得該些參數還可進行更進一步的微調,以達歸屬函數的最佳化設計。It should be noted that the level values of the second language item and the third language item designed by the present invention can also be processed by a genetic algorithm familiar to those skilled in the art, wherein the genetic algorithm includes the copying, Mating and mutation steps are not described here. Through this gene algorithm, these parameters can be further fine-tuned to achieve the optimal design of the attribution function.

除此之外,本發明還揭露一種自動對焦之模糊控制器,其包括上述設計方法所設計出之歸屬函數,以使得運用該些歸屬函數之模糊控制器的自動對焦控制器之性能可達到最好的效果,進而使鏡頭對焦所移動的次數可達到最少,進而克服了習知用試誤法產生的歸屬函數所造成的自動對焦時間仍然太久的缺點。In addition, the present invention also discloses an autofocus fuzzy controller, which includes a attribution function designed by the above design method, so that the performance of the autofocus controller of the fuzzy controller using the attribution functions can reach the maximum The good effect, in turn, minimizes the number of times the lens is moved, thereby overcoming the shortcomings of the autofocus time caused by the attribution function generated by the trial and error method.

綜上所述,本發明之模糊歸屬函數的設計方法可解決習知使用試誤法所得出之歸屬函數無法最佳化的缺點。透過田口直交表以該些選定的水準值進行實驗,以求得各別的信號雜音比,其可作為量測系統的品質特性。S/N比最大者,為最佳之參數水準組合,在此參數水準下所產製的產品,其損失最少,變異性最小。最後再透過建立回應表,根據回應表中數值較大者所對應之水準值作為歸屬函數之參數。另外透過基因演算法對該些參數進行更精確的計算,以對歸屬函數之參數做出最佳化。透過此方法設計出之自動對焦控制器,將可達到快速擷取清晰影像之目的。In summary, the design method of the fuzzy attribution function of the present invention can solve the disadvantage that the attribution function obtained by the trial and error method cannot be optimized. Experiments were conducted with the selected level values through the Taguchi Direct Meter to obtain individual signal-to-noise ratios that can be used as quality characteristics of the measurement system. The S/N ratio is the best, which is the best combination of parameters. The products produced under this parameter level have the least loss and the smallest variability. Finally, through the establishment of the response table, the level value corresponding to the larger value in the response table is used as the parameter of the attribution function. In addition, these parameters are more accurately calculated by the genetic algorithm to optimize the parameters of the attribution function. The autofocus controller designed by this method will achieve the purpose of quickly capturing clear images.

雖然本發明已用較佳實施例揭露如上,然其並非用以限定本發明,本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾,因此本發明之保護範圍當視後附之申請專利範 圍所界定者為準。While the invention has been described above in terms of the preferred embodiments, the invention is not intended to limit the invention, and the invention may be practiced without departing from the spirit and scope of the invention. Retouching, so the scope of protection of the present invention is attached to the patent application The definition of the enclosure shall prevail.

10‧‧‧歸屬函數MTF10‧‧‧ attribution function MTF

20‧‧‧歸屬函數dMTF20‧‧‧ attribution function dMTF

30‧‧‧歸屬函數Output30‧‧‧ attribution function Output

100‧‧‧模糊控制器100‧‧‧Fuzzy controller

120‧‧‧模糊化機構120‧‧‧Fuzzy institutions

140‧‧‧模糊規則庫140‧‧‧Fuzzy Rule Base

160‧‧‧模糊推論引擎160‧‧‧Fuzzy inference engine

180‧‧‧解模糊化機構180‧‧‧Unfuzzification

S10‧‧‧步驟S10‧‧‧ steps

S20‧‧‧步驟S20‧‧‧ steps

S30‧‧‧步驟S30‧‧‧ steps

S40‧‧‧步驟S40‧‧‧ steps

S50‧‧‧步驟S50‧‧ steps

S60‧‧‧步驟S60‧‧ steps

S70‧‧‧步驟S70‧‧‧ steps

第1圖為習知技術之鏡頭對焦方式示意圖。FIG. 1 is a schematic diagram of a lens focusing mode of the prior art.

第2圖為現有模糊控制器之架構方塊圖。Figure 2 is a block diagram of the architecture of the existing fuzzy controller.

第3圖繪示本發明較佳實施例之模糊歸屬函數的設計方法的流程圖。FIG. 3 is a flow chart showing a method for designing a fuzzy attribution function according to a preferred embodiment of the present invention.

第4圖繪示一清晰度值、一清晰度值變化量及一鏡頭焦距變化量之歸屬函數。Figure 4 is a graph showing the attribution function of a sharpness value, a change in the sharpness value, and a change in the focal length of a lens.

第5圖為本發明較佳實施例之一模糊規則庫。Figure 5 is a fuzzy rule base of a preferred embodiment of the present invention.

第6圖為本發明較佳實施例之選定之複數個水準值。Figure 6 is a selection of a plurality of levels of values in accordance with a preferred embodiment of the present invention.

第7圖為本發明較佳實施例之該些水準值之田口直交表。Figure 7 is a top-of-the-line intersection of the level values of the preferred embodiment of the present invention.

第8圖是根據第7圖之S/N比所計算出之回應表。Figure 8 is a response table calculated from the S/N ratio of Figure 7.

第9圖繪示本發明之較佳實施例之設計方法所設計出之歸屬函數。Figure 9 is a diagram showing the attribution function designed by the design method of the preferred embodiment of the present invention.

S10‧‧‧步驟S10‧‧‧ steps

S20‧‧‧步驟S20‧‧‧ steps

S30‧‧‧步驟S30‧‧‧ steps

S40‧‧‧步驟S40‧‧‧ steps

S50‧‧‧步驟S50‧‧ steps

S60‧‧‧步驟S60‧‧ steps

S70‧‧‧步驟S70‧‧‧ steps

Claims (8)

一種用於自動對焦之模糊控制器的模糊歸屬函數的設計方法,其係用於設計自動對焦之模糊控制器之歸屬函數,其包括下列步驟:(A)選定複數個第一語言項、複數個第二語言項及複數個第三語言項,其中該些第一語言項係對應於一清晰度值,該些第二語言項係對應於一清晰度值變化量,並且該些第三語言項係對應於一鏡頭焦距變化量;(B)選定該些第二語言項及該些第三語言項所各別對應的複數個水準值;(C)建立該些水準值之一田口直交表;(D)利用該模糊控制器根據該田口直交表進行對焦實驗以得出複數個實驗結果,其中該些實驗結果係為平均對焦次數,並計算各該些實驗結果之各別的信號雜音比;(E)根據該些信號雜音比計算出對應於該些第二語言項及該些第三語言項之一回應表;以及(F)根據該回應表來選擇該些第二語言項所各別對應的該些水準值之一者,以及該些第三語言項所各別對應的該些水準值之一者,以作為歸屬函數之複數個參數。 A method for designing a fuzzy attribution function of a fuzzy controller for autofocus, which is used for designing a attribution function of an autofocus fuzzy controller, comprising the following steps: (A) selecting a plurality of first language items, a plurality of a second language item and a plurality of third language items, wherein the first language items correspond to a sharpness value, the second language items correspond to a sharpness value change amount, and the third language items Corresponding to a lens focal length change; (B) selecting a plurality of level values corresponding to the second language items and the third language items; (C) establishing one of the level values of the Taguchi orthogonal table; (D) using the fuzzy controller to perform a focusing experiment according to the Taguchi orthogonal table to obtain a plurality of experimental results, wherein the experimental results are average focusing times, and calculating respective signal to noise ratios of the respective experimental results; (E) calculating, according to the signal noise ratios, a response table corresponding to the second language items and the third language items; and (F) selecting the second language items according to the response table. Corresponding to these level values One of the plurality of standard values, and the plurality of third language item corresponding to respective one of those, as a plurality of parameters of the membership function. 如申請專利範圍第1項所述之用於自動對焦之模糊控制器的模糊歸屬函數的設計方法,其中該些第一語言項值係各為近似零、正小及正大,而該些第二及第三語言項值則各為負大、負小、近似零、正小及正大。 The method for designing a fuzzy attribution function of a fuzzy controller for autofocus according to claim 1, wherein the first language term values are approximately zero, positive, and positive, and the second And the third language term values are negative, negative, approximate zero, positive and positive. 如申請專利範圍第1項所述之用於自動對焦之模糊控制器的模糊歸屬函數的設計方法,其中步驟A中包括建立一模糊規則庫,其係用以將該些第一語言項與該些第二語言項之結合映射至該些第三語言項之規則。 The method for designing a fuzzy attribution function of a fuzzy controller for autofocus according to claim 1, wherein the step A includes establishing a fuzzy rule base for using the first language item and the The combination of the second language items maps to the rules of the third language items. 如申請專利範圍第2項所述之用於自動對焦之模糊控制器的模糊歸屬函數的設計方法,其中該田口直交表係為L18 (21 ×37 )直交表。The method for designing a fuzzy attribution function of a fuzzy controller for autofocus according to claim 2, wherein the Taguchi orthogonal table is an L 18 (2 1 × 3 7 ) orthogonal table. 如申請專利範圍第1項所述之用於自動對焦之模糊控制器的模糊歸屬函數的設計方法,其中計算該各該些實驗結果之各別的信號雜音比的步驟,係根據望小特性公式來進行。 The method for designing a fuzzy attribution function of a fuzzy controller for autofocus according to claim 1, wherein the step of calculating a respective signal noise ratio of each of the experimental results is based on a small characteristic formula Come on. 如申請專利範圍第1項所述之用於自動對焦之模糊控制器的模糊歸屬函數的設計方法,其中步驟F中係選擇該回應表中數值較大所對應之水準值作為歸屬函數之參數。 The method for designing a fuzzy attribution function for a fuzzy controller for autofocus according to claim 1, wherein in step F, a level value corresponding to a larger value in the response table is selected as a parameter of the attribution function. 如申請專利範圍第1項所述之用於自動對焦之模糊控制器的模糊歸屬函數的設計方法,進一步包括對該些參數進行一基因演算法,其包括複製、交配及突變步驟。 The method for designing a fuzzy attribution function for a fuzzy controller for autofocus according to claim 1, further comprising performing a genetic algorithm on the parameters, including a copying, mating, and a mutation step. 一種自動對焦之模糊控制器,其包括有如申請專利範圍第1項所述之方法所設計出之歸屬函數。 An autofocus fuzzy controller comprising a attribution function designed by the method of claim 1 of the patent application.
TW100103399A 2011-01-28 2011-01-28 Method for designining fuzzy membership functions of of fuzzy controller auto focus TWI454940B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW100103399A TWI454940B (en) 2011-01-28 2011-01-28 Method for designining fuzzy membership functions of of fuzzy controller auto focus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW100103399A TWI454940B (en) 2011-01-28 2011-01-28 Method for designining fuzzy membership functions of of fuzzy controller auto focus

Publications (2)

Publication Number Publication Date
TW201232291A TW201232291A (en) 2012-08-01
TWI454940B true TWI454940B (en) 2014-10-01

Family

ID=47069548

Family Applications (1)

Application Number Title Priority Date Filing Date
TW100103399A TWI454940B (en) 2011-01-28 2011-01-28 Method for designining fuzzy membership functions of of fuzzy controller auto focus

Country Status (1)

Country Link
TW (1) TWI454940B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI489396B (en) * 2013-03-01 2015-06-21 First Optotech Co Ltd Image structure analysis method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5566380A (en) * 1989-09-10 1996-10-15 Canon Kabushiki Kaisha Automatic focusing system with response control using fuzzy interference
TW201005416A (en) * 2008-07-21 2010-02-01 Univ Nat Changhua Education Fuzzy control device for zoom and autofocus aperture of video camera lens
TW201101814A (en) * 2009-06-26 2011-01-01 Nat Univ Chin Yi Technology Method of compensating for backlight image and photograph apparatus with backlight image compensation system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5566380A (en) * 1989-09-10 1996-10-15 Canon Kabushiki Kaisha Automatic focusing system with response control using fuzzy interference
TW201005416A (en) * 2008-07-21 2010-02-01 Univ Nat Changhua Education Fuzzy control device for zoom and autofocus aperture of video camera lens
TW201101814A (en) * 2009-06-26 2011-01-01 Nat Univ Chin Yi Technology Method of compensating for backlight image and photograph apparatus with backlight image compensation system

Also Published As

Publication number Publication date
TW201232291A (en) 2012-08-01

Similar Documents

Publication Publication Date Title
KR101488655B1 (en) Method and apparatus for auto focusing
CN109644230B (en) Image processing method, image processing apparatus, image pickup apparatus, and storage medium
CN109698901B (en) Automatic focusing method and device, storage medium and computer equipment
US8194995B2 (en) Fast camera auto-focus
Chung et al. Removing chromatic aberration by digital image processing
CN108600638B (en) Automatic focusing system and method for camera
JP6537083B2 (en) Method and imager for automatic focusing
Elamvazuthi et al. The application of Mamdani fuzzy model for auto zoom function of a digital camera
CN113747041A (en) Camera focusing method and focusing method based on recurrent neural network
Liang et al. BaMBNet: a blur-aware multi-branch network for dual-pixel defocus deblurring
KR20170101532A (en) Method for image fusion, Computer program for the same, and Recording medium storing computer program for the same
CN111242176A (en) Computer vision task processing method and device and electronic system
US20220076071A1 (en) Image processing method, image processing apparatus, learning method, learning apparatus, and storage medium
TWI454940B (en) Method for designining fuzzy membership functions of of fuzzy controller auto focus
CN112241940B (en) Fusion method and device for multiple multi-focus images
Sun et al. Combining Taguchi with fuzzy method on extended optimal design of miniature zoom optics with liquid lens
CN105959577A (en) Camera focusing method and apparatus
JP2019212132A (en) Image processing method, image processing apparatus, image capturing apparatus, program, and storage medium
CN112203023B (en) Billion pixel video generation method and device, equipment and medium
CN109727193B (en) Image blurring method and device and electronic equipment
US20090237553A1 (en) Digital photographing apparatuses, methods of controlling the same, and recording medium storing computer readable instructions for executing the methods
CN113763524A (en) Physical optical model and neural network-based dual-flow shot rendering method and system
Anikina et al. Detect to focus: Latent-space autofocusing system with decentralized hierarchical multi-agent reinforcement learning
JP7009219B2 (en) Image processing method, image processing device, image pickup device, image processing program, and storage medium
Zhu et al. The sparse least square support vector regression for estimating illumination chromaticity