CN102811309A - Method and device for generating images with shallow depth of field - Google Patents
Method and device for generating images with shallow depth of field Download PDFInfo
- Publication number
- CN102811309A CN102811309A CN2011101440908A CN201110144090A CN102811309A CN 102811309 A CN102811309 A CN 102811309A CN 2011101440908 A CN2011101440908 A CN 2011101440908A CN 201110144090 A CN201110144090 A CN 201110144090A CN 102811309 A CN102811309 A CN 102811309A
- Authority
- CN
- China
- Prior art keywords
- image
- shallow depth
- aperture value
- processing
- field
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 230000009466 transformation Effects 0.000 claims description 19
- 238000009499 grossing Methods 0.000 claims description 16
- 238000006243 chemical reaction Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 230000015572 biosynthetic process Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 3
- 238000003786 synthesis reaction Methods 0.000 description 3
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 2
- 230000005669 field effect Effects 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000002194 synthesizing effect Effects 0.000 description 1
Images
Landscapes
- Studio Devices (AREA)
Abstract
Description
技术领域 technical field
本发明涉及一种图像处理方法及装置,尤其涉及一种产生浅景深图像的方法及装置。The invention relates to an image processing method and device, in particular to a method and device for generating shallow depth of field images.
背景技术 Background technique
图1是已知相机镜头对被摄主体平面进行对焦的示意图。请参照图1,相机镜头10对着被摄主体平面20对焦时,当被摄主体平面20在焦点平面30成像达到最清晰画面后,相机镜头10与被摄主体平面20之间的距离为摄影距离Y,而相机镜头10与焦点平面30之间的距离为镜头焦点距离(焦距)y。在使用相机拍摄图像时,为了突显所拍摄图像中的主题,一般会采用所谓浅景深的拍摄技巧,也就是在小于摄影距离Y之内的物件皆可清楚成像,然而在此摄影距离Y之外的物件则逐渐模糊。FIG. 1 is a schematic diagram of a conventional camera lens focusing on a subject plane. Please refer to FIG. 1, when the
然而,一般相机镜头所能制造出的浅景深效果相当有限,若要获得较佳的浅景深效果,则需对同一场景以不同焦距进行一系列的连拍,分别找出每个像素点在各图像中最清晰的位置,进而利用焦距与景深的关系,来推出图像中各像素点的相对景深,然而此方法所需的处理时间冗长,且消耗的储存空间很大,不利于商品化。However, the shallow depth of field effect that general camera lenses can produce is quite limited. To obtain a better shallow depth of field effect, it is necessary to take a series of continuous shots of the same scene with different focal lengths, and find out the position of each pixel at each point. The clearest position in the image, and then use the relationship between the focal length and the depth of field to deduce the relative depth of field of each pixel in the image. However, this method requires a long processing time and consumes a large storage space, which is not conducive to commercialization.
若是对同一场景以不同焦距拍摄2至3张图像,也就是说,利用少数几张图像来推得各像素点相对景深的关系,虽然可稍微减少处理时间,但其结果易受图像噪点影响,导致处理后的图像产生景深不连续或是不够自然的问题。If you take 2 to 3 images of the same scene with different focal lengths, that is to say, use a few images to deduce the relationship between the relative depth of each pixel, although the processing time can be slightly reduced, but the result is easily affected by image noise. As a result, the processed image has a discontinuous or unnatural depth of field.
发明内容 Contents of the invention
有鉴于此,本发明提供一种产生浅景深图像的方法,可判别两种不同光圈值所拍摄的图像内容的相对景深,藉此保留图像主体的清晰度而强化图像非主体部分的模糊程度。In view of this, the present invention provides a method for generating an image with a shallow depth of field, which can determine the relative depth of field of images captured by two different aperture values, thereby preserving the clarity of the main body of the image and enhancing the blurring of the non-main part of the image.
本发明提供一种产生浅景深图像的装置,可利用不同光圈值对同一场景进行拍摄,进行图像处理后可保留图像主体的清晰度而强化图像非主体部分的模糊程度。The invention provides a device for generating images with shallow depth of field, which can use different aperture values to shoot the same scene, and after image processing, the clarity of the main body of the image can be preserved and the blurring degree of the non-main part of the image can be enhanced.
从一观点来看,本发明提出一种产生浅景深图像的方法,此方法包括下列步骤。依据第一光圈值对被摄主体进行拍摄,藉以产生第一光圈值图像。并依据第二光圈值对此被摄主体进行拍摄,藉以产生第二光圈值图像,其中,第二光圈值大于第一光圈值。此外,分析第一光圈值图像与第二光圈值图像,以获得图像差值。另外,若判断此图像差值大于临界值,则对第一光圈值图像进行图像处理以获得浅景深图像。From one point of view, the present invention proposes a method for generating an image with a shallow depth of field, and the method includes the following steps. The subject is photographed according to the first aperture value, so as to generate the first aperture value image. The subject is photographed according to the second aperture value, so as to generate the second aperture value image, wherein the second aperture value is greater than the first aperture value. In addition, the first aperture value image and the second aperture value image are analyzed to obtain an image difference value. In addition, if it is determined that the image difference is greater than the critical value, image processing is performed on the image with the first aperture value to obtain an image with a shallow depth of field.
在本发明的一实施例中,所述的依据第一光圈值对被摄主体进行拍摄,藉以产生第一光圈值图像的步骤包括依据第一光圈值对此被摄主体进行对焦后拍摄,并获得此第一光圈值图像。并且于第一光圈值图像中选取包括此被摄主体的一清晰区域。In an embodiment of the present invention, the step of photographing the subject according to the first aperture value so as to generate the image with the first aperture value includes focusing on the subject according to the first aperture value and then photographing the subject, and Obtain this first f-stop image. And a clear area including the subject is selected in the first aperture value image.
在本发明的一实施例中,所述的依据第二光圈值对此被摄主体进行拍摄,藉以产生第二光圈值图像的步骤之后,还包括利用此清晰区域以计算第二光圈值图像的几何转换参数。并依据此几何转换参数对第二光圈值图像进行几何转换,以获得转换后的第二光圈值图像。In an embodiment of the present invention, after the step of photographing the subject according to the second aperture value to generate the second aperture value image, it further includes using the clear area to calculate the second aperture value image Geometry transformation parameters. And perform geometric transformation on the second aperture value image according to the geometric transformation parameter to obtain the converted second aperture value image.
在本发明的一实施例中,其中若判断图像差值大于临界值,则对第一光圈值图像进行图像处理以产生浅景深图像的步骤包括下列步骤。若判断图像差值大于临界值,则对第一光圈值图像与转换后的第二光圈值图像进行平滑化处理,藉以获得相对景深图。并且对此相对景深图进行模糊化处理以产生模糊化图像。再将此模糊化图像与第一光圈值图像进行平均化处理,藉以获得该浅景深图像。In an embodiment of the present invention, if it is determined that the image difference is greater than a threshold value, the step of performing image processing on the first aperture value image to generate a shallow depth-of-field image includes the following steps. If it is determined that the image difference is greater than the critical value, smoothing is performed on the first aperture value image and the converted second aperture value image, so as to obtain a relative depth of field map. And a blurring process is performed on the relative depth-of-field map to generate a blurred image. Then average the blurred image and the first aperture value image to obtain the shallow depth of field image.
在本发明的一实施例中,所述的平滑化处理采用图像内插方法。In an embodiment of the present invention, the smoothing process uses an image interpolation method.
在本发明的一实施例中,所述的产生浅景深图像的方法还包括若判断此图像差值不大于临界值,则直接输出第一光圈值图像。In an embodiment of the present invention, the method for generating a shallow depth-of-field image further includes directly outputting the first aperture value image if it is determined that the image difference is not greater than a critical value.
从另一观点来看,本发明提出一种产生浅景深图像的装置,其包括图像获取模组以及处理模组。图像获取模组分别依据第一光圈值及第二光圈值对被摄主体进行拍摄,藉以分别产生第一光圈值图像及第二光圈值图像。其中,第二光圈值大于第一光圈值。处理模组耦接至图像获取模组,分析第一光圈值图像与第二光圈值图像,藉以获得图像差值。处理模组若判断此图像差值大于临界值,则对第一光圈值图像进行图像处理以产生浅景深图像。From another point of view, the present invention provides a device for generating images with a shallow depth of field, which includes an image acquisition module and a processing module. The image acquisition module shoots the subject according to the first aperture value and the second aperture value, so as to generate the first aperture value image and the second aperture value image respectively. Wherein, the second aperture value is greater than the first aperture value. The processing module is coupled to the image acquisition module, and analyzes the first aperture value image and the second aperture value image to obtain image difference. If the processing module determines that the image difference is greater than the critical value, it performs image processing on the first aperture value image to generate a shallow depth-of-field image.
在本发明的一实施例中,所述的图像获取模组依据第一光圈值对被摄主体进行对焦后拍摄,并产生第一光圈值图像。In an embodiment of the present invention, the image acquisition module focuses on the subject according to the first aperture value and shoots, and generates an image with the first aperture value.
在本发明的一实施例中,所述的处理模组对图像获取模组所产生的第一光圈值图像中选取包括被摄主体的清晰区域。In an embodiment of the present invention, the processing module selects a clear area including the subject from the first aperture value image generated by the image acquisition module.
在本发明的一实施例中,所述的产生浅景深图像的装置还包括几何转换单元。几何转换单元耦接至处理模组,几何转换单元利用此清晰区域以计算第二光圈值图像的几何转换参数,并利用几何转换参数对第二光圈值图像进行几何转换,以产生转换后的第二光圈值图像。In an embodiment of the present invention, the device for generating a shallow depth-of-field image further includes a geometric conversion unit. The geometric conversion unit is coupled to the processing module. The geometric conversion unit uses the clear area to calculate the geometric conversion parameters of the second aperture value image, and uses the geometric conversion parameters to perform geometric conversion on the second aperture value image to generate the converted first aperture value image. Two f-stop images.
在本发明的一实施例中,所述的处理模组包括平滑化处理单元以及模糊化处理单元。处理模组若判断此图像差值大于临界值,则处理模组控制平滑化处理单元对第一光圈值图像与转换后的第二光圈值图像进行平滑化处理,以获得相对景深图。模糊化处理单元对相对景深图进行模糊化处理以产生模糊化图像,其中,处理模组将模糊化图像与第一光圈值图像进行平均化处理,藉以产生浅景深图像。In an embodiment of the present invention, the processing module includes a smoothing processing unit and a blurring processing unit. If the processing module determines that the image difference is greater than the critical value, the processing module controls the smoothing processing unit to perform smoothing processing on the first aperture value image and the converted second aperture value image to obtain a relative depth of field map. The blurring processing unit performs blurring processing on the relative depth of field image to generate a blurred image, wherein the processing module averages the blurred image and the first aperture value image to generate a shallow depth of field image.
在本发明的一实施例中,所述的处理模组若判断图像差值不大于临界值,则直接输出第一光圈值图像。In an embodiment of the present invention, if the processing module determines that the image difference is not greater than a threshold value, it directly outputs the first aperture value image.
基于上述,本发明所提供的产生浅景深图像的方法及装置,藉由光圈大小的不同造成图像景深的不同的特性,对同一场景以不同光圈值进行拍摄,并且比较图像间的差异,藉此判别图像内容的相对景深,当图像差值够大时,便可进行图像合成以保留图像主体的清晰度而强化非主体的模糊程度;当图像差值偏低时,则可直接输出大光圈所拍摄的图像。Based on the above, the method and device for generating shallow depth-of-field images provided by the present invention use different aperture sizes to cause different characteristics of image depth-of-field, shoot the same scene with different aperture values, and compare the differences between images, thereby Determine the relative depth of field of the image content. When the image difference is large enough, image synthesis can be performed to preserve the sharpness of the subject of the image and enhance the blur of non-subjects; captured image.
为让本发明的上述特征和优点能更明显易懂,下文特举实施例,并配合附图作详细说明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail with reference to the accompanying drawings.
附图说明 Description of drawings
图1是已知相机镜头对被摄主体平面进行对焦的示意图。FIG. 1 is a schematic diagram of a conventional camera lens focusing on a subject plane.
图2是依照本发明的一实施例所示的产生浅景深图像的装置方框图。FIG. 2 is a block diagram of an apparatus for generating images with a shallow depth of field according to an embodiment of the present invention.
图3是依照本发明的一实施例所示的产生浅景深图像的方法流程图。FIG. 3 is a flowchart of a method for generating a shallow depth-of-field image according to an embodiment of the present invention.
图4是依照本发明的另一实施例所示的产生浅景深图像的装置方框图。Fig. 4 is a block diagram of an apparatus for generating images with a shallow depth of field according to another embodiment of the present invention.
图5是依照本发明的另一实施例所示的产生浅景深图像的方法流程图。FIG. 5 is a flowchart of a method for generating a shallow depth-of-field image according to another embodiment of the present invention.
附图标记:Reference signs:
10:相机镜头10: Camera Lens
20:被摄主体平面20: Subject plane
30:焦点平面30: Focus plane
200、400:产生浅景深图像的装置200, 400: Devices that produce shallow depth-of-field images
210、410:图像获取模组210, 410: image acquisition module
220、420:处理模组220, 420: processing module
422:平滑化处理单元422: smoothing processing unit
424:模糊化处理单元424: Fuzzy processing unit
430:几何转换单元430: Geometric Transformation Unit
Y:摄影距离Y: Photography distance
y:镜头焦点距离y: lens focal length
S310~S340:本发明的一实施例的产生浅景深图像的方法的各步骤S310-S340: each step of the method for generating a shallow depth-of-field image according to an embodiment of the present invention
S510~S580:本发明的另一实施例的产生浅景深图像的方法的各步骤S510-S580: each step of the method for generating a shallow depth-of-field image according to another embodiment of the present invention
具体实施方式 Detailed ways
本发明提出一种利用景深与光圈大小的关系来合成浅景深图像的方法。先以大光圈对近距离的物件进行对焦后拍摄,然后约略框出图像中的清晰区域,接着改以较小光圈拍摄第二张图像,对两张图像进行分析,利用此两张图像间的差值大小来代表被摄主体区域与其他背景区域的相对景深,并根据此图像差值决定是否进行浅景深图像合成。为了使本发明的内容更为明了,以下列举实施例作为本发明确实能够据以实施的范例。The invention proposes a method for synthesizing shallow depth of field images by using the relationship between the depth of field and the size of the aperture. Focus on close objects with a large aperture first and then shoot, then roughly frame the clear area in the image, then change to a smaller aperture to shoot the second image, analyze the two images, and use the difference between the two images The magnitude of the difference represents the relative depth of field between the subject area and other background areas, and it is determined whether to perform image synthesis with a shallow depth of field according to the image difference. In order to make the content of the present invention clearer, the following examples are listed as examples in which the present invention can actually be implemented.
图2是依照本发明的一实施例所示的产生浅景深图像的装置方框图。请参照图2,本实施例的产生浅景深图像的装置200例如是数码相机、摄影机或具备相机功能的智能型手机等等,产生浅景深图像的装置200包括图像获取模组210以及处理模组220。其功能分述如下:FIG. 2 is a block diagram of an apparatus for generating images with a shallow depth of field according to an embodiment of the present invention. Please refer to FIG. 2 , the device 200 for generating images with a shallow depth of field in this embodiment is, for example, a digital camera, a video camera, or a smart phone with a camera function, etc. The device 200 for generating images with a shallow depth of field includes an image acquisition module 210 and a processing module 220. Its functions are described as follows:
图像获取模组210包括镜头、感光元件以及光圈。镜头例如是标准镜头、广角镜头、变焦镜头等。感光元件例如是电荷耦合元件(ChargeCoupled Device,CCD)、互补性氧化金属半导体(ComplementaryMetal-Oxide Semiconductor,CMOS)元件或其他元件,镜头与感光元件或其组合在此皆不设限。The image acquisition module 210 includes a lens, a photosensitive element and an aperture. The lens is, for example, a standard lens, a wide-angle lens, a zoom lens, or the like. The photosensitive element is, for example, a Charge Coupled Device (CCD), a Complementary Metal-Oxide Semiconductor (CMOS) element or other elements, and the lens, photosensitive element or combination thereof are not limited herein.
光圈指的是一组制作在镜头里面可以活动的叶片,藉由控制叶片开合的大小,就可以控制光线在一定时间内,进入图像获取模组210内光量的多寡。此开孔会随着镜头上的光圈值(本领域普通技术人员亦称为f值)做调节而开大或缩小。常见的f值有:f1.4、f2、f2.8、f4、f5.6、f8、f11、f16、f22、f32。在此需注意的是,f值愈小则光圈开孔愈大,进光量愈多;f值愈大则光圈开孔愈小,进光量愈少。据此,本实施例中所述的“大光圈”是指f值较小的光圈值。本实施例的图像获取模组210主要利用两种不同光圈值来对同一场景进行拍摄,藉以产生第一及第二光圈值图像。The aperture refers to a group of movable blades made in the lens. By controlling the opening and closing of the blades, the amount of light entering the image acquisition module 210 within a certain period of time can be controlled. The aperture will be enlarged or reduced as the aperture value (also referred to as f-number by those skilled in the art) on the lens is adjusted. Common f values are: f1.4, f2, f2.8, f4, f5.6, f8, f11, f16, f22, f32. It should be noted here that the smaller the f value, the larger the opening of the aperture, and the more light entering; the larger the f value, the smaller the opening of the aperture, and the less light entering. Accordingly, the "large aperture" mentioned in this embodiment refers to an aperture value with a smaller f value. The image capture module 210 of this embodiment mainly uses two different aperture values to shoot the same scene, so as to generate images of the first and second aperture values.
处理模组220例如是中央处理单元(Central Processing Unit,CPU),或是其他可编程的微处理器(Microprocessor)、数字信号处理器(Digital Signal Processor,DSP)、可编程控制器、特殊应用集成电路(Application Specific Integrated Circuits,ASIC)、可编程逻辑装置(Programmable Logic Device,PLD)或其他类似装置,处理模组220耦接至图像获取模组210,用以对图像获取模组210所接收的第一及第二光圈值图像进行分析处理,藉以产生浅景深图像。The processing module 220 is, for example, a central processing unit (Central Processing Unit, CPU), or other programmable microprocessor (Microprocessor), digital signal processor (Digital Signal Processor, DSP), programmable controller, special application integration circuit (Application Specific Integrated Circuits, ASIC), programmable logic device (Programmable Logic Device, PLD) or other similar devices, the processing module 220 is coupled to the image acquisition module 210, in order to the image acquisition module 210 received The first and second aperture value images are analyzed and processed to generate a shallow depth of field image.
图3是依照本发明的一实施例所示的产生浅景深图像的方法流程图。请参照图3,本实施例的方法适用于图2的产生浅景深图像的装置200,以下即搭配图2中的各项元件说明本实施例产生浅景深图像的方法的详细步骤:FIG. 3 is a flowchart of a method for generating a shallow depth-of-field image according to an embodiment of the present invention. Please refer to FIG. 3 , the method of this embodiment is applicable to the device 200 for generating a shallow depth of field image in FIG. 2 , and the detailed steps of the method for generating a shallow depth of field image in this embodiment are described below with the components in FIG. 2 :
首先在步骤S310中,图像获取模组210依据第一光圈值对被摄主体进行对焦后拍摄,藉以产生第一光圈值图像。接着,在步骤S320中,图像获取模组210依据第二光圈值并且不改变其他条件(例如焦距、快门或摄影距离等)的情况下,对此被摄主体进行拍摄,藉以产生第二光圈值图像。其中,第二光圈值大于第一光圈值,也就是说,第一光圈值图像的进光量大于第二光圈值。因此,在相同条件下,以不同光圈所拍摄的画面结果有所不同。光圈愈大(f值愈小),景物清楚的范围就会愈小,背景就愈模糊,拍摄的主体较有立体感,主题也更为明确。Firstly, in step S310 , the image acquisition module 210 focuses on the subject according to the first aperture value and shoots, so as to generate an image with the first aperture value. Next, in step S320, the image acquisition module 210 shoots the subject according to the second aperture value without changing other conditions (such as focal length, shutter or shooting distance, etc.), so as to generate the second aperture value image. Wherein, the second aperture value is greater than the first aperture value, that is, the amount of light entering the image at the first aperture value is greater than the second aperture value. Therefore, under the same conditions, the results of pictures taken with different apertures are different. The larger the aperture (the smaller the f value), the smaller the range of clear objects, the more blurred the background, the more three-dimensional the subject, and the clearer the subject.
更详细地说,当我们以大光圈对被摄主体进行对焦后拍摄,被摄主体所在的平面(如图1所示的被摄主体平面20,请配合参照图1)附近的物件会是清晰的,若不改变其他条件的情况下,仅改以较小光圈对同一场景进行拍摄,除了被摄主体所在的平面附近的物件是清晰的以外,距离被摄主体所在的平面较远的物件亦为清晰的。如此一来,藉由比较两张不同光圈值所拍摄的图像,便可判别出图像中何处是近距离物件,何处是远距离物件。In more detail, when we focus on the subject with a large aperture and shoot, the objects near the plane where the subject is located (
接下来在步骤S330中,处理模组220便是根据上述观点对第一及第二光圈值图像进行分析,以获得图像差值。其方法例如是计算第一及第二光圈值图像中的每个像素点的灰阶值之差,还可辅以图像边缘检测演算法藉以分辨出被摄主体区域与其他背景区域的差别。若图像差值偏低,代表整张图像中的各物件与被摄主体所在的对焦平面的距离不远,因此以两种不同光圈值所拍摄出来的图像皆为清晰的。若图像差值较大,代表整张图像中的各物件与被摄主体所在的对焦平面的距离较远。Next, in step S330 , the processing module 220 analyzes the first and second aperture value images according to the above point of view to obtain image difference values. The method is, for example, to calculate the difference between the grayscale values of each pixel in the first and second aperture value images, and an image edge detection algorithm can also be used to distinguish the difference between the subject area and other background areas. If the image difference is low, it means that the distance between the objects in the entire image and the focal plane where the subject is located is not far away, so the images captured with two different aperture values are clear. If the image difference is large, it means that the distance between each object in the entire image and the focal plane where the subject is located is relatively large.
因此,在步骤S340中,处理模组220若判断此图像差值大于临界值,则对第一光圈值图像进行图像处理以获得浅景深图像。其中,临界值可由处理模组220依照目前的拍摄模式自动选定或是由使用者依照拍摄环境自由设定,在此不设限。图像处理是对背景区域(距离被摄主体所在的对焦平面较远的各物件)进行模糊强化,以达到突显主题,使被摄主体较有立体感的效果。Therefore, in step S340 , if the processing module 220 determines that the image difference is greater than the critical value, image processing is performed on the first aperture value image to obtain a shallow depth-of-field image. Wherein, the threshold value can be automatically selected by the processing module 220 according to the current shooting mode or freely set by the user according to the shooting environment, and there is no limitation here. Image processing is to blur and enhance the background area (objects that are far away from the focal plane where the subject is located) in order to highlight the subject and make the subject more three-dimensional.
在此须说明的是,第一光圈值与第二光圈值的比例与所使用的镜头特性以及摄影距离(如图1所示的摄影距离Y)有关,因此第一光圈值与第二光圈值的比例须根据产生浅景深图像的装置200的镜头特性以及不同的摄影距离事先做调校,而后实际拍摄时,方可根据镜头与被摄主体之间的距离来调整适合的第一光圈值与第二光圈值进行拍摄,因此,第一光圈值与第二光圈值并非固定不变,可由使用者依据实际拍摄情况做调整。It should be noted here that the ratio of the first aperture value to the second aperture value is related to the characteristics of the lens used and the shooting distance (the shooting distance Y shown in Figure 1), so the first aperture value and the second aperture value The ratio must be adjusted in advance according to the lens characteristics of the device 200 that produces shallow depth-of-field images and different shooting distances, and then the appropriate first aperture value and the distance between the lens and the subject can be adjusted according to the distance between the lens and the subject in actual shooting. Shooting is performed at the second aperture value, therefore, the first aperture value and the second aperture value are not fixed, and can be adjusted by the user according to the actual shooting situation.
以下另举一实施例来对本发明进行说明。图4是依照本发明的另一实施例所示的产生浅景深图像的装置方框图。请参照图4,本实施例的产生浅景深图像的装置400包括图像获取模组410、处理模组420以及几何转换单元430。图4所示的产生浅景深图像的装置400与图2所示的产生浅景深图像的装置200大致相似,故以下仅就两者不同之处进行说明。Another embodiment is given below to illustrate the present invention. Fig. 4 is a block diagram of an apparatus for generating images with a shallow depth of field according to another embodiment of the present invention. Referring to FIG. 4 , the
处理模组420包括平滑化处理单元422以及模糊化处理单元424。平滑化处理单元422例如是采用图像内插方法,用以对两张图像进行一平滑化处理。模糊化处理单元424例如是采用空间滤波器(spatialfilter)、线性滤波器(linear filter)、非线性滤波器(non-linearfilter)或模糊化滤波器(blur filter)等,用以对图像进行模糊化。几何转换单元430耦接至处理模组420,其采用仿射矩阵(affinetransformation matrix)执行位移量校正,而可将两张不同图像的起始像素点校正至相同位置。The
图5是依照本发明的另一实施例所示的产生浅景深图像的方法流程图。请同时配合参照图4与图5。FIG. 5 is a flowchart of a method for generating a shallow depth-of-field image according to another embodiment of the present invention. Please refer to Figure 4 and Figure 5 together.
图像获取模组410依据第一光圈值对被摄主体进行拍摄,藉以产生第一光圈值图像。处理模组420接着在第一光圈值图像中选取包括此被摄主体的一清晰区域,也就是被摄主体所在的平面的对焦区域,在此对焦区域的图像画面为清晰的图像(步骤S510)。图像获取模组410接着依据第二光圈值对此被摄主体进行拍摄,藉以产生第二光圈值图像,其中,第二光圈值大于第一光圈值(步骤S520)。The
几何转换单元430利用仿射矩阵(affine transformation matrix)对此清晰区域计算出几何转换参数(步骤S530),并利用此几何转换参数对第二光圈值图像进行几何转换,使得转换后的第二光圈值图像的清晰区域的起始像素点位置相同于第一光圈值图像的清晰区域的起始像素点位置(步骤S540)。处理模组420分析第一光圈值图像与转换后的第二光圈值图像,以获得图像差值(步骤S550),接着处理模组420判断此图像差值是否大于临界值(步骤S560)。The
若此图像差值大于临界值,则对第一光圈值图像进行图像处理以获得强化背景模糊的浅景深图像(步骤S570)。举例而言,处理模组420可控制平滑化处理单元422对第一光圈值图像与转换后的第二光圈值图像进行内插,以获得相对景深图。详细地说,由于图像差值够大,代表第一光圈值图像的景深较深,第二光圈值图像的景深较浅,因此采用内插的平滑化处理后可产生景深较连续的相对景深图。接着可利用模糊化处理单元424对相对景深图进行模糊化处理以产生一模糊化图像,其中,模糊化程度可为使用者事先预定。最后,处理模组420便将此模糊化图像与第一光圈值图像的各像素点进行平均化处理(例如是加权平均等)。据此,可产生保持被摄主体区域的清晰而强化模糊其他背景区域的浅景深图像。If the image difference is greater than the critical value, image processing is performed on the image with the first aperture value to obtain a shallow depth-of-field image with enhanced background blur (step S570 ). For example, the
然而,回到步骤560,若判断此图像差值不大于临界值,表示被摄主体以外的各物件及其他背景区域的位置,皆靠近被摄主体所在的平面,也就是说,以第一及第二两种不同光圈值所拍摄出来的图像差距不大,皆为清晰的图像,即无法合成强化背景模糊的浅景深图像,因此可直接输出第一光圈值图像(步骤S580)。在一实施例中,当处理模组420判断图像差值不大于临界值,即可显示一提示画面于产生浅景深图像的装置400的屏幕(未示出),藉以提示使用者目前拍摄的场景不适合进行浅景深图像的合成,因此,使用者可另外寻找长景深的场景进行拍摄。据此,产生浅景深图像的装置400可省下不必要的计算,缩短其处理时间。在另一实施例中,若使用者以现有的图像获取模组410所能提供的最大光圈及最小光圈进行拍摄的图像,其图像差值无法大于临界值,也就是不足以判断相对景深时,可辅以改变镜头焦点距离(焦距)之后进行拍摄,以产生图像差值较大的两张图像,然而镜头焦点距离与摄影距离亦有直接的关系,因此镜头焦点距离的调校也须依实际拍摄情况做调整,才能拍出图像差值大于临界值的两张图像。However, returning to step 560, if it is judged that the image difference is not greater than the critical value, it means that the positions of objects other than the subject and other background regions are all close to the plane where the subject is located, that is to say, with the first and The images captured by the second two different aperture values have little difference, and both are clear images, that is, images with a shallow depth of field that enhance background blur cannot be synthesized, so the image with the first aperture value can be directly output (step S580 ). In one embodiment, when the
综上所述,本发明的产生浅景深图像的方法及装置,只需具有大小两种不同光圈所拍摄的两张图像,即可合成出较佳浅景深效果的图像,计算简单且一般消费型相机即可达成。并不需要如高档相机所配备的昂贵的变焦镜头进行一系列的连拍,才能计算并产生浅景深图像。此外,本发明的方法及装置在两张图像的图像差值偏低,不适合进行浅景深图像的合成时,还可事先提示使用者另寻较适合的场景拍摄,藉此省下运算处理时间。To sum up, the method and device for generating shallow depth-of-field images of the present invention can synthesize images with better shallow depth-of-field effects only by having two images taken with two different apertures. The calculation is simple and generally consumer-friendly. The camera can do it. It doesn't take an expensive zoom lens like a high-end camera to take a series of continuous shots to calculate and produce a shallow depth-of-field image. In addition, the method and device of the present invention can also prompt the user to find another more suitable scene for shooting when the image difference between the two images is too low to be suitable for shallow depth-of-field image synthesis, thereby saving calculation and processing time .
虽然本发明已以实施例揭示如上,然其并非用以限定本发明,任何所属技术领域的普通技术人员,当可作些许更动与润饰,而不脱离本发明的精神和范围。Although the present invention has been disclosed above with the embodiments, it is not intended to limit the present invention, and any person of ordinary skill in the art may make some changes and modifications without departing from the spirit and scope of the present invention.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2011101440908A CN102811309A (en) | 2011-05-31 | 2011-05-31 | Method and device for generating images with shallow depth of field |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2011101440908A CN102811309A (en) | 2011-05-31 | 2011-05-31 | Method and device for generating images with shallow depth of field |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN102811309A true CN102811309A (en) | 2012-12-05 |
Family
ID=47234877
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2011101440908A Pending CN102811309A (en) | 2011-05-31 | 2011-05-31 | Method and device for generating images with shallow depth of field |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102811309A (en) |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103945210A (en) * | 2014-05-09 | 2014-07-23 | 长江水利委员会长江科学院 | Multi-camera photographing method for realizing shallow depth of field effect |
| CN105262952A (en) * | 2015-10-23 | 2016-01-20 | 努比亚技术有限公司 | Mobile terminal and image processing method thereof |
| CN106303202A (en) * | 2015-06-09 | 2017-01-04 | 联想(北京)有限公司 | A kind of image information processing method and device |
| CN106303201A (en) * | 2015-06-04 | 2017-01-04 | 光宝科技股份有限公司 | Image capturing device and focusing method |
| CN106576140A (en) * | 2014-10-28 | 2017-04-19 | 夏普株式会社 | Image processing device and program |
| WO2018028585A1 (en) * | 2016-08-10 | 2018-02-15 | 宁波舜宇光电信息有限公司 | Multi-camera module with diaphragms of different sizes, and application thereof |
| CN110677561A (en) * | 2018-07-02 | 2020-01-10 | 纬创资通股份有限公司 | Image synthesis method and system |
| CN111144404A (en) * | 2019-12-06 | 2020-05-12 | 恒大新能源汽车科技(广东)有限公司 | Legacy object detection method, device, system, computer device, and storage medium |
| CN114708142A (en) * | 2022-04-21 | 2022-07-05 | 维沃移动通信有限公司 | Image processing method, image processing apparatus, electronic device, and readable storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101196670A (en) * | 2006-12-05 | 2008-06-11 | 华晶科技股份有限公司 | Depth-of-field surrounding shooting method and device |
| CN101221341A (en) * | 2007-01-08 | 2008-07-16 | 华晶科技股份有限公司 | Depth of field composition setting method |
| CN101764925A (en) * | 2008-12-25 | 2010-06-30 | 华晶科技股份有限公司 | Shallow depth of field simulation method for digital image |
| US20110122287A1 (en) * | 2009-11-25 | 2011-05-26 | Keiji Kunishige | Imaging device and imaging device control method |
-
2011
- 2011-05-31 CN CN2011101440908A patent/CN102811309A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101196670A (en) * | 2006-12-05 | 2008-06-11 | 华晶科技股份有限公司 | Depth-of-field surrounding shooting method and device |
| CN101221341A (en) * | 2007-01-08 | 2008-07-16 | 华晶科技股份有限公司 | Depth of field composition setting method |
| CN101764925A (en) * | 2008-12-25 | 2010-06-30 | 华晶科技股份有限公司 | Shallow depth of field simulation method for digital image |
| US20110122287A1 (en) * | 2009-11-25 | 2011-05-26 | Keiji Kunishige | Imaging device and imaging device control method |
Cited By (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103945210A (en) * | 2014-05-09 | 2014-07-23 | 长江水利委员会长江科学院 | Multi-camera photographing method for realizing shallow depth of field effect |
| CN106576140A (en) * | 2014-10-28 | 2017-04-19 | 夏普株式会社 | Image processing device and program |
| CN106576140B (en) * | 2014-10-28 | 2019-10-18 | 夏普株式会社 | Image processing device and camera device |
| CN106303201A (en) * | 2015-06-04 | 2017-01-04 | 光宝科技股份有限公司 | Image capturing device and focusing method |
| CN106303202A (en) * | 2015-06-09 | 2017-01-04 | 联想(北京)有限公司 | A kind of image information processing method and device |
| CN105262952A (en) * | 2015-10-23 | 2016-01-20 | 努比亚技术有限公司 | Mobile terminal and image processing method thereof |
| WO2018028585A1 (en) * | 2016-08-10 | 2018-02-15 | 宁波舜宇光电信息有限公司 | Multi-camera module with diaphragms of different sizes, and application thereof |
| CN110677561A (en) * | 2018-07-02 | 2020-01-10 | 纬创资通股份有限公司 | Image synthesis method and system |
| CN110677561B (en) * | 2018-07-02 | 2021-06-18 | 纬创资通股份有限公司 | Image synthesis method and system |
| CN111144404A (en) * | 2019-12-06 | 2020-05-12 | 恒大新能源汽车科技(广东)有限公司 | Legacy object detection method, device, system, computer device, and storage medium |
| CN111144404B (en) * | 2019-12-06 | 2023-08-11 | 恒大恒驰新能源汽车科技(广东)有限公司 | Method, apparatus, system, computer device and storage medium for detecting legacy object |
| CN114708142A (en) * | 2022-04-21 | 2022-07-05 | 维沃移动通信有限公司 | Image processing method, image processing apparatus, electronic device, and readable storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI479453B (en) | Method and device for generating shallow depth of field image | |
| CN107948519B (en) | Image processing method, device and equipment | |
| TWI602152B (en) | Image capturing device and image processing method thereof | |
| CN101998053B (en) | Image processing method, image processing apparatus, and imaging apparatus | |
| CN111669493B (en) | A shooting method, device and equipment | |
| CN102811309A (en) | Method and device for generating images with shallow depth of field | |
| CN102696219B (en) | Camera head, image capture method and integrated circuit | |
| JP6355454B2 (en) | Imaging apparatus, control method therefor, program, and storage medium | |
| TW201320734A (en) | Image processing method for producing background blurred image and image capturing device thereof | |
| JP2020533697A (en) | Methods and equipment for image processing | |
| CN103973963B (en) | Image acquisition device and image processing method thereof | |
| JP6116299B2 (en) | Imaging apparatus and control method thereof | |
| CN110177212B (en) | Image processing method and apparatus, electronic device, computer-readable storage medium | |
| JP5146015B2 (en) | Imaging apparatus and imaging method | |
| US7899315B2 (en) | Method of automatically adjusting the depth of field | |
| WO2017208991A1 (en) | Image capturing and processing device, electronic instrument, image capturing and processing method, and image capturing and processing device control program | |
| CN103973962B (en) | Image processing method and image acquisition device | |
| JP2010183460A (en) | Image capturing apparatus and method of controlling the same | |
| CN103095978A (en) | Image processing method for generating background blur and image capturing device thereof | |
| JP2015080157A (en) | Image processing apparatus, image processing method, and program | |
| JP2018142983A (en) | Image processing apparatus, control method therefor, program, and storage medium | |
| JP5871590B2 (en) | Imaging apparatus and control method thereof | |
| JP2014131188A (en) | Imaging apparatus, control method of the same, and control program | |
| JP2011044965A (en) | Imaging apparatus, imaging method and computer program | |
| JP2014175703A (en) | Imaging apparatus, control method for the same, and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C05 | Deemed withdrawal (patent law before 1993) | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20121205 |