[go: up one dir, main page]

CN102314043A - Auxiliary focusing method for human face block - Google Patents

Auxiliary focusing method for human face block Download PDF

Info

Publication number
CN102314043A
CN102314043A CN2010102258753A CN201010225875A CN102314043A CN 102314043 A CN102314043 A CN 102314043A CN 2010102258753 A CN2010102258753 A CN 2010102258753A CN 201010225875 A CN201010225875 A CN 201010225875A CN 102314043 A CN102314043 A CN 102314043A
Authority
CN
China
Prior art keywords
face
focus
image
section
image capture
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN2010102258753A
Other languages
Chinese (zh)
Inventor
严志彬
蔡嘉伦
郭力文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Altek Corp
Original Assignee
Altek Corp
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 Altek Corp filed Critical Altek Corp
Priority to CN2010102258753A priority Critical patent/CN102314043A/en
Publication of CN102314043A publication Critical patent/CN102314043A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Automatic Focus Adjustment (AREA)

Abstract

The invention discloses a method for auxiliary focusing of a human face block, which is suitable for an image capturing device with an automatic focusing program, wherein the automatic focusing program has a preset sampling interval. The method for auxiliary focusing of the face block comprises the following steps: capturing an image to be focused, wherein the image to be focused is provided with a human face block; calculating the face parameters of the face blocks in the image to be focused; looking up a parameter focal length comparison table according to the human face parameters to obtain a focusing section; and executing an automatic focusing program according to the focusing section and the face sampling interval to obtain a target focal length, wherein the face sampling interval is smaller than a preset sampling interval.

Description

人脸区块辅助对焦的方法The method of face block auxiliary focus

技术领域 technical field

本发明涉及一种辅助对焦的方法,特别是一种以人脸区块辅助对焦的方法。The present invention relates to a method for assisting focusing, in particular to a method for assisting focusing with human face blocks.

背景技术 Background technique

在拍摄影像时,需要正确地把焦距对到被摄物体上以得到清晰的照片,而在现今一般的数字相机等影像撷取装置都已内建有自动对焦功能。自动对焦大致上可以分为两大类,一为主动式自动对焦(active auto focus),另一为被动式自动对焦(passive auto focus)。When shooting an image, it is necessary to correctly focus on the subject to obtain a clear picture, and today's general digital cameras and other image capture devices have built-in auto-focus functions. Autofocus can be roughly divided into two categories, one is active autofocus (active autofocus), and the other is passive autofocus (passive autofocus).

主动式自动对焦的技术利用一组红外线发射器或是激光发射器和相对的接收器投射光的图案在被摄体上,再以三角测量法(triangulation)等方法计算相机与被摄物体之间的距离,而此距离即为焦距。然而主动式自动对焦方式精度较差,也就是说无法得到很准确的焦距,且无法被使用于影像撷取装置和被摄物体之间有玻璃等东西阻隔的情况。此外,使用主动式自动对焦需在相机内额外设置光发射器和接收器,因此成本较高。Active autofocus technology uses a group of infrared emitters or laser emitters and relative receivers to project light patterns on the subject, and then calculates the distance between the camera and the subject by methods such as triangulation. distance, and this distance is the focal length. However, the precision of the active autofocus method is poor, that is to say, it is impossible to obtain a very accurate focal length, and it cannot be used in the situation where there is glass or other things between the image capture device and the object to be photographed. In addition, the use of active autofocus requires an additional light transmitter and receiver in the camera, which is costly.

被动式自动对焦则在正式拍摄前,在从离影像撷取装置最近的微距到被设为无限远的区域中撷取许多张影像,并分析所获得的影像的清晰度来决定焦距。被动式自动对焦方式只需用到相机本身所具有的影像感测器及运算单元,因此能够减轻制造成本。但是被动式自动对焦由于需耗费的运算量较大,因此常牺牲精度以避免花费过多的时间在自动对焦上。Passive autofocus captures many images from the closest macro distance to the infinity area before the official shooting, and analyzes the clarity of the obtained images to determine the focal length. The passive auto-focus method only needs to use the image sensor and computing unit of the camera itself, so the manufacturing cost can be reduced. However, passive autofocus often sacrifices precision to avoid spending too much time on autofocus due to the large amount of computation required.

而近年来,使用数字相机等影像撷取装置来拍摄影像的使用者大幅增加。除了摄影专业人员之外,也有越来越多的一般使用者使用数字相机来拍摄。通常,一般使用者所拍摄的影像,因拍摄技巧不如专业人员,故其所摄得的影像经常会有焦距不对等问题。然而在拍摄照片时,人物影像常是画面中的重点的部分。传统的自动对焦方式却可能会把背景或是人物以外的其他东西判断为摄影主体,而存在有应该为拍摄重点的人物却反而失焦的问题。再者一旦自动对焦的精度不足而产生对焦误差,很可能会导致拍摄的影像严重模糊。尤其是当拍摄的影像是人像时,出现在人脸上的摄影缺陷更显得糟糕。In recent years, the number of users who use image capture devices such as digital cameras to capture images has increased significantly. In addition to photography professionals, there are also more and more general users who use digital cameras to shoot. Usually, the images captured by general users often have problems such as focal length inconsistencies because the shooting skills of ordinary users are not as good as those of professionals. However, when taking a photo, the image of a person is often the most important part of the picture. The traditional auto-focus method may judge the background or other things other than the characters as the subject of photography, but there is a problem that people who should be the focus of the shooting are out of focus instead. Furthermore, once the precision of the auto focus is insufficient and a focus error occurs, it is likely to cause serious blurring of the captured image. Especially when the captured image is a portrait, photographic imperfections appearing on people's faces are even worse.

发明内容 Contents of the invention

为了解决上述问题,本发明提供一种人脸区块辅助对焦的方法,其适用于具有一自动对焦程序的一影像撷取装置。自动对焦程序具有一预设取样间距,而人脸区块辅助对焦的方法包括:撷取一欲对焦影像,其中欲对焦影像具有一人脸区块;计算欲对焦影像中的人脸区块的一人脸参数;依据人脸参数查阅一参数焦距对照表以得到一对焦区段;以及依据对焦区段以及一人脸取样间距执行自动对焦程序以得到一目标焦距,其中人脸取样间距小于预设取样间距。In order to solve the above problems, the present invention provides a method for assisting focusing of face blocks, which is suitable for an image capture device with an auto-focus program. The auto-focus program has a preset sampling interval, and the face block-assisted focusing method includes: capturing an image to be focused, wherein the image to be focused has a face block; calculating a person of the face block in the image to be focused face parameters; refer to a parameter focal length comparison table according to the face parameters to obtain a focus section; and perform an auto-focus procedure according to the focus section and a face sampling interval to obtain a target focal length, wherein the face sampling interval is smaller than the preset sampling interval .

人脸参数可以是人脸区块与欲对焦影像的一长度比或是一面积比。而参数焦距对照表可对应于一人脸侦测程序,且影像撷取装置以此人脸侦测程序在欲对焦影像中侦测出人脸区块。The face parameter can be a length ratio or an area ratio between the face block and the image to be focused. The parameter focal length comparison table may correspond to a face detection program, and the image capture device detects a face block in the image to be focused by using the face detection program.

根据本发明的一实施范例,依据人脸参数查阅参数焦距对照表以得到对焦区段的步骤可包括:依据人脸参数查阅参数焦距对照表,并得到与人脸参数对应的一预测对焦位置;以及依据影像撷取装置的一缩放倍率,以预测对焦位置为基准点得到对焦区段。According to an implementation example of the present invention, the step of consulting the parameter focal length comparison table according to the face parameters to obtain the focus segment may include: consulting the parameter focal length comparison table according to the face parameters, and obtaining a predicted focus position corresponding to the face parameters; And according to a zoom ratio of the image capture device, the focus segment is obtained with the predicted focus position as a reference point.

此外,对焦区段可具有为一前区段以及一后区段。其中前区段位于预测对焦位置至影像撷取装置的一近焦距之间,后区段则位于预测对焦位置至影像撷取装置的一远焦距之间。且根据本发明的一实施范例,前区段的长度可与后区段的长度相同。而根据本发明的另一实施范例,前区段的长度可大于或是小于后区段的长度。In addition, the focus segment may have a front segment and a rear segment. The front segment is located between the predicted focus position and a short focus distance of the image capture device, and the rear segment is located between the predicted focus position and a far focus distance of the image capture device. And according to an embodiment of the present invention, the length of the front section may be the same as that of the rear section. According to another embodiment of the present invention, the length of the front section may be greater than or shorter than the length of the rear section.

而得到对焦区段之后,自动对焦程序可以以一二次多项式逼近法计算目标焦距。After the focus segment is obtained, the auto-focus program can calculate the target focal length by a quadratic polynomial approximation method.

综上所述,人脸区块辅助对焦的方法依据人脸区块的人脸参数查阅参数焦距对照表,并在得到的对焦区段内以较高的精度执行自动对焦程序。因此能够提高自动对焦的精度而得到更佳的目标焦距,而能够拍摄到清晰的人脸影像。To sum up, the face block assisted focusing method consults the parameter focal length comparison table according to the face parameters of the face block, and executes the auto-focus procedure with high precision in the obtained focus area. Therefore, the accuracy of autofocus can be improved to obtain a better target focal length, and a clear human face image can be captured.

附图说明 Description of drawings

图1为根据本发明一实施例的影像撷取装置的方块示意图;FIG. 1 is a schematic block diagram of an image capture device according to an embodiment of the present invention;

图2为根据本发明一实施例的人脸区块辅助对焦的方法的流程图;FIG. 2 is a flow chart of a method for assisting focusing of a face block according to an embodiment of the present invention;

图3A为根据本发明一实施例的人脸区块的示意图;FIG. 3A is a schematic diagram of a face block according to an embodiment of the present invention;

图3B为根据本发明另一实施例的人脸区块的示意图;3B is a schematic diagram of a face block according to another embodiment of the present invention;

图4A为根据本发明一实施例的对焦区段的示意图;FIG. 4A is a schematic diagram of a focus section according to an embodiment of the present invention;

图4B为根据本发明另一实施例的对焦区段的示意图;FIG. 4B is a schematic diagram of a focus section according to another embodiment of the present invention;

图4C为根据本发明又一实施例的对焦区段的示意图;以及FIG. 4C is a schematic diagram of a focus region according to yet another embodiment of the present invention; and

图5为根据本发明一实施例的清晰度曲线的示意图。FIG. 5 is a schematic diagram of a sharpness curve according to an embodiment of the present invention.

其中,附图标记Among them, reference signs

20    影像撷取装置20 image capture device

22    镜头单元22 lens unit

24    感光单元24 photosensitive units

26    微处理器26 microprocessors

28    储存单元28 storage units

30    欲对焦影像30 To focus on the image

32    人脸区块32 face blocks

40    预测对焦位置40 predict focus position

42    对焦区段42 focus section

44    前区段44 front section

46    后区段46 rear section

50    清晰度曲线50 sharpness curve

52    二次多项式拟合曲线52 Quadratic polynomial fitting curve

具体实施方式 Detailed ways

以下在实施方式中详细叙述本发明的详细特征以及优点,其内容足以使任何本领域技术人员了解本发明的技术内容并据以实施,且根据本说明书所公开的内容、申请专利范围及附图,任何本领域技术人员可轻易地理解本发明相关的目的及优点。The detailed features and advantages of the present invention are described in detail below in the implementation manner, and its content is enough to make any person skilled in the art understand the technical content of the present invention and implement it accordingly, and according to the content disclosed in this specification, the patent scope of the application and the accompanying drawings , any person skilled in the art can easily understand the related objects and advantages of the present invention.

本发明提供一种人脸区块辅助对焦的方法,其适用于具有一自动对焦(Auto Focusing,AF)程序的一影像撷取装置,其中自动对焦程序具有一预设取样间距。The present invention provides a method for assisting focusing of a face block, which is suitable for an image capture device with an Auto Focusing (AF) program, wherein the Auto Focusing program has a preset sampling interval.

请参照图1,其为根据本发明一实施范例的影像撷取装置的方块示意图。但根据本发明的人脸区块辅助对焦的方法所适用的影像撷取装置不限于图1。Please refer to FIG. 1 , which is a schematic block diagram of an image capture device according to an embodiment of the present invention. However, the image capture device applicable to the method for assisting focusing of face blocks according to the present invention is not limited to FIG. 1 .

影像撷取装置20可以例如是数字相机、附有拍照功能的相机、摄影机或是网络摄影机(webcam)。影像撷取装置20包括一镜头单元(lens unit)22、一感光单元(photosensitive unit)24、一微处理器(micro processor unit)26以及一储存单元(storage unit)28。当撷取影像时,影像撷取装置20将镜头单元22对焦于一对焦距离(focusing distance,亦称为焦距,focus)上。则当使用者拍摄影像时,微处理器26控制镜头单元22至对应此对焦距离的一对焦位置,并将通过镜头单元22以及感光单元24得到的影像储存于储存单元28。The image capture device 20 can be, for example, a digital camera, a camera with a camera function, a video camera or a webcam. The image capture device 20 includes a lens unit (lens unit) 22 , a photosensitive unit (photosensitive unit) 24 , a microprocessor (micro processor unit) 26 and a storage unit (storage unit) 28 . When capturing an image, the image capturing device 20 focuses the lens unit 22 on a focusing distance (also referred to as focus). Then when the user shoots an image, the microprocessor 26 controls the lens unit 22 to a focus position corresponding to the focus distance, and stores the image obtained by the lens unit 22 and the photosensitive unit 24 in the storage unit 28 .

对焦距离指镜头单元22的光学中心点至被摄物或被摄人物之间的距离,长度单位可以是米或厘米。而对焦位置亦可被称为焦距(focus length),其指镜头单元22的光学中心点至感光单元24之间的距离。影像撷取装置20可通过一步进马达(step motor,未绘示)控制镜头装置22至不同的对焦位置上。对焦位置一般以步距(step,亦称为步进距离)为单位。The focus distance refers to the distance from the optical center point of the lens unit 22 to the subject or person, and the unit of length may be meters or centimeters. The focus position can also be referred to as focus length, which refers to the distance from the optical center of the lens unit 22 to the photosensitive unit 24 . The image capture device 20 can control the lens device 22 to different focusing positions through a step motor (not shown). The focusing position is generally taken as a unit of a step (step, also referred to as a step distance).

需注意的是,对焦距离与对焦位置之间的关系并不一定是成正比。例如在对焦距离为1米对应的步距数并不一定是对焦距离为半米对应的步距数的两倍;对焦距离为2米对应的步距数亦不一定是对焦距离为1米对应的步距数的两倍。It should be noted that the relationship between the focus distance and the focus position is not necessarily proportional. For example, the number of steps corresponding to a focusing distance of 1 meter is not necessarily twice the number of steps corresponding to a focusing distance of half a meter; the number of steps corresponding to a focusing distance of 2 meters is not necessarily the same as that corresponding to a focusing distance of 1 meter. twice the number of steps.

接着请同时参考图2、图3A以及图3B,其分别为根据本发明一实施范例的人脸区块辅助对焦的方法的流程图,以及根据本发明不同实施范例的人脸区块的示意图。Next, please refer to FIG. 2 , FIG. 3A and FIG. 3B , which are respectively a flow chart of a method for assisting focusing of a face block according to an embodiment of the present invention, and schematic diagrams of face blocks according to different embodiments of the present invention.

影像撷取装置20首先撷取一欲对焦影像30(步骤S110),其中欲对焦影像30具有一人脸区块(face block)32。人脸区块32指被摄人物的脸被撷取成欲对焦影像30之后,欲对焦影像30之中人脸部分的影像。且影像撷取装置20的微处理器26可执行一人脸侦测程序,以侦测欲对焦影像30中的人脸区块32。The image capturing device 20 first captures an image to be focused 30 (step S110 ), wherein the image to be focused 30 has a face block 32 . The face block 32 refers to an image of the face portion in the to-be-focused image 30 after the face of the subject is captured as the to-be-focused image 30 . And the microprocessor 26 of the image capture device 20 can execute a face detection program to detect the face block 32 in the image 30 to be focused.

影像撷取装置20平时可使用自动对焦程序,依据预设取样间隔将镜头单元22逐一移动至不同的对焦位置以进行自动对焦。然而当欲对焦影像30中侦测到人脸区块32时,代表使用者欲对至少一个人物拍摄。则人脸区块辅助对焦的方法可以以下述步骤针对被摄人物提高自动对焦程序的精度并得到一目标焦距,比使用目标焦距拍摄被摄人物来得到优秀的人像影像。The image capture device 20 can usually use an auto-focus program to move the lens unit 22 to different focus positions one by one according to a preset sampling interval to perform auto-focus. However, when the face block 32 is detected in the image to be focused 30 , it means that the user intends to shoot at least one person. Then, the method for assisting focusing by the face block can improve the accuracy of the auto-focus procedure for the subject and obtain a target focal length by the following steps, which is better than using the target focal length to capture the subject to obtain an excellent portrait image.

得到人脸区块32之后,微处理器26计算欲对焦影像30中的脸区块32的一人脸参数(步骤S 120)。根据本发明,人脸参数可以是人脸区块32与整张欲对焦影像30的一长度比或是一面积比。举例而言,假设欲对焦影像30的解析度为640×480,而以人脸侦测程序侦测得到的人脸区块32的解析度为120×80。则人脸参数可以是

Figure BSA00000189458800051
Figure BSA00000189458800052
或是 After obtaining the face block 32, the microprocessor 26 calculates a face parameter of the face block 32 in the image to be focused on (step S120). According to the present invention, the face parameter may be a length ratio or an area ratio between the face block 32 and the entire image to be focused 30 . For example, assume that the resolution of the image 30 to be focused is 640×480, and the resolution of the face block 32 detected by the face detection program is 120×80. Then the face parameters can be
Figure BSA00000189458800051
Figure BSA00000189458800052
or

由于人脸参数采用人脸区块32与欲对焦影像30之间的比例值而非绝对值,因此人脸区块辅助对焦的方法可适用于不同影像格式以及各种影像撷取装置20。Since the face parameter adopts the proportional value between the face block 32 and the image to be focused on 30 instead of an absolute value, the face block-assisted focusing method is applicable to different image formats and various image capture devices 20 .

接着微处理器26依据人脸参数查阅一参数焦距对照表,以得到一对焦区段(步骤S130)。对焦区段为撷取被摄人物的影像时可能的对焦位置的范围,故应以较高的对焦精度于对焦区段内执行自动对焦程序。Then the microprocessor 26 consults a parameter focal length comparison table according to the face parameters to obtain a focus segment (step S130 ). The focus area is the range of possible focus positions when capturing the image of the subject, so the auto-focus procedure should be executed in the focus area with high focus accuracy.

较佳的是,参数焦距对照表可对应于人脸侦测程序。因为即使处理同一张欲对焦影像30,使用不同的人脸侦测程序可能找出不同大小或不同位置的人脸区块32。因此参数焦距对照表可配合人脸侦测程序设计。Preferably, the parameter focal length comparison table can correspond to the face detection program. Because even if the same image to be in focus 30 is processed, different face detection programs may be used to find out the face blocks 32 of different sizes or different positions. Therefore, the parameter focal length comparison table can be designed in conjunction with the face detection program.

如图3A以及图3B所示,一般而言,距离影像撷取装置20较近的被摄人物会在欲对焦影像30中形成较大的人脸区块32;而距离影像撷取装置20较远的被摄人物则会在欲对焦影像30中形成较小的人脸区块32。As shown in FIG. 3A and FIG. 3B , generally speaking, the subject who is closer to the image capture device 20 will form a larger face block 32 in the image 30 to be focused; A distant subject will form a smaller face block 32 in the image to be in focus 30 .

根据本发明的一实施例,依据人脸参数查阅参数焦距对照表以得到对焦区段的步骤可包括:依据人脸参数查阅参数焦距对照表,并得到与人脸参数对应的一预测对焦位置;以及依据影像撷取装置20的一缩放倍率,以预测对焦位置为基准点得到对焦区段。According to an embodiment of the present invention, the step of consulting the parameter focal length comparison table according to the face parameters to obtain the focus segment may include: consulting the parameter focal length comparison table according to the face parameters, and obtaining a predicted focus position corresponding to the face parameters; And according to a zoom ratio of the image capture device 20 , the focus segment is obtained with the predicted focus position as a reference point.

缩放倍率为撷取欲对焦影像30时,影像撷取装置20被设置的变焦(zoom)倍率,亦对应于焦距。例如当影像撷取装置20的镜头单元22可进行焦距为37mm(毫米)至260mm变焦,则缩放倍率为37mm至260mm。具变焦功能的镜头单元22可以在拍摄前调整镜头单元22之中的镜片的位置,而改变焦距。其中最短焦距(37mm)的一端称为广角端(wide),影像撷取装置20能够撷取到范围较大的影像;反之最长焦距的一端(260mm)则为望远端(tele),视觉上像是把远处的景物影像拉近影像撷取装置20,而有把影像放大的效果。The zoom magnification is the zoom magnification set for the image capture device 20 when capturing the image 30 to be focused, which also corresponds to the focal length. For example, when the lens unit 22 of the image capture device 20 can zoom with a focal length of 37 mm (millimeter) to 260 mm, the zoom ratio is 37 mm to 260 mm. The lens unit 22 with zoom function can adjust the position of the lenses in the lens unit 22 before shooting, so as to change the focal length. The end of the shortest focal length (37mm) is called the wide-angle end (wide), and the image capture device 20 can capture images in a larger range; otherwise, the end of the longest focal length (260mm) is called the telephoto end (tele), and the visual It seems that the image of the scene in the distance is brought closer to the image capture device 20, so that the image is enlarged.

缩放倍率会影响到预设取样间距。例如当缩放倍率被设为接近广角端时,预设取样间距可以是20step;而当缩放倍率被设为接近望远端时,预设取样间距可以是30step。影像撷取装置20可依据撷取欲对焦影像30时的缩放倍率以预测对焦位置为基准点得到对焦区段,也就是得到撷取被摄人物的影像时最可能的对焦位置的范围。The zoom ratio will affect the preset sampling interval. For example, when the zoom ratio is set close to the wide-angle end, the preset sampling interval may be 20 steps; and when the zoom ratio is set close to the telephoto end, the preset sampling interval may be 30 steps. The image capture device 20 can obtain the focus segment according to the zoom ratio when capturing the image to be focused 30 and use the predicted focus position as a reference point, that is, obtain the range of the most likely focus position when capturing the image of the subject.

请参照图4A、图4B以及图4C,其分别为根据本发明不同实施范例的对焦区段的示意图。Please refer to FIG. 4A , FIG. 4B and FIG. 4C , which are schematic diagrams of focusing regions according to different implementation examples of the present invention.

在步骤S130中以预测对焦位置40得到对焦区段42,且对焦区段42可具有为一前区段44以及一后区段46。其中前区段44位于预测对焦位置40至影像撷取装置20的一近焦距(Near)之间,后区段46则位于预测对焦位置40至影像撷取装置20的一远焦距(Far)之间。其中近焦距的焦距较长(例如200步距),而远焦距的焦距较短(例如100步距)。且不同的缩放倍率亦会对应有不同的近焦距以及远焦距。In step S130 , the focus segment 42 is obtained from the predicted focus position 40 , and the focus segment 42 may have a front segment 44 and a rear segment 46 . The front segment 44 is located between the predicted focus position 40 and a near focal distance (Near) of the image capture device 20, and the rear segment 46 is located between the predicted focus position 40 and a far focus distance (Far) of the image capture device 20. between. The focal length of the near focal length is longer (for example, 200 steps), and the focal length of the far focal length is shorter (for example, 100 steps). And different magnifications also correspond to different near focus distances and far focus distances.

且根据本发明,前区段44的长度可与后区段46的长度相同;或是前区段44的长度可大于或小于后区段46的长度。And according to the present invention, the length of the front section 44 can be the same as the length of the rear section 46 ; or the length of the front section 44 can be greater or smaller than the length of the rear section 46 .

以下举实际的数据作为例子来说明,但根据本发明的人脸区块辅助对焦的方法并不限于这些举例的数据。The actual data is taken as an example for illustration below, but the method for assisting focusing of the face block according to the present invention is not limited to these example data.

当撷取欲对焦影像30时,影像撷取装置20的缩放倍率较接近广角端,则代表可能欲对较远处的被摄人物进行对焦。假设此时的预设取样间距为20步距,而查表得到的预测对焦位置40为第150步距。则可指定由预测对焦位置40往目前的缩放倍率的远焦距方向的10个步距起,到预测对焦位置40往近焦距方向的20个步距为止的范围为对焦区段42。因此对焦区段42为第140步距到第170步距之间的范围。When the image 30 to be focused is captured, the zoom ratio of the image capture device 20 is closer to the wide-angle end, which means that it is possible to focus on a subject far away. Assume that the preset sampling interval at this time is 20 steps, and the predicted focus position 40 obtained by looking up the table is the 150th step. The range from 10 steps from the predicted focus position 40 to the far focus direction of the current magnification to 20 steps from the predicted focus position 40 to the near focus direction can be designated as the focus section 42 . Therefore, the focus section 42 is the range between the 140th step and the 170th step.

又例如当影像撷取装置20在撷取欲对焦影像30时缩放倍率较接近望远端,且预设取样间距为30步距。则可指定由预测对焦位置40的第150步距处往目前的缩放倍率的远焦距方向的30个步距起,到预测对焦位置40往近焦距方向的15个步距为止的范围为对焦区段42。因此对焦区段42为第120步距到第165步距之间的范围。For another example, when the image capture device 20 captures the image 30 to be focused, the zoom ratio is closer to the telephoto end, and the default sampling interval is 30 steps. Then, the range from the 150th step distance of the predicted focus position 40 to the far focal length direction of the current zoom ratio can be designated as the focus area. Paragraph 42. Therefore, the focusing section 42 is a range between the 120th step and the 165th step.

然而根据本发明的另一实施范例,参数焦距对照表中并非记录与人脸参数对应的预测对焦位置40,而记录与人脸参数对应的一预测焦段。且影像撷取装置20亦可如上述步骤依据缩放倍率以及预测焦段得到对焦区段42。However, according to another implementation example of the present invention, instead of recording the predicted focus position 40 corresponding to the face parameter, the parameter focal length comparison table records a predicted focal length corresponding to the face parameter. Moreover, the image capture device 20 can also obtain the in-focus segment 42 according to the magnification ratio and the predicted focal length according to the above-mentioned steps.

得到对焦区段42之后,微处理器26依据对焦区段42以及一人脸取样间距执行自动对焦程序以得到目标焦距(步骤S140)。其中人脸取样间距小于预设取样间距,即在对焦区段42内微处理器26以高于预设值的自动对焦精度执行自动对焦程序。人脸取样焦距亦与缩放倍率有关,例如当缩放倍率接近广角端时,人脸取样间距可以是4步距;而当缩放倍率接近望远端时,人脸取样间距可以是6步距。After the focus segment 42 is obtained, the microprocessor 26 executes an auto-focus procedure according to the focus segment 42 and a face sampling interval to obtain the target focal length (step S140 ). The face sampling interval is smaller than the preset sampling interval, that is, the microprocessor 26 executes the auto-focus procedure with an auto-focus precision higher than the preset value in the focus section 42 . The face sampling focal length is also related to the zoom ratio. For example, when the zoom ratio is close to the wide-angle end, the face sampling interval can be 4 steps; and when the zoom ratio is close to the telephoto end, the face sampling interval can be 6 steps.

承上述实际数据的例子,则可在第140步距到第170步距之间的对焦区段42中,以4步距的取样间隔执行自动对焦程序。或是可在第120步距到第165步距之间的对焦区段42中,以6步距的取样间隔执行自动对焦程序。Based on the above example of actual data, in the focus section 42 between the 140th step and the 170th step, the auto-focus procedure can be executed at a sampling interval of 4 steps. Alternatively, in the focus section 42 between the 120th step and the 165th step, the auto-focus procedure can be executed at a sampling interval of 6 steps.

得到对焦区段42之后,自动对焦程序便可以以一二次多项式逼近法计算目标焦距。After the focus segment 42 is obtained, the auto-focus program can calculate the target focal length by a quadratic polynomial approximation method.

请参照图5,其为根据本发明一实施范例的清晰度曲线的示意图。Please refer to FIG. 5 , which is a schematic diagram of a sharpness curve according to an embodiment of the present invention.

二次多项式逼近法亦可称为二次多项式曲线拟合法。自动对焦程序在对焦区段42之内的多个对焦位置上分别撷取一张影像,并计算这些影像的一清晰度。接着可将对焦区段42内的各个对焦以及对应的清晰度作为X轴以及Y轴进行描点,并得到一清晰度曲线50。接着依据清晰度曲线50进行二次多项式曲线拟合可以得到一二次多项式拟合曲线52,并计算二次多项式拟合曲线52的峰值(peak)所对应的对焦位置作为目标焦距。The quadratic polynomial approximation method can also be called the quadratic polynomial curve fitting method. The auto-focus program captures an image at multiple focus positions within the focus area 42 and calculates a resolution of these images. Then, each focus in the focus section 42 and the corresponding sharpness can be plotted as X-axis and Y-axis, and a sharpness curve 50 can be obtained. Then, a quadratic polynomial curve fitting is performed according to the sharpness curve 50 to obtain a quadratic polynomial fitting curve 52 , and the focus position corresponding to the peak of the quadratic polynomial fitting curve 52 is calculated as the target focal length.

更详细地说,自动对焦程序在对焦区段42之内,每隔一个人脸取样间距撷取一张影像来计算清晰度。而人脸取样间距的计算方式可以是将对焦区段42除以一取样点数。则于同一对焦区段42之内,取样点数越多就表示人脸取样间距越小,自动对焦的精度越高。More specifically, the auto-focus program captures an image every other face sampling interval within the focus section 42 to calculate the sharpness. The face sampling interval can be calculated by dividing the focus segment 42 by a sampling point. In the same focusing section 42 , the more sampling points, the smaller the face sampling interval, and the higher the auto-focusing accuracy.

举例而言,在欲对焦影像30中没有侦测到人脸区块32时,自动对焦程序在微距到无限远之间的范围取10点取样点数进行自动对焦。而在欲对焦影像30中侦测到人脸区块32时,亦在对焦区段42内取10点取样点数进行自动对焦。如此一来,虽然花费同样的时间以10张影像进行二次多项式逼近法,但可得到更准确的目标焦距,而能够避免对焦误差。For example, when the face block 32 is not detected in the image to be focused 30 , the auto-focus program takes 10 sampling points in the range from macro to infinity to perform auto-focus. And when the face block 32 is detected in the image to be focused on 30 , 10 sampling points are also taken in the focused area 42 for auto-focusing. In this way, although it takes the same time to perform the quadratic polynomial approximation method with 10 images, a more accurate target focal length can be obtained and focus errors can be avoided.

前述的参数焦距对照表系可采用实验法建立。实验法建立指以不同的焦距对对应各种人脸参数的被摄人物拍摄,计算而得对应各人脸参数的预测对焦位置40,借以建立参数焦距对照表。The aforementioned parameter focal length comparison table can be established by experiment. The establishment of the experimental method refers to shooting subjects corresponding to various facial parameters with different focal lengths, and calculating the predicted focus position 40 corresponding to each facial parameter, so as to establish a parameter focal length comparison table.

此外,虽前述的实施范例以具有单一个人脸区块32的欲对焦影像30为例,人脸区块辅助对焦的方法亦适用于具有多个人脸区块32的欲对焦影像30。例如可取所有的人脸参数的平均值、中位数(median)或众数(mode)进行查表;或是可用多个人脸参数查表得到多个预测对焦位置40再取其平均数、中位数或众数作为最后的预测对焦位置40。In addition, although the aforementioned implementation example takes the image 30 to be in focus with a single face block 32 as an example, the method for assisting focusing by the face block is also applicable to the image 30 to be in focus with multiple face blocks 32 . For example, the average value, median or mode of all face parameters can be taken to look up the table; or a plurality of face parameters can be used to look up the table to obtain a plurality of predicted focus positions 40 and then take the average, median The digit or mode is used as the final predicted focus position 40 .

综上所述,根据本发明的人脸区块辅助对焦的方法依据人脸区块的人脸参数查阅参数焦距对照表,并在得到的对焦区段内以较高的精度执行自动对焦程序。由于不需在影像撷取装置内设置光发射器和接收器等额外的硬件,因此制造成本较低。再者提高自动对焦的精度便可得到较公知技术更准确的目标焦距,而能够令使用者拍摄到清晰的人脸影像。To sum up, according to the face block assisted focusing method of the present invention, the parameter focal length comparison table is consulted according to the face parameters of the face block, and the auto-focus procedure is executed with high precision in the obtained focus area. Since there is no need to set additional hardware such as a light transmitter and a receiver in the image capture device, the manufacturing cost is relatively low. Furthermore, by improving the precision of the auto-focus, a more accurate target focal length can be obtained compared with the known technology, so that the user can capture clear images of human faces.

当然,本发明还可有其他多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员可根据本发明作出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。Certainly, the present invention also can have other multiple embodiments, without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and deformations according to the present invention, but these corresponding changes All changes and modifications should belong to the scope of protection of the appended claims of the present invention.

Claims (9)

1.一种人脸区块辅助对焦的方法,适用于具有一自动对焦程序的一影像撷取装置,其特征在于,该自动对焦程序具有一预设取样间距,该人脸区块辅助对焦的方法包括:1. A method for assisting focusing of a face block, suitable for an image capture device with an auto-focus program, characterized in that the auto-focus program has a preset sampling interval, and the face block assists focus Methods include: 撷取一欲对焦影像,其中该欲对焦影像具有一人脸区块;capturing an image to be focused, wherein the image to be focused has a face block; 计算该欲对焦影像中的该人脸区块的一人脸参数;calculating a face parameter of the face block in the image to be focused; 依据该人脸参数查阅一参数焦距对照表以得到一对焦区段;以及Consulting a parameter focal length comparison table according to the face parameters to obtain a focus segment; and 依据该对焦区段以及一人脸取样间距执行该自动对焦程序以得到一目标焦距,其中该人脸取样间距小于该预设取样间距。The auto-focus procedure is executed according to the focus segment and a face sampling interval to obtain a target focal length, wherein the face sampling interval is smaller than the preset sampling interval. 2.根据权利要求1所述的人脸区块辅助对焦的方法,其特征在于,该人脸参数为该人脸区块与该欲对焦影像的一长度比。2 . The method for assisting focus by a face block according to claim 1 , wherein the face parameter is a length ratio between the face block and the image to be focused. 3 . 3.根据权利要求1所述的人脸区块辅助对焦的方法,其特征在于,该人脸参数为该人脸区块与该欲对焦影像的一面积比。3. The method for assisting focusing of a face block according to claim 1, wherein the face parameter is an area ratio of the face block to the image to be focused. 4.根据权利要求1所述的人脸区块辅助对焦的方法,其特征在于,该参数焦距对照表对应于一人脸侦测程序,且该影像撷取装置以该人脸侦测程序在该欲对焦影像中侦测该人脸区块。4. The method according to claim 1, characterized in that, the parameter focal length comparison table corresponds to a face detection program, and the image capture device uses the face detection program in the Detect the face block in the focused image. 5.根据权利要求1所述的人脸区块辅助对焦的方法,其特征在于,该依据该人脸参数查阅一参数焦距对照表以得到一对焦区段的步骤包括:5. The method for assisted focusing of face blocks according to claim 1, wherein the step of consulting a parameter focal length comparison table according to the face parameters to obtain a focus section comprises: 依据该人脸参数查阅该参数焦距对照表,并得到与该人脸参数对应的一预测对焦位置;以及Consult the parameter focal length comparison table according to the face parameter, and obtain a predicted focus position corresponding to the face parameter; and 依据该影像撷取装置的一缩放倍率,以该预测对焦位置为基准点得到该对焦区段。According to a zoom ratio of the image capture device, the focus segment is obtained with the predicted focus position as a reference point. 6.根据权利要求5所述的人脸区块辅助对焦的方法,其特征在于,该对焦区段具有一前区段以及一后区段,该前区段位于该预测对焦位置至该影像撷取装置的一近焦距之间,该后区段位于该预测对焦位置至该影像撷取装置的一远焦距之间,且该前区段的长度与该后区段的长度相同。6. The method according to claim 5, wherein the focus section has a front section and a back section, and the front section is located between the predicted focus position and the image capture The rear section is located between the predicted focus position and a far focal distance of the image capture device, and the length of the front section is the same as the length of the rear section. 7.根据权利要求5所述的人脸区块辅助对焦的方法,其特征在于,该对焦区段具有一前区段以及一后区段,该前区段位于该预测对焦位置至该影像撷取装置的一近焦距之间,该后区段位于该预测对焦位置至该影像撷取装置的一远焦距之间,且该前区段的长度大于该后区段的长度。7. The method according to claim 5, wherein the focus section has a front section and a back section, and the front section is located between the predicted focus position and the image capture The rear section is located between the predicted focus position and a far focal distance of the image capture device, and the length of the front section is greater than the length of the rear section. 8.根据权利要求5所述的人脸区块辅助对焦的方法,其特征在于,该对焦区段具有一前区段以及一后区段,该前区段位于该预测对焦位置至该影像撷取装置的一近焦距之间,该后区段位于该预测对焦位置至该影像撷取装置的一远焦距之间,且该前区段的长度小于该后区段的长度。8. The method according to claim 5, wherein the focus section has a front section and a back section, and the front section is located between the predicted focus position and the image capture The rear section is located between the predicted focus position and a far focal distance of the image capture device, and the length of the front section is smaller than the length of the rear section. 9.根据权利要求5所述的人脸区块辅助对焦的方法,其特征在于,该自动对焦程序以一二次多项式逼近法计算该目标焦距。9 . The method for assisting focusing of a face block according to claim 5 , wherein the auto-focus program calculates the target focal length by a quadratic polynomial approximation method. 10 .
CN2010102258753A 2010-07-09 2010-07-09 Auxiliary focusing method for human face block Pending CN102314043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102258753A CN102314043A (en) 2010-07-09 2010-07-09 Auxiliary focusing method for human face block

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102258753A CN102314043A (en) 2010-07-09 2010-07-09 Auxiliary focusing method for human face block

Publications (1)

Publication Number Publication Date
CN102314043A true CN102314043A (en) 2012-01-11

Family

ID=45427330

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102258753A Pending CN102314043A (en) 2010-07-09 2010-07-09 Auxiliary focusing method for human face block

Country Status (1)

Country Link
CN (1) CN102314043A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430267A (en) * 2015-12-01 2016-03-23 厦门瑞为信息技术有限公司 Method for adaptively adjusting camera parameters based on face image illumination parameters
CN105657276A (en) * 2016-02-29 2016-06-08 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN105763798A (en) * 2016-02-29 2016-07-13 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN110336948A (en) * 2019-07-23 2019-10-15 浙江华创视讯科技有限公司 Method, device, storage medium and electronic device for focusing on a predetermined area
CN110445985A (en) * 2019-08-30 2019-11-12 联想(北京)有限公司 A kind of image-pickup method, electronic equipment and computer readable storage medium
TWI695632B (en) * 2018-02-22 2020-06-01 圓展科技股份有限公司 Audio control device and control method thereof
CN112367468A (en) * 2020-10-30 2021-02-12 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN115278089A (en) * 2022-09-26 2022-11-01 合肥岭雁科技有限公司 Face fuzzy image focusing correction method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1621775A (en) * 2003-11-24 2005-06-01 株式会社三丰 Systems and methods for rapidly automatically focusing a machine vision inspection system
CN1716078A (en) * 2004-06-03 2006-01-04 佳能株式会社 Image pickup apparatus and image pickup method
CN101086604A (en) * 2006-06-09 2007-12-12 索尼株式会社 Imaging apparatus, control method of imaging apparatus, and computer program
CN101236348A (en) * 2008-03-13 2008-08-06 北京中星微电子有限公司 Automatic focusing method and image collecting device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1621775A (en) * 2003-11-24 2005-06-01 株式会社三丰 Systems and methods for rapidly automatically focusing a machine vision inspection system
CN1716078A (en) * 2004-06-03 2006-01-04 佳能株式会社 Image pickup apparatus and image pickup method
CN101086604A (en) * 2006-06-09 2007-12-12 索尼株式会社 Imaging apparatus, control method of imaging apparatus, and computer program
CN101236348A (en) * 2008-03-13 2008-08-06 北京中星微电子有限公司 Automatic focusing method and image collecting device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430267A (en) * 2015-12-01 2016-03-23 厦门瑞为信息技术有限公司 Method for adaptively adjusting camera parameters based on face image illumination parameters
CN105657276A (en) * 2016-02-29 2016-06-08 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN105763798A (en) * 2016-02-29 2016-07-13 广东欧珀移动通信有限公司 Control method, control device and electronic device
TWI695632B (en) * 2018-02-22 2020-06-01 圓展科技股份有限公司 Audio control device and control method thereof
CN110336948A (en) * 2019-07-23 2019-10-15 浙江华创视讯科技有限公司 Method, device, storage medium and electronic device for focusing on a predetermined area
CN110336948B (en) * 2019-07-23 2021-04-30 浙江华创视讯科技有限公司 Method and device for focusing in preset area, storage medium and electronic device
CN110445985A (en) * 2019-08-30 2019-11-12 联想(北京)有限公司 A kind of image-pickup method, electronic equipment and computer readable storage medium
CN112367468A (en) * 2020-10-30 2021-02-12 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN112367468B (en) * 2020-10-30 2022-02-01 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN115278089A (en) * 2022-09-26 2022-11-01 合肥岭雁科技有限公司 Face fuzzy image focusing correction method, device, equipment and storage medium
CN115278089B (en) * 2022-09-26 2022-12-02 合肥岭雁科技有限公司 Face fuzzy image focusing correction method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10462374B2 (en) Zooming control apparatus, image capturing apparatus and control methods thereof
CN109922251B (en) Method, device and system for rapid capture
US9313419B2 (en) Image processing apparatus and image pickup apparatus where image processing is applied using an acquired depth map
TWI432870B (en) Image processing system and automatic focusing method
CN102314043A (en) Auxiliary focusing method for human face block
US20100157135A1 (en) Passive distance estimation for imaging algorithms
US8315512B2 (en) Method and apparatus for auto-focus control of digital camera
US8648960B2 (en) Digital photographing apparatus and control method thereof
KR20110073245A (en) Auto Focus Control, Image Capture Device, and Auto Focus
CN103763458B (en) Method and device for scene change detection
WO2015020038A1 (en) Imaging device
US8294810B2 (en) Assisting focusing method for face block
CN101154016A (en) Imaging device with AF optical zoom
KR20090028255A (en) Method and device for automatic focusing of image acquisition device
WO2021134179A1 (en) Focusing method and apparatus, photographing device, movable platform and storage medium
CN101453568A (en) Image forming system and image forming method thereof
TWI393981B (en) Use the flash to assist in detecting focal lengths
JP2004157456A (en) Camera and range-finding method of camera
CN105472263B (en) Image capturing method and image capturing device using same
TWI398716B (en) Use the flash to assist in detecting focal lengths
CN102650801A (en) Camera and automatic focusing method thereof
US8711271B2 (en) Digital photographing apparatus and control method for evaluating validity of an auto-focus operation
CN115379201A (en) Test method and device, electronic device and readable storage medium
JP2013061560A (en) Distance measuring device, and imaging device
TWI423661B (en) Face block assisted focus method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120111