Nothing Special   »   [go: up one dir, main page]

CN117178286A - Bokeh processing method, electronic device and computer-readable storage medium - Google Patents

Bokeh processing method, electronic device and computer-readable storage medium Download PDF

Info

Publication number
CN117178286A
CN117178286A CN202180096376.5A CN202180096376A CN117178286A CN 117178286 A CN117178286 A CN 117178286A CN 202180096376 A CN202180096376 A CN 202180096376A CN 117178286 A CN117178286 A CN 117178286A
Authority
CN
China
Prior art keywords
image
size
foreground
bokeh
camera parameters
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
CN202180096376.5A
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN117178286A publication Critical patent/CN117178286A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/958Computational photography systems, e.g. light-field imaging systems for extended depth of field imaging
    • H04N23/959Computational photography systems, e.g. light-field imaging systems for extended depth of field imaging by adjusting depth of field during image capture, e.g. maximising or setting range based on scene characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20004Adaptive image processing
    • G06T2207/20012Locally adaptive
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/66Remote control of cameras or camera parts, e.g. by remote control devices
    • H04N23/661Transmitting camera control signals through networks, e.g. control via the Internet
    • H04N23/662Transmitting camera control signals through networks, e.g. control via the Internet by using master/slave camera arrangements for affecting the control of camera image capture, e.g. placing the camera in a desirable condition to capture a desired image

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Studio Devices (AREA)

Abstract

公开了一种散景处理方法。该方法包括:获取包括焦距和F值的DSLR相机参数;获取图像、对焦距离和对应于该图像的深度图;基于DSLR相机参数、对焦距离和深度图获得图像的每个像素的散景大小,以生成散景大小图;以及基于散景大小图对图像执行散景处理。

A bokeh processing method is disclosed. The method includes: obtaining DSLR camera parameters including focal length and F value; obtaining an image, a focus distance and a depth map corresponding to the image; obtaining the bokeh size of each pixel of the image based on the DSLR camera parameters, focus distance and depth map, to generate a bokeh size map; and perform bokeh processing on the image based on the bokeh size map.

Description

散景处理方法、电子设备以及计算机可读存储介质Bokeh processing method, electronic device and computer-readable storage medium

技术领域Technical field

本公开涉及一种用于散景处理的方法,具体地,涉及一种用于精确地再现相当于由数码单反(dgital single lens reflex,DSLR)相机创建的散景的高质量散景的方法、执行该方法的电子设备以及存储实现该方法的程序的计算机可读存储介质。The present disclosure relates to a method for bokeh processing, and in particular, to a method for accurately reproducing high-quality bokeh equivalent to the bokeh created by a digital single lens reflex (DSLR) camera, An electronic device for executing the method and a computer-readable storage medium storing a program for implementing the method.

背景技术Background technique

近年来,人工生成具有散景的图像的技术被广泛使用。在具有散景的图像中,被摄体应该清晰地显示诸如人之类的被摄体,另一方面,应该模糊诸如建筑物或天空之类的背景。例如,在被被摄体占据的区域中,散景大小/强度被设置为0,并且其他区域的散景大小随着与被摄体的距离增加而增加。In recent years, techniques for artificially generating images with bokeh have been widely used. In an image with bokeh, subjects such as people should be shown clearly, while backgrounds such as buildings or the sky, on the other hand, should be blurred. For example, in the area occupied by the subject, the bokeh size/strength is set to 0, and the bokeh size in other areas increases with distance from the subject.

诸如智能电话之类的电子设备的图像传感器的尺寸/面积小于具有诸如35mm传感器之类的大传感器的DSLR相机的尺寸/面积。由于传感器尺寸小,不可避免的是,基于使用电子设备拍摄的图像生成的散景大小小于使用DSLR相机拍摄的图像的散景大小。因此,由电子设备生成的具有散景的图像可能看起来不自然。为了改善具有散景的图像的质量,众所周知可以使用深度图的深度值来确定散景的大小。然而,即使使用这种方法,也很难获得与使用DSLR相机拍摄的图像具有相同散景的图像。The size/area of the image sensor of an electronic device such as a smartphone is smaller than that of a DSLR camera with a large sensor such as a 35mm sensor. Due to the small sensor size, it is inevitable that the size of the bokeh generated based on images taken with electronic devices is smaller than that of images taken with a DSLR camera. Therefore, images with bokeh generated by electronic devices may look unnatural. To improve the quality of images with bokeh, it is known to use the depth value of a depth map to determine the size of the bokeh. However, even using this method, it is difficult to obtain images with the same bokeh as those taken with a DSLR camera.

发明内容Contents of the invention

本公开旨在解决上述技术问题中的至少一个问题。因此,本公开需要提供一种用于散景处理的方法和实现这种方法的电子设备。The present disclosure aims to solve at least one of the above technical problems. Therefore, the present disclosure needs to provide a method for bokeh processing and an electronic device implementing the method.

根据本公开,一种用于散景处理的方法包括:获取包括焦距(f)和焦比F值(A)的DSLR相机参数,获取图像、对焦距离(D)和对应于该图像的深度图,基于DSLR相机参数、对焦距离和深度图获得图像的每个像素的散景大小以生成散景大小图,以及基于散景大小图对图像执行散景处理。According to the present disclosure, a method for bokeh processing includes: acquiring DSLR camera parameters including focal length (f) and focal ratio F value (A), acquiring an image, a focus distance (D), and a depth map corresponding to the image , obtain the bokeh size of each pixel of the image based on the DSLR camera parameters, focus distance and depth map to generate a bokeh size map, and perform bokeh processing on the image based on the bokeh size map.

根据本公开,一种电子设备包括处理器和用于存储指令的存储器。当由处理器执行时,指令使得处理器执行根据本公开的方法。According to the present disclosure, an electronic device includes a processor and a memory for storing instructions. When executed by a processor, the instructions cause the processor to perform methods in accordance with the present disclosure.

根据本公开,提供了一种计算机可读存储介质,其上存储有计算机程序。计算机程序由计算机执行以实现根据本公开的方法。According to the present disclosure, a computer-readable storage medium is provided with a computer program stored thereon. The computer program is executed by a computer to implement the method according to the present disclosure.

附图说明Description of drawings

本公开的实施例的这些和/或其他方面和优点将从参照下面附图进行的以下描述中变得明显并更容易理解。These and/or other aspects and advantages of embodiments of the present disclosure will become apparent and better understood from the following description taken with reference to the following drawings.

图1A是示出根据本公开实施例的电子设备的配置的功能框图。1A is a functional block diagram showing the configuration of an electronic device according to an embodiment of the present disclosure.

图1B是根据本公开实施例的电子设备中的图像信号处理器的功能框图。1B is a functional block diagram of an image signal processor in an electronic device according to an embodiment of the present disclosure.

图2是根据本公开实施例的用于生成具有散景的图像的流程图。Figure 2 is a flowchart for generating an image with bokeh, according to an embodiment of the present disclosure.

图3是用于输入DSLR相机参数的用户界面的示例。Figure 3 is an example of a user interface for entering DSLR camera parameters.

图4A示出了由相机模块捕获的图像的示例。Figure 4A shows an example of an image captured by a camera module.

图4B示出与图4A所示图像相对应的深度图的示例。FIG. 4B shows an example of a depth map corresponding to the image shown in FIG. 4A.

图5示出了通过使用根据本公开实施例的方法生成的散景大小图的示例。Figure 5 shows an example of a bokeh size map generated by using a method according to an embodiment of the present disclosure.

图6示出了通过使用根据本公开实施例的方法生成的具有散景的图像的示例。Figure 6 shows an example of an image with bokeh generated by using a method according to an embodiment of the present disclosure.

图7是用于说明基于DSLR相机参数的散景的重点的图。FIG. 7 is a diagram illustrating the focus of bokeh based on DSLR camera parameters.

图8是用于说明在景深(depth of field,DoF)范围内散景大小的变化的图。FIG. 8 is a diagram illustrating changes in bokeh size within a depth of field (DoF) range.

具体实施方式Detailed ways

将详细描述本公开的实施例,并且将在附图中示出实施例的示例。在整个描述中,相同或相似的元件和具有相同或相似功能的元件由相同的附图标记表示。参考附图在此描述的实施例是解释性的,以及旨在说明本公开,但不应被解释为限制本公开。Embodiments of the present disclosure will be described in detail, and examples of the embodiments are illustrated in the accompanying drawings. Throughout the description, identical or similar elements and elements having the same or similar function are designated by the same reference numerals. The embodiments described herein with reference to the drawings are illustrative and intended to illustrate the disclosure but should not be construed to limit the disclosure.

<电子设备100><Electronic Equipment 100>

将参照图1A描述电子设备100。图1A是示出根据本公开的实施例的电子设备100的配置的示例的功能框图。Electronic device 100 will be described with reference to FIG. 1A. 1A is a functional block diagram showing an example of the configuration of the electronic device 100 according to an embodiment of the present disclosure.

电子设备100是诸如智能手机、平板终端或移动电话之类的移动设备,但是可以是配备有一个或多个相机模块的其他类型的电子设备。The electronic device 100 is a mobile device such as a smartphone, a tablet terminal, or a mobile phone, but may be other types of electronic devices equipped with one or more camera modules.

如图1A所示。电子设备100包括立体相机模块10、距离传感器模块20和图像信号处理器30、全球导航卫星系统(global navigation satellite system,GNSS)模块40、无线通信模块41、编解码器42、扬声器43、麦克风44、显示模块45、输入模块46、惯性测量单元(inertial measurement unit,IMU)47、主处理器48和存储器49。As shown in Figure 1A. The electronic device 100 includes a stereo camera module 10 , a distance sensor module 20 and an image signal processor 30 , a global navigation satellite system (GNSS) module 40 , a wireless communication module 41 , a codec 42 , a speaker 43 , and a microphone 44 , display module 45, input module 46, inertial measurement unit (inertial measurement unit, IMU) 47, main processor 48 and memory 49.

立体相机模块10包括用于双目立体观看的主相机模块11和从相机模块12,如图1A所示。相机模块10可以以给定的帧速率拍摄视频。The stereo camera module 10 includes a master camera module 11 and a slave camera module 12 for binocular stereo viewing, as shown in Figure 1A. Camera module 10 can capture video at a given frame rate.

主相机模块11包括能够聚焦于被摄体的第一透镜11a、检测经由第一透镜11a输入的图像的第一图像传感器11b、以及驱动第一图像传感器11b的第一图像传感器驱动11c,如图1A所示。The main camera module 11 includes a first lens 11a capable of focusing on a subject, a first image sensor 11b that detects an image input via the first lens 11a, and a first image sensor driver 11c that drives the first image sensor 11b, as shown in FIG. Shown in 1A.

从相机模块12包括能够聚焦于被摄体的第二透镜12a、检测经由第二透镜12a输入的图像的第二图像传感器12b、以及驱动第二图像传感器12b的第二图像传感器驱动12c,如图1A所示。The slave camera module 12 includes a second lens 12a capable of focusing on a subject, a second image sensor 12b that detects an image input via the second lens 12a, and a second image sensor driver 12c that drives the second image sensor 12b, as shown in FIG. Shown in 1A.

主相机模块11捕获主相机图像。从相机模块12捕获从相机图像。主相机图像和从相机图像可以是诸如RGB图像之类的彩色图像或单色图像。The main camera module 11 captures main camera images. Slave camera images are captured from the camera module 12 . The master camera image and the slave camera image may be color images such as RGB images or monochrome images.

通过立体匹配技术,可以基于主相机图像和从相机图像生成深度图。具体地,针对立体图像(即,主相机图像和从相机图像)的每个对应像素计算视差量。深度值随着视差量的增加而增加。深度图包括图像中每个像素的深度值。Through stereo matching technology, a depth map can be generated based on the main camera image and the slave camera image. Specifically, the amount of parallax is calculated for each corresponding pixel of the stereoscopic image (ie, the main camera image and the slave camera image). The depth value increases as the amount of parallax increases. The depth map includes the depth value of each pixel in the image.

距离传感器模块20捕获深度图。例如,距离传感器模块20是飞行时间(time offlight,ToF)相机,以及通过向被摄体发射脉冲光并检测从被摄体反射的光来捕获ToF深度图。ToF深度图指示电子设备100和被摄体之间的实际距离。可选地,可以省略距离传感器模块。Distance sensor module 20 captures a depth map. For example, the distance sensor module 20 is a time-of-flight (ToF) camera, and a ToF depth map is captured by emitting pulsed light to a subject and detecting light reflected from the subject. The ToF depth map indicates the actual distance between the electronic device 100 and the subject. Optionally, the distance sensor module can be omitted.

图像信号处理器(image signal processor,ISP)30控制主相机模块11、从相机模块12和距离传感器模块20。ISP 30还对由立体相机模块10捕获的图像执行图像处理。具体地,ISP 30从相机模块10获取原始图像。原始图像是主相机图像或从相机图像。ISP 30对原始图像执行散景处理,以生成具有散景的图像。可以基于原始图像和散景大小图来生成具有散景的图像,这将在后面描述。An image signal processor (ISP) 30 controls the master camera module 11 , the slave camera module 12 and the distance sensor module 20 . The ISP 30 also performs image processing on images captured by the stereo camera module 10 . Specifically, the ISP 30 acquires original images from the camera module 10 . The original image is either the master camera image or the slave camera image. ISP 30 performs bokeh processing on the original image to generate an image with bokeh. An image with bokeh can be generated based on the original image and the bokeh size map, which will be described later.

当相机模块10捕获图像时,ISP 30从立体相机模块10获取所捕获图像中的自动对焦区域。自动对焦区域表示焦点对准区域(in-focus area)。例如,自动对焦区域显示为自动对焦矩形。通过相机模块10的自动对焦操作获得自动对焦区域。When the camera module 10 captures an image, the ISP 30 acquires the autofocus area in the captured image from the stereo camera module 10 . The autofocus area represents the in-focus area. For example, the autofocus area appears as an autofocus rectangle. The autofocus area is obtained through the autofocus operation of the camera module 10 .

ISP 30获取对焦距离或被摄体距离。对焦距离是被摄体和相机模块10之间的距离。更准确地说,对焦距离指示聚焦平面和透镜11a(11b)的主点之间的距离。ISP 30 gets the focus distance or subject distance. The focus distance is the distance between the subject and the camera module 10 . More precisely, the focus distance indicates the distance between the focus plane and the principal point of the lens 11a (11b).

ISP 30可以基于深度图和自动对焦区域来计算对焦距离。例如,通过计算自动对焦区域中深度值的代表值来获取对焦距离。代表值可以是平均值、中值或四分位数距离值(例如,第三四分位数、第一四分位数)。ISP 30 can calculate focus distance based on depth map and autofocus area. For example, the focus distance is obtained by calculating a representative value of the depth value in the autofocus area. The representative value can be the mean, median, or interquartile range value (e.g., third quartile, first quartile).

GNSS模块40测量电子设备100的当前位置。无线通信模块41与互联网进行无线通信。编解码器42使用预定的编码/解码方法双向地执行编码和解码。扬声器43根据由编解码器42解码的声音数据输出声音。麦克风44基于输入的声音向编解码器42输出声音数据。The GNSS module 40 measures the current location of the electronic device 100 . The wireless communication module 41 performs wireless communication with the Internet. The codec 42 bidirectionally performs encoding and decoding using a predetermined encoding/decoding method. The speaker 43 outputs sound based on the sound data decoded by the codec 42 . The microphone 44 outputs sound data to the codec 42 based on the input sound.

显示模块45显示各种信息,例如由相机模块10实时捕获的图像、用户界面(UserInterface,UI)、以及由ISP 30生成的具有散景的图像。The display module 45 displays various information, such as images captured in real time by the camera module 10 , a user interface (UI), and images with bokeh generated by the ISP 30 .

输入模块46通过用户的操作输入信息。输入模块46是触摸面板或键盘等。输入模块46输入指令以捕获和存储在显示模块45上显示的图像。此外,输入模块46输入由用户选择的DSLR相机参数(如下所述)。The input module 46 inputs information through user operations. The input module 46 is a touch panel, a keyboard, or the like. Input module 46 inputs instructions to capture and store images displayed on display module 45 . Additionally, input module 46 inputs user-selected DSLR camera parameters (described below).

IMU 47检测电子设备100的角速度和加速度。电子设备100的姿势可以通过IMU 47的测量结果来掌握。The IMU 47 detects the angular velocity and acceleration of the electronic device 100 . The posture of the electronic device 100 can be grasped from the measurement results of the IMU 47 .

主处理器48控制全球导航卫星系统(GNSS)模块40、无线通信模块41、编解码器42、扬声器43、麦克风44、显示模块45、输入模块46和IMU 47。The main processor 48 controls the Global Navigation Satellite System (GNSS) module 40, the wireless communication module 41, the codec 42, the speaker 43, the microphone 44, the display module 45, the input module 46 and the IMU 47.

存储器49存储图像的数据、深度图的数据、待在图像处理中使用的各种相机参数、以及在图像信号处理器30和/或主处理器48上运行的程序。Memory 49 stores data for images, data for depth maps, various camera parameters to be used in image processing, and programs running on image signal processor 30 and/or main processor 48 .

接下来,参考图1B详细描述ISP 30。Next, the ISP 30 is described in detail with reference to FIG. 1B.

ISP 30包括第一获取单元31、第二获取单元32、获得单元33和执行单元34。The ISP 30 includes a first acquisition unit 31 , a second acquisition unit 32 , an acquisition unit 33 and an execution unit 34 .

第一获取单元31被配置为获取包括焦距和F值的DSLR相机参数。DSLR相机参数是数码单反相机的相机参数。相机参数包括图像传感器的类型和透镜的类型。DSLR相机参数不同于安装在电子设备100上的相机模块10的相机参数。The first acquisition unit 31 is configured to acquire DSLR camera parameters including focal length and F value. DSLR camera parameters are the camera parameters of a digital SLR camera. Camera parameters include the type of image sensor and the type of lens. The DSLR camera parameters are different from the camera parameters of the camera module 10 installed on the electronic device 100 .

DSLR相机参数至少包括焦距和F值。DSLR相机参数还可以包括DSLR图像传感器的尺寸和/或分辨率。DSLR图像传感器是DSLR相机的图像传感器。DSLR camera parameters include at least focal length and F-number. DSLR camera parameters may also include the size and/or resolution of the DSLR image sensor. A DSLR image sensor is the image sensor of a DSLR camera.

第二获取单元32用于获取图像、对焦距离和深度图。深度图对应于获取的图像。The second acquisition unit 32 is used to acquire images, focus distances and depth maps. The depth map corresponds to the acquired image.

获得单元33被配置为基于DSLR相机参数、对焦距离和深度图获得图像的每个像素的散景大小,以生成散景大小图。The obtaining unit 33 is configured to obtain the bokeh size of each pixel of the image based on the DSLR camera parameters, the focus distance, and the depth map to generate a bokeh size map.

执行单元34被配置为基于散景大小图对图像执行散景处理。The execution unit 34 is configured to perform bokeh processing on the image based on the bokeh size map.

<散景处理方法><Bokeh processing method>

将参照图2中所示的流程图来描述根据本公开实施例的散景处理方法。A bokeh processing method according to an embodiment of the present disclosure will be described with reference to the flowchart shown in FIG. 2 .

在步骤S1中,显示模块45显示允许用户输入DSLR相机参数的用户界面(UI)。In step S1, the display module 45 displays a user interface (UI) that allows the user to input DSLR camera parameters.

图3示出了由显示模块45显示的UI的示例。用户可以通过UI输入DSLR相机参数。在该示例中,用户可以选择DSLR图像传感器的类型,即“645”、“35mm”或“APS-C”。用户还可以选择透镜类型,即焦距(20毫米至100毫米)和F值(F1.4至F11)。在选择DSLR相机参数之后,用户单击“保存”按钮以将所选择的参数保存在存储器49中。FIG. 3 shows an example of a UI displayed by the display module 45. Users can enter DSLR camera parameters through the UI. In this example, the user can select the type of DSLR image sensor, which is "645", "35mm" or "APS-C". Users can also select the lens type, namely focal length (20mm to 100mm) and F-number (F1.4 to F11). After selecting the DSLR camera parameters, the user clicks the "Save" button to save the selected parameters in memory 49.

可选地,可以显示允许用户从候选中选择DSLR图像传感器的分辨率的UI。Alternatively, a UI allowing the user to select the resolution of the DSLR image sensor from candidates may be displayed.

在步骤S2中,ISP 30的第一获取单元31获取用户在步骤S1中输入的DSLR相机参数。具体地,第一获取单元31从存储器49读取所输入的DSLR相机参数。In step S2, the first acquisition unit 31 of the ISP 30 acquires the DSLR camera parameters input by the user in step S1. Specifically, the first acquisition unit 31 reads the input DSLR camera parameters from the memory 49 .

在步骤S3中,ISP 30的第二获取单元32获取图像(即,原始图像)、对焦距离以及对应于原始图像的深度图。具体地,当用户使用电子设备100拍摄照片/视频时,立体相机模块10捕获主相机图像和从相机图像。第二获取单元32获取主相机图像或从相机图像作为原始图像。In step S3, the second acquisition unit 32 of the ISP 30 acquires the image (ie, the original image), the focus distance, and the depth map corresponding to the original image. Specifically, when a user takes photos/videos using the electronic device 100, the stereo camera module 10 captures a main camera image and a slave camera image. The second acquisition unit 32 acquires the main camera image or the slave camera image as the original image.

借助于立体匹配技术,ISP 30基于主相机图像和从相机图像生成深度图。With the help of stereo matching technology, ISP 30 generates a depth map based on the main camera image and the slave camera image.

可选地,可以从距离传感器模块20获取深度图。Alternatively, a depth map may be obtained from the distance sensor module 20.

第二获取单元32从相机模块10获取自动对焦区域,并通过计算自动对焦区域中的深度值的代表值来获取对焦距离。The second acquisition unit 32 acquires the autofocus area from the camera module 10 and acquires the focus distance by calculating a representative value of the depth value in the autofocus area.

替代地,第二获取单元32可以直接从相机模块10获取对焦距离。在这种情况下,对焦距离是由相机模块10的自动对焦操作来确定的。Alternatively, the second acquisition unit 32 may directly acquire the focus distance from the camera module 10 . In this case, the focus distance is determined by the autofocus operation of the camera module 10 .

图4A示出了由相机模块10捕获的图像的示例。图像包括三个对象S1、S2和S3,它们从前面按照对象S1、对象S2和对象S3的顺序被放置在桌子上。在图4A所示的例子中。自动对焦区域R在被摄体S2上。Figure 4A shows an example of an image captured by camera module 10. The image includes three objects S1, S2 and S3, which are placed on the table in the order of object S1, object S2 and object S3 from the front. In the example shown in Figure 4A. The autofocus area R is on the subject S2.

图4B示出了与图4A所示的获取的图像相对应的深度图的示例。深度图是灰度图像。例如,深度图中的区域的亮度随着与电子设备100的距离增加而降低。FIG. 4B shows an example of a depth map corresponding to the acquired image shown in FIG. 4A. Depth maps are grayscale images. For example, the brightness of areas in the depth map decreases as the distance from the electronic device 100 increases.

接下来,在步骤S4中,针对所获取图像的每个像素,ISP 30的获得单元33基于DSLR相机参数、对焦距离和深度图计算散景大小。因此,生成散景大小图。Next, in step S4, for each pixel of the acquired image, the obtaining unit 33 of the ISP 30 calculates the bokeh size based on the DSLR camera parameters, the focus distance, and the depth map. Therefore, a bokeh size map is generated.

散景大小可以通过以下等式计算:Bokeh size can be calculated by the following equation:

其中,C是散景大小,f是焦距,A是F值,D是对焦距离,d是深度图中相应像素的深度值。Among them, C is the bokeh size, f is the focal length, A is the F value, D is the focus distance, and d is the depth value of the corresponding pixel in the depth map.

图5示出了在步骤S4中生成的散景大小图的示例。散景大小图是灰度图像。散景大小图中区域的亮度随着该区域的散景大小的增加而增加。在图5所示的示例中,指示聚焦对象S2的区域的亮度最低(即最小的散景大小)。另一方面,指示聚焦对象S1的区域的亮度最高(即最大的散景大小)。FIG. 5 shows an example of the bokeh size map generated in step S4. Bokeh size images are grayscale images. Bokeh Size The brightness of an area in the image increases as the bokeh size of that area increases. In the example shown in Figure 5, the area indicating the focus object S2 has the lowest brightness (ie the smallest bokeh size). On the other hand, the area indicating the focus object S1 has the highest brightness (ie, the largest bokeh size).

在步骤S5中,ISP 30的执行单元34基于在步骤S4中生成的散景大小图对原始图像执行散景处理。因此,可以获得具有散景的图像。In step S5, the execution unit 34 of the ISP 30 performs bokeh processing on the original image based on the bokeh size map generated in step S4. Therefore, images with bokeh can be obtained.

可以通过对原始图像应用平滑滤波器来执行散景处理。平滑滤波器是基于散景大小图生成的滤波器。例如,平滑滤波器是具有标准偏差的高斯滤波器,该标准偏差是基于散景大小图中的散景大小计算的。可以通过以下等式将散景大小转换为标准偏差。Bokeh processing can be performed by applying a smoothing filter to the original image. The smoothing filter is a filter generated based on the bokeh size map. For example, a smoothing filter is a Gaussian filter with a standard deviation calculated based on the bokeh size in the bokeh size map. Bokeh size can be converted to standard deviation via the following equation.

其中,σ是标准偏差,C是散景大小,以及pp是DSLR图像传感器的像素间距。where σ is the standard deviation, C is the bokeh size, and pp is the pixel pitch of the DSLR image sensor.

像素间距pp可以通过以下等式计算:Pixel pitch pp can be calculated by the following equation:

其中,S是DSLR图像传感器的面积,Np是DSLR图像传感器中的像素数。S和Np都是DSLR相机参数。Where, S is the area of the DSLR image sensor, and N p is the number of pixels in the DSLR image sensor. S and N p are both DSLR camera parameters.

具体地,执行单元34生成用于图像中的每个像素的高斯核。基于标准偏差σ确定高斯核的系数。然后,针对图像中的每个像素,执行单元34在相应像素上卷积高斯核。Specifically, execution unit 34 generates a Gaussian kernel for each pixel in the image. Determine the coefficients of the Gaussian kernel based on the standard deviation σ. Then, for each pixel in the image, execution unit 34 convolves a Gaussian kernel on the corresponding pixel.

例如,高斯核的大小是3×3,8×8,16×16,但是它不限于任何特定的大小。可以基于标准偏差σ来确定核大小。例如,核大小随着标准偏差的减小而增加。也可以基于ISP 30的计算能力来确定核大小。例如,核大小随着计算能力的增加而增加。For example, the sizes of Gaussian kernel are 3×3, 8×8, 16×16, but it is not limited to any specific size. The kernel size can be determined based on the standard deviation σ. For example, kernel size increases as standard deviation decreases. The core size can also be determined based on the computing power of the ISP 30. For example, core size increases with increasing computing power.

图6示出了在步骤S5中生成的具有散景的图像的示例。聚焦对象S2被清晰地显示,而对象S1和S3被大大模糊。Figure 6 shows an example of the image with bokeh generated in step S5. Focused object S2 is shown clearly, while objects S1 and S3 are greatly blurred.

图7示出了电子设备100的用户P拍摄被摄体人S的照片或视频并且前景中有花FG和背景中有树BG的情况。如图7所示,在整个距离上,基于根据上述方法的DSLR相机参数生成的散景大小(实线)大于基于电子设备100的实际相机参数生成的散景大小(虚线)。因此,可以获得花FG和树BG的大散景。FIG. 7 shows a situation where the user P of the electronic device 100 takes a photo or video of the subject person S and there are flowers FG in the foreground and trees BG in the background. As shown in FIG. 7 , over the entire distance, the bokeh size generated based on the DSLR camera parameters according to the above method (solid line) is larger than the bokeh size generated based on the actual camera parameters of the electronic device 100 (dashed line). Therefore, large bokeh of flowers FG and trees BG can be obtained.

此外,从图7可以看出。被摄体人S附近的散景大小的曲线沿距离方向不对称。也就是说,被摄体人S前面的散景大小大于被摄体人S后面的散景大小。这可以从上述用于计算散景大小的等式中理解。Furthermore, it can be seen from Figure 7. The curve of the bokeh size near the subject person S is asymmetrical in the distance direction. That is to say, the bokeh size in front of the subject person S is larger than the bokeh size behind the subject person S. This can be understood from the above equation for calculating bokeh size.

需要注意的是,存在多种散景处理方法。步骤S5中的散景处理不限于上述方法,只要使用散景大小图即可。It’s important to note that there are many ways to deal with bokeh. The bokeh processing in step S5 is not limited to the above method, as long as the bokeh size map is used.

可以从预先存储在存储器49中的预设参数中获取DSLR相机参数。在这种情况下,不需要显示上述UI,也就是说,步骤S1不是必需的。The DSLR camera parameters can be obtained from preset parameters stored in the memory 49 in advance. In this case, the above-mentioned UI does not need to be displayed, that is, step S1 is not necessary.

可选地,可以由主处理器48执行上述步骤中的至少一个步骤。Optionally, at least one of the above steps may be performed by the main processor 48 .

可选地,可以改变被摄体附近的散景大小。具体地,景深(DoF)中的散景大小可以改变为小于所计算的散景大小的值。通常,DoF中的所有散景大小都改变为0。在这种情况下,获得单元33通过上述等式计算散景大小,并将DoF中的散景大小改变为小于所计算的散景大小的预定值(例如,0)。Optionally, you can change the size of the bokeh near the subject. Specifically, the bokeh size in the depth of field (DoF) may be changed to a value smaller than the calculated bokeh size. Normally, all bokeh sizes in DoF are changed to 0. In this case, the obtaining unit 33 calculates the bokeh size through the above-mentioned equation, and changes the bokeh size in the DoF to a predetermined value (for example, 0) smaller than the calculated bokeh size.

图8示出了与上述图7相同的情况。如图8所示,DoF中的散景大小被设置为0。换句话说,在被摄体S前面的距离Tf的第一范围内和在被摄体S后面的距离Tr的第二范围内,散景大小被设置为0。将第一范围和第二范围中的散景大小设置为0,使得被摄体人S能够被更清晰地显示。Figure 8 shows the same situation as Figure 7 described above. As shown in Figure 8, the bokeh size in DoF is set to 0. In other words, the bokeh size is set to 0 within the first range of the distance Tf in front of the subject S and in the second range of the distance Tr behind the subject S. The bokeh size in the first range and the second range is set to 0, so that the subject person S can be displayed more clearly.

可以基于焦距(f)、F值(A)、对焦距离(D)和容许弥散圆(δ)来计算DoF。具体地,DoF通过以下等式计算。DoF can be calculated based on focal length (f), F-number (A), focus distance (D), and allowed circle of confusion (δ). Specifically, DoF is calculated by the following equation.

DoF=Tf+Tr DoF=T f +T r

其中,Tf是前景深,Tr是后景深,δ是容许弥散圆,f是焦距,A是F值,D是对焦距离。Among them, T f is the foreground depth, T r is the back depth of field, δ is the allowable circle of confusion, f is the focal length, A is the F value, and D is the focus distance.

容许弥散圆δ通过以下等式计算。The allowed circle of confusion δ is calculated by the following equation.

δ=Max{pp,adr}δ=Max{pp,adr}

adr=1.22×λ×A,adr=1.22×λ×A,

其中,δ是容许弥散圆,Max是返回两个自变量中的较大者的函数,pp是DSLR图像传感器的像素间距,adr是艾里斑半径,λ是代表性波长(例如,530nm),以及a是F值。where δ is the allowed circle of confusion, Max is a function that returns the larger of the two independent variables, pp is the pixel pitch of the DSLR image sensor, adr is the Airy disk radius, and λ is the representative wavelength (for example, 530nm), and a is the F value.

如上所述,根据本公开的实施例,通过使用基于DSLR相机参数生成的散景大小图来执行散景处理,可以精确地再现相当于由DSLR相机创建的散景的高质量散景。换句话说,生成具有自然的和大的散景的图像是可能的。As described above, according to embodiments of the present disclosure, by performing bokeh processing using a bokeh size map generated based on DSLR camera parameters, high-quality bokeh equivalent to bokeh created by a DSLR camera can be accurately reproduced. In other words, it is possible to generate images with natural and large bokeh.

例如,即使图片或视频是使用智能手机等拍摄的,具有相对较小图像传感器的智能手机可以生成具有大散景(相当于由具有大图像传感器的DSLR相机创建的散景)的图像。For example, even if the picture or video was taken using a smartphone or the like, a smartphone with a relatively small image sensor can generate an image with large bokeh (equivalent to the bokeh created by a DSLR camera with a large image sensor).

在本公开的实施例的描述中,应当理解,诸如“中心”、“纵向”、“横向”、“长度”、“宽度”、“厚度”、“上部”、“下部”、“前部”、“后部”、“背部”、“左侧”、“右侧”、“垂直”、“水平”、“顶部”、“底部”、“内部”、“外部”、“顺时针”和“逆时针”的术语应该被解释为指代如讨论的附图中所描述或示出的方向或位置。这些相关术语仅用于简化本公开的描述,并且不指示或暗示所提及的装置或元件必须具有特定方向,或者必须以特定方向被构造或操作。因此,这些术语不能被解释为限制本公开。In the description of the embodiments of the present disclosure, it should be understood that terms such as "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front" , "rear", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise" and " The term "counterclockwise" should be interpreted to refer to a direction or position as described or illustrated in the figures in question. These relative terms are used only to simplify the description of the present disclosure and do not indicate or imply that the device or element mentioned must have a particular orientation, or must be constructed or operated in a particular orientation. Therefore, these terms should not be construed as limiting the present disclosure.

此外,诸如“第一”和“第二”的术语在本文中用于描述的目的,并且不旨在指示或暗示相对重要性或意义,或者暗示所指示的技术特征的数量。因此,定义为“第一”和“第二”的特征可以包括该特征中的一个或多个。在本公开的描述中,“多个”意味着“两个或多于两个”,除非另有说明。Furthermore, terms such as “first” and “second” are used herein for descriptive purposes and are not intended to indicate or imply relative importance or significance, or to imply the number of technical features indicated. Thus, features defined as "first" and "second" may include one or more of these features. In the description of the present disclosure, "plurality" means "two or more than two" unless otherwise stated.

在本公开的实施例的描述中,除非另外指定或限制,否则术语“安装的”、“连接的”、“耦接的”等被广泛使用,并且可以是例如固定连接、可拆卸连接或整体连接;也可以是机械或电气连接;也可以是直接连接或通过中间结构的间接连接;也可以是本领域技术人员根据特定情况能够理解的两个元件的内部通信。In the description of the embodiments of the present disclosure, unless otherwise specified or limited, the terms "mounted", "connected", "coupled", etc. are used broadly, and may be, for example, a fixed connection, a detachable connection, or an integral Connection; it can also be a mechanical or electrical connection; it can also be a direct connection or an indirect connection through an intermediate structure; it can also be an internal communication between two elements that a person skilled in the art can understand according to the specific situation.

在本公开的实施例中,除非另外指定或限制,其中第一特征“在”第二特征“上”或“在”第二特征“下”的结构可以包括第一特征与第二特征直接接触的实施例,并且还可以包括第一特征和第二特征彼此不直接接触、而是通过在它们之间形成的附加特征接触的实施例。此外,第一特征“在”第二特征“上”、“在”第二特征“的上方”或“在”第二特征“的顶部”可以包括第一特征正交或倾斜地“在”第二特征“上”、“在”第二特征“的上方”或“在”第二特征“的顶部”的实施例,或者仅仅意味着第一特征处于比第二特征的高度更高的高度;而第一特征“在”第二特征“下”、“在”第二特征“的下方”或“在”第二特征“的底部”可以包括第一特征正交地或倾斜地“在”第二特征“下”、“在”第二特征“的下方”或“在”第二特征“的底部”的实施例,或者仅仅意味着第一特征处于比第二特征的高度低的高度。In embodiments of the present disclosure, unless otherwise specified or limited, structures wherein a first feature is "on" or "under" a second feature may include the first feature in direct contact with the second feature embodiments, and may also include embodiments in which the first feature and the second feature are not in direct contact with each other, but are in contact through additional features formed therebetween. Additionally, a first feature "on", "over" a second feature, or "on top of" a second feature may include the first feature being "on" the second feature orthogonally or obliquely. Embodiments of two features being "on", "above" or "on top of" the second feature, or simply meaning that the first feature is at a higher height than the height of the second feature; And a first feature "below", "below" or "at" the bottom of a second feature may include the first feature being "below" the second feature, either orthogonally or obliquely. Embodiments of two features "below", "below" or "at" the bottom of a second feature may simply mean that the first feature is at a lower height than the height of the second feature.

在上面的描述中提供了各种实施例和示例来实现本公开的不同结构。为了简化本公开,在上面描述了某些元件和设置。然而,这些元件和设置仅作为示例,并不旨在限制本公开。此外,在本公开的不同示例中,可以重复附图标记和/或参考字母。这种重复是为了简化和清晰,而不是指不同实施例和/或设置之间的关系。此外,本公开提供了不同工艺和材料的示例。然而,本领域技术人员将理解,也可以应用其他工艺和/或材料。Various embodiments and examples are provided in the above description to implement different structures of the present disclosure. To simplify the present disclosure, certain elements and arrangements are described above. However, these elements and arrangements are merely examples and are not intended to limit the disclosure. Furthermore, reference numbers and/or reference letters may be repeated in different examples of the present disclosure. This repetition is for simplicity and clarity and does not imply a relationship between the various embodiments and/or arrangements. Additionally, this disclosure provides examples of different processes and materials. However, those skilled in the art will understand that other processes and/or materials may also be used.

在整个说明书中,对“实施例”、“一些实施例”、“示例性实施例”、“示例”、“特定示例”或“一些示例”的参考意味着结合该实施例或示例描述的具体特征、结构、材料或特性包括在本公开的至少一个实施例或示例中。因此,整个说明书中的上述短语的出现不一定是指本公开的同一实施例或示例。此外,在一个或多个实施例或示例中,具体特征、结构、材料或特性可以以任何合适的方式被组合。Throughout this specification, reference to "embodiments," "some embodiments," "exemplary embodiments," "examples," "particular examples," or "some examples" means that the particular embodiment or example is described in connection with that embodiment or example. Features, structures, materials, or characteristics are included in at least one embodiment or example of the present disclosure. Thus, the appearances of the above phrases throughout the specification are not necessarily referring to the same embodiment or example of the present disclosure. Furthermore, the specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

在流程图中描述的或在本文中以其他方式描述的任何过程或方法可以被理解为包括用于实现过程中的特定逻辑功能或步骤的可执行指令的代码的一个或多个模块、片段或部分,并且本公开的优选实施例的范围包括其他实现,其中本领域技术人员应该理解,可以以与所示或讨论的顺序不同的顺序(包括以基本相同的顺序或相反的顺序)来实现功能。Any process or method depicted in a flowchart or otherwise described herein may be understood to include one or more modules, segments, or code of executable instructions for implementing specific logical functions or steps in the process. parts, and the scope of the preferred embodiments of the present disclosure includes other implementations in which those skilled in the art will understand that the functions may be performed in an order different from that shown or discussed, including in substantially the same order or the reverse order. .

本文中以其他方式描述的或在流程图中示出的逻辑和/或步骤(例如,用于实现逻辑功能的可执行指令的具体顺序表)可以在任何计算机可读介质中具体实现,该计算机可读介质将由指令执行系统、设备或装置(例如基于计算机的系统、包括处理器的系统、或能够从执行指令的指令执行系统、设备和装置获得指令的其他系统)使用,或者将与指令执行系统、设备和装置结合使用。就本说明书而言,“计算机可读介质”可以是适用于包括、存储、通信、传播或传送将由指令执行系统、设备或装置使用或与指令执行系统、设备或装置组合使用的程序的任何设备。计算机可读介质的更具体示例包括但不限于:具有一根或多根导线的电子连接(电子设备)、便携式计算机外壳(磁性设备)、随机存取存储器(randomaccess memory,RAM)、只读存储器(read only memory,ROM)、可擦除可编程只读存储器(erasable programmable read-only memory,EPROM或闪存)、光纤设备和便携式光盘只读存储器(compact disk read-only memory,CDROM)。此外,计算机可读介质甚至可以是能够在其上打印程序的纸或其他合适的介质,这是因为,例如,当需要以电子方式获得程序时,可以光学扫描纸或其他合适的介质,然后用其他合适的方法编辑、解密或处理,以及然后可以将程序存储在计算机存储器中。The logic and/or steps otherwise described herein or illustrated in flowchart diagrams (e.g., a specific sequence of executable instructions for implementing the logical functions) may be embodied in any computer-readable medium. The readable medium will be used by or will be used by an instruction execution system, apparatus, or apparatus, such as a computer-based system, a system including a processor, or other system capable of obtaining instructions from an instruction execution system, apparatus, or apparatus that executes the instructions. Systems, equipment and devices are used in combination. For purposes of this specification, a "computer-readable medium" may be any device suitable for containing, storing, communicating, propagating, or transferring a program for use by or in combination with an instruction execution system, apparatus, or device . More specific examples of computer-readable media include, but are not limited to: an electrical connection having one or more wires (electronic device), a portable computer case (magnetic device), random access memory (RAM), read-only memory (read only memory, ROM), erasable programmable read-only memory (EPROM or flash memory), fiber optic equipment and portable compact disk read-only memory (compact disk read-only memory, CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, since, for example, when a program is required to be obtained electronically, the paper or other suitable medium can be optically scanned and then used Compiled, decrypted or processed by other suitable means, and the program may then be stored in computer memory.

应当理解,本公开的每个部分可以通过硬件、软件、固件或它们的组合来实现。在上述实施例中,多个步骤或方法可以通过存储在存储器中的软件或固件来实现,并由合适的指令执行系统来执行。例如,如果通过硬件实现,同样在另一个实施例中,步骤或方法可以通过本领域已知的以下技术之一或组合来实现:具有用于实现数据信号的逻辑功能的逻辑门电路的分立逻辑电路、具有合适的组合逻辑门电路的专用集成电路、可编程门阵列(programmable gate array,PGA)、现场可编程门阵列(field programmable gate array,FPGA)等。It should be understood that each part of the present disclosure can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, also in another embodiment, the steps or methods may be implemented by one or a combination of the following techniques known in the art: discrete logic with logic gates for implementing the logical function of the data signal Circuits, application-specific integrated circuits with appropriate combinational logic gate circuits, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.

本领域技术人员应当理解,本公开的上述示例性方法中的全部或部分步骤可以通过使用程序命令相关硬件来实现。这些程序可以存储在计算机可读存储介质中,并且当在计算机上运行时,这些程序包括本公开的方法实施例中的步骤之一或组合。Those skilled in the art should understand that all or part of the steps in the above exemplary methods of the present disclosure can be implemented by using program commands to related hardware. These programs may be stored in a computer-readable storage medium, and when run on a computer, these programs include one or a combination of the steps in the method embodiments of the present disclosure.

此外,本公开实施例的每个功能单元可以集成在处理模块中,或者这些单元可以是单独的物理存在,或者两个或更多个单元集成在处理模块中。集成模块可以以硬件的形式或以软件功能模块的形式实现。当集成模块以软件功能模块的形式实现并作为独立产品出售或使用时,集成模块可以存储在计算机可读存储介质中。In addition, each functional unit of the embodiment of the present disclosure may be integrated in a processing module, or these units may be separate physical existences, or two or more units may be integrated in a processing module. Integrated modules can be implemented in the form of hardware or in the form of software function modules. When the integrated module is implemented in the form of a software function module and sold or used as an independent product, the integrated module can be stored in a computer-readable storage medium.

上述存储介质可以是只读存储器、磁盘、光盘(compact disc,CD)等。存储介质可以是暂时性的或非暂时性的。The above storage medium may be a read-only memory, a magnetic disk, a compact disc (CD), etc. Storage media may be transitory or non-transitory.

尽管已经示出和描述了本公开的实施例,但是本领域技术人员将理解,这些实施例是解释性的,并不能被解释为限制本公开,以及在不脱离本公开的范围的情况下,可以在实施例中进行改变、修改、替代和变型。Although embodiments of the disclosure have been shown and described, those skilled in the art will understand that these embodiments are illustrative and are not to be construed as limiting the disclosure, and without departing from the scope of the disclosure, Changes, modifications, substitutions, and variations may be made in the embodiments.

Claims (20)

1. A method for foreground processing, comprising:
acquiring digital single inverse DSLR camera parameters including focal length and F value;
acquiring an image, a focusing distance and a depth map corresponding to the image;
based on the DSLR camera parameters, the focusing distance and the depth map, obtaining a foreground size of each pixel of the image to generate a foreground size map; and
and executing the foreground processing on the image based on the foreground size map.
2. The method of claim 1, wherein the DSLR camera parameters are obtained through a user interface allowing a user to input the DSLR camera parameters.
3. The method of claim 1, wherein the DSLR camera parameters are obtained from preset parameters.
4. A method according to any one of claims 1 to 3, wherein the focus distance is a representative value of a depth value in an autofocus area.
5. The method of any one of claims 1 to 4, wherein the dispersion Jing Daxiao is calculated by equation (1):
wherein C is the foreground size, F is the focal length, a is the F value, D is the focus distance, and D is the depth value of the corresponding pixel in the depth map.
6. The method according to any one of claims 1 to 5, wherein a scene size in the depth of field DoF is changed to a predetermined value smaller than the calculated scene size.
7. The method of claim 6, wherein the predetermined value is 0.
8. The method according to claim 6 or 7, wherein the DoF is calculated based on the focal length, the F value, the focus distance, and an allowable circle of confusion.
9. The method of claim 8, wherein the DoF is calculated by equations (2), (3) and (4):
DoF=T f +T r …(2)
wherein T is f Is the front depth of field, T r Is the back depth of field, δ is the allowed circle of confusion, F is the focal length, a is the F value, and D is the focus distance.
10. The method according to any one of claims 1 to 9, wherein the foreground processing is performed by applying a smoothing filter generated based on the foreground size map to the image.
11. The method of claim 10, wherein the smoothing filter is a gaussian filter having a standard deviation calculated based on the foreground size.
12. The method of claim 11, wherein the standard deviation is calculated by equation (5):
where σ is the standard deviation, C is the foreground size, and pp is the pixel pitch of the DSLR image sensor.
13. The method of claim 11 or 12, wherein the size of the gaussian filter is determined based on the standard deviation.
14. An electronic device for image processing, comprising:
a first acquisition unit configured to acquire digital single inverse DSLR camera parameters including a focal length and an F value;
a second acquisition unit configured to acquire an image, a focusing distance, and a depth map corresponding to the image;
an obtaining unit configured to obtain a foreground size of each pixel of the image based on the DSLR camera parameters, the focusing distance, and the depth map, to generate a foreground size map; and
and the execution unit is configured to execute the foreground processing on the image based on the foreground size map.
15. The electronic device of claim 14, wherein the first acquisition unit acquires the DSLR camera parameters through a user interface allowing a user to input the DSLR camera parameters.
16. The electronic device of claim 14, wherein the first obtaining unit obtains the DSLR camera parameters from preset parameters.
17. The electronic device according to any one of claims 14 to 16, wherein the obtaining unit calculates the foreground size and changes the foreground size in the depth of field DoF to a predetermined value smaller than the calculated foreground size.
18. The electronic device of any of claims 14-17, wherein the execution unit is to perform the foreground processing by applying a smoothing filter generated based on the foreground size map to the image.
19. An electronic device for image processing comprising a processor and a memory for storing instructions, wherein the instructions, when executed by the processor, cause the processor to perform the method of any one of claims 1 to 13.
20. A computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by a computer to implement the method of any of claims 1 to 13.
CN202180096376.5A 2021-04-08 2021-04-08 Bokeh processing method, electronic device and computer-readable storage medium Pending CN117178286A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/086031 WO2022213332A1 (en) 2021-04-08 2021-04-08 Method for bokeh processing, electronic device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN117178286A true CN117178286A (en) 2023-12-05

Family

ID=83544980

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202180096376.5A Pending CN117178286A (en) 2021-04-08 2021-04-08 Bokeh processing method, electronic device and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN117178286A (en)
WO (1) WO2022213332A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2012258467A1 (en) * 2012-12-03 2014-06-19 Canon Kabushiki Kaisha Bokeh amplification
CN103973962B (en) * 2013-02-06 2017-09-01 聚晶半导体股份有限公司 Image processing method and image acquisition device
US9087405B2 (en) * 2013-12-16 2015-07-21 Google Inc. Depth map generation using bokeh detection
US10567641B1 (en) * 2015-01-19 2020-02-18 Devon Rueckner Gaze-directed photography
CN105989574A (en) * 2015-02-25 2016-10-05 光宝科技股份有限公司 Image processing apparatus and image depth processing method

Also Published As

Publication number Publication date
WO2022213332A1 (en) 2022-10-13

Similar Documents

Publication Publication Date Title
KR102278776B1 (en) Image processing method, apparatus, and apparatus
TWI706379B (en) Method, apparatus and electronic device for image processing and storage medium thereof
US9544574B2 (en) Selecting camera pairs for stereoscopic imaging
KR102338576B1 (en) Electronic device which stores depth information associating with image in accordance with Property of depth information acquired using image and the controlling method thereof
KR102565513B1 (en) Method and apparatus for multiple technology depth map acquisition and fusion
US9906772B2 (en) Method for performing multi-camera capturing control of an electronic device, and associated apparatus
US9313419B2 (en) Image processing apparatus and image pickup apparatus where image processing is applied using an acquired depth map
WO2019105214A1 (en) Image blurring method and apparatus, mobile terminal and storage medium
US9402065B2 (en) Methods and apparatus for conditional display of a stereoscopic image pair
CN107950018A (en) The shallow depth of field true to nature presented by focus stack
CN108024058B (en) Image blurring processing method and device, mobile terminal and storage medium
CN108053363A (en) Background blurring processing method, device and equipment
US9332195B2 (en) Image processing apparatus, imaging apparatus, and image processing method
KR20170059704A (en) Image capturing apparatus and method for the same
US20230033956A1 (en) Estimating depth based on iris size
KR102022892B1 (en) Apparatus and method for processing image of mobile terminal comprising camera
KR20160123757A (en) Image photographig apparatus and image photographing metheod
CN117178286A (en) Bokeh processing method, electronic device and computer-readable storage medium
WO2022198525A1 (en) Method of improving stability of bokeh processing and electronic device
WO2022016331A1 (en) Method of compensating tof depth map and electronic device
JP2020046475A (en) Image processing device and control method therefor
WO2022002158A1 (en) Photography method, image processing method, and electronic device
JP2008263386A (en) Still image pickup apparatus
Baek et al. Mirrorless interchangeable-lens light field digital photography camera system
JP2024102803A (en) Imaging device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination