TW200934226A - Image capturing device and auto-focus method - Google Patents

Image capturing device and auto-focus method

Info

Publication number
TW200934226A
TW200934226A TW97102859A TW97102859A TW200934226A TW 200934226 A TW200934226 A TW 200934226A TW 97102859 A TW97102859 A TW 97102859A TW 97102859 A TW97102859 A TW 97102859A TW 200934226 A TW200934226 A TW 200934226A
Authority
TW
Taiwan
Prior art keywords
motor
module
steps
sum
squares
Prior art date
Application number
TW97102859A
Other languages
Chinese (zh)
Other versions
TWI337498B (en
Inventor
Zhi-Hui Wen
Original Assignee
Hon Hai Prec Ind Co Ltd
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 Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Priority to TW97102859A priority Critical patent/TWI337498B/en
Publication of TW200934226A publication Critical patent/TW200934226A/en
Application granted granted Critical
Publication of TWI337498B publication Critical patent/TWI337498B/en

Links

Abstract

The present invention relates to an image capturing device. The image capturing device includes a lens module, a motor, a motor driving circuit and an auto-focus controlling software. The motor has a first step and a second step bigger than the first step, and the motor used the first step during auto-focus. The auto-focus controlling software includes a motor controlling module, a recording module, and a comparing module. The motor controlling module can control the motor driving the lens module by the motor driving circuit. The recording module is used for recording the number of the steps about the motor driving the lens module. The comparing module can compare the number with a pre-setting number predetermined in the comparing module. The comparing module will set the step of the motor as the second step when the number is no less than the pre-setting number. The comparing module will set the step as the first step when the number is less than the pre-setting number.

Description

200934226 九、發明說明: 【發明所屬之技術領域】 • 纟發明涉及-種拍攝裝置及其自動對焦方法。 【先前技術】 先前的多數拍攝農置,老 士 夏都具有自動對焦系統,同 時自動對焦系統的自動對隹、*危士 ^ 對焦速度直接影響所述拍攝 裝置之拍攝速度。 人們喜歡使用拍攝梦署 ❹機I 4 π 數位相機或數位攝像 機4來拍攝生活中有意蠤 pe缺二丄&丄 義之日T刻或某一個精彩瞬 間。然而,由於生活中之掊逢 ^ ^ 積才間是不可重現的,i言 【發明内容】 、速自動對焦亚進行拍攝。 把!有鑒於此’有必要提供一種能夠快速自動對隹之 拍攝裝置及其自動對焦方法。 自動對…、之 一種拍攝裝置,其能夠白 匕列自動對焦,該拍塭驻罢白 〇括一個鏡頭模組、—個啻 攝裝置Ο 個自動對隹护制單- 一固電機驅動電路和一 .Λ ^ ^ ^ 所述電機在驅動所述鏡頭掇组 攸热窮返到近距離自動對焦過程中,罝右 貝权 長與一個第-步# ”有一個第一步 長,並首先:用所过:斤述第一步長小於所述第二步 動對隹控制單元勺^ 長進行自動對焦,所述自 電機驅動電路$ % + 制杈鬼,用於通過所述 記釺^ 所述^ ‘㈣所述鏡頭hi數 ,塊’用於記錄所述電機驅動所述二f;且,步數 數,當從益窮遠5,丨& &動所述鏡碩模組之步 到近距離自動對焦時,所述步數增 7 200934226 加’當從近距離到無窮遠自動對焦時,所述步數減 小’比較模塊,用於將所述記錄之步數與存儲在所述 ’比較模塊中之一個預設步數比較,當所述記錄之步數 大於等於所述預設步數時,將所述電機之步長設置為 所述第二步長,當所述記錄之步數小於所述預設步數 時’將所述電機之步長設置為所述第一步長。 一種拍攝裝置之自動對焦方法,所述拍攝裝置包 括一個鏡頭模組和一個電機’所述電機驅動所述鏡頭 模組從無窮遠到近距離自動對焦過程中,具有一個第 一步長與一個第二步長,所述第一步長小於所述第二 步長’所述拍攝裝置内預設有一個預設步數,所述自 動對焦方法包括:控制所述電機,驅動所述鏡頭模組 以第一步長開始自動對焦;獲取所述電機驅動鏡頭模 組之步數;當所述步數大於等於所述預設步數時,將 所述電機之步長設置為所述第二步長,當所述記錄之 ❹步數小於所述預設步數時’將所述電機之步長設置為 所述第一步長’所述預設步數為預先設置於所述拍攝 裝置内之一個數值。 與先前技術比較’所述拍攝裝置能夠於從無窮遠 到近距離對焦過程中首先採用小步長即所述第一步 長進行對焦’於自動對焦初期’對焦距離隨著所述電 機驅動步數之增加變化非常明顯’故採用小步長不會 丟失最清晰之焦點位置;當所述電機驅動所述鏡頭模 組達到所述預設步數之後’將所述電機之步長設置為 大步長即所述第二步長,此時對焦距離之變化隨著所 8 200934226 戶斤以採用大步長能 述電機驅動步數之增加趨於緩慢 夠提高對焦速度。 【實施方式】 請參閱圖 D /、之拍攝裳置1之硬體 架構圖。所述拍攝裝置1能夠自動對焦,宜包括一: 鏡頭模組2、-個電機3、—個電機驅動電路4、— 個缓存5和一個自動對隹批制留_ 切7 “、、徑制早兀10。所述拍攝裴 置1可以為數位相機、數位攝像 ^ ^ 、 Ο 稱1豕機等。在本實施方式 中’其為一個數位相機。 所述電機3為步進電機,ι田& 乂电俄其用於驅動所述鏡頭模 組2進行自動對焦。所述電機驅動電路*,用於接收 所述自動對焦控制單元10之控制資訊,來控制所述 電機3。 所述鏡頭杈組2為一個能夠自動對焦之鏡頭模 組。在本實施方式中,所述鏡頭模組2具有一個影像 感測器’其為一個CCD,且該影像感測器具有自動 對焦模式,在啟動該自動對焦模式時,所述影像感測 器之感光區的有效感光區域會減小,這樣來減少自動 對焦時之訊號處理數量,可以起到加快自動對焦速度 之作用。 所述緩存5用於缓存資料’所述緩存5緩存有一 個對應於所述影像感測器感測之影像之累加平方 和。所述累加平方和為將所述拍攝裝置1感測到之圖 像的每一行晝素中,相鄰晝素之晝素值作差後,將差 值進行平方’再將該平方後之值進行累加得到每一行 9 200934226 之平方和’最後將每一行之平 個累加平方和。 和再進行累加得到一 請一併參閱圖1和圖2。 士忐拄的合准〜 所處鏡頭模組2於製作 疋成時,均會進仃測試,於測 拓雜命啻秘〇 、*或時均會得到一個對焦 距離與所述電機3驅動步數 伽r、图 之對應表’根據該表繪製 -個座標圖。如圖2所示,其 友 驅動步數,其縱細表示對隹表不所4電機3之 „ ,、、、距離。通過圖2會發現, © 一^功,所述電機3驅動所述鏡頭模組2 母步所一:之對焦距離之變化會非常明顯,故需 要小步長進行驅動,於自動料巷 H勒對焦之末期,所述電機3 驅動所述鏡頭模組2之每一丰^ ^ ^ 厶母 步所對應之對焦距離之 變化不明顯’故可以將所述電機3之步長設置較大— 些。 針對圖2所不現象,為所述電冑3設置二個步 長,分別為第-步長和第二步長,且所述第一步長小 ❹於所述第二步長。在自動對焦初期,所述電機3之步 長採用所述第一步長,而在自動對焦末期所述電機3 =步長採用所述第二步長,並且於所述自動對焦控制 單元10中預設一個預設步數作為分界點,當所述電 機3以所述第一步長驅動所述鏡頭模組2之步數達到 所述預設步數時’則將所述電機3之步長改為所述第 二步長。 可以理解’所述電機3之步長還可以設置三個、 四個或五個等等’並相應之設置複數個預設步數,但 只要其起到之作用與本發明相同或相似’均應涵蓋於 200934226 尽發明保護範圍内。 請-併參閱圖1# 制單元1〇之功能模 :3為所述自動對焦控 包括一個電機捭制n "動對焦控制單元工 屯恢徑制拉塊u、步數 丄〇 h、m 鬼14、差值平方運算模塊q : 累加運异模塊16、眘 /心升供噁15、 塊!8。 “4比較模塊I?以及-個判斷模 所述電機控制模塊丄丄,用於 電路4控制所述電機3驅動所 電機動監動 1電機控制模塊 通過控制所述電機驅動電路4,實現控制所述電機= 所述步數記錄模塊12用於記錄所述電機3 所述鏡頭模組2之步數,當從無窮遠到近距離自動對 焦時,所述步數增加,當從近距離到無窮遠自動對焦 時,所述步數減小。所述步數記錄模塊12為一個計 ❹數程式,當所述電機3驅動所述鏡頭模組2每移動一 步’所述步數記錄模塊12會相應增加計數或減少計 數。設所述電機3驅動所述鏡頭模組2從無窮遠處向 近距離自動對焦時’所述電機3驅動所述鏡頭模組2 移動方向為正向移動,相反則為反向移動。所述電機 3驅動所述鏡頭模組2正向移動一步,所述步數記錄 模塊12便會增加記錄之步數,相反地,所述電機3 每驅動所述鏡頭模組2反向移動一步,則所述步數記 錄模塊12會減少計數。 所述比較模塊13用於將所述記錄之步數與所述 11 200934226 預設步數比較,當所述記錄之步數大於等於所述預設 步數時,將所述電機3之步長設置為所述第二步長, 當所述記錄之步數小於所述預設步數時,將所述電機 3之步長設置為所述第-步長。所述預設步數為預先 存儲於所述比較模塊13中一個變數,並且在該比較 模塊13運行之前或開始運行時進行初始化。所述比 較模塊13獲取所述步數記錄模塊12記錄之計數,並 將其與所述預設步數進彳ttb較,#所料數達到所述 ❹預設步數則改變所述電機3之步長,具體地,#所述 電機3以所述第一步長驅動所述鏡頭模組2正向移動 時’若達到所述預設步數’所料機㈣模塊^通 過所述電機驅動電路4控制所述電機3,將所述電機 3之步長改為所述第二步長;當所述電機3以所述第 二步長驅動所述鏡頭模組2反向移動時,此時,所述 步數記錄模塊12之計數逐漸減小,當達到所述預設 ❹V數時所述電機控制模塊11通過所述電機驅動電 路4:制所述電機3之步長為所述第一步長。 ^田所述步數記錄模塊12記錄之步數等於所述預 ==數時’所述比較模塊13可以保持所述電機3之 :別二長再驅動所述鏡頭模組2 一步之後再做改 二。當然’當所述記錄之步長等於所述預設步長時, 逛可能有夕泠诚士上 ^ ^ 、之處理方式,比如,再設置一個變數來 、二_人之步數,通過將前一次之步數與當前步數 $ =軚,從而判斷步數之變化趨勢,當所述記錄之步 、於所述預設步長時,直接根據所述變化趨勢來改 12 200934226 變此時之步長。 所述圖像獲取模塊14用於獲取所述鏡頭模組2 在自動對焦過程中感測到之圖像。 所述差值平方運算模塊15用於求出所述圖像每 行晝素中’相鄰晝素之晝素值差值之平方和。所述 差值平方運算模塊15會求出所述獲取之圖像中,每 行相鄰兩個晝素之畫素值之差值,再對該差值進行箏 方後求和’最後得到每一行晝素之晝素值差值之中方 和,從而得到一組資料,可以將該組資料存儲到〆個 線性表,如佇列、棧等’將該些差值缓存。 、/所述累加運算模塊16用於將所述求出之平方和 ,仃累加传到一個累加平方和,具體地,所述累加速 异模塊16得至所述線性纟,並逐個絲資料進行累 ❹ 戶:述資料比較模塊17用於將所述 方和與所料存5巾存儲之?、加平方 =炎 =累加平方和大於所述緩存之累加平方::把戶; 迷資料比較模塊17將所述求得之累大、體地1 緩存5中緩存之累加平方和相交:、、,和與所、 :大之-個以及對應之電機步數緩終將;I :大從而確保所述緩存”始終緩存之累IS:是 所㈣龍| 帛力# 所述鏡頭模組2到達自動 丈電機3是否軀動 ί焦摩巳圍之終點,若到達終 13 200934226 .驅動戶::::f電機控制模塊11 ’控制所述電機3 ㈣到達所述緩存5之電機步數。 裝置1之閱圖^圖3和圖4,圖4為所述拍攝200934226 IX. Description of the invention: [Technical field to which the invention pertains] • The invention relates to a type of photographing device and an autofocus method thereof. [Prior Art] Most of the previous shootings, the old Xia has an auto-focus system, and the auto-focus system of the auto-focus system and the * focus speed directly affect the shooting speed of the shooting device. People like to use the shooting system, the I 4 π digital camera or the digital camera 4 to shoot the life of the pe 缺 丄 丄 丄 amp amp 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或 或However, due to the fact that life is not reproducible, I said [invention], speed auto focus Asia to shoot. Put it! In view of this, it is necessary to provide a camera capable of quickly and automatically facing the camera and its autofocus method. Automatically, for example, a kind of shooting device capable of white-collar auto-focusing, the shooting station includes a lens module, a squeezing device, an automatic aligning protection single-a solid-motor driving circuit and 1. Λ ^ ^ ^ The motor drives the lens 掇 group to return to the close-range autofocus process, and the 罝 right bei length and a first step # ” have a first step, and first: The use of the first step is less than the second step of the second step of the control unit scoop ^ long autofocus, the self-motor drive circuit $% + system ghost, used to pass the record Said ^ (4) the lens hi number, the block 'used to record the motor to drive the two f; and, the number of steps, when from the poor 5, 丨 && When stepping to close-range autofocus, the number of steps is increased by 7 200934226 plus 'when autofocusing from close range to infinity, the number of steps is reduced' comparison module for storing the number of steps in the record Comparing a preset step number in the comparison module, when the number of steps of the recording is greater than or equal to the preset step Setting the step size of the motor to the second step, and setting the step size of the motor to the first step length when the number of steps of recording is less than the preset number of steps An autofocus method of a photographing device, the photographing device comprising a lens module and a motor, wherein the motor drives the lens module from infinity to close-range autofocus, having a first step and a a second step length, wherein the first step length is smaller than the second step size, wherein the camera device is pre-set with a preset number of steps, and the auto-focus method includes: controlling the motor to drive the lens module The group starts the autofocus with the first step length; obtains the number of steps of the motor driving lens module; when the number of steps is greater than or equal to the preset step number, sets the step size of the motor to the second a step size, when the number of steps of the recording is less than the preset number of steps, 'set the step size of the motor to the first step length', the preset number of steps is preset to the photographing device a value within. Compare with prior art The camera can focus on the first step from the infinity to the close focus process. The focus is at the beginning of the autofocus. The focus distance varies greatly with the increase of the motor drive steps. Using a small step size does not lose the clearest focus position; after the motor drives the lens module to reach the preset number of steps, 'the step size of the motor is set to a large step, that is, the second step Long, at this time, the change of the focus distance with the increase of the number of steps of the motor drive step can be increased by the increase of the number of steps in the motor. [Embodiment] Please refer to Figure D /, shooting A hardware architecture diagram of the camera 1. The camera device 1 can automatically focus, and preferably includes: a lens module 2, a motor 3, a motor drive circuit 4, a cache 5, and an automatic pairing batch _ Cut 7 ", the diameter system is earlier than 10. The shooting device 1 can be a digital camera, a digital camera ^ ^ , a 豕 1 豕 machine, and the like. In the present embodiment, it is a digital camera. The motor 3 is a stepping motor, and it is used to drive the lens module 2 for autofocusing. The motor drive circuit* is configured to receive control information of the auto focus control unit 10 to control the motor 3. The lens unit 2 is a lens module capable of autofocusing. In this embodiment, the lens module 2 has an image sensor 'which is a CCD, and the image sensor has an auto focus mode. When the auto focus mode is activated, the image sensor is The effective photosensitive area of the photosensitive area is reduced, so that the number of signal processing during autofocus can be reduced, which can speed up the autofocus speed. The cache 5 is used to cache data. The cache 5 buffer has an accumulated sum of squares corresponding to the image sensed by the image sensor. The sum of squares is the value of each square element of the image sensed by the photographing device 1, and the difference between the pixel values of the adjacent pixels is squared, and the squared value is then squared. Accumulate to get the sum of the squares of each line 9 200934226 'The last sum of the squares of each line. And add up again to get one. Please refer to Figure 1 and Figure 2. The gratification of the gentry ~ When the lens module 2 is in production, it will enter the test, and will get a focus distance and the motor 3 drive step when measuring the miscellaneous tips, * or The number of gamma, the correspondence table of the graph 'based on the table - a coordinate map. As shown in Fig. 2, the number of steps is driven by the friend, and the vertical dimension indicates the distance of the motor, which is not the same as that of the motor 3. As shown in Fig. 2, it is found that the motor 3 drives the The lens module 2 is one of the mother steps: the change of the focus distance is very obvious, so it needs a small step to drive. At the end of the automatic material lane H-focus, the motor 3 drives each of the lens modules 2 The change of the focus distance corresponding to the ^^^厶 mother step is not obvious. Therefore, the step size of the motor 3 can be set larger. For the phenomenon shown in Fig. 2, two steps are set for the power unit 3. Long, respectively, is a first step and a second step, and the first step is smaller than the second step. In the initial stage of autofocus, the step of the motor 3 adopts the first step length And at the end of the autofocus, the motor 3=step adopts the second step, and presets a preset step in the auto-focus control unit 10 as a demarcation point, when the motor 3 is When the first step of driving the lens module 2 reaches the preset number of steps, the step size of the motor 3 is changed to The second step can be understood. 'The step size of the motor 3 can also be set to three, four or five, etc.' and correspondingly set a plurality of preset steps, but as long as it plays a role The same or similar aspects of the present invention should be covered by the protection scope of 200934226. Please - and refer to Figure 1# Function module of the unit 1〇: 3 for the auto focus control including a motor clamp n " dynamic focus control Unit work, recovery path, pull block u, step number 丄〇h, m ghost 14, difference square operation module q: accumulate different operation module 16, caution / heart rise for evil 15, block! 8. "4 comparison module I And a motor module 丄丄 for determining the mode, the circuit 4 is used to control the motor 3, and the motor is monitored. The motor control module controls the motor drive circuit 4 to control the motor. The step number recording module 12 is configured to record the number of steps of the lens module 2 of the motor 3. When the auto focus is from infinity to close range, the number of steps increases, when autofocusing from close range to infinity, The number of steps is reduced. The step number recording module 12 is a program number program. When the motor 3 drives the lens module 2 to move one step, the step number recording module 12 increases or decreases the count accordingly. When the motor 3 drives the lens module 2 to autofocus from a near distance to a close distance, the motor 3 drives the lens module 2 to move in a forward direction, and vice versa. The motor 3 drives the lens module 2 to move forward one step, and the step number recording module 12 increases the number of steps of recording. Conversely, the motor 3 moves backward by one step for driving the lens module 2 Then, the step number recording module 12 will reduce the count. The comparing module 13 is configured to compare the number of steps of the recording with the preset number of steps of the 2009 200934226, and when the number of steps of the recording is greater than or equal to the preset number of steps, the step of the motor 3 is The second step is set, and when the number of steps of the recording is less than the preset number of steps, the step size of the motor 3 is set to the first step. The preset number of steps is a variable previously stored in the comparison module 13, and is initialized before the comparison module 13 is run or when it starts running. The comparison module 13 obtains the count recorded by the step number recording module 12, and compares it with the preset step number 彳 ttb, and the number of the predetermined number of steps reaches the predetermined step number to change the motor 3 Step by step, specifically, the motor 3 drives the lens module 2 to move in the forward direction when the first step is long; 'If the preset number of steps is reached', the machine (4) module passes the motor The driving circuit 4 controls the motor 3 to change the step size of the motor 3 to the second step; when the motor 3 drives the lens module 2 to move in the second step by the second step, At this time, the count of the step number recording module 12 is gradually decreased. When the preset number of ❹V is reached, the motor control module 11 passes the motor drive circuit 4: the step size of the motor 3 is the The first step is long. ^The step number recording module 12 records that the number of steps is equal to the pre-=number. The comparison module 13 can hold the motor 3: the second lens is further driven to the lens module 2, and then Change two. Of course, when the step size of the record is equal to the preset step size, the shopping may have a method of processing ^^, and, for example, setting a variable, the number of steps of the second person, The number of previous steps and the current number of steps $=軚, thereby determining the trend of the number of steps, when the step of recording, at the preset step size, directly changes according to the change trend 12 200934226 change this time Step by step. The image acquisition module 14 is configured to acquire an image sensed by the lens module 2 during the auto focus process. The difference square operation module 15 is configured to find a sum of squares of the difference values of the pixel values of the adjacent pixels in each pixel of the image. The difference square operation module 15 obtains the difference between the pixel values of two adjacent pixels in each of the acquired images, and then performs a squared summation on the difference, and finally obtains each A sum of the prime values of the rows of pixels, thereby obtaining a set of data, which can be stored in a linear table, such as a queue, a stack, etc., to buffer the differences. The summation operation module 16 is configured to pass the sum of the squares of the obtained sums to an accumulated sum of squares. Specifically, the accumulative acceleration module 16 obtains the linear chirp and performs the data one by one. Tired household: The data comparison module 17 is used to store the square and the stored 5 towels? , plus square = inflammation = cumulative sum of squares is greater than the cumulative square of the cache:: the household; the data comparison module 17 intersects the cumulative sum of the obtained cache, the volume of the buffer in the cache 1 of the volume 1 :, , and and the:, the big one and the corresponding number of motor steps will be slow; I: large to ensure that the cache is always cached tired IS: is the (four) dragon | 帛力# The lens module 2 arrives Whether the automatic motor 3 is moving or not, the end point of the motor is reached, and if it reaches the end 13 200934226, the driver::::f motor control module 11 'controls the number of motor steps of the motor 3 (four) reaching the buffer 5. 1 reading picture ^ Figure 3 and Figure 4, Figure 4 is the shooting

T 1丄之自動料隹V 包括法之流程圖,所述自動對焦方法 G枯Μ下步驟。 步驟S11 :於舍丨&、+. + 114 2以第一 +且 卫制所述電機3,驅動所述鏡頭模組 拍攝裝置\門:?動對焦。在本實施方式中’所述 Μ、+、+ &汗。自動對焦,所述電機控制模塊11通 過所述電機驅動雷w / u w 、 頭模組2。 電路4控制所述電機3來驅動所述鏡 S13.記錄所述電機3驅動鏡頭模組2之步 數。在本實絲士 4·、i 組2每移動^’#所述電機3驅動所述鏡頭模 .、… V,所述步數記錄模塊12會相應之增 2^ ^汁數。設所述電機3驅動所述鏡頭模組 HΜ向近距離自動對焦冑,所述電機3驅動 ❽述鏡頭模、,且2移動方向為正向移動,相反則為反向 動所述電機3驅動所述鏡頭模組2正向移動一 ,所述^數°己錄模塊12便會增加記錄之步數,相 反’所述電冑3每驅動所述鏡頭模組2反向移動一 步,則所述步數記錄模塊i 2會減少計數。 步驟S17 :當所述記錄之步數大於所述預設步數 時:將所述電機3之步長設置為所述第二步長,當所 迷汜錄之v數小於所述預設步數時,將所述電機3之 步長設置為所述第一步長。在本實施方式中,所述比 較模塊13用於將所述記錄之步數與所述預設步數比 14 200934226 較,當所述記錄之步數大於所述預設步數時,將所述 電機3之步長設置為所述第二步長,當所述記錄之步 數小於所述預設步數時,將所述電機3之步長設置為 所述第一步長。 步驟S21 :當所述電機3驅動所述鏡頭模組2移 動一步’則獲取所述拍攝裝置1感測到之圖像。在本 實施方式中’所述圖像獲取模塊14獲取所述鏡頭模 組2感測到之圖像。 0 步驟S23 :求出所述圖像每一行晝素中,相鄰晝 素晝素值差值之平方和。在本實施方式中,所述差 值平方運算模塊15求出所述圖像每一行畫素中,相 鄰晝素之晝素值差值之平方和。 步驟S25 :將所述平方和累加,得出一個累加平 $和。在本實施方式中,所述累加運算模塊Μ將 述平方和累加,得出一個累加平方和。 ©古^ v驟S29 .將所述累加平方和所述缓存之累加平 累加::Γ ί,當所述累加平方和大於所述緩存5之 步數。〇 ^,緩存所述累加平方和以及對應之電機 組2 :3 .判斷所述電機3是否驅動所述鏡頭 逑判斷埴抬Ί Ο 你+貫把万式中, 、塊18判斷所述電機3是 組2到这白私咖 气J疋古驅動所述鏡頭 達自動對焦範圍之终 自動對隹,會鉍/ ^ 右禾到違終點’繼 牛…重新從所述步驟S21開始執行。 驟37 .右到達終點,則控制所述電機3驅 15 200934226 ,所述鏡頭模組2為所述缓存之位置。 . 與先前技術比較,所述拍攝裝置能夠於從無窮遠 到近距離對焦過程中首先採用小步長即所述第一步 長進仃對焦,於自動對焦初期對焦距離隨著所述電 機驅動步數之增加變化非常明顯,故採用小步長不合 ^ m 之焦點位置;當所述電機驅動所述鏡頭模 達到所述預設步數之後,將所述電機之步長設置為 ❻苴「長即所述第二步長,此時已達到自動對焦之末 於@ 距離之變化隨著所述電機驅動步數之增加趨 所以採用大步長能夠提高對焦速度。 ,上所述,本發明符合發明專利要件,爰依法提 方+申請。惟,以上所述者僅為本發明之較佳實施 孰t本發明之範圍並不以上述實施方式為限,舉凡 修^技藝之人士援依本發明之精神所作之等效 I:或變化,皆應涵蓋於以下申請專利範圍内。 ◎【圖式簡單說明】 本發明提供之拍攝裝置之硬體架構圖; 座標圖; r f攝裝置之對焦距離與驅動步數.之 圖3係圖1中拍攝裝置 能模塊圖; 置之自動對焦控制單元之功 圖4係圖1中拍攝裝 圖。 置之自動對焦方法之流程 【主要元件符號說明 拍攝裝置 鏡頭模組 2 16 200934226 電機 3 電機驅動電路 4 缓存 5 自動對焦控制單元 10 電機控制模塊 11 步數記錄模塊 12 比較模塊 13 圖像獲取模塊 14 差值平方運算模塊 15 累加運算模塊 16 資料比較模塊 17 判斷模塊 18The automatic magazine V of T 1 includes a flow chart of the method, and the autofocus method G has the following steps. Step S11: in the first + and defending the motor 3, and driving the lens module, the camera, the door: ? Focus on the focus. In the present embodiment, the Μ, +, + & sweat. Autofocus, the motor control module 11 drives the lightning w / u w , the head module 2 through the motor. The circuit 4 controls the motor 3 to drive the mirror S13. The step of recording the motor 3 to drive the lens module 2 is recorded. In the present embodiment, the motor 3 drives the lens module . . . , V, and the step number recording module 12 increases the number of juices accordingly. The motor 3 is driven to drive the lens module H to the close-range AF, the motor 3 drives the lens module, and the moving direction of the lens is positive, and vice versa. The lens module 2 moves forward one, and the number of recording modules 12 increases the number of steps of recording. Conversely, the electric motor 3 moves backward by one step for driving the lens module 2, The step number recording module i 2 will reduce the count. Step S17: when the number of steps of the recording is greater than the preset number of steps: setting the step size of the motor 3 to the second step, when the number of v records is less than the preset step When the number is small, the step size of the motor 3 is set to the first step length. In this embodiment, the comparison module 13 is configured to compare the number of steps of the recording with the preset step number 14 200934226, and when the number of steps of the recording is greater than the preset number of steps, The step size of the motor 3 is set to the second step length, and when the number of steps of the recording is less than the preset number of steps, the step size of the motor 3 is set to the first step length. Step S21: When the motor 3 drives the lens module 2 to move by one step, the image sensed by the photographing device 1 is acquired. In the present embodiment, the image acquisition module 14 acquires an image sensed by the lens module 2. 0 Step S23: Find the sum of the squares of the difference values of the neighboring elements in each pixel of the image. In the present embodiment, the difference square operation module 15 obtains the sum of the squares of the difference values of the pixel values of the adjacent pixels in each pixel of the image. Step S25: accumulating the sum of squares to obtain a cumulative sum of $ and . In the present embodiment, the accumulation operation module 累 adds the sum of squares to obtain an accumulated sum of squares. The sum of the accumulated squares of the buffers is added up to: Γ ί when the accumulated sum of squares is greater than the number of steps of the cache 5. 〇^, buffering the accumulated square sum and the corresponding motor group 2:3. Judging whether the motor 3 drives the lens, determining the 埴 Ί Ο Ο Ο Ο Ο 、 、 、 判断 判断 判断 判断 判断 判断 判断It is the group 2 to this white private coffee J疋古 drive the lens to reach the end of the auto focus range automatically, will 铋 / ^ right Wo to the end of the end of the 'following cattle... re-execute from the step S21. Step 37. When the right reaches the end point, the motor 3 drive 15 200934226 is controlled, and the lens module 2 is the position of the cache. Compared with the prior art, the photographing device can first adopt a small step length, that is, the first step of the long-range focus, from the infinity to the close-range focusing process, and the focusing distance in the initial stage of the autofocus is driven by the motor. The increase of the change is very obvious, so the focus position of the small step is not used; after the motor drives the lens mode to reach the preset number of steps, the step size of the motor is set to "long" The second step, at this time, the change of the @ distance at the end of the autofocus is increased, so that the step speed can be increased by using a large step length as the number of motor drive steps increases. The present invention is in accordance with the invention. Patent requirements, 爰 提 + 申请 申请 申请 。 。 。 。 。 。 。 。 。 。 。 。 。 + + + 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本Equivalent I: or change of spirit should be included in the scope of the following patent application. ◎ [Simple diagram of the drawing] The hardware structure diagram of the photographing device provided by the present invention; coordinate map; rf camera device The focal length and the number of driving steps. Figure 3 is the module diagram of the camera in Figure 1. The diagram of the autofocus control unit is shown in Figure 1. The process of the autofocus method [Main component symbol description Camera lens module 2 16 200934226 Motor 3 Motor drive circuit 4 Cache 5 Autofocus control unit 10 Motor control module 11 Step number recording module 12 Comparison module 13 Image acquisition module 14 Difference square operation module 15 Accumulation operation module 16 Data comparison Module 17 Judgment Module 18

1717

Claims (1)

200934226 十、申請專利範圍 • -種拍攝裝置,其能夠自動對焦,該拍攝裝置包 括-個鏡頭模組、-個電機、一個電機驅動電路 和一個自動對焦控制單元,所述電機在驅動所述 鏡頭模組從無窮遠到近距離自動對焦過程中,呈 有一個第一步長與一個第二步長,所述第一步長 小於所述第二步長’並首先採用所述第一步長進 行自動對焦,所述自動對焦控制單元包括:電機 控制模塊,用於通過所述電機驅動電路控制所述 電機驅動所述鏡頭模組;步數記錄模塊,用於記 錄所述電機驅動所述鏡頭模組之步數,告 遠到近距離自動對焦時,所述步數增加 距離到無窮遠自動對焦時,所述步數減小;比較 模塊,用於將所述記錄之步數與存儲於所述比較 模塊中之一個預設步數比較,當所述記錄之步數 ❹ 大於等於所述預設步數時,將所述電機之步長設 置為所述第二步長,當所述記錄之步數小於所述 預設步數時,將所述電機之步長設置為所述第一 步長。 • 甲請專利範圍第1項所述拍攝裝置,其中,所 述拍攝裝置還包括一個緩存’所述緩存中緩存有 個累加平方和,所述自動對焦控制單元還包 括·圖像獲取模塊,用於獲取所述鏡頭模組感測 !之圖像,差值平方運算模塊,用於求出所述圖 像每一行晝素中,相鄰畫素之畫素值差值之平方 18 200934226 ,和,累加運算模塊,用於將所述平方和累加,得 ,出-個累加平方和;資料比較模塊,用於將所述 累加平方和與所述緩存之累加平方和進行比較, 當所述累加平方和大於所述緩存之累加平方和 時,緩存所述累加平方和以及對應之電機步數; 判斷模塊,用於判斷所述電機是否驅動所述鏡頭 模組到達自動對焦範圍之終點,若到達終點,則 ❹通過所述電機驅動電路控制所述電機驅動所述鏡 頭模組為所述緩存之電機步數。 3.如申請專利範圍第1項所述拍攝裝置,其中,所 述鏡頭模組具有一個影像感測器,所述影像感測 益具有一個自動對焦模式,該自動對焦模式中減 小所述影像感測器之感測區的有效感光區域,以 減少自動對焦過程中處理之訊號。 4 ·—種拍攝裝置之自動對焦方法,所述拍攝裝置包 ❹ 括一個鏡頭模組和一個電機,所述電機驅動所述 鏡頭模組從無窮遠到近距離自動對焦過程中,具 有一個第一步長與一個第二步長,所述第一步長 小於所述第二步長,所述拍攝裝置内預設有一個 預設步數,所述自動對焦方法包括:控制所述電 機,驅動所述鏡頭模組以第一步長開始自動對 焦;獲取所述電機驅動鏡頭模組之步數;當所述 步數大於等於所述預設步數時,將所述電機之步 長設置為所述第二步長’當所述記錄之步數小於 所述預設步數時’將所述電機之步長設置為所述 19 200934226 長,所述預設步數為預先設置於所述拍攝 裝置内之一個數值。 5 ·如申睛專利範圍第4頂ό ... 圍弟項所述拍攝裝置之自動對焦 时?:中’所述拍攝裂置具有-個緩存,所述 * Γ氣緩存有一個累加平方和,於以第-步長開 ie f μ對焦之步驟之後,還包括以下步驟:當所 拍'摄往驅動所述鏡頭模組移動一步’則獲取所述 〇去:裝置感測到之圖像;求出所述圖像每一行晝 車 相邠晝素之晝素值差值之平方和;將所述 :和累加,侍出一個累加平方和;將所述累加 :方和所述緩存之累加平方和進行比肖,當所述 Ζ加平方和大於所述緩存之累加平方和時,缓存 Iί f加平方和以及對應之電機步數;判斷所述 線疋否驅動所述鏡頭模組到達自動對焦範圍之 ^點,右到達終點’則控制所述電機驅動所述鏡 ❹頭模組為所述緩存之位置。 20200934226 X. Patent application scope - A type of photographing device capable of autofocusing, the photographing device comprises a lens module, a motor, a motor drive circuit and an auto focus control unit, wherein the motor drives the lens The module has a first step length and a second step length from infinity to close range autofocus, the first step length being smaller than the second step length' and first adopting the first step length Autofocusing, the autofocus control unit includes: a motor control module for controlling the motor to drive the lens module by the motor driving circuit; and a step recording module for recording the motor to drive the lens The number of steps of the module, when the far-reaching autofocus is reached, when the number of steps increases the distance to infinity autofocus, the number of steps is reduced; the comparison module is configured to store the number of steps in the recording Comparing a preset step number in the comparison module, when the number of steps ❹ of the record is greater than or equal to the preset number of steps, setting the step size of the motor to Said second step, when the recording of the number of steps is less than the predetermined number of steps, the steps of the motor is set to the first long step. The photographing apparatus of claim 1, wherein the photographing apparatus further includes a buffer 'the buffer is buffered with an accumulated sum of squares, and the auto focus control unit further includes an image acquisition module. Obtaining an image of the lens module sensing!, a difference square operation module, configured to obtain a square of the difference between the pixel values of adjacent pixels in each row of the image, 200934226, and And an accumulating operation module, configured to accumulate the sum of squares, and obtain a sum of squared sums; a data comparison module, configured to compare the sum of squared sums with a sum of squares of the buffers, when the accumulating When the sum of the squares is greater than the sum of squares of the buffers, the accumulated square sum and the corresponding number of motor steps are buffered; the determining module is configured to determine whether the motor drives the lens module to reach the end point of the auto focus range, if the arrival At the end point, the motor drive circuit controls the motor to drive the lens module to the number of motor steps of the cache. 3. The photographing apparatus according to claim 1, wherein the lens module has an image sensor, and the image sensing has an autofocus mode, wherein the image is reduced in the autofocus mode. The effective photosensitive area of the sensing area of the sensor to reduce the signal processed during the autofocus process. 4: an autofocus method of a photographing device, the photographing device includes a lens module and a motor, and the motor drives the lens module from infinity to close-range autofocus, having a first a step size and a second step length, wherein the first step length is smaller than the second step length, and a preset step number is preset in the photographing device, and the auto focus method comprises: controlling the motor, driving The lens module starts autofocusing with a first step length; acquiring the number of steps of the motor to drive the lens module; when the number of steps is greater than or equal to the preset number of steps, setting the step size of the motor to The second step length 'when the number of steps of recording is less than the preset number of steps', the step size of the motor is set to be 19 200934226 long, and the preset step number is preset in the A value within the camera. 5 · For example, the scope of the patent application is the fourth top ό ... The autofocus of the shooting device described by the brothers?: The 'the shooting split has a buffer, and the * Xenon buffer has an accumulated sum of squares. After the step of opening the ie f μ focusing in the first step, the method further includes the following steps: when the photographing is taken to drive the lens module to move one step, the image is acquired: the image sensed by the device Calculating a sum of squares of the difference values of the pixel values of each row of the image; summing the sum: and accumulating an accumulated sum of squares; adding the sum: the square and the buffer The sum of squares is compared, and when the sum of squares is greater than the sum of squares of the buffers, the buffer I I f f sums the squares and the corresponding number of motor steps; determines whether the line 驱动 drives the lens module to arrive The point of the auto focus range, right to the end point 'controls the motor to drive the mirror head module to the position of the buffer. 20
TW97102859A 2008-01-25 2008-01-25 Image capturing device and auto-focus method TWI337498B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97102859A TWI337498B (en) 2008-01-25 2008-01-25 Image capturing device and auto-focus method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW97102859A TWI337498B (en) 2008-01-25 2008-01-25 Image capturing device and auto-focus method

Publications (2)

Publication Number Publication Date
TW200934226A true TW200934226A (en) 2009-08-01
TWI337498B TWI337498B (en) 2011-02-11

Family

ID=44866197

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97102859A TWI337498B (en) 2008-01-25 2008-01-25 Image capturing device and auto-focus method

Country Status (1)

Country Link
TW (1) TWI337498B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI580941B (en) * 2015-11-10 2017-05-01 群光電子股份有限公司 Auto Focus Test System And Method
CN112291469A (en) * 2018-07-23 2021-01-29 深圳市真迈生物科技有限公司 Imaging method, device and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI580941B (en) * 2015-11-10 2017-05-01 群光電子股份有限公司 Auto Focus Test System And Method
CN112291469A (en) * 2018-07-23 2021-01-29 深圳市真迈生物科技有限公司 Imaging method, device and system

Also Published As

Publication number Publication date
TWI337498B (en) 2011-02-11

Similar Documents

Publication Publication Date Title
JP5903608B2 (en) Camera system
US7796182B2 (en) Image-taking apparatus and focusing method
US9332173B2 (en) Imaging device having motion detector and in-focus position estimating unit, and imaging method
US8611739B2 (en) Focus adjusting apparatus and imaging apparatus
US9413923B2 (en) Imaging apparatus
WO2014153950A1 (en) Quick automatic focusing method and image acquisition device
TW201109761A (en) Imaging apparatus, focusing method, and computer-readable recording medium recording program
US8195042B2 (en) Imaging apparatus and control method
US8508584B2 (en) Image pickup apparatus, zoom correction information creation method and program, and recording medium
JP5812706B2 (en) Optical device and control method thereof
US8395697B2 (en) Imaging apparatus and lens unit
US9113082B2 (en) Imaging device
US7826737B2 (en) Image pickup apparatus and focusing method thereof
JP2006162991A (en) Stereoscopic image photographing apparatus
US9160916B2 (en) Focus adjustment apparatus with a size detector
JP5438805B2 (en) Automatic focusing device, automatic focusing method, and imaging device
TW200934226A (en) Image capturing device and auto-focus method
US8890980B2 (en) Imaging apparatus and zoom lens with adjustable stop positions
CN102833484A (en) Image pickup apparatus and control method thereof
KR101698917B1 (en) Integrated control method of pan tilt zoom focusing of closed circuit television camera
JP2010268400A (en) Electronic camera
TWI407235B (en) Auto focus system and method same
JP5344770B2 (en) Imaging device
JP5525807B2 (en) camera
JP2005277765A (en) Video camera

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees