[go: up one dir, main page]

HK1251748B - Imaging method and device based on dual camera - Google Patents

Imaging method and device based on dual camera Download PDF

Info

Publication number
HK1251748B
HK1251748B HK18111015.8A HK18111015A HK1251748B HK 1251748 B HK1251748 B HK 1251748B HK 18111015 A HK18111015 A HK 18111015A HK 1251748 B HK1251748 B HK 1251748B
Authority
HK
Hong Kong
Prior art keywords
image
resolution
camera
main
main image
Prior art date
Application number
HK18111015.8A
Other languages
Chinese (zh)
Other versions
HK1251748A1 (en
Inventor
欧阳丹
谭国辉
Original Assignee
Oppo广东移动通信有限公司
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to HK18111015.8A priority Critical patent/HK1251748B/en
Publication of HK1251748A1 publication Critical patent/HK1251748A1/en
Publication of HK1251748B publication Critical patent/HK1251748B/en

Links

Description

基于双摄像头的成像方法和装置Dual-camera imaging method and device

技术领域Technical Field

本发明涉及移动终端技术领域,尤其涉及一种基于双摄像头的成像方法和装置。The present invention relates to the field of mobile terminal technology, and in particular to an imaging method and device based on dual cameras.

背景技术Background Art

双摄像头已经越来越多地应用于移动终端设备上,现有技术中采用双摄像头中的一个用来拍摄照片,由另一个摄像头用来辅助计算照片的深度信息,以便进行后续的图像虚化处理。Dual cameras have been increasingly used in mobile terminal devices. In the prior art, one of the dual cameras is used to take photos, and the other camera is used to assist in calculating the depth information of the photo for subsequent image blurring processing.

但是,相关技术中的双摄像头在拍摄得到图像之后,往往采用固定的分辨率进行后续的图像处理,导致功能较为单一,用户无法根据需求对分辨率进行调整。However, after capturing an image, the dual cameras in the related art often use a fixed resolution for subsequent image processing, resulting in relatively simple functions and users being unable to adjust the resolution according to their needs.

发明内容Summary of the Invention

本申请旨在至少在一定程度上解决相关技术中的技术问题之一。The present application aims to solve one of the technical problems in the related art at least to a certain extent.

为此,本申请提出一种基于双摄像头的成像方法,通过设置拍摄模式,确定主图像分辨率和副图像分辨率,实现拍摄后图像分辨率的调整。To this end, the present application proposes an imaging method based on a dual camera, which adjusts the image resolution after shooting by setting the shooting mode, determining the main image resolution and the secondary image resolution.

为达上述目的,本申请第一方面实施例提出了一种基于双摄像头的成像方法,该方法包括:To achieve the above objectives, the first embodiment of the present application proposes an imaging method based on a dual camera, the method comprising:

获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像;Acquire a first image captured by the primary camera, and acquire a second image captured by the secondary camera;

确定已选定的拍摄模式;Confirm the selected shooting mode;

根据所述拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据所述拍摄模式和副摄像头的分辨率,确定副图像分辨率;Determining a primary image resolution based on the shooting mode and the resolution of the primary camera, and determining a secondary image resolution based on the shooting mode and the resolution of the secondary camera;

根据所述第一图像,生成符合所述主图像分辨率的主图像;generating a main image that meets the main image resolution based on the first image;

根据所述第二图像,生成符合所述副图像分辨率的副图像;generating a secondary image that meets the secondary image resolution based on the second image;

根据所述主图像和所述副图像,获取所述主图像的深度信息;Acquiring depth information of the main image according to the main image and the sub-image;

根据所述主图像的深度信息,对所述主图像进行虚化处理,得到所需的目标图像。The main image is blurred according to the depth information of the main image to obtain a desired target image.

本申请实施例的一种基于双摄像头的成像方法中,获取主摄像头拍摄的第一图像,副摄像头拍摄的第二图像,根据确定的拍摄模式和主摄像头、副摄像头的分辨率,分别确定主图像分辨率和副图像分辨率,根据第一图像,生成符合主图像分辨率的主图像,根据第二图像,生成符合副图像分辨率的副图像,根据主图像和副图像,获取主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。根据拍摄模式和主、副摄像头的分辨率,确定主图像分辨率和副图像分辨率,实现拍摄后图像分辨率的调整,解决现有技术中双摄像头在拍摄得到图像后,采用固定分辨率进行后续图像处理,导致功能较为单一,无法满足用户根据需求调整分辨率的技术问题。In an imaging method based on a dual camera according to an embodiment of the present application, a first image captured by a main camera and a second image captured by a secondary camera are obtained. The main image resolution and the secondary image resolution are determined based on a determined shooting mode and the resolutions of the main camera and the secondary camera, respectively. A main image that meets the main image resolution is generated based on the first image, and a secondary image that meets the secondary image resolution is generated based on the second image. Depth information of the main image is obtained based on the main image and the secondary image, and the main image is blurred to obtain the desired target image. The main image resolution and the secondary image resolution are determined based on the shooting mode and the resolutions of the main and secondary cameras to adjust the image resolution after shooting. This solves the technical problem in the prior art that dual cameras use a fixed resolution for subsequent image processing after shooting, resulting in relatively simple functions and an inability to meet the user's needs to adjust the resolution.

为达上述目的,本申请第二方面实施例提出了一种基于双摄像头的成像装置,该装置包括:To achieve the above objectives, a second embodiment of the present application provides an imaging device based on a dual camera, the device comprising:

获取模块,用于获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像;An acquisition module, configured to acquire a first image captured by the primary camera and a second image captured by the secondary camera;

确定模块,用于确定已选定的拍摄模式;根据所述拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据所述拍摄模式和副摄像头的分辨率,确定副图像分辨率;其中,所述拍摄模式包括全身模式和半身模式;a determination module, configured to determine a selected shooting mode; determine a primary image resolution based on the shooting mode and a resolution of the primary camera, and determine a secondary image resolution based on the shooting mode and a resolution of the secondary camera; wherein the shooting modes include a full-body mode and a half-body mode;

生成模块,用于根据所述第一图像,生成符合所述主图像分辨率的主图像;根据所述第二图像,生成符合所述副图像分辨率的副图像;a generating module configured to generate a primary image conforming to the primary image resolution based on the first image; and to generate a secondary image conforming to the secondary image resolution based on the second image;

景深模块,用于根据所述主图像和所述副图像,获取所述主图像的深度信息;A depth of field module, configured to obtain depth information of the main image based on the main image and the auxiliary image;

处理模块,用于根据所述主图像的深度信息,对所述主图像进行虚化处理,得到所需的目标图像。The processing module is used to perform blurring processing on the main image according to the depth information of the main image to obtain the required target image.

本申请实施例的一种基于双摄像头的成像装置中,获取模块,用于获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像,确定模块,用于确定已选定的拍摄模式,根据拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据拍摄模式和副摄像头的分辨率,确定副图像分辨率,生成模块,用于根据第一图像,生成符合主图像分辨率的主图像,根据第二图像,生成符合副图像分辨率的副图像,景深模块,用于根据主图像和副图像,获取主图像的深度信息,处理模块,用于根据主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。本实施例中根据拍摄模式和主、副摄像头的分辨率,确定主图像分辨率和副图像分辨率,实现拍摄后图像分辨率的调整。In an imaging device based on a dual camera according to an embodiment of the present application, an acquisition module is used to acquire a first image captured by a main camera and a second image captured by a secondary camera; a determination module is used to determine a selected shooting mode, determine the resolution of the main image based on the shooting mode and the resolution of the main camera, and determine the resolution of the secondary image based on the shooting mode and the resolution of the secondary camera; a generation module is used to generate a main image that meets the resolution of the main image based on the first image, and generate a secondary image that meets the resolution of the secondary image based on the second image; a depth of field module is used to acquire depth information of the main image based on the main image and the secondary image; and a processing module is used to blur the main image based on the depth information of the main image to obtain the desired target image. In this embodiment, the main image resolution and the secondary image resolution are determined based on the shooting mode and the resolutions of the main and secondary cameras to achieve adjustment of the image resolution after shooting.

为达上述目的,本申请第三方面实施例提出了一种移动终端,包括:双摄像头、存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序;所述处理器执行所述程序时,从所述双摄像头中确定出主摄像头和副摄像头,并控制所述主摄像头和副摄像头进行拍摄,以实现如第一方面所述的基于双摄像头的成像方法。To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes a mobile terminal, comprising: a dual camera, a memory, a processor, and a computer program stored in the memory and runnable on the processor; when the processor executes the program, it determines the main camera and the secondary camera from the dual cameras, and controls the main camera and the secondary camera to shoot, so as to realize the dual-camera-based imaging method as described in the first aspect.

为了实现上述目的,本申请第四方面实施例提出了一种计算机可读存储介质,该程序被处理器执行时实现如第一方面所述的基于双摄像头的成像方法。In order to achieve the above-mentioned objectives, the fourth embodiment of the present application proposes a computer-readable storage medium, which, when executed by a processor, implements the dual-camera-based imaging method as described in the first aspect.

本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned through practice of the present invention.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

图1为本发明实施例所提供的一种基于双摄像头的成像方法的流程示意图;FIG1 is a schematic flow chart of an imaging method based on dual cameras provided by an embodiment of the present invention;

图2为三角测距的原理示意图;Figure 2 is a schematic diagram of the principle of triangulation;

图3为本发明实施例所提供的另一种基于双摄像头的成像方法的流程示意图;FIG3 is a schematic flow chart of another dual-camera-based imaging method provided by an embodiment of the present invention;

图4为本申请实施例所提供的一种基于双摄像头的成像装置的结构示意图;FIG4 is a schematic structural diagram of an imaging device based on dual cameras provided in an embodiment of the present application;

图5为本申请实施例所提供的另一种基于双摄像头的成像装置的结构示意图;FIG5 is a schematic structural diagram of another dual-camera-based imaging device provided in an embodiment of the present application;

图6是根据本发明另一个实施例的终端设备的结构示意图;FIG6 is a schematic structural diagram of a terminal device according to another embodiment of the present invention;

图7为一个实施例中图像处理电路的示意图。FIG. 7 is a schematic diagram of an image processing circuit according to an embodiment.

具体实施方式DETAILED DESCRIPTION

下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

下面参考附图描述本发明实施例的基于双摄像头的成像方法和装置。The following describes an imaging method and apparatus based on dual cameras according to an embodiment of the present invention with reference to the accompanying drawings.

图1为本发明实施例所提供的一种基于双摄像头的成像方法的流程示意图。FIG1 is a schematic flow chart of an imaging method based on dual cameras provided in an embodiment of the present invention.

如图1所示,该基于双摄像头的成像方法包括以下步骤:As shown in FIG1 , the dual-camera-based imaging method includes the following steps:

步骤S101,获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像。Step S101: Acquire a first image captured by a main camera, and acquire a second image captured by a secondary camera.

本实施例的方法应用于含有双摄像头的移动终端,为了便于区分,双摄像头可分别称为第一摄像头和第二摄像头,在第一摄像头和第二摄像头中,一个作为主摄像头获取用于成像的第一图像,一个作为副摄像头获取用于参考计算景深的第二图像。The method of this embodiment is applied to a mobile terminal with a dual camera. For ease of distinction, the dual cameras can be respectively referred to as a first camera and a second camera. Among the first camera and the second camera, one is used as a main camera to obtain a first image for imaging, and the other is used as a secondary camera to obtain a second image for reference calculation of depth of field.

为了达到较佳的成像效果,作为一种可能的实现方式,第一摄像头的分辨率高于第二摄像头,而第二摄像头的感光度高于第一摄像头。可以根据拍摄场景从第一摄像头和第二摄像头中选定主摄像头和副摄像头。具体来说,在获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像之前,需要先测定环境亮度,根据环境亮度,从双摄像头中确定主摄像头和副摄像头,根据确定的主摄像头和副摄像头,分别获取为成像拍摄的第一图像,以及为计算景深拍摄的第二图像。在后续实施例中还将对这一过程进行更加详细说明,本实施例中对此不再赘述。To achieve a better imaging effect, as a possible implementation method, the resolution of the first camera is higher than that of the second camera, and the sensitivity of the second camera is higher than that of the first camera. The main camera and the secondary camera can be selected from the first camera and the second camera according to the shooting scene. Specifically, before obtaining the first image captured by the main camera and the second image captured by the secondary camera, it is necessary to first measure the ambient brightness. Based on the ambient brightness, the main camera and the secondary camera are determined from the dual cameras. Based on the determined main camera and secondary camera, the first image captured for imaging and the second image captured for depth of field calculation are respectively acquired. This process will be described in more detail in subsequent embodiments and will not be repeated in this embodiment.

步骤S102,确定已选定的拍摄模式。Step S102: Determine the selected shooting mode.

具体地,拍摄模式包括全身模式和半身模式。其中,全身模式适用于在进行人像拍摄时,需要拍摄全身人像的场景中。当用户选定了全身模式时,用户一般会在取景时,将人像整体落入取景框中。Specifically, the shooting modes include full-body mode and half-body mode. Full-body mode is suitable for portraits where you need to capture a full-body portrait. When the user selects full-body mode, they will generally frame the shot so that the entire portrait falls within the frame.

半身模式,适用于在进行人像拍摄时,需要拍摄部分人像的场景中,这里的部分人像通常是上半身,也就是头部和上肢躯干部分。当用户选定了半身模式时,用户一般会在取景时,仅将上半身人像落入取景框中。Half-body mode is suitable for portraits where you need to capture a portion of a person's body, typically the upper body, including the head and torso. When Half-body mode is selected, users typically frame their shot with only the upper body of the person in the frame.

作为一种可能的实现方式,可在移动终端拍摄预览界面,提供控件,以便用户通过该控件选择拍摄模式。As a possible implementation method, a control may be provided on the shooting preview interface of the mobile terminal so that the user can select a shooting mode through the control.

步骤S103,根据拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据拍摄模式和副摄像头的分辨率,确定副图像分辨率。Step S103 : determining the resolution of the primary image according to the shooting mode and the resolution of the primary camera, and determining the resolution of the secondary image according to the shooting mode and the resolution of the secondary camera.

具体地,若拍摄模式是全身模式,根据已确定的主摄像头的分辨率,将主摄像头的分辨率,与全身模式对应的调节系数进行乘法运算,得到主图像分辨率;根据已确定的副摄像头的分辨率,将副摄像头的分辨率,与全身模式对应的调节系数进行乘法运算,得到副图像分辨率。Specifically, if the shooting mode is full-body mode, according to the determined resolution of the main camera, the resolution of the main camera is multiplied by the adjustment coefficient corresponding to the full-body mode to obtain the main image resolution; according to the determined resolution of the secondary camera, the resolution of the secondary camera is multiplied by the adjustment coefficient corresponding to the full-body mode to obtain the secondary image resolution.

这里的调节系数,用于图像的分辨率调整过程中,指示调整后的分辨率与调整前的分辨率之间的比例关系。这里的调节系数取值范围为大于1以及0至1之间。具体来说,若调整后的分辨率大于调整前的分辨率,调节系数取值为大于1,若调整后的分辨率小于调整前的分辨率,调节系数的取值为0至1之间。The adjustment coefficient is used during image resolution adjustment to indicate the ratio of the adjusted resolution to the original resolution. The adjustment coefficient ranges from greater than 1 to between 0 and 1. Specifically, if the adjusted resolution is greater than the original resolution, the adjustment coefficient is greater than 1; if the adjusted resolution is less than the original resolution, the adjustment coefficient is between 0 and 1.

若拍摄模式是半身模式,根据已确定的主摄像头的分辨率,将主摄像头的分辨率,与半身模式对应的调节系数进行乘法运算,得到主图像分辨率;根据已确定的副摄像头的分辨率,将副摄像头的分辨率,与半身模式对应的调节系数进行乘法运算。If the shooting mode is half-body mode, according to the determined resolution of the main camera, the resolution of the main camera is multiplied by the adjustment coefficient corresponding to the half-body mode to obtain the main image resolution; according to the determined resolution of the secondary camera, the resolution of the secondary camera is multiplied by the adjustment coefficient corresponding to the half-body mode.

需要说明的是,全身模式对应的调节系数大于半身模式对应的调节系数。It should be noted that the adjustment coefficient corresponding to the full-body mode is greater than the adjustment coefficient corresponding to the half-body mode.

步骤S104,根据第一图像,生成符合主图像分辨率的主图像。Step S104: generating a main image that meets the main image resolution based on the first image.

第一图像是根据主摄像头拍摄得到的,第一图像的分辨率和主摄像头的分辨率相同,而主图像的分辨率是根据主摄像头的分辨率乘以拍摄模式对应的调节系数得到的,因此,在拍摄模式对应的调节系数是小于等于1的正数的情况下,第一图像分辨率大于或等于主图像分辨。具体地,若第一图像的分辨率大于主图像分辨率,对第一图像进行截取,得到符合主图像分辨率的主图像;若第一图像分辨率等于主图像分辨率,则第一图像则为主图像。The first image is captured by the main camera. The resolution of the first image is the same as that of the main camera. The resolution of the main image is obtained by multiplying the resolution of the main camera by the adjustment coefficient corresponding to the shooting mode. Therefore, when the adjustment coefficient corresponding to the shooting mode is a positive number less than or equal to 1, the resolution of the first image is greater than or equal to the resolution of the main image. Specifically, if the resolution of the first image is greater than the resolution of the main image, the first image is cropped to obtain a main image that meets the resolution of the main image. If the resolution of the first image is equal to the resolution of the main image, the first image becomes the main image.

步骤S105,根据第二图像,生成符合副图像分辨率的副图像。Step S105 : generating a secondary image that meets the secondary image resolution based on the second image.

第二图像是根据副摄像头拍摄得到的,第二图像的分辨率和副摄像头的分辨率相同,而副图像的分辨率是根据副摄像头的分辨率乘以拍摄模式对应的调节系数得到的,因此,在拍摄模式对应的调节系数是小于等于1的正数的情况下,第二图像分辨率大于或等于副图像分辨。具体地,若第二图像的分辨率大于副图像分辨率,对第二图像进行截取,得到符合副图像分辨率的副图像;若第二图像分辨率等于副图像分辨率,则第二图像即为副图像。The second image is captured using the secondary camera. Its resolution is the same as the secondary camera's. The secondary image's resolution is obtained by multiplying the secondary camera's resolution by the adjustment coefficient corresponding to the shooting mode. Therefore, if the adjustment coefficient corresponding to the shooting mode is a positive number less than or equal to 1, the second image's resolution is greater than or equal to the secondary image's resolution. Specifically, if the second image's resolution is greater than the secondary image's resolution, the second image is cropped to obtain a secondary image that matches the secondary image's resolution. If the second image's resolution is equal to the secondary image's resolution, the second image serves as the secondary image.

步骤S106,根据主图像和副图像,计算主图像的深度信息。Step S106 : Calculate depth information of the main image based on the main image and the sub-image.

具体地,由于主图像和副图像是分别由不同的摄像头拍摄得到的,两个摄像头之间具有一定的距离,从而导致的视差,根据三角测距原理,可以计算得到主图像和副图像中,同一对象的深度信息,也就是该对象距离主副摄像头所在平面的距离。Specifically, since the main image and the secondary image are taken by different cameras respectively, there is a certain distance between the two cameras, resulting in parallax. According to the principle of triangulation, the depth information of the same object in the main image and the secondary image can be calculated, that is, the distance of the object from the plane where the main and secondary cameras are located.

为了清楚说明这一过程,下面将对三角测距原理进行简要介绍。In order to explain this process clearly, the principle of triangulation is briefly introduced below.

而在实际场景,人眼分辨景物的深度主要是依靠双目视觉分辨出的。这和双摄像头分辨深度的原理一样。本实施例中根据主图像和副图像,计算主图像的深度信息,主要方法是依靠三角测距原理,图2为三角测距的原理示意图。In real-world scenarios, the human eye primarily relies on binocular vision to discern the depth of objects. This is similar to the principle behind dual-camera depth resolution. In this embodiment, depth information for the primary image is calculated based on the primary and secondary images, primarily using the principle of triangulation. Figure 2 illustrates this principle.

基于图2中,在实际空间中,画出了成像对象,以及两个摄像头所在位置OR和OT,以及两个摄像头的焦平面,焦平面距离两个摄像头所在平面的距离为f,在焦平面位置两各摄像头进行成像,从而得到两张拍摄图像。Based on Figure 2, in real space, the imaging object, the positions of the two cameras OR and OT , and the focal planes of the two cameras are drawn. The distance f between the focal plane and the plane where the two cameras are located is , and the two cameras perform imaging at the focal plane position, thereby obtaining two captured images.

P和P’分别是同一对象在不同拍摄图像中的位置。其中,P点距离所在拍摄图像的左侧边界的距离为XR,P’点距离所在拍摄图像的左侧边界的距离为XT。OR和OT分别为两个摄像头,这两个摄像头在同一平面,距离为B。P and P' are the positions of the same object in different images. The distance from point P to the left edge of the image is X R , and the distance from point P' to the left edge of the image is XT . OR and OT are two cameras located on the same plane, separated by a distance B.

基于三角测距原理,图2中的对象与两个摄像头所在平面之间的距离Z,具有如下关系:Based on the principle of triangulation, the distance Z between the object in Figure 2 and the plane where the two cameras are located has the following relationship:

基于此,可以推得其中,d为同一对象在不同拍摄图像中的位置之间的距离差。由于B、f为定值,因此,根据d可以确定出对象的距离Z。Based on this, we can deduce that d is the distance difference between the positions of the same object in different captured images. Since B and f are constants, the distance Z of the object can be determined based on d.

步骤S107,根据主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。Step S107 : blurring the main image according to the depth information of the main image to obtain the desired target image.

具体地,计算得到主图像的深度信息之后,可以根据主图像中各对象的深度信息,确定出该对象为前景还是背景。一般来说,深度信息指示对象距离主副摄像头所在平面较近,深度取值较小时,可以确定该对象为前景,否则,该对象为背景。Specifically, after calculating the depth information of the primary image, the depth information of each object in the primary image can be used to determine whether the object is foreground or background. Generally speaking, if the depth information indicates that the object is close to the plane of the primary and secondary cameras and the depth value is small, the object can be determined to be foreground; otherwise, the object is background.

可以对识别出的背景,进行虚化处理,得到目标图像,在目标图像中,前景更加突出,背景得到了虚化,呈现出对焦的前景的成像效果。The identified background can be blurred to obtain a target image. In the target image, the foreground is more prominent and the background is blurred, presenting an imaging effect of a focused foreground.

本申请实施例的一种基于双摄像头的成像方法中,获取主摄像头拍摄的第一图像,副摄像头拍摄的第二图像,根据确定的拍摄模式和主摄像头、副摄像头的分辨率,分别确定主图像分辨率和副图像分辨率,根据第一图像,生成符合主图像分辨率的主图像,根据第二图像,生成符合副图像分辨率的副图像,根据主图像和副图像,计算主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。根据拍摄模式和主、副摄像头的分辨率,确定主图像分辨率和副图像分辨率,实现拍摄后图像分辨率的调整,解决现有技术中双摄像头在拍摄得到图像后,采用固定分辨率进行后续图像处理,导致功能较为单一,无法满足用户根据需求调整分辨率的技术问题。In an imaging method based on a dual camera according to an embodiment of the present application, a first image captured by a main camera and a second image captured by a secondary camera are obtained. The main image resolution and the secondary image resolution are determined based on the determined shooting mode and the resolutions of the main camera and the secondary camera, respectively. A main image that meets the main image resolution is generated based on the first image, and a secondary image that meets the secondary image resolution is generated based on the second image. The depth information of the main image is calculated based on the main image and the secondary image, and the main image is blurred to obtain the desired target image. The main image resolution and the secondary image resolution are determined based on the shooting mode and the resolutions of the main and secondary cameras to adjust the image resolution after shooting. This solves the technical problem in the prior art that after shooting, dual cameras use a fixed resolution for subsequent image processing, resulting in relatively simple functions and an inability to meet the user's needs to adjust the resolution.

在上一实施例的基础上,为了更加清楚的说明,在不同的拍摄模式下,如何确定主图像和副图像的分辨率,实现即保证了成像效果,又使得拍摄后图像分辨率灵活调整的方法,本申请实施例提供了另一种基于双摄像头的成像方法的可能的实现方式。On the basis of the previous embodiment, in order to more clearly illustrate how to determine the resolution of the main image and the secondary image in different shooting modes, so as to achieve a method that not only ensures the imaging effect but also allows the image resolution to be flexibly adjusted after shooting, the embodiment of the present application provides another possible implementation method of the imaging method based on dual cameras.

图3为本发明实施例所提供的另一种基于双摄像头的成像方法的流程示意图,如图3所示,该方法包括:FIG3 is a flow chart of another dual-camera-based imaging method provided by an embodiment of the present invention. As shown in FIG3 , the method includes:

步骤S301,根据环境亮度,从双摄像头中确定主摄像头和副摄像头。Step S301: Determine the main camera and the secondary camera from the dual cameras according to the ambient brightness.

具体地,作为一种可能的实现形式,可以采用独立的测光器件,测量环境的亮度。Specifically, as a possible implementation form, an independent light measuring device may be used to measure the brightness of the environment.

作为另一种可能的实现形式,可以读取第一摄像头和第二摄像头自动调节的ISO值,根据读取到的ISO值,确定环境亮度。一般来说,第一摄像头和第二摄像头应采用相同的ISO值,从而采用该ISO值,便可以确定对应的环境亮度。但若读取到的第一摄像头ISO值和第二摄像头ISO值是不同的,可以根据两者的平均值确定对应的环境亮度。As another possible implementation, the automatically adjusted ISO values of the first and second cameras can be read and the ambient brightness determined based on the read ISO values. Generally, the first and second cameras should use the same ISO value, so that the corresponding ambient brightness can be determined using that ISO value. However, if the read ISO values of the first and second cameras are different, the corresponding ambient brightness can be determined based on the average of the two values.

需要说明的是,ISO值用来指示摄像头的感光度,常用的ISO值有50、100、200、400、1000等等,摄像头可以根据环境亮度,自动调节ISO值,从而,本实施例中,可以根据ISO值,反推出环境亮度。一般在光线充足的情况下,ISO值器50或100,在光线不足的情况下,ISO值可以为400或更高。It should be noted that the ISO value is used to indicate the sensitivity of the camera. Commonly used ISO values include 50, 100, 200, 400, 1000, etc. The camera can automatically adjust the ISO value according to the ambient brightness. Therefore, in this embodiment, the ambient brightness can be inferred based on the ISO value. Generally, in sufficient light, the ISO value is 50 or 100, and in insufficient light, the ISO value can be 400 or higher.

其中,双摄像头包括第一摄像头和第二摄像头,其中,第一摄像头的分辨率高于第二摄像头,第二摄像头的感光度高于第一摄像头,例如:第一摄像头可以为1600万像素(Mega pixel,MP)摄像头,第二摄像头可以为8百万像素(MP)摄像头。The dual camera includes a first camera and a second camera, wherein the resolution of the first camera is higher than that of the second camera, and the sensitivity of the second camera is higher than that of the first camera. For example, the first camera can be a 16-megapixel (MP) camera, and the second camera can be an 8-megapixel (MP) camera.

具体地,若环境亮度高于阈值亮度,将第一摄像头作为主摄像头,并将第二摄像头作为副摄像头。若环境亮度不高于阈值亮度,将第二摄像头作为主摄像头,并将第一摄像头作为副摄像头。Specifically, if the ambient brightness is higher than a threshold brightness, the first camera is used as the main camera and the second camera is used as the secondary camera. If the ambient brightness is not higher than the threshold brightness, the second camera is used as the main camera and the first camera is used as the secondary camera.

这是由于在环境亮度不高于阈值亮度的情况下,光线不足,采用高分辨率摄像头作为主摄像头进行拍照时,会出现较多的噪声,从而导致成像效果不佳。因此,在光线不足时,可以采用高感光度的摄像头为主摄像头进行拍照,减少图像中的噪声,提高成像效果。This is because when the ambient brightness is below the threshold, the light is insufficient. When using a high-resolution camera as the primary camera to take pictures, more noise will appear, resulting in poor imaging quality. Therefore, when the light is insufficient, you can use a high-sensitivity camera as the primary camera to reduce noise in the image and improve the imaging quality.

相反地,在环境亮度高于阈值亮度的情况下,光线充足的情况下,由于高分辨率的摄像头分辨率较高,成像也较为清晰,噪声较少,因此,可以将高分辨率摄像头作为主摄像头进行拍照,并将高感光摄像头作为副摄像头计算得到较为准确的深度信息,从而提高成像效果。On the contrary, when the ambient brightness is higher than the threshold brightness and there is sufficient light, the high-resolution camera has a higher resolution, the image is clearer and has less noise. Therefore, the high-resolution camera can be used as the main camera to take pictures, and the high-sensitivity camera can be used as the secondary camera to calculate more accurate depth information, thereby improving the imaging effect.

步骤S302,获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像。Step S302: Acquire a first image captured by the main camera, and acquire a second image captured by the secondary camera.

例如,当环境亮度高于阈值亮度时,将分辨率为16MP的第一摄像头作为主摄像头,拍摄得到第一图像的分辨率为16MP,将分辨率为8MP的第二摄像头作为副摄像头,拍摄得到第二图像的分辨率为8MP。For example, when the ambient brightness is higher than the threshold brightness, the first camera with a resolution of 16MP is used as the main camera to capture the first image with a resolution of 16MP, and the second camera with a resolution of 8MP is used as the secondary camera to capture the second image with a resolution of 8MP.

当环境亮度低于阈值亮度时,将分辨率为8MP的第二摄像头作为主摄像头,拍摄得到第一图像的分辨率为8MP,将分辨率为16MP的第一摄像头作为副摄像头,拍摄得到第二图像的分辨率为16MP。When the ambient brightness is lower than the threshold brightness, the second camera with a resolution of 8MP is used as the main camera to capture the first image with a resolution of 8MP, and the first camera with a resolution of 16MP is used as the secondary camera to capture the second image with a resolution of 16MP.

步骤S303,根据已选定的拍摄模式,以及根据主摄像头的分辨率和副摄像头的分辨率,和拍摄模式对应的调节调节系数,获取主图像分辨率和副图像分辨率。Step S303 : Obtain the main image resolution and the sub-image resolution according to the selected shooting mode, the resolution of the main camera, the resolution of the sub-camera, and the adjustment coefficient corresponding to the shooting mode.

具体地,拍摄模式包括全身模式和半身模式,其中,全身模式对应的调节系数大于半身模式对应的调节系数,作为一种可能的实现方式,全身模式对应的调节系数为1,半身模式对应的调节系数为0.5。Specifically, the shooting modes include full-body mode and half-body mode, wherein the adjustment coefficient corresponding to the full-body mode is greater than the adjustment coefficient corresponding to the half-body mode. As a possible implementation method, the adjustment coefficient corresponding to the full-body mode is 1, and the adjustment coefficient corresponding to the half-body mode is 0.5.

举例,当用户选择的拍摄模式为全身模式时,若环境亮度高于阈值亮度,主摄像头分辨率为16MP,副摄像头分辨率为8MP,分别和全身模式对应的调节系数1相乘后,得到主图像分辨率为16MP,副图像分辨率为8MP;若环境亮度低于阈值亮度,主摄像头分辨率为8MP,副摄像头分辨率为16MP,分别和全身模式对应的调节系数1相乘后,得到主图像分辨率为8MP,副图像分辨率为16MP。For example, when the user selects full-body shooting mode, if the ambient brightness is higher than the threshold brightness, the main camera resolution is 16MP and the secondary camera resolution is 8MP. After multiplying them by the adjustment factor 1 corresponding to the full-body mode, the main image resolution is 16MP and the secondary image resolution is 8MP. If the ambient brightness is lower than the threshold brightness, the main camera resolution is 8MP and the secondary camera resolution is 16MP. After multiplying them by the adjustment factor 1 corresponding to the full-body mode, the main image resolution is 8MP and the secondary image resolution is 16MP.

当用户选择的拍摄模式为半身模式,若环境亮度高于阈值亮度,主摄像头分辨率为16MP,副摄像头分辨率为8MP,分别和半身模式对应的调节系数0.5相乘后,得到主图像分辨率为8MP,副图像分辨率为4MP;若环境亮度低于阈值亮度,主摄像头分辨率为8MP,副摄像头分辨率为16MP,分别和半身模式对应的调节系数0.5相乘后,得到主图像分辨率为4MP,副图像分辨率为8MP。When the user selects half-body shooting mode, if the ambient brightness is higher than the threshold brightness, the main camera resolution is 16MP and the secondary camera resolution is 8MP. After multiplying them by the adjustment coefficient of 0.5 corresponding to half-body mode, the resulting main image resolution is 8MP and the secondary image resolution is 4MP. If the ambient brightness is lower than the threshold brightness, the main camera resolution is 8MP and the secondary camera resolution is 16MP. After multiplying them by the adjustment coefficient of 0.5 corresponding to half-body mode, the resulting main image resolution is 4MP and the secondary image resolution is 8MP.

需要说明的是,全身模式和半身模式对应的调节系数,本领域技术人员还可以根据具体情况进行设定,本实施例中不做具体限定,因原理相同,也不做赘述。It should be noted that the adjustment coefficients corresponding to the full-body mode and the half-body mode can be set by those skilled in the art according to specific circumstances. This is not specifically limited in this embodiment and will not be elaborated on because the principles are the same.

步骤S304,若第一图像的分辨率大于主图像分辨率,对第一图像进行截取,得到符合主图像分辨率的主图像。Step S304: If the resolution of the first image is greater than the resolution of the main image, the first image is cropped to obtain a main image that meets the resolution of the main image.

其中,目标区域是第一图像中的中央区域,因拍摄得到的图像四周具有畸变,中央区域图像质量较好,故截取第一图像的中央区域作为主图像可保证主图像的成像质量。The target area is the central area of the first image. Since the captured image is distorted on all sides and the image quality of the central area is better, intercepting the central area of the first image as the main image can ensure the imaging quality of the main image.

具体地,当环境亮度大于阈值亮度时,第一图像的分辨率为16MP,若当前用户选择的是全身模式,则主图像分辨率为16MP,第一图像的分辨率和主图像分辨率相同,则不需要将第一图像进行截取,直接将第一图像作为主图像,主图像分辨率为16MP;若当前用户选择的是半身模式,则主图像分辨率为8MP,则第一图像的分辨率大于主图像的分辨率,则从第一图像的中央区域截取符合主图像分辨率8MP的区域,作为主图像,主图像的分辨率即为8MP。Specifically, when the ambient brightness is greater than the threshold brightness, the resolution of the first image is 16MP. If the current user selects the full-body mode, the resolution of the main image is 16MP. The resolution of the first image is the same as the resolution of the main image, and there is no need to capture the first image. The first image is directly used as the main image, and the resolution of the main image is 16MP; if the current user selects the half-body mode, the resolution of the main image is 8MP. The resolution of the first image is greater than the resolution of the main image, and the area that meets the main image resolution of 8MP is captured from the central area of the first image as the main image, and the resolution of the main image is 8MP.

当环境亮度小于阈值亮度时,第一图像的分辨率为8MP,若当前用户选择的是全身模式,则主图像分辨率为8MP,第一图像的分辨率和主图像分辨率相同,则不需要从第一图像中截取,直接将第一图像作为主图像,主图像分辨率为8MP;若当前用户选择的是半身模式,则主图像分辨率为4MP,则第一图像的分辨率8MP大于主图像的分辨率4MP,则从第一图像的中央区域截取符合主图像分辨率4MP的区域,作为主图像,主图像的分辨率即为4MP。When the ambient brightness is less than the threshold brightness, the resolution of the first image is 8MP. If the current user selects the full-body mode, the resolution of the main image is 8MP. If the resolution of the first image is the same as the main image resolution, there is no need to capture from the first image, and the first image is directly used as the main image, and the resolution of the main image is 8MP. If the current user selects the half-body mode, the resolution of the main image is 4MP. If the resolution of the first image 8MP is greater than the resolution of the main image 4MP, an area that meets the main image resolution of 4MP is captured from the central area of the first image as the main image, and the resolution of the main image is 4MP.

步骤S305,若第二图像的分辨率大于副图像分辨率,对第二图像进行截取,得到符合副图像分辨率的副图像。Step S305 : If the resolution of the second image is greater than the resolution of the sub-image, the second image is cropped to obtain a sub-image that meets the resolution of the sub-image.

具体地,当环境亮度大于阈值亮度时,第二图像的分辨率为8MP,若当前用户选择的是全身模式,则副图像分辨率为8MP,第二图像的分辨率和副图像分辨率相同,则不需要将第二图像进行截取,直接将第二图像作为副图像,副图像分辨率为8MP;若当前用户选择的是半身模式,则副图像分辨率为4MP,则第二图像的分辨率大于副图像的分辨率,则从第二图像的中央区域截取符合副图像分辨率4MP的区域,作为副图像,副图像的分辨率即为4MP。Specifically, when the ambient brightness is greater than the threshold brightness, the resolution of the second image is 8MP. If the current user selects the full-body mode, the resolution of the sub-image is 8MP. The resolution of the second image is the same as the sub-image resolution, and there is no need to capture the second image. The second image is directly used as the sub-image, and the sub-image resolution is 8MP; if the current user selects the half-body mode, the resolution of the sub-image is 4MP. The resolution of the second image is greater than the resolution of the sub-image, and the area that meets the sub-image resolution of 4MP is captured from the central area of the second image as the sub-image, and the resolution of the sub-image is 4MP.

当环境亮度小于阈值亮度时,第二图像的分辨率为16MP,若当前用户选择的是全身模式,则副图像分辨率为16MP,第二图像的分辨率和主图像分辨率相同,则不需要从第二图像中截取,直接将第二图像作为副图像,副图像分辨率为16MP;若当前用户选择的是半身模式,则副图像分辨率为8MP,则第二图像的分辨率16MP大于副图像的分辨率8MP,则从第二图像的中央区域截取符合副图像分辨率8MP的区域,作为副图像,副图像的分辨率即为8MP。When the ambient brightness is lower than the threshold brightness, the resolution of the second image is 16MP. If the current user selects the full-body mode, the resolution of the secondary image is 16MP. The resolution of the second image is the same as that of the primary image. There is no need to capture from the second image, and the second image is directly used as the secondary image with a resolution of 16MP. If the current user selects the half-body mode, the resolution of the secondary image is 8MP. If the resolution of the second image (16MP) is greater than the resolution of the secondary image (8MP), an area that meets the secondary image resolution of 8MP is captured from the central area of the second image as the secondary image, and the resolution of the secondary image is 8MP.

步骤S306,根据主图像和副图像,获取主图像的深度信息。Step S306: Acquire depth information of the main image according to the main image and the sub-image.

具体地,根据主图像和副图像中,关于同一对象的位置偏差,以及双摄像头的参数,确定出主图像的深度信息。Specifically, the depth information of the main image is determined based on the position deviation of the same object in the main image and the sub-image, and the parameters of the dual cameras.

具体计算过程,参见前述实施例中步骤106的相关描述,本实施例中对此不再赘述。For the specific calculation process, please refer to the relevant description of step 106 in the above embodiment, which will not be repeated in this embodiment.

步骤S307,根据主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。Step S307 : blurring the main image according to the depth information of the main image to obtain the desired target image.

具体地,计算得到主图像的深度信息之后,可以根据主图像中各对象的深度信息,确定出该对象为前景还是背景。一般来说,深度信息指示对象距离主副摄像头所在平面较近,深度取值较小时,可以确定该对象为前景,否则,该对象为背景。Specifically, after calculating the depth information of the primary image, the depth information of each object in the primary image can be used to determine whether the object is foreground or background. Generally speaking, if the depth information indicates that the object is close to the plane of the primary and secondary cameras and the depth value is small, the object can be determined to be foreground; otherwise, the object is background.

可以对识别出的背景,进行虚化处理,得到目标图像,在目标图像中,前景更加突出,背景得到了虚化,呈现出对焦的前景的成像效果。The identified background can be blurred to obtain a target image. In the target image, the foreground is more prominent and the background is blurred, presenting an imaging effect of a focused foreground.

步骤S308,若主图像分辨率小于副图像分辨率,对目标图像进行升采样,升采样后的目标图像分辨率符合副图像分辨率。Step S308 : If the resolution of the main image is smaller than the resolution of the secondary image, upsample the target image so that the resolution of the upsampled target image meets the resolution of the secondary image.

具体地,如步骤S303中所述,在环境亮度低于阈值亮度时,则获取得到的主图像分辨率小于副图像分辨率,将目标图像分辨率进行升采样,例如采用插值法进行升采样,升采样后得到的目标图像的分辨率符合副图像分辨率。Specifically, as described in step S303, when the ambient brightness is lower than the threshold brightness, the obtained main image resolution is smaller than the secondary image resolution, and the target image resolution is upsampled, for example, by using interpolation method, and the resolution of the target image obtained after upsampling meets the secondary image resolution.

例如,在全身模式时,主图像分辨率为8MP,副图像分辨率为16MP,将该主图像进行虚化处理后得到的目标图像分辨率为8MP,将该目标图像进行升采样,得到分辨率为16MP的目标图像,即使得升采样后目标图像的分辨率符合副图像分辨率,均为16MP。For example, in full-body mode, the main image resolution is 8MP and the sub-image resolution is 16MP. After blurring the main image, the target image resolution obtained is 8MP. The target image is upsampled to obtain a target image with a resolution of 16MP, that is, the resolution of the upsampled target image meets the sub-image resolution, both of which are 16MP.

这是因为,在暗光环境下,选择了分辨率较低,而感光度较高的的第二摄像头获取得到了主图像,主图像分辨率较低,但成像质量好,通过将主图像进行升采样,既保证了在暗光环境下的成像质量,又提高了目标图像的分辨率,使得目标图像的分辨率和分辨率较高的副图像分辨率相符。This is because, in a dark environment, the second camera with lower resolution and higher sensitivity is selected to obtain the main image. The main image has a lower resolution but good image quality. By upsampling the main image, the image quality in a dark environment is guaranteed and the resolution of the target image is improved, so that the resolution of the target image matches the resolution of the secondary image with a higher resolution.

本申请实施例的一种基于双摄像头的成像方法中,获取主摄像头拍摄的第一图像,副摄像头拍摄的第二图像,根据确定的拍摄模式和主摄像头、副摄像头的分辨率,分别确定主图像分辨率和副图像分辨率,根据第一图像,生成符合主图像分辨率的主图像,根据第二图像,生成符合副图像分辨率的副图像,根据主图像和副图像,计算主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。根据拍摄模式和主、副摄像头的分辨率,确定主图像分辨率和副图像分辨率,实现拍摄后图像分辨率的调整,其中,全身模式是全分辨率成像,图像更清晰;半身模式是将原图剪裁出中央部分区域成像,可以减小图像四周畸变的影响、更加突出主体,同时加快处理速度。通过两种模式切换还可以达到类似变焦的效果。In an imaging method based on a dual camera according to an embodiment of the present application, a first image captured by a main camera and a second image captured by a secondary camera are obtained. The main image resolution and the secondary image resolution are determined based on the determined shooting mode and the resolutions of the main camera and the secondary camera, respectively. A main image that meets the main image resolution is generated based on the first image, and a secondary image that meets the secondary image resolution is generated based on the second image. The depth information of the main image is calculated based on the main image and the secondary image, and the main image is blurred to obtain the desired target image. The main image resolution and the secondary image resolution are determined based on the shooting mode and the resolutions of the main and secondary cameras to adjust the image resolution after shooting. The full-body mode is full-resolution imaging with a clearer image; the half-body mode is imaging by cropping the central area of the original image, which can reduce the effect of image distortion around the periphery, highlight the subject, and speed up processing. By switching between the two modes, a similar zoom effect can also be achieved.

为了实现上述实施例,本发明还提出一种基于双摄像头的成像装置。In order to implement the above embodiment, the present invention also proposes an imaging device based on dual cameras.

图4为本申请实施例所提供的一种基于双摄像头的成像装置的结构示意图,如图4所示,该装置包括:获取模块41、确定模块42、生成模块43、景深模块44和处理模块45。Figure 4 is a structural schematic diagram of an imaging device based on dual cameras provided in an embodiment of the present application. As shown in Figure 4, the device includes: an acquisition module 41, a determination module 42, a generation module 43, a depth of field module 44 and a processing module 45.

获取模块41,用于获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像.Acquisition module 41, for acquiring a first image captured by the main camera, and acquiring a second image captured by the secondary camera.

确定模块42,用于确定已选定的拍摄模式,根据拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据拍摄模式和副摄像头的分辨率,确定副图像分辨率,其中,拍摄模式包括全身模式和半身模式。The determination module 42 is used to determine the selected shooting mode, determine the main image resolution based on the shooting mode and the resolution of the main camera, and determine the secondary image resolution based on the shooting mode and the resolution of the secondary camera, wherein the shooting mode includes a full-body mode and a half-body mode.

生成模块43,用于根据第一图像,生成符合主图像分辨率的主图像,根据第二图像,生成符合副图像分辨率的副图像。The generating module 43 is configured to generate a main image that meets the main image resolution based on the first image, and to generate a sub-image that meets the sub-image resolution based on the second image.

景深模块44,用于根据主图像和副图像,获取主图像的深度信息。The depth of field module 44 is configured to obtain depth information of the main image based on the main image and the sub-image.

处理模块45,用于根据主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。The processing module 45 is used to perform blurring processing on the main image according to the depth information of the main image to obtain the desired target image.

需要说明的是,前述对方法实施例的解释说明也适用于本实施例的装置,此处不再赘述。It should be noted that the above explanations of the method embodiment are also applicable to the device of this embodiment and will not be repeated here.

本申请实施例的一种基于双摄像头的成像装置中,获取模块,用于获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像,确定模块,用于确定已选定的拍摄模式,根据拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据拍摄模式和副摄像头的分辨率,确定副图像分辨率,生成模块,用于根据第一图像,生成符合主图像分辨率的主图像,根据第二图像,生成符合副图像分辨率的副图像,景深模块,用于根据主图像和副图像,获取主图像的深度信息,处理模块,用于根据主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。本实施例中根据拍摄模式和主、副摄像头的分辨率,确定主图像分辨率和副图像分辨率,实现拍摄后图像分辨率的调整,解决现有技术中双摄像头在拍摄得到图像后,采用固定分辨率进行后续图像处理,导致功能较为单一,无法满足用户根据需求调整分辨率的技术问题。In an imaging device based on a dual camera according to an embodiment of the present application, an acquisition module is used to acquire a first image captured by a main camera and a second image captured by a secondary camera. A determination module is used to determine a selected shooting mode, determine the resolution of the main image based on the shooting mode and the resolution of the main camera, and determine the resolution of the secondary image based on the shooting mode and the resolution of the secondary camera. A generation module is used to generate a main image that meets the resolution of the main image based on the first image, and generate a secondary image that meets the resolution of the secondary image based on the second image. A depth of field module is used to acquire depth information of the main image based on the main image and the secondary image. A processing module is used to blur the main image based on the depth information of the main image to obtain a desired target image. In this embodiment, the main image resolution and the secondary image resolution are determined based on the shooting mode and the resolutions of the main and secondary cameras to achieve adjustment of the image resolution after shooting. This solves the technical problem in the prior art that after shooting, dual cameras use a fixed resolution for subsequent image processing, resulting in relatively simple functions and an inability to meet the user's needs to adjust the resolution.

基于上述实施例,本申请还提出了一种基于双摄像头的成像装置的可能的实现方式,图5为本申请实施例所提供的另一种基于双摄像头的成像装置的结构示意图,如图5所示,在上一实施例的基础上,该装置还可以包括:切换模块46和升采样模块47。Based on the above embodiments, the present application also proposes a possible implementation method of an imaging device based on a dual camera. Figure 5 is a structural schematic diagram of another imaging device based on a dual camera provided in an embodiment of the present application. As shown in Figure 5, based on the previous embodiment, the device may further include: a switching module 46 and an upsampling module 47.

切换模块46,用于:若环境亮度高于阈值亮度,将第一摄像头作为主摄像头,并将第二摄像头作为副摄像头;若环境亮度不高于阈值亮度,将第二摄像头作为主摄像头,并将第一摄像头作为副摄像头。The switching module 46 is used to: if the ambient brightness is higher than the threshold brightness, use the first camera as the main camera and the second camera as the secondary camera; if the ambient brightness is not higher than the threshold brightness, use the second camera as the main camera and the first camera as the secondary camera.

升采样模块47,用于若主图像分辨率小于副图像分辨率,对目标图像进行升采样,升采样后的目标图像分辨率符合副图像分辨率。在本申请实施例的一种可能的实现方式中,确定模块42,还可以包括:第一运算单元421和第二运算单元422。The upsampling module 47 is configured to upsample the target image if the resolution of the primary image is smaller than the resolution of the secondary image, so that the resolution of the upsampled target image matches the resolution of the secondary image. In one possible implementation of the embodiment of the present application, the determination module 42 may further include a first operation unit 421 and a second operation unit 422.

第一运算单元421,用于根据主摄像头的分辨率和拍摄模式对应的调节系数,获取主图像分辨率。The first computing unit 421 is configured to obtain the main image resolution according to the resolution of the main camera and the adjustment coefficient corresponding to the shooting mode.

第二运算单元422,根据副摄像头的分辨率和拍摄模式对应的调节系数,获取副图像分辨率。The second computing unit 422 obtains the secondary image resolution according to the resolution of the secondary camera and the adjustment coefficient corresponding to the shooting mode.

进一步,在本申请实施例的一种可能的实现方式中,生成模块43,具体可以用于:若第一图像的分辨率大于主图像分辨率,对第一图像进行截取,得到符合主图像分辨率的主图像;若第二图像的分辨率大于副图像分辨率,对第二图像进行截取,得到符合副图像分辨率的副图像。Furthermore, in a possible implementation of an embodiment of the present application, the generation module 43 can be specifically used to: if the resolution of the first image is greater than the resolution of the main image, cut out the first image to obtain a main image that meets the resolution of the main image; if the resolution of the second image is greater than the resolution of the secondary image, cut out the second image to obtain a secondary image that meets the resolution of the secondary image.

需要说明的是,前述对方法实施例的解释说明也适用于本实施例的装置,此处不再赘述。It should be noted that the above explanations of the method embodiment are also applicable to the device of this embodiment and will not be repeated here.

本申请实施例的一种基于双摄像头的成像装置中,获取模块,用于获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像,确定模块,用于确定已选定的拍摄模式,根据拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据拍摄模式和副摄像头的分辨率,确定副图像分辨率,生成模块,用于根据第一图像,生成符合主图像分辨率的主图像,根据第二图像,生成符合副图像分辨率的副图像,景深模块,用于根据主图像和副图像,获取主图像的深度信息,处理模块,用于根据主图像的深度信息,对主图像进行虚化处理,得到所需的目标图像。本实施例中根据拍摄模式和主、副摄像头的分辨率,确定主图像分辨率和副图像分辨率,实现拍摄后图像分辨率的调整,其中,全身模式是全分辨率成像,图像更清晰;半身模式是将原图剪裁出中央部分区域成像,可以减小图像四周畸变的影响、更加突出主体,同时加快处理速度。通过两种模式切换还可以达到类似变焦的效果。In an embodiment of the present application, an imaging device based on a dual camera includes an acquisition module for acquiring a first image captured by a primary camera and a second image captured by a secondary camera. A determination module is configured to determine a selected shooting mode and, based on the shooting mode and the resolution of the primary camera, determine the resolution of the primary image, and based on the shooting mode and the resolution of the secondary camera, determine the resolution of the secondary image. A generation module is configured to generate a primary image that matches the primary image resolution based on the first image and a secondary image that matches the secondary image resolution based on the second image. A depth of field module is configured to acquire depth information of the primary image based on the primary and secondary images. A processing module is configured to blur the primary image based on the depth information of the primary image to obtain a desired target image. In this embodiment, the primary and secondary image resolutions are determined based on the shooting mode and the resolutions of the primary and secondary cameras to adjust the image resolution after capture. The full-body mode provides full-resolution imaging for a clearer image, while the half-body mode crops the central portion of the original image for imaging, which can reduce the effects of image distortion around the periphery, highlight the subject, and speed up processing. Switching between the two modes can also achieve a zoom-like effect.

为了实现上述实施例,本发明还提出一种移动终端,图6是根据本发明另一个实施例的终端设备的结构示意图,如图6所示,该终端设备1000包括:壳体1100和位于壳体1100内的第一摄像头1112、第二摄像头1113、存储器1114和处理器1115。In order to implement the above embodiments, the present invention also proposes a mobile terminal. Figure 6 is a structural schematic diagram of a terminal device according to another embodiment of the present invention. As shown in Figure 6, the terminal device 1000 includes: a shell 1100 and a first camera 1112, a second camera 1113, a memory 1114 and a processor 1115 located in the shell 1100.

其中,存储器1114存储有可执行程序代码;处理器1115通过读取存储器1114中存储的可执行程序代码来运行与可执行程序代码对应的程序,以从所述双摄像头中确定出主摄像头和副摄像头,并控制所述主摄像头和副摄像头进行拍摄,实现如前述方法实施例所述的基于双摄像头的成像方法。Among them, the memory 1114 stores executable program code; the processor 1115 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 1114 to determine the main camera and the secondary camera from the dual cameras, and control the main camera and the secondary camera to shoot, thereby realizing the dual-camera-based imaging method as described in the aforementioned method embodiment.

其中,第一摄像头的分辨率高于第二摄像头,第二摄像头的感光度高于第一摄像头,第一摄像头和第二摄像头的视场角相同。The resolution of the first camera is higher than that of the second camera, the sensitivity of the second camera is higher than that of the first camera, and the field of view of the first camera and the second camera are the same.

为了使得第一摄像头具有高分辨率,可以采用16MP摄像头,当然也可以采用其他高分辨率摄像头,本实施例中对此不作限定。In order to make the first camera have high resolution, a 16MP camera may be used. Of course, other high-resolution cameras may also be used, which is not limited in this embodiment.

同时,为了使得第二摄像头具有高感光性,可以采用8MP摄像头,像素颗粒更大,感光性好,当然也可以采用其他高感光性摄像头,本实施例中对此不作限定。At the same time, in order to make the second camera have high sensitivity, an 8MP camera can be used, which has larger pixel particles and good sensitivity. Of course, other high-sensitivity cameras can also be used, which is not limited in this embodiment.

为了实现上述实施例,本发明还提出一种计算机可读存储介质,其上存储有计算机程序,该程序被移动终端的处理器执行时实现如前述实施例中基于双摄像头的成像方法。In order to implement the above embodiments, the present invention further proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a mobile terminal, implements the imaging method based on dual cameras as in the above embodiments.

上述移动终端中还包括图像处理电路,图像处理电路可以利用硬件和/或软件组件实现,可包括定义ISP(IMPage Signal Processing,图像信号处理)管线的各种处理单元。图7为一个实施例中图像处理电路的示意图。如图7所示,为便于说明,仅示出与本发明实施例相关的图像处理技术的各个方面。The mobile terminal also includes image processing circuitry, which can be implemented using hardware and/or software components and may include various processing units that define the ISP (Image Signal Processing) pipeline. Figure 7 is a schematic diagram of the image processing circuitry in one embodiment. For ease of illustration, Figure 7 only illustrates aspects of image processing technology relevant to embodiments of the present invention.

如图7所示,图像处理电路包括ISP处理器940和控制逻辑器950。成像设备910捕捉的图像数据首先由ISP处理器940处理,ISP处理器940对图像数据进行分析以捕捉可用于确定和/或成像设备910的一个或多个控制参数的图像统计信息。成像设备910具体可以包括两个摄像头,每一个摄像头可包括具有一个或多个透镜912和图像传感器914。图像传感器914可包括色彩滤镜阵列(如Bayer滤镜),图像传感器914可获取用图像传感器914的每个成像像素捕捉的光强度和波长信息,并提供可由ISP处理器940处理的一组原始图像数据。传感器920可基于传感器920接口类型把原始图像数据提供给ISP处理器940。传感器920接口可以利用SMPIA(Standard MPobile IMPaging Architecture,标准移动成像架构)接口、其它串行或并行照相机接口或上述接口的组合。As shown in FIG7 , the image processing circuitry includes an ISP processor 940 and control logic 950. Image data captured by the imaging device 910 is first processed by the ISP processor 940, which analyzes the image data to capture image statistics that can be used to determine and/or adjust one or more control parameters of the imaging device 910. Specifically, the imaging device 910 may include two cameras, each of which may include one or more lenses 912 and an image sensor 914. The image sensor 914 may include a color filter array (e.g., a Bayer filter) that acquires light intensity and wavelength information captured by each imaging pixel of the image sensor 914 and provides a set of raw image data that can be processed by the ISP processor 940. The sensor 920 may provide the raw image data to the ISP processor 940 based on the interface type of the sensor 920. The sensor 920 interface may utilize a SMPIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of these interfaces.

ISP处理器940按多种格式逐个像素地处理原始图像数据。例如,每个图像像素可具有8、10、12或14比特的位深度,ISP处理器940可对原始图像数据进行一个或多个图像处理操作、收集关于图像数据的统计信息。其中,图像处理操作可按相同或不同的位深度精度进行。The ISP processor 940 processes raw image data on a pixel-by-pixel basis in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits. The ISP processor 940 may perform one or more image processing operations on the raw image data and collect statistical information about the image data. The image processing operations may be performed at the same or different bit depths of precision.

ISP处理器940还可从图像存储器930接收像素数据。例如,从传感器920接口将原始像素数据发送给图像存储器930,图像存储器930中的原始像素数据再提供给ISP处理器940以供处理。图像存储器930可为存储器装置的一部分、存储设备、或电子设备内的独立的专用存储器,并可包括DMPA(Direct MPeMPory Access,直接直接存储器存取)特征。The ISP processor 940 may also receive pixel data from the image memory 930. For example, raw pixel data may be sent from the sensor 920 interface to the image memory 930, and the raw pixel data in the image memory 930 may be provided to the ISP processor 940 for processing. The image memory 930 may be part of a memory device, a storage device, or an independent dedicated memory within the electronic device, and may include a DMPA (Direct Memory Access) feature.

当接收到来自传感器920接口或来自图像存储器930的原始图像数据时,ISP处理器940可进行一个或多个图像处理操作,如时域滤波。处理后的图像数据可发送给图像存储器930,以便在被显示之前进行另外的处理。ISP处理器940从图像存储器930接收处理数据,并对所述处理数据进行原始域中以及RGB和YCbCr颜色空间中的图像数据处理。处理后的图像数据可输出给显示器970,以供用户观看和/或由图形引擎或GPU(Graphics ProcessingUnit,图形处理器)进一步处理。此外,ISP处理器940的输出还可发送给图像存储器930,且显示器970可从图像存储器930读取图像数据。在一个实施例中,图像存储器930可被配置为实现一个或多个帧缓冲器。此外,ISP处理器940的输出可发送给编码器/解码器960,以便编码/解码图像数据。编码的图像数据可被保存,并在显示于显示器970设备上之前解压缩。编码器/解码器960可由CPU或GPU或协处理器实现。Upon receiving raw image data from the sensor 920 interface or from the image memory 930, the ISP processor 940 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to the image memory 930 for further processing before being displayed. The ISP processor 940 receives processed data from the image memory 930 and processes the processed data in the raw domain as well as in the RGB and YCbCr color spaces. The processed image data may be output to the display 970 for user viewing and/or further processing by a graphics engine or GPU (Graphics Processing Unit). Furthermore, the output of the ISP processor 940 may be sent to the image memory 930, from which the display 970 may read image data. In one embodiment, the image memory 930 may be configured to implement one or more frame buffers. Furthermore, the output of the ISP processor 940 may be sent to the encoder/decoder 960 for encoding/decoding image data. The encoded image data may be stored and decompressed before being displayed on the display 970 device. The encoder/decoder 960 may be implemented by a CPU, a GPU, or a coprocessor.

ISP处理器940确定的统计数据可发送给控制逻辑器950单元。例如,统计数据可包括自动曝光、自动白平衡、自动聚焦、闪烁检测、黑电平补偿、透镜912阴影校正等图像传感器914统计信息。控制逻辑器950可包括执行一个或多个例程(如固件)的处理器和/或微控制器,一个或多个例程可根据接收的统计数据,确定成像设备910的控制参数以及的控制参数。例如,控制参数可包括传感器920控制参数(例如增益、曝光控制的积分时间)、照相机闪光控制参数、透镜912控制参数(例如聚焦或变焦用焦距)、或这些参数的组合。ISP控制参数可包括用于自动白平衡和颜色调整(例如,在RGB处理期间)的增益水平和色彩校正矩阵,以及透镜912阴影校正参数。The statistical data determined by the ISP processor 940 may be sent to the control logic 950 unit. For example, the statistical data may include image sensor 914 statistical information such as auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 912 shading correction, etc. The control logic 950 may include a processor and/or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters of the imaging device 910 and control parameters based on the received statistical data. For example, the control parameters may include sensor 920 control parameters (e.g., gain, integration time for exposure control), camera flash control parameters, lens 912 control parameters (e.g., focal length for focus or zoom), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices used for auto-white balance and color adjustment (e.g., during RGB processing), as well as lens 912 shading correction parameters.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.

在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAMP),只读存储器(ROMP),可擦除可编辑只读存储器(EPROMP或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROMP)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic device), a random access memory (RAMP), a read-only memory (ROMP), an erasable and programmable read-only memory (EPROMP or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROMP). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.

应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.

上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and are not to be construed as limiting the present invention. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.

Claims (12)

1.一种基于双摄像头的成像方法,其特征在于,所述方法包括以下步骤:1. An imaging method based on dual cameras, characterized in that the method includes the following steps: 获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像;Acquire the first image captured by the main camera, and acquire the second image captured by the secondary camera; 确定已选定的拍摄模式;Confirm the selected shooting mode; 根据所述拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据所述拍摄模式和副摄像头的分辨率,确定副图像分辨率,其中,所述拍摄模式包括全身模式和半身模式;The main image resolution is determined based on the shooting mode and the resolution of the main camera, and the secondary image resolution is determined based on the shooting mode and the resolution of the secondary camera, wherein the shooting mode includes full-body mode and half-body mode. 根据所述第一图像,生成符合所述主图像分辨率的主图像;Based on the first image, generate a main image that matches the resolution of the main image; 根据所述第二图像,生成符合所述副图像分辨率的副图像;Based on the second image, generate a sub-image that matches the resolution of the sub-image; 根据所述主图像和所述副图像,获取所述主图像的深度信息;Based on the main image and the sub-image, obtain the depth information of the main image; 根据所述主图像的深度信息,对所述主图像进行虚化处理,得到所需的目标图像。Based on the depth information of the main image, the main image is blurred to obtain the desired target image. 2.根据权利要求1所述的成像方法,其特征在于,所述根据所述拍摄模式和主摄像头的分辨率,确定主图像分辨率,包括:2. The imaging method according to claim 1, characterized in that, determining the main image resolution based on the shooting mode and the resolution of the main camera includes: 根据所述主摄像头的分辨率和所述拍摄模式对应的调节系数,获取所述主图像分辨率。The main image resolution is obtained based on the resolution of the main camera and the adjustment coefficient corresponding to the shooting mode. 3.根据权利要求1所述的成像方法,其特征在于,所述根据所述拍摄模式和副摄像头的分辨率,确定副图像分辨率,包括:3. The imaging method according to claim 1, characterized in that, determining the secondary image resolution based on the shooting mode and the resolution of the secondary camera includes: 根据所述副摄像头的分辨率和所述拍摄模式对应的调节系数,获取所述副图像分辨率。The resolution of the secondary image is obtained based on the resolution of the secondary camera and the adjustment coefficient corresponding to the shooting mode. 4.根据权利要求2或3所述的成像方法,其特征在于,所述全身模式对应的调节系数大于所述半身模式对应的调节系数。4. The imaging method according to claim 2 or 3, wherein the adjustment coefficient corresponding to the whole-body mode is greater than the adjustment coefficient corresponding to the half-body mode. 5.根据权利要求1所述的成像方法,其特征在于,所述根据所述第一图像,生成符合所述主图像分辨率的主图像,包括:5. The imaging method according to claim 1, characterized in that, generating a main image conforming to the resolution of the main image based on the first image includes: 若所述第一图像的分辨率大于所述主图像分辨率,对所述第一图像进行截取,得到符合所述主图像分辨率的主图像。If the resolution of the first image is greater than the resolution of the main image, the first image is cropped to obtain a main image that conforms to the resolution of the main image. 6.根据权利要求1所述的成像方法,其特征在于,所述根据所述第二图像,生成符合所述副图像分辨率的副图像,包括:6. The imaging method according to claim 1, characterized in that, generating a sub-image conforming to the sub-image resolution based on the second image comprises: 若所述第二图像的分辨率大于所述副图像分辨率,对所述第二图像进行截取,得到符合所述副图像分辨率的副图像。If the resolution of the second image is greater than the resolution of the sub-image, the second image is cropped to obtain a sub-image that conforms to the resolution of the sub-image. 7.根据权利要求1所述的成像方法,其特征在于,所述双摄像头包括第一摄像头和第二摄像头,所述第一摄像头的分辨率高于第二摄像头,所述第二摄像头的感光度高于所述第一摄像头;所述获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像之前,还包括:7. The imaging method according to claim 1, characterized in that the dual cameras include a first camera and a second camera, the resolution of the first camera is higher than that of the second camera, and the photosensitivity of the second camera is higher than that of the first camera; before acquiring the first image captured by the main camera and the second image captured by the secondary camera, the method further includes: 若环境亮度高于阈值亮度,将所述第一摄像头作为主摄像头,并将所述第二摄像头作为副摄像头;If the ambient brightness is higher than the threshold brightness, the first camera will be used as the main camera and the second camera will be used as the secondary camera. 若所述环境亮度不高于所述阈值亮度,将所述第二摄像头作为主摄像头,并将所述第一摄像头作为副摄像头。If the ambient brightness is not higher than the threshold brightness, the second camera will be used as the main camera and the first camera will be used as the secondary camera. 8.根据权利要求1-3任一项所述的成像方法,其特征在于,所述根据所述主图像的深度信息,对所述主图像进行虚化处理,得到所需的目标图像之后,还包括:8. The imaging method according to any one of claims 1-3, characterized in that, after blurring the main image based on the depth information of the main image to obtain the desired target image, it further includes: 若所述主图像分辨率小于所述副图像分辨率,对所述目标图像进行升采样,升采样后的目标图像分辨率符合所述副图像分辨率。If the resolution of the main image is less than the resolution of the secondary image, the target image is upsampled, and the resolution of the upsampled target image matches the resolution of the secondary image. 9.一种基于双摄像头的成像装置,其特征在于,所述装置包括:9. An imaging device based on dual cameras, characterized in that the device comprises: 获取模块,用于获取主摄像头拍摄的第一图像,以及获取副摄像头拍摄的第二图像;The acquisition module is used to acquire the first image captured by the main camera and the second image captured by the secondary camera; 确定模块,用于确定已选定的拍摄模式;根据所述拍摄模式和主摄像头的分辨率,确定主图像分辨率,以及根据所述拍摄模式和副摄像头的分辨率,确定副图像分辨率;其中,所述拍摄模式包括全身模式和半身模式;A determining module is used to determine the selected shooting mode; determine the main image resolution based on the shooting mode and the resolution of the main camera, and determine the secondary image resolution based on the shooting mode and the resolution of the secondary camera; wherein, the shooting mode includes full-body mode and half-body mode; 生成模块,用于根据所述第一图像,生成符合所述主图像分辨率的主图像;根据所述第二图像,生成符合所述副图像分辨率的副图像;A generation module is configured to generate a main image conforming to the resolution of the main image based on the first image; and to generate a sub-image conforming to the resolution of the sub-image based on the second image. 景深模块,用于根据所述主图像和所述副图像,获取所述主图像的深度信息;A depth-of-field module is used to obtain the depth information of the main image based on the main image and the sub-image; 处理模块,用于根据所述主图像的深度信息,对所述主图像进行虚化处理,得到所需的目标图像。The processing module is used to perform blurring processing on the main image based on the depth information of the main image to obtain the desired target image. 10.一种移动终端,其特征在于,包括:双摄像头、存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序;所述处理器执行所述程序时,从所述双摄像头中确定出主摄像头和副摄像头,并控制所述主摄像头和副摄像头进行拍摄,实现如权利要求1-8中任一项所述的基于双摄像头的成像方法。10. A mobile terminal, characterized in that it comprises: dual cameras, a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor executes the program, it determines a main camera and a secondary camera from the dual cameras and controls the main camera and the secondary camera to take pictures, thereby realizing the dual-camera-based imaging method as described in any one of claims 1-8. 11.根据权利要求10所述的移动终端,其特征在于,11. The mobile terminal according to claim 10, characterized in that, 所述双摄像头包括第一摄像头和第二摄像头,所述第一摄像头的分辨率高于第二摄像头,所述第二摄像头的感光度高于所述第一摄像头,所述第一摄像头和所述第二摄像头的视场角相同。The dual cameras include a first camera and a second camera. The first camera has a higher resolution than the second camera, the second camera has a higher light sensitivity than the first camera, and the first camera and the second camera have the same field of view. 12.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-8中任一项所述的基于双摄像头的成像方法。12. A computer-readable storage medium having a computer program stored thereon, characterized in that, when executed by a processor, the program implements the imaging method based on a dual camera as described in any one of claims 1-8.
HK18111015.8A 2018-08-27 Imaging method and device based on dual camera HK1251748B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
HK18111015.8A HK1251748B (en) 2018-08-27 Imaging method and device based on dual camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
HK18111015.8A HK1251748B (en) 2018-08-27 Imaging method and device based on dual camera

Publications (2)

Publication Number Publication Date
HK1251748A1 HK1251748A1 (en) 2019-02-01
HK1251748B true HK1251748B (en) 2020-12-18

Family

ID=

Similar Documents

Publication Publication Date Title
JP7145208B2 (en) Method and Apparatus and Storage Medium for Dual Camera Based Imaging
JP6935587B2 (en) Methods and equipment for image processing
CN107948519B (en) Image processing method, device and equipment
KR102293443B1 (en) Image processing method and mobile terminal using dual camera
KR102266649B1 (en) Image processing method and device
CN108055452B (en) Image processing method, device and equipment
CN108024056B (en) Imaging method and device based on dual cameras
CN108712608B (en) Terminal equipment shooting method and device
CN109005364A (en) Image formation control method, device, electronic equipment and computer readable storage medium
CN107846556B (en) Imaging method, imaging device, mobile terminal and storage medium
CN107835372A (en) Imaging method, device, mobile terminal and storage medium based on dual camera
CN108156369B (en) Image processing method and device
CN107872631B (en) Image shooting method and device based on double cameras and mobile terminal
CN108683863A (en) Imaging control method, device, electronic device, and readable storage medium
WO2019124289A1 (en) Device, control method, and storage medium
HK1251748B (en) Imaging method and device based on dual camera
HK1251387B (en) Imaging method and device based on dual camera
HK1251748A1 (en) Imaging method and device based on dual camera
HK1251749B (en) Image processing method, device and equipment
HK1249686B (en) Image processing method, apparatus and device
HK1249976B (en) Image processing method, apparatus, device and storage medium
HK1251752A1 (en) Image processing method and device