201204023 六、發明說明: 【發明所屬之技術領域】 特別是-種以人臉區塊 本發明係關於一種輔助對焦的方法 輔助對焦的方法。 【先前技術】 sive auto focus) 〇 在拍攝影像時,需要正確地把焦距對到被攝物體上以得 晰的照片,而在現今_般的數位相機等影像錄裝置都已 自動對焦雜。自動難纽上可时為兩大類―為 動對焦(active aut0 focus) ’另一為被動式自動對焦㈣丨,工201204023 VI. Description of the Invention: [Technical Field of the Invention] In particular, a human face block is a method for assisting focusing. [Prior Art] sive auto focus) 〇 When shooting an image, it is necessary to correctly focus the focus on the subject, and the video recording devices such as today's digital cameras are automatically focused. There are two main categories of automatic difficulties: active aut0 focus and passive autofocus (4).
。主動式自動對焦的技術係利用—組紅外線發射器或是雷射發 射器和相對的接收11投射光_案在被攝體上,再以三角測量法 (—〇η)等方法計算相機與被攝物體之間的距離,❿此距二即 為焦距。細主動式自動對財式精度較差,也就是說無法得到 很準確的鎌’且無法觀跡影雑取裝置和被齡體之間有 玻璃等東酿隔的情況。此外,使用主動式自動對焦需在相機内 額外設置光發射器和接收器,因此成本較高。 被動式自動對焦則在正式拍攝前,於從離影像娜裝置最近 的微距到被設為無限遠的區域巾娜許錄影像,並分析所獲得 的〜像的满度來決定;m動式自動對焦方式只需用到相機 ,身所具有的影像細器及運算單元,故能_輕製造成本。但 是被動式自動触由於需耗費的運算量較大,因此常犧牲精度以 避免花費過多的時間在自動對焦上。 201204023 者大來’使用數位相機等影像擷取裝置來拍攝影像的使用 ΓΤ。除了攝影專業人員之外,也有越來越多的-般: 攝=不:機來拍攝,,—般使用者所拍攝的影像,因拍 業人«,故其賴得的影像时會該 題。然而在拍攝照片時,人物影像常是畫面中的重點的部分= 統的自動對焦方式卻可能會把背景或是人物以外的其他東西判斷 為攝影主體,而存在有賴為轉重_人物卻反^失焦的問 題。再者—旦自動對焦的精度从而產生舰誤差,很可能會導 致拍攝的影像嚴重模糊。尤其是當拍攝的影像是人像時,出現在 人臉上的攝影缺陷更顯得糟糕。 【發明内容】 、為了解決上述問題,本發明提供—種人臉區塊辅助對焦的方 法其適用於具有-自動對焦程序的一影像擷取裝置。自動對焦 心序具有-預設取樣間距,而人臉區塊輔麟焦的方法包括:掏 取欲對焦影像’其中欲對焦影像具有一人臉區塊;計算欲對焦 影像中的人臉區塊的-人臉參數;依據人臉參數細_參數焦距 對照表以得到-難區段;以及雜對纽段以及—人臉取樣間 距執仃自麟:!、程序以得到—目標紐,其巾人臉取樣間距係小 於預設取樣間距。 人臉參數可以是人臉區塊與欲對焦影像的一長度比或是一面 積比。而參數焦距對照表可對應於一人臉偵測程序,且影像擷取 裝置係以此人臉偵測程序於欲對焦影像中偵測出人臉區塊。 201204023 根據本發明之例,依據人臉參數細參數焦距對照 表以得到難、財驟可包括:依據人臉參數細參數焦距對 •絲’並付到與人臉參數對應的—預晰焦位置;以及依據影像 擁取裝置的-縮放倍率,以預測對焦位置為基準點得到對焦區段。 此外’對:1、區&可具有為-前區段以及—後區段。其中前區 段係位於賴對餘置至影像擁取裝置的—近焦距之間,後區段 則位於测難位置至影_取裝置的—遠焦距之間。且根據本 發明之-實施關’祕段的長度可與躯段的長度相同。而根 據本發明之另-實施細’ _段的長度可大於或是小於後區段 的長度。 而得到對焦區段之後,自動難程序可以以—二次多項式逼 近法計算目標焦距。 练上所述,人臉區塊輔助對焦的方法依據人臉區塊的人臉參 數查閱參數:!、轉絲’並於制的對段邮較高的精度執 行自動對焦私序。因此能夠提高自動對焦的精度而得到更佳的目 標焦距,而能夠拍攝到清晰的人臉影像。 【實施方式】 以下在實轭方式中詳細敘述本發明之詳細特徵以及優點,其 内谷足以使任何熟習相關技藝者了解本發明之技術内容並據以實 施’且根據本朗書所揭露之内容、申請補顧及圖式,任何 熟習相關技藝者可輕祕理解本發明細之目的及優點。 本發明提供一種人臉區塊輔助對焦的方法,其適用於具有一 201204023 自動對焦(Amo Focusing,AF)程序的-影像擷取裝置,其中自 動對焦程序具有一預設取樣間距。 請參照「第1圖」’其係為根據本發明—實施範例之影像操取 裝置之方塊示意圖。然根據本發明之人臉區塊輔助對焦的方法所 適用的影像擷取裝置係不限於「第1圖」。 影像摘取裝置20可以例如是數位相機、附有拍照功能的相 機攝衫機或是網路攝影機(webcam)。影像擷取裝置如包括一 鏡頭單元 〇enS unit) 22、一感光單元(ph〇t〇sensitive 讀)24、 一微處理器(micro processorunit)26以及一儲存單元(如喂仙幻 28。當揭取影像時,影像掘取裝£ 2〇係將鏡頭單元^對焦於一 對焦距離(f0cusing distance,亦稱為焦距,免咖)上。則當使用 者拍攝影像時’微處理H 26㈣綱料22靖應此對焦距離 的-對焦位置’並將透職頭單元22錢感光單元24得到的影 像儲存於儲存單元28。 〜 對焦距離係指鏡頭單元22的絲中心點至被攝物或被攝人物 之間的距離’長度單何以是公尺或公分。而職位置亦可被稱 2焦長(focus length) ’其係指綱單元22的光學中心點至感光 皁元24之間的距離。影像祿取裝置20可透過-步進馬達(step motor ’未繪不)控制鏡頭裝置22至不同的對焦位置上。對焦位 置-般以步距(step,亦稱為步進距離)為單位。 需注意的是,難距離與對餘置之_關係並不一定是成 正比。例如於對焦距離為i公尺對應之步距數並不一定是對焦距 離為半公尺對應之步距數的兩倍;對焦距離為2公尺對應之步距 201204023 數亦不-定找焦距離為丨公尺對應之步距數的兩倍。. The active autofocus technology uses a set of infrared emitters or a laser emitter and a relative receiver 11 to project light on the object, and then calculates the camera and the method by triangulation (-〇η). The distance between the objects, the distance between them is the focal length. The fine active automatic method has a poor precision, which means that it is impossible to obtain a very accurate 镰' and it is impossible to observe the situation where the device and the body are separated by glass. In addition, the use of active autofocus requires additional light emitters and receivers in the camera, which is costly. Passive autofocus is determined before the official shooting, from the nearest macro from the image device to the area that is set to infinity, and analyzes the fullness of the image obtained. The focusing method only requires the use of the camera and the image squeegee and arithmetic unit, so it can be lightly manufactured. However, passive automatic touches require a large amount of computation, so often the accuracy is sacrificed to avoid spending too much time on autofocus. 201204023 者大来' Use of image capture devices such as digital cameras to capture images. In addition to photography professionals, there are more and more - like: photo = no: machine to shoot, the image of the user-like, because of the film industry «, so the image of the film will be the title . However, when taking a photo, the image of the character is often the key part of the picture. The autofocus method of the system may judge the background or other things other than the character as the subject of the subject, and the existence depends on the weight of the _ character but the opposite ^ The problem of out of focus. Furthermore, once the accuracy of the autofocus produces a ship error, it is likely to cause a severe blur of the captured image. Especially when the image taken is a portrait, the photographic defects appearing on the person's face are even worse. SUMMARY OF THE INVENTION In order to solve the above problems, the present invention provides a method for assisting focusing of a human face block, which is suitable for an image capturing device having an autofocus program. The autofocus heart sequence has a preset sampling pitch, and the method of the face block auxiliary lining includes: capturing the image to be focused, wherein the image to be focused has a face block; and calculating the face block in the image to be focused. - face parameters; according to the face parameters fine _ parameter focal length comparison table to get - difficult section; and miscellaneous pairs of sections and - face sampling spacing from the Lin:!, the program to get - the target New Zealand, its towel The face sampling pitch is less than the preset sampling interval. The face parameter can be a length ratio or a side ratio of the face block to the image to be focused. The parameter focal length comparison table may correspond to a face detection program, and the image capturing device detects the face block in the image to be focused by using the face detection program. 201204023 According to an example of the present invention, according to the face parameter fine parameter focal length comparison table, the difficulty may be included: according to the face parameter fine parameter focal length pair • silk 'and corresponding to the face parameter - pre-focus position And according to the zoom ratio of the image capturing device, the focus segment is obtained by using the predicted focus position as a reference point. Further, 'pair: 1, zone & may have a - front section and a - post section. The front segment is located between the near focal length of the image to the image capturing device, and the rear segment is located between the measuring position and the far focus of the image capturing device. Also, the length of the "secret" section according to the present invention may be the same as the length of the body segment. Further, according to another aspect of the present invention, the length of the thin section may be larger or smaller than the length of the rear section. After the focus segment is obtained, the automatic difficulty program can calculate the target focal length by the quadratic polynomial approximation method. As described above, the method of assisting the focus of the face block is based on the face parameters of the face block to refer to the parameters: !, the turn wire and the high precision of the segment is performed on the higher precision of the segment. Therefore, the accuracy of the autofocus can be improved to obtain a better target focal length, and a clear human face image can be captured. [Embodiment] Hereinafter, the detailed features and advantages of the present invention will be described in detail in the conjugate mode, which is sufficient for any skilled person to understand the technical contents of the present invention and to implement 'and according to the contents disclosed in this book. Applicants, applicants and related art can understand the purpose and advantages of the present invention. The invention provides a method for assisting focusing of a face block, which is suitable for an image capturing device having a 201204023 Amo Focusing (AF) program, wherein the autofocus program has a preset sampling pitch. Please refer to "FIG. 1", which is a block diagram of an image manipulation device according to an embodiment of the present invention. However, the image capturing apparatus to which the method of assisting focusing of the face block according to the present invention is applied is not limited to "Fig. 1". The image pickup device 20 can be, for example, a digital camera, a camera camera with a camera function, or a webcam. The image capturing device includes a lens unit 〇enS unit) 22, a photosensitive unit (ph〇t〇sensitive reading) 24, a microprocessor (micro processor unit) 26, and a storage unit (such as feeding the fairy illusion 28. When taking the image, the image capture device will focus on the lens unit (f0cusing distance, also known as focal length, free of coffee). When the user shoots the image, 'micro processing H 26 (four) outline 22 Jing should respond to the focus-focus position and store the image obtained by the head unit 22 money sensing unit 24 in the storage unit 28. ~ Focus distance refers to the center point of the lens unit 22 to the subject or the subject The distance between the lengths is a meter or a cent. The position can also be called 2 focal lengths, which is the distance between the optical center point of the unit 22 and the photosensitive soap element 24. The staking device 20 can control the lens device 22 to different focus positions through a step motor (step motor 'not drawn). The focus position is generally in steps (also called step distance). Note that difficult distance The relationship between the remaining _ relations is not necessarily proportional. For example, the number of steps corresponding to the focal length of i meters is not necessarily twice the number of steps corresponding to the focal length of half a meter; the focusing distance is 2 The step distance corresponding to the ruler is not limited to 201204023. The fixed focus distance is twice the number of steps corresponding to the metric meter.
接著請同時參考「第2圖」'「第3A圖」以及「第3B圖」, 其分別為根據本㈣-實職狀人臉區塊·雜的方法之流 程圖’以據本發明不同實施範例之人臉區塊之示賴。μ 影像娜裝置20首先操取一欲對焦影像30 (步驟S11〇),其 中欲對焦影像30具有-人臉區塊(faee bbek) %。人臉區塊η 係指被攝人物驗觀取献對絲像3()讀,輯 之中人臉部分的f彡像。且縣練裝置2G讀纽器%可執行 -人臉侧程序,以_欲影像3G巾的人臉區塊32。 影像娜裝置20平時可使用自動對焦程序,依據預設取樣間 隔將鏡頭單元22逐-_至獨崎纽置⑽行自麟焦。然 而當欲對祕像30巾_到人臉轉32時,代表賴者欲對至 少-個人麵攝。狀祕塊輔輯_方法可㈣下述步驟針 對被攝人物提高自崎錄序的精度並目標餘,比使用 目標焦距拍攝被攝人物來得到優秀的人像影像。 付到人臉區塊32之後’微處理^ 26計算欲聽影像3〇中的 臉區塊32的_人臉參數(步驟S12G)。根據本發明,人臉參數可 以是人臉區塊32與整張欲對焦影像%的—長度比或是一面積 比。舉例而言,假設欲對焦影像30的解析度為_*彻,而以人 臉債測程序伽|则的人舰塊32的解析度為丨胸q。則人臉參 120 3 640 ~Ϊ6 數可以是 ^或是Si 由於人臉參祕_人賴塊32與崎鮮彡像%之間的比 例值而非賴值’故人歷塊_對_方法可細於不同影像 201204023 格式以及各種影像擷取裝置20。 接著微處理器26依據人臉參數查閱一參數焦距對照表,以得 到一對焦區段(步驟S130)。對焦區段係為擷取被攝人物之影像 時可此的對f、位置的範圍,故應以較高的對錢度於對焦區段内 執行自動對焦程序。 較佳的是,參數焦距對照表係可對應於人臉偵測程序。因為 即使處理同一張欲對焦影像30,使用不同的人臉偵測程序可能找 出不同大小或不同位置的人臉區塊32。因此參數焦距對照表可配 合人臉偵測程序設計。 如「第3A圖」以及「第3B圖」所示,一般而言,距離影像 榻取裝置20較近的被攝人物會在輯焦影像30巾形成較大的人 臉區塊32’而距離影像操取裝置2〇較遠的被攝人物則會在欲對焦 影像30中形成較小的人臉區塊32。 根據本發明之—實施制,依據人臉參數雜參數焦距對照 表以得晴雜段的轉可包括:輯人齡數查·數焦賴 照表’並得到與人臉參數對應的一預測對焦位置;以及依據影像 齡裝置20的-縮放倍率,以預測對焦位置絲準點得到對隹區 縮放倍率係為擷取欲對焦影像30時,影像掏取農置2〇被机 置的變焦倍率,亦對應於焦長。例如當影像摘取裝置^ 的鏡頭單元22可進行焦長為37mm (公厘)至26〇mm變焦,則 縮放倍率為3?mm至挪麵。具變焦功能的鏡頭單元η可以在 拍攝前調整鏡頭單元22之中的鏡片的位置,而改變焦長。盆中最 201204023 短焦長(37mm)的一端稱為廣角端(wide),影像擷取裝置如 能夠擷取到範圍較大的影像;反之最長焦長的一端貝, 為望遠端(tele) ’視覺上像是把遠處的景物f彡像拉近影像榻取裳J 置20 ’而有把影像放大的效果。 、 縮放倍率會影_職取制距。例如當縮放倍率被設為接 近廣角端時,預設取制距可以是20 step ;而當縮放倍率被設為 接近望遠稱,預設取制距可以是3G step。f彡賴取裝置^可 鲁依據擷取欲對焦影像3〇時的縮放倍率以預測對焦位置為基準點得 到對焦區段’也就是得_取被攝人物之影像時最可能的對焦位 置的範圍。 … 请參照「第4A圖」、「第4B圖」以及「第4C圖」,其分 別為根據本發明不同實施範例之對焦區段之示意圖。 刀 ^步驟S130中以預測對焦位置4〇得到對焦區段42,且對焦 區段42可具有為一前區段44以及一後區段46。其中前區段44 _係位於預測對焦位置40至影像操取裝置2〇的一近焦距(Near) 之間,後11段46則位於預測對焦位置4G至影像擷取裝置2〇的一 f焦距(Fa〇之間。其中近焦距的焦長較長(例如200步距),而 喊距的焦長較短(例如蠢步距)。且不同的縮放倍率亦會對應 有不同的近焦距以及遠焦距。 。、θ ί根據本發日月,前區段44的長度可與後區段46的長度相同; 或疋别區段44的長度可大於或擔観段46的長度。 以下舉實際之數據作為赃來說明,但根縣發明之人臉區 土輔助對焦的方法並不限於這些舉例之數據。 201204023 當擁取欲對焦影像30時,影像榻取裝置2〇的縮放倍率較接 ^廣角f ’則代表可能欲對較遠處的被攝人物進行難。假設此 =預二取樣間距為20步距,而查表得到之預測對焦位置4 第:距。則可指定由預測對焦位置40往目前 : ===峡,卿騎嶋物紐方向的= 土的細為對焦區段42。因此對焦區段42為第⑽步距 到第170步距之間的範圍。 #接影像_置2〇在榻取欲對焦影像3〇時縮放被率 罢4η 賴設取制距為30步距。則可指定由預測對隹 ^距起ti第Μ""步轉往目前之縮放倍率的遠焦距方向的30個 步距起’到預測對焦位置40往近焦距方向的Μ個步距為 :=區段㈣步距之 然而根據本㈣之另—實施範例,參 錄之獅跑、位置4G,岐_==== -預測焦段。且影賴取裝置2G亦可 及預測焦段得到對焦區段42。 依據縮放倍據以 人臉段自41 讀’物1126⑽麵_段42以及一 麵W自咖筛_彳吼切(步驟 八中人臉取樣間距係小於預設取 r 理器26以高於預設值的自動對焦精度執行17自動^段库42内微處 樣焦距亦與縮放倍率有關,例如當 ^序。人臉取 取樣間距辦― 201204023 間距可以是6步距。Please refer to "Fig. 2", "3A" and "3B", respectively, which are flowcharts according to the method of (4) - the actual face block and the miscellaneous method, according to different embodiments of the present invention. The face of the face block. The μ image capturing device 20 first operates a desired image 30 (step S11〇), wherein the image to be focused 30 has a faee bbek %. The face block η refers to the f人物 image of the face part of the person who is photographed and taken to the silk image 3(). And the county training device 2G reader can be executed - the face side program, to the image of the 3G towel face block 32. The image sensor device 20 can use the auto-focus program to separate the lens unit 22 from the monograph to the monosyllabic (10) line according to the preset sampling interval. However, when you want to turn to the secret image 30 towel _ to the face to 32, it means that the person wants to be at least - personal face. The esoteric block _ method can be used. (4) The following steps are used to improve the accuracy of the self-scoring sequence for the person being photographed, and the target is more excellent than the target person using the target focal length to obtain an excellent portrait image. After the face block 32 is applied, the micro-processing 26 calculates the _ face parameter of the face block 32 to be listened to in the image 3 (step S12G). According to the present invention, the face parameter can be a length ratio or an area ratio of the face block 32 to the entire image to be focused. For example, suppose the resolution of the image to be focused 30 is _*, and the resolution of the human block 32 with the face of the fingerprint is 丨*. Then the face parameter 120 3 640 ~ Ϊ 6 number can be ^ or Si due to the face 参 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Finer than the different image 201204023 format and various image capturing devices 20. Next, the microprocessor 26 refers to a parametric focal length reference table based on the face parameters to obtain a focus section (step S130). The focus section is the range of f and position that can be used to capture the image of the subject. Therefore, the autofocus procedure should be performed in the focus section with a high degree of money. Preferably, the parameter focal length comparison table may correspond to a face detection program. Because even if the same image to be focused 30 is processed, a different face detection program may be used to find face blocks 32 of different sizes or different positions. Therefore, the parameter focal length comparison table can be matched with the face detection program design. As shown in "3A" and "3B", in general, a subject who is closer to the image couch 20 will form a larger face block 32' in the focus image 30. The subject who is far away from the image capturing device 2 will form a smaller face block 32 in the image to be focused 30. According to the implementation system of the present invention, according to the face parameter misparameter focal length comparison table, the turn of the clear segment may include: a series of human age counts and a number of focus tables and a predicted focus corresponding to the face parameters. Positioning; and according to the zooming magnification of the image-aged device 20, the zooming magnification is obtained by predicting the focus position of the focus position, and the zooming magnification of the image is taken when the image is captured. Corresponds to the focal length. For example, when the lens unit 22 of the image pickup device can perform a focal length of 37 mm (millimeter) to 26 mm, the zoom magnification is 3 mm to the surface. The lens unit η having the zoom function can adjust the position of the lens in the lens unit 22 before shooting, and change the focal length. The end of the most 201204023 short focal length (37mm) in the basin is called the wide-angle end (wide), and the image capturing device can capture a larger range of images; otherwise, the end of the longest focal length is telescopic. Visually, it is like zooming in on the image of the distant scene, and it has the effect of magnifying the image. , zoom ratio will be shadow _ job take the distance. For example, when the zoom magnification is set to be close to the wide-angle end, the preset take-up distance may be 20 step; and when the zoom magnification is set to be close to the telephoto scale, the preset take-up distance may be 3G step.彡 取 取 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ . ... Please refer to "4A", "4B" and "4C", which are schematic views of the focusing sections according to different embodiments of the present invention, respectively. The focus portion 42 is obtained by predicting the focus position 4 步骤 in step S130, and the focus section 42 may have a front section 44 and a rear section 46. The front segment 44_ is located between the predicted focus position 40 and a near focal length (Near) of the image capturing device 2〇, and the rear 11 segment 46 is located at the predicted focus position 4G to an f focal length of the image capturing device 2〇. (Fa〇. Among them, the focal length of the near focal length is longer (for example, 200 steps), and the focal length of the shouting distance is shorter (for example, the stupid step). Different zoom ratios also correspond to different near focal lengths and The distance between the far focal lengths . . . , θ ί , according to the date of the present invention, may be the same as the length of the rear section 46; or the length of the screening section 44 may be greater than or the length of the section 46. The data is used as a description, but the method of the human face-assisted focusing method invented by the root county is not limited to the data of these examples. 201204023 When the image 30 to be focused is captured, the zoom ratio of the image pickup device 2〇 is higher than that of the image. The wide-angle f 'represents that it may be difficult to make a distant person. It is assumed that this = the pre-sampling interval is 20 steps, and the look-up table obtains the predicted focus position 4: distance. You can specify the predicted focus position. 40 to the present: ===xia, Qing riding the object direction = soil The focus is on the focus section 42. Therefore, the focus section 42 is in the range from the (10)th step to the 170th step. #接影像_Set 2〇 When zooming in on the couch to zoom in on the image 3〇, the zoom rate is 4η 赖The set distance is 30 steps. It can be specified from the prediction of the distance 隹 距 ti Μ quot & & & & & & & 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 The step distance in the direction of the focal length is: = section (four) step distance However, according to the other example of (4), the lion running, position 4G, 岐_==== - predicted focal length, and the device 2G It is also possible to obtain the focus section 42 with the predicted focal length. According to the zooming factor, the face segment is read from the 'object 1126 (10) plane _ section 42 and the side W is sifted from the coffee screen _ ( (the face sampling interval in step 8 is smaller than The preset take-up processor 26 performs the auto-focus precision higher than the preset value. The auto-segment focal length in the auto-segment library 42 is also related to the zoom magnification, for example, when the face is taken, the sampling interval is set to - 201204023. It is 6 steps.
承上述實際數據的例子,則可在苐M =區段42中,以4步距之取樣間隔執行自 二=:步距到第165步距之間的對焦區段42中,以6步距 之取樣間隔執行自動對焦程序。 得到對焦區段42之後,自鱗焦程序便可⑽-二次多項式 逼近法計算目標焦距。 、 請參照「第5圖」,其係為根據本發明—實施範例之清晰度 曲線之示意圖。 二次多項式逼近法亦可稱為二次多項式曲線擬合法。自動對 焦程序於區段42之⑽多個難位置上個臟取—張影像, 並計算這絲像的—清喊。接著可將龍區段42 _各個對焦 以及對應之清晰度作為X軸以及γ軸進行描點,並得到一清晰度 曲線50。接著依據清晰度曲線5()進行二次多項式曲線擬合可以得 到一二次多項式擬合曲線52’並計算二次多項式擬合曲線52的峰 值(peak)所對應的對焦位置作為目標焦距。 更詳細地說,自動對焦程序係於對焦區段42之内,每隔一個 人臉取制賴取-張影絲計算清晰度^而人臉取樣間距的計 算方式可以是騎f'區段42除以-取樣點數。麟同_對焦區段 42之内,取樣點數越多就表示人臉取樣間距越小,自動對焦的精 度越高。 舉例而言’在欲對焦影像3〇中沒有偵測到人臉區塊32時, 自動對焦程序於微距到無限遠之間的範圍取1〇點取樣點數進行自 201204023 動對焦。而在欲對焦影像30中偵測到人臉區塊32時,亦 區段42内取10點取樣點數進行自動對焦。如此 費 同樣的時間以ω張影像進行二次多項式逼近法,但可得収= 的目彳示焦距,而能夠避免對焦誤差。 前述之參數驗賴表射採財驗法建立。實驗法建立係 曰以不同的焦距對對應各種人臉參數之被攝人物拍攝 對應各人臉參數之預測對焦位置4〇,藉以建立參數焦距對昭表。于 何述之實絲_具有單,塊32的欲對焦 ~象0為例,人臉區塊輔助財法亦賴於具衫個人臉區 塊32的欲對焦影像30。例如可取所有的人臉參數的平均值、中^ 數或眾數進行查表;或是可衫個人臉參數絲得到多個預測對 焦位置40再取其平均數、中位數或眾數作為最後的預測對焦位置 40 〇 綜上所述’根據本發明之人臉區塊輔助對焦的方法依據人臉 區塊的人臉參數_參缝距對縣,並於得_職區段内以 較向的精度執行自崎紐序。由於不需在影賴取裝置内設置 光發射器和接收H等額外的硬體,因此製造成核低^再者提高 自動對焦晴度便可得顺習知技術更準_目標驗,而能^ 令使用者拍攝到清晰的人臉影像。 —雖然本發明以前述之較佳實施·露如上,然其並非用以限 定本發明,任何熟習相像聽者,在猶離本判之精神和範圍 内’、當可作些許之更動制飾,因此本㈣之專娜護範圍須視 本說明書卿之ψ請專概騎狀者為準。 12 201204023 【圖式簡單說明】 第1圖係為根據本發明一實施範例之影像擷取裝置之方塊示 意圖; 第2圖係為根據本發明一實施範例之人臉區塊輔助對焦的方 法之流程圖; 第3A圖係為根據本發明一實施範例之人臉區塊之示意圖; 第3B圖係為根據本發明另一實施範例之人臉區塊之示意圖; 第4A圖係為根據本發明一實施範例之對焦區段之示意圖; 第4B圖係為根據本發明另一實施範例之對焦區段之示意圖; 第4C圖係為根據本發明又一實施範例之對焦區段之示意 圖;以及 u 第5圖係為根據本發明一實施範例之清晰度曲線之示意圖。 【主要元件符號說明】 20 22 24 26 28 30 32 40An example of the above actual data may be performed in the 区段M=section 42 at a sampling interval of 4 steps from the focus section 42 between the step=step to the 165th step, in 6 steps. The auto-focus procedure is performed at the sampling interval. After the focus section 42 is obtained, the target focal length can be calculated from the scale coke program by the (10)-quadratic polynomial approximation method. Please refer to "figure 5" which is a schematic diagram of a sharpness curve according to the present invention. The quadratic polynomial approximation method can also be called a quadratic polynomial curve fitting method. The auto focus program takes a dirty image on the (10) multiple difficult positions of the segment 42 and calculates the shout of the silk image. The dragon segments 42 _ respective focus and corresponding sharpness can then be plotted as the X-axis and the γ-axis, and a sharpness curve 50 is obtained. Then, the quadratic polynomial curve fitting according to the sharpness curve 5() can obtain a quadratic polynomial fitting curve 52' and calculate the in-focus position corresponding to the peak of the quadratic polynomial fitting curve 52 as the target focal length. In more detail, the auto-focusing program is within the focusing section 42, and every other face is taken to calculate the sharpness and the face sampling interval can be calculated by dividing the f' section 42 by - The number of sampling points. Within the Lintong_focus section 42, the more sampling points, the smaller the face sampling interval and the higher the accuracy of autofocus. For example, when the face block 32 is not detected in the image to be focused, the autofocus program takes 1 point of sampling points from macro to infinity to perform focusing from 201204023. When the face block 32 is detected in the image to be focused 30, the number of sampling points in the segment 42 is also taken to perform autofocus. In this way, the quadratic polynomial approximation method is performed with ω images at the same time, but the focal length of the target can be obtained, and the focus error can be avoided. The aforementioned parameter verification method is established by the method of mining and mining. The experimental method is established to capture the predicted focus position corresponding to each face parameter with different focal lengths for the subjects corresponding to various face parameters, thereby establishing a parameter focal length pair table. In the case of He Shuzhi _ has a single, block 32 to focus ~ like 0 for example, the face block assisted financial method also depends on the personal face of the shirt 32 to focus on the image 30. For example, it is possible to look up the average value, the middle number or the mode of all face parameters, or to obtain a plurality of predicted focus positions 40 and then take the average, median or mode as the last. The predicted focus position 40 is summarized as follows. The method for assisting the face block according to the present invention is based on the face parameter of the face block _ the distance from the seam to the county, and in the field of the job The precision is performed from the narrative order. Since it is not necessary to set up a light emitter and receive additional hardware such as H in the device, the manufacturing nucleation is low, and the improvement of the autofocus brightness can be more accurate than the target technology. ^ Allows the user to capture a clear face image. </ RTI> <RTIgt; </ RTI> <RTIgt; </ RTI> <RTIgt; </ RTI> <RTIgt; </ RTI> <RTIgt; </ RTI> <RTIgt; Therefore, the scope of the special care of this (4) shall be subject to the requirements of this specification. 12 201204023 [Brief Description of the Drawings] FIG. 1 is a block diagram of an image capturing device according to an embodiment of the present invention; FIG. 2 is a flow chart of a method for assisting focusing of a human face block according to an embodiment of the present invention. FIG. 3A is a schematic diagram of a face block according to an embodiment of the present invention; FIG. 3B is a schematic diagram of a face block according to another embodiment of the present invention; FIG. 4A is a diagram according to the present invention; FIG. 4B is a schematic diagram of a focusing section according to another embodiment of the present invention; FIG. 4C is a schematic diagram of a focusing section according to still another embodiment of the present invention; and u 5 is a schematic diagram of a sharpness curve according to an embodiment of the present invention. [Main component symbol description] 20 22 24 26 28 30 32 40
影像擷取裝置 鏡頭單元 感光單元 微處理器 儲存單元 欲對焦影像 人臉區塊 預測對焦位置 對焦區段 13 42 201204023 44 前區段 46 後區段 50 清晰度曲線 52 二次多項式擬合曲線Image capture unit Lens unit Photo unit Microprocessor Storage unit Image to be focused Face block Predicted focus position Focus section 13 42 201204023 44 Front section 46 Rear section 50 Sharpness curve 52 Quadratic polynomial fitting curve