CN109639983B - Photographing method, photographing device, terminal and computer-readable storage medium - Google Patents

Photographing method, photographing device, terminal and computer-readable storage medium Download PDF

Info

Publication number
CN109639983B
CN109639983B CN201910013723.8A CN201910013723A CN109639983B CN 109639983 B CN109639983 B CN 109639983B CN 201910013723 A CN201910013723 A CN 201910013723A CN 109639983 B CN109639983 B CN 109639983B
Authority
CN
China
Prior art keywords
image
camera
depth
photographing
captured image
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.)
Expired - Fee Related
Application number
CN201910013723.8A
Other languages
Chinese (zh)
Other versions
CN109639983A (en
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
Priority to CN201910013723.8A priority Critical patent/CN109639983B/en
Publication of CN109639983A publication Critical patent/CN109639983A/en
Application granted granted Critical
Publication of CN109639983B publication Critical patent/CN109639983B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Studio Devices (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Abstract

The application belongs to the technical field of photographing, and particularly relates to a photographing method, a photographing device, a photographing terminal and a computer-readable storage medium, wherein the photographing method is applied to the photographing terminal, the photographing terminal is provided with two cameras, the two cameras comprise a 3D camera and an RGB camera, and the photographing method comprises the following steps: acquiring a current photographing mode of a terminal; if the photographing mode is a first preset mode, starting the RGB camera to acquire a first photographed image; if the photographing mode is a second preset mode, starting the 3D camera to obtain a second photographed image and a first depth image; the assembly process of the camera is simplified, and the assembly efficiency of the camera is improved; meanwhile, the problem that the resolution ratio of image shooting cannot meet the requirements of users due to the fact that the 3D camera is used for image shooting is avoided.

Description

拍照方法、装置、终端及计算机可读存储介质Photographing method, device, terminal and computer-readable storage medium

技术领域technical field

本申请属于拍照技术领域,尤其涉及一种拍照方法、装置、终端及计算机可读存储介质。The present application belongs to the technical field of photographing, and in particular, relates to a photographing method, device, terminal, and computer-readable storage medium.

背景技术Background technique

在计算机视觉系统中,三维场景信息为图像分割、目标检测、物体跟踪等各类计算机视觉应用提供了更多的可能性,深度图像(Depth map)作为一种普遍的三维场景信息表达方式得到了广泛的应用。深度图像的每个像素点的灰度值可用于表征场景中某一点距离摄像机的远近。In computer vision systems, 3D scene information provides more possibilities for various computer vision applications such as image segmentation, target detection, and object tracking. Wide range of applications. The gray value of each pixel of the depth image can be used to characterize the distance of a certain point in the scene from the camera.

目前,通常采用双目立体视觉的方法获取深度图像,该方法需要设置两个摄像头,并且,这两个摄像头需要间隔一定距离,同时需要用支架固定,以及需要对其进行标定,摄像头的装配较复杂。At present, the binocular stereo vision method is usually used to obtain the depth image. This method needs to set up two cameras, and the two cameras need to be separated by a certain distance. At the same time, they need to be fixed with brackets, and they need to be calibrated. The assembly of the cameras is relatively complex.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种拍照方法、装置、终端及计算机可读存储介质,可以解决获取深度信息的摄像头装配复杂的技术问题。Embodiments of the present application provide a photographing method, device, terminal, and computer-readable storage medium, which can solve the technical problem of complex camera assembly for acquiring depth information.

本申请实施例第一方面提供一种拍照方法,应用于终端,所述终端设置有双摄像头,所述双摄像头包括3D摄像头和RGB摄像头,所述拍照方法包括:A first aspect of the embodiments of the present application provides a photographing method, which is applied to a terminal, where the terminal is provided with dual cameras, the dual cameras include a 3D camera and an RGB camera, and the photographing method includes:

获取终端当前的拍照模式;Get the current camera mode of the terminal;

若所述拍照模式为第一预设模式,则开启所述RGB摄像头获取第一拍摄图像;If the photographing mode is the first preset mode, turning on the RGB camera to obtain a first photographed image;

若所述拍照模式为第二预设模式,则开启所述3D摄像头获取第二拍摄图像以及第一深度图像。If the photographing mode is the second preset mode, the 3D camera is turned on to obtain the second photographed image and the first depth image.

本申请实施例第二方面提供一种拍照装置,配置于终端,所述终端设置有双摄像头,所述双摄像头包括3D摄像头和RGB摄像头,所述拍照装置包括:A second aspect of an embodiment of the present application provides a photographing device, which is configured in a terminal, wherein the terminal is provided with dual cameras, the dual cameras include a 3D camera and an RGB camera, and the photographing device includes:

获取单元,用于获取终端当前的拍照模式;an obtaining unit, used for obtaining the current photographing mode of the terminal;

第一拍摄单元,用于若所述拍照模式为第一预设模式,则开启所述RGB摄像头获取第一拍摄图像;a first photographing unit, configured to turn on the RGB camera to obtain a first photographed image if the photographing mode is the first preset mode;

第二拍摄单元,用于若所述拍照模式为第二预设模式,则开启所述3D摄像头获取第二拍摄图像以及第一深度图像。A second photographing unit, configured to turn on the 3D camera to obtain a second photographed image and a first depth image if the photographing mode is the second preset mode.

本申请实施例第三方面提供一种终端,包括双摄像头、存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述方法的步骤。A third aspect of an embodiment of the present application provides a terminal, including dual cameras, a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the above method when executing the computer program.

本申请实施例第四方面提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现上述方法的步骤。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the foregoing method are implemented.

本申请实施例中,通过设置3D摄像头在图像拍摄时直接获取深度图像,不需要使用两个摄像头进行深度图像的获取,因此,可以不需要用支架对摄像头进行固定,以及对摄像头进行标定,简化了摄像头的装配流程,提高了摄像头的装配效率。另外,本申请还通过在设置3D摄像头的同时设置RGB摄像头,实现了在拍照模式为第一预设模式时,可以通过RGB摄像头进行第一拍摄图像的获取,避免了利用3D摄像头进行图像拍摄,导致图像拍摄的分辨率无法满足用户需求的问题。In the embodiment of the present application, by setting the 3D camera to directly obtain the depth image when the image is captured, it is not necessary to use two cameras to obtain the depth image. Therefore, it is not necessary to use a bracket to fix the camera and calibrate the camera, which simplifies The assembly process of the camera is improved, and the assembly efficiency of the camera is improved. In addition, in the present application, by setting the RGB camera at the same time as the 3D camera, it is realized that when the photographing mode is the first preset mode, the RGB camera can be used to obtain the first photographed image, and the use of the 3D camera for image photographing is avoided. The problem that the resolution of the image captured cannot meet the user's needs.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following drawings will briefly introduce the drawings that need to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore do not It should be regarded as a limitation of the scope, and for those of ordinary skill in the art, other related drawings can also be obtained according to these drawings without any creative effort.

图1是本申请实施例提供的一种拍照方法的第一实现流程示意图;FIG. 1 is a schematic flowchart of a first implementation of a photographing method provided by an embodiment of the present application;

图2是本申请实施例提供的拍照预览界面的第一示意图;2 is a first schematic diagram of a photographing preview interface provided by an embodiment of the present application;

图3是本申请实施例提供的一种拍照方法的第二实现流程示意图;3 is a schematic flowchart of a second implementation of a photographing method provided by an embodiment of the present application;

图4是本申请实施例提供的拍照方法步骤105的具体实现流程示意图;FIG. 4 is a schematic flowchart of a specific implementation of step 105 of the photographing method provided by the embodiment of the present application;

图5是本申请实施例提供的拍照预览界面的第二示意图;5 is a second schematic diagram of a photographing preview interface provided by an embodiment of the present application;

图6是本申请实施例提供的拍照装置的结构示意图;6 is a schematic structural diagram of a photographing device provided by an embodiment of the present application;

图7是本申请实施例提供的终端的结构示意图。FIG. 7 is a schematic structural diagram of a terminal provided by an embodiment of the present application.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

目前,在获取深度图像时,通常采用双目立体视觉的方法获取,该方法需要设置两个摄像头,并且可以由这两个摄像头同时获取同一场景的两幅图像,通过立体匹配算法找到两幅图像中对应的像素点,随后根据三角原理计算出视差信息,并将所述视差信息转换成可用于表征场景中物体距离的深度图像。At present, when acquiring depth images, the method of binocular stereo vision is usually used. This method needs to set up two cameras, and the two cameras can simultaneously acquire two images of the same scene, and find the two images through a stereo matching algorithm. Then, the disparity information is calculated according to the triangulation principle, and the disparity information is converted into a depth image that can be used to represent the distance of objects in the scene.

这种获取深度图像的方法中,摄像头的装配需要间隔一定距离,同时需要用支架固定,以及需要对摄像头进行标定,摄像头的装配比较复杂。特别是在支架的选取上,若使用金属支架固定摄像头,则有可能会影响射频信号的传输;若用非金属支架固定摄像头,则有可能需要使用厚度较大的支架才能保证摄像头较高的稳定性,这对于需要实现轻薄设计的终端来说,无疑将增大终端结构的设计难度。In this method of acquiring a depth image, the assembly of the camera needs to be separated by a certain distance, and at the same time, it needs to be fixed with a bracket, and the camera needs to be calibrated, and the assembly of the camera is relatively complicated. Especially in the selection of brackets, if a metal bracket is used to fix the camera, it may affect the transmission of radio frequency signals; if a non-metal bracket is used to fix the camera, a bracket with a thicker thickness may be required to ensure the higher stability of the camera This will undoubtedly increase the design difficulty of the terminal structure for terminals that need to achieve thin and light designs.

本申请实施例中,通过设置3D摄像头在图像拍摄时直接获取深度图像,不需要使用两个摄像头进行深度图像的获取,因此,可以不需要用支架对摄像头进行固定,以及对摄像头进行标定,简化了摄像头的装配流程,提高了摄像头的装配效率,不会增加终端结构设计的难度。In the embodiment of the present application, by setting the 3D camera to directly obtain the depth image when the image is captured, it is not necessary to use two cameras to obtain the depth image. Therefore, it is not necessary to use a bracket to fix the camera and calibrate the camera, which simplifies The assembly process of the camera is improved, the assembly efficiency of the camera is improved, and the difficulty of terminal structure design is not increased.

另外,在实际应用中,3D摄像头在输出二维RGB图像和携带深度信息的深度图像时,深度图像对应的深度精度越高,二维RGB图像的分辨率下降越明显,无法满足用户对图像分辨率的要求。对此,本申请实施例还通过在设置3D摄像头的同时设置RGB摄像头,实现了在拍照模式为第一预设模式时,可以通过RGB摄像头进行第一拍摄图像的获取,避免了利用3D摄像头进行图像拍摄,导致图像拍摄的分辨率无法满足用户需求的问题。In addition, in practical applications, when a 3D camera outputs a two-dimensional RGB image and a depth image carrying depth information, the higher the depth accuracy corresponding to the depth image, the more obvious the decrease in the resolution of the two-dimensional RGB image. rate requirements. In this regard, the embodiment of the present application also sets the RGB camera when the 3D camera is set, so that when the photographing mode is the first preset mode, the RGB camera can be used to obtain the first photographed image, avoiding the need to use the 3D camera to obtain the first photographed image. Image capture, resulting in the problem that the resolution of the image capture cannot meet the needs of users.

如图1示出了本申请实施例提供的一种拍照方法实现流程示意图,该方法应用于终端,可以由终端上配置的拍照装置执行,适用于需提高摄像头装配效率的情形,包括步骤101至步骤103。FIG. 1 shows a schematic diagram of the implementation flow of a photographing method provided by an embodiment of the present application. The method is applied to a terminal, can be executed by a photographing device configured on the terminal, and is suitable for a situation where the assembly efficiency of a camera needs to be improved. The method includes steps 101 to 101 Step 103.

其中,上述终端包括智能手机、平板电脑、学习机等配置有拍照装置的终端。该终端可以安装有拍照应用,并且设置有双摄像头,所述双摄像头包括3D摄像头和RGB摄像头。Wherein, the above-mentioned terminal includes a terminal equipped with a photographing device, such as a smart phone, a tablet computer, and a learning machine. The terminal may be installed with a camera application and provided with dual cameras, the dual cameras include a 3D camera and an RGB camera.

所述3D摄像头在拍摄时可以同时输出二维RGB图像和携带深度信息的深度图像;所述RGB摄像头在拍摄时可以输出的分辨率较高的二维RGB图像。The 3D camera can simultaneously output a two-dimensional RGB image and a depth image carrying depth information when shooting; the RGB camera can output a two-dimensional RGB image with higher resolution when shooting.

步骤101,获取终端当前的拍照模式。Step 101: Obtain the current photographing mode of the terminal.

可选的,在本申请的一些实施方式中,可以在接收到相机启动指令时,获取终端当前的拍照模式。Optionally, in some embodiments of the present application, the current photographing mode of the terminal may be acquired when a camera startup instruction is received.

例如,上述相机启动指令包括用户在系统桌面中点击拍照应用图标触发的相机启动指令、用户通过点物理按键触发的相机启动指令、用户通过语音触发的相机启动指令或者其他方式触发的相机启动指令。For example, the above-mentioned camera startup instructions include camera startup instructions triggered by the user clicking on the camera application icon on the system desktop, camera startup instructions triggered by the user pressing a physical button, camera startup instructions triggered by the user through voice, or camera startup instructions triggered by other means.

可选的,在本申请的一些实施方式中,还可以在接收到拍照指令时,获取终端当前的拍照模式。Optionally, in some embodiments of the present application, the current photographing mode of the terminal may also be acquired when a photographing instruction is received.

例如,如图2所示,在接收到用户点击拍照预览界面21中的拍照控件22触发的拍照指令时,获取终端当前的拍照模式;或者在接收到用户通过点击物理按键触发的拍照指令时,获取终端当前的拍照模式;又或者,在接收到用户通过语音触发的拍照指令时,获取终端当前的拍照模式;此处仅仅是举例说明,本申请实施例中,不对拍照指令的触发方式进行限定。For example, as shown in FIG. 2, when receiving a photographing instruction triggered by the user clicking on the photographing control 22 in the photographing preview interface 21, the current photographing mode of the terminal is obtained; or when receiving a photographing instruction triggered by the user by clicking a physical button, Obtain the current photographing mode of the terminal; or, when receiving a photographing instruction triggered by the user through voice, obtain the current photographing mode of the terminal; this is just an example, and in this embodiment of the present application, the triggering method of the photographing instruction is not limited .

可选的,上述拍照模式可以包括第一预设拍照模式、第二预设拍照模式和第三预设拍照模式中一种或多种。所述第一预设拍照模式为开启RGB摄像头进行拍摄的模式;所述第二预设拍照模式为开启3D摄像头进行拍摄的模式;所述第三预设拍照模式为同时开启RGB摄像头和3D摄像头的拍摄模式。Optionally, the above-mentioned photographing mode may include one or more of a first preset photographing mode, a second preset photographing mode, and a third preset photographing mode. The first preset photographing mode is a mode in which an RGB camera is turned on for shooting; the second preset photographing mode is a mode in which a 3D camera is turned on for shooting; the third preset photographing mode is a mode in which the RGB camera and the 3D camera are simultaneously turned on shooting mode.

可选的,终端的拍摄模式可以根据接收到的用户在拍照预览界面中触发的设置指令进行设置。Optionally, the shooting mode of the terminal may be set according to the received setting instruction triggered by the user in the photographing preview interface.

例如,如图2所示,终端的拍摄模式可以根据接收到的用户在拍照预览界面21中点击设置控件23后,在弹窗24中选择选择控件25触发的所述第一预设拍照模式的设置指令,选择选择控件26触发的所述第二预设拍照模式的设置指令,选择选择控件27触发的所述第三预设拍照模式的设置指令。For example, as shown in FIG. 2 , the shooting mode of the terminal may be based on the received user clicking the setting control 23 in the shooting preview interface 21 , and then selecting the first preset shooting mode triggered by the selection control 25 in the pop-up window 24 . For the setting instruction, the setting instruction of the second preset photographing mode triggered by the selection control 26 is selected, and the setting instruction of the third preset photographing mode triggered by the selection control 27 is selected.

步骤102,若所述拍照模式为第一预设模式,则开启所述RGB摄像头获取第一拍摄图像。Step 102: If the photographing mode is the first preset mode, turn on the RGB camera to obtain a first photographed image.

本申请实施例中,在获取终端当前的拍照模式之后,若所述拍照模式为第一预设模式,则表示用户只需要进行二维RGB图像的拍摄,因此,可以通过单独开启所述RGB摄像头进行二维RGB图像的拍摄,满足用户对拍摄较高分辨率的图像的要求。In this embodiment of the present application, after obtaining the current photographing mode of the terminal, if the photographing mode is the first preset mode, it means that the user only needs to photograph two-dimensional RGB images. Therefore, the RGB camera can be turned on independently Shoot two-dimensional RGB images to meet the user's requirements for shooting higher-resolution images.

例如,用户需要进行自拍或者正常的图片拍摄时,则可以将拍照模式设置为第一预设模式,以便在终端接收到拍照指令时开启所述RGB摄像头获取第一拍摄图像,或者,在进行图像预览时,开启所述RGB摄像头,并在接收到拍照指令时由所述RGB摄像头获取所述第一拍摄图像。For example, when the user needs to take a selfie or take a normal picture, the camera mode can be set to the first preset mode, so that when the terminal receives the camera instruction, the RGB camera is turned on to obtain the first captured image, or when the image is taken When previewing, the RGB camera is turned on, and the first shot image is acquired by the RGB camera when a photographing instruction is received.

步骤103,若所述拍照模式为第二预设模式,则开启所述3D摄像头获取第二拍摄图像以及第一深度图像。Step 103: If the photographing mode is the second preset mode, turn on the 3D camera to obtain a second photographed image and a first depth image.

本申请实施例中,当用户需要同时获取二维RGB图像和携带深度信息的深度图像时,则可以将拍照模式设置为第二预设模式,以便在终端接收到拍照指令时开启所述3D摄像头获取第二拍摄图像和深度图像,或者,在进行图像预览时,开启所述3D摄像头,并在接收到拍照指令时由所述3D摄像头同时获取所述第二拍摄图像和深度图像。In the embodiment of the present application, when the user needs to obtain a two-dimensional RGB image and a depth image carrying depth information at the same time, the camera mode can be set to the second preset mode, so that the 3D camera can be turned on when the terminal receives a camera instruction Acquire the second captured image and the depth image, or, when performing image preview, turn on the 3D camera, and simultaneously acquire the second captured image and the depth image by the 3D camera when receiving a photographing instruction.

本申请实施例中,通过设置包括3D摄像头和RGB摄像头的双摄像头,可以为用户提供两种分别独立的拍摄模式,即,所述第一预设模式和第二预设模式。这两种拍摄模式下,两个摄像头独立工作,互补干扰,当3D摄像头开启时,所述RGB摄像头不开启,当所述RGB摄像头开启时,所述3D摄像头不开启;并且,两个摄像头的开启可以通过用户选择的拍摄模式进行控制,具有控制方式灵活的特点,可以根据用户需求实现两者的自动切换。In the embodiment of the present application, by setting a dual camera including a 3D camera and an RGB camera, two independent shooting modes can be provided for the user, that is, the first preset mode and the second preset mode. In these two shooting modes, the two cameras work independently and interfere with each other. When the 3D camera is turned on, the RGB camera is not turned on, and when the RGB camera is turned on, the 3D camera is not turned on; The opening can be controlled by the shooting mode selected by the user, which has the characteristics of flexible control mode, and can automatically switch between the two according to user needs.

另外,由于这两个摄像头的工作互相独立,互不影响,因此,这两个摄像头的可以不需要用支架进行固定,两者之间也没有距离的限制,同时也可以不需要对这两个摄像头进行标定,简化了摄像头的装配流程,提高了摄像头的装配效率。In addition, because the work of the two cameras is independent of each other and does not affect each other, therefore, the two cameras do not need to be fixed with a bracket, and there is no distance limit between the two, and there is no need for the two cameras. The camera is calibrated, which simplifies the assembly process of the camera and improves the assembly efficiency of the camera.

可选的,上述步骤103中,在所述获取第二拍摄图像以及第一深度图像之后,还可以包括:根据所述第二拍摄图像以及所述第一深度图像,输出三维图像。Optionally, in the foregoing step 103, after the acquiring the second captured image and the first depth image, the method may further include: outputting a three-dimensional image according to the second captured image and the first depth image.

例如,在进行3D美妆时,为了使虚拟妆容与采集的用户图像融合得更加自然,则可以通过开启所述3D摄像头,同时获取所述第二拍摄图像和所述深度图像,并输出相应的三维图像。For example, when performing 3D beauty makeup, in order to make the virtual makeup look more natural with the captured user image, the 3D camera can be turned on to simultaneously acquire the second captured image and the depth image, and output the corresponding 3D image.

作为本申请的一种实施方式,如图3所示,所述获取终端当前的拍照模式之后,还可以包括步骤104至步骤105。As an implementation manner of the present application, as shown in FIG. 3 , after acquiring the current photographing mode of the terminal, steps 104 to 105 may be further included.

步骤104,若所述拍照模式为第三预设模式,则同时开启所述RGB摄像头和所述3D摄像头,并分别获取所述第一拍摄图像、第二拍摄图像以及所述第一深度图像。Step 104 , if the photographing mode is the third preset mode, turn on the RGB camera and the 3D camera at the same time, and acquire the first photographed image, the second photographed image, and the first depth image respectively.

步骤105,将所述第一深度图像携带的深度信息映射到所述第一拍摄图像中,得到携带深度信息的第一拍摄图像。Step 105: Map the depth information carried by the first depth image to the first captured image to obtain a first captured image carrying depth information.

由于3D摄像头本身可以同时输出二维RGB图像和深度图像,因此,在需要获取三维图像时,只需要开启一个3D摄像头进行图像拍摄即可。但是,由于在实际应用中,3D摄像头在输出二维RGB图像和携带深度信息的深度图像时,深度图像对应的深度精度越高,二维RGB图像的分辨率下降越明显,因此,在需要获取分辨率较高且深度精度也较高的三维图像时,则不能在直接使用3D摄像头直接输出二维RGB图像和深度图像获取三维图像。Since the 3D camera itself can output a two-dimensional RGB image and a depth image at the same time, when a three-dimensional image needs to be acquired, only one 3D camera needs to be turned on for image capture. However, in practical applications, when a 3D camera outputs a two-dimensional RGB image and a depth image carrying depth information, the higher the depth accuracy corresponding to the depth image, the more obvious the decrease in the resolution of the two-dimensional RGB image. For 3D images with higher resolution and higher depth accuracy, the 3D camera cannot be used to directly output 2D RGB images and depth images to obtain 3D images.

本申请实施例中,通过综合3D摄像头和RGB摄像头各自的优势,同时开启所述RGB摄像头和所述3D摄像头,获取所述第一拍摄图像、第二拍摄图像以及所述第一深度图像,再将所述第一深度图像携带的深度信息映射到所述第一拍摄图像中,得到携带深度信息的第一拍摄图像,以便根据所述携带深度信息的第一拍摄图像得到分辨率较高且深度精度较高的三维图像;避免了利用3D摄像头进行图像拍摄,导致图像拍摄的分辨率无法满足用户需求的问题。In the embodiment of the present application, by combining the respective advantages of the 3D camera and the RGB camera, the RGB camera and the 3D camera are turned on at the same time, the first captured image, the second captured image and the first depth image are acquired, and then the Mapping the depth information carried by the first depth image to the first captured image to obtain a first captured image carrying depth information, so as to obtain a higher resolution and deeper depth according to the first captured image carrying depth information High-precision 3D image; avoids the problem of using 3D camera for image capture, resulting in the problem that the resolution of the image capture cannot meet the needs of users.

由于上述第一摄像头与第二摄像头之间有可能间隔的距离比较大,因此,所述第一拍摄图像与所述第二拍摄图像的拍摄内容有可能存在不一致的情况,因此,在本申请的一些实施方式中,如图4所示,上述步骤105,将所述第一深度图像携带的深度信息映射到所述第一拍摄图像中,得到携带深度信息的第一拍摄图像,可以包括:步骤401至步骤403。Since the distance between the first camera and the second camera may be relatively large, the shooting content of the first captured image and the second captured image may be inconsistent. Therefore, in the present application In some embodiments, as shown in FIG. 4 , in the above step 105, the depth information carried by the first depth image is mapped to the first captured image to obtain the first captured image carrying depth information, which may include the following steps: 401 to step 403 .

步骤401,对所述第一拍摄图像和所述第二拍摄图像进行对齐变换和裁剪处理,得到与所述第一拍摄图像对应的第三拍摄图像,以及与所述第二拍摄图像对应的第四拍摄图像;所述第三拍摄图像中的像素与所述第四拍摄图像中的像素一一对应。Step 401: Perform alignment transformation and cropping processing on the first captured image and the second captured image to obtain a third captured image corresponding to the first captured image, and a third captured image corresponding to the second captured image. Four captured images; the pixels in the third captured image correspond one-to-one with the pixels in the fourth captured image.

例如,利用对齐算法对所述第一拍摄图像和所述第二拍摄图像进行对齐变换和裁剪处理,使得所述第三拍摄图像中的像素与所述第四拍摄图像中的像素一一对应。其中,所述对齐算法可以为通用的对齐算法,例如,前向加法算法和逆组合算法。For example, using an alignment algorithm to perform alignment transformation and cropping processing on the first captured image and the second captured image, so that the pixels in the third captured image correspond one-to-one with the pixels in the fourth captured image. Wherein, the alignment algorithm may be a general alignment algorithm, for example, a forward addition algorithm and an inverse combination algorithm.

步骤402,对所述第一深度图像进行与所述第二拍摄图像相同的对齐变换和裁剪处理,得到第二深度图像。Step 402: Perform the same alignment transformation and cropping processing on the first depth image as the second captured image to obtain a second depth image.

步骤403,将所述第二深度图像的深度信息映射到所述第三拍摄图像,得到携带深度信息的第三拍摄图像。Step 403: Map the depth information of the second depth image to the third captured image to obtain a third captured image carrying depth information.

由于第一深度图像与所述第二拍摄图像为3D摄像头同时输出的图像,因此,其拍摄内容是相同的,因此,在对第二拍摄图像进行对齐变换和裁剪处理得到第四拍摄图像后,使用与所述第二拍摄图像相同的对齐变换和裁剪处理对所述第一深度图像进行对齐变换和裁剪处理,可以使得得到第二深度图像能够与所述第四拍摄图像一一对应,即,与所述第三拍摄图像一一对应。因此,需要对所述第一深度图像进行与所述第二拍摄图像相同的对齐变换和裁剪处理,得到第二深度图像,使得所述第二深度图像的深度信息可以映射到所述第三拍摄图像,得到携带深度信息的第三拍摄图像。Since the first depth image and the second captured image are images output by the 3D camera at the same time, the captured contents are the same. Therefore, after the second captured image is aligned, transformed and cropped to obtain the fourth captured image, The first depth image is aligned, transformed and cropped using the same alignment transformation and cropping process as the second captured image, so that the obtained second depth image can be in a one-to-one correspondence with the fourth captured image, that is, One-to-one correspondence with the third captured images. Therefore, it is necessary to perform the same alignment transformation and cropping processing on the first depth image as the second captured image to obtain a second depth image, so that the depth information of the second depth image can be mapped to the third captured image image to obtain a third shot image carrying depth information.

可选的,所述同时开启所述RGB摄像头和所述3D摄像头之前,包括:将所述3D摄像头的深度精度调整至最大值,以便尽可能的得到深度精度较高的三维图像。Optionally, before turning on the RGB camera and the 3D camera at the same time, the method includes: adjusting the depth accuracy of the 3D camera to a maximum value, so as to obtain a three-dimensional image with higher depth accuracy as much as possible.

可选的,在上述图1描述的实施方式中,步骤103,所述若所述拍照模式为第二预设模式,则开启所述3D摄像头获取第二拍摄图像以及第一深度图像,可以包括:若所述拍照模式为第二预设模式,则将所述3D摄像头的深度精度调整至预设精度值之后,开启所述3D摄像头获取第二拍摄图像以及第一深度图像。Optionally, in the embodiment described in FIG. 1 above, in step 103, if the photographing mode is the second preset mode, turning on the 3D camera to obtain the second photographing image and the first depth image may include: : If the photographing mode is the second preset mode, after adjusting the depth accuracy of the 3D camera to a preset accuracy value, the 3D camera is turned on to obtain the second photographed image and the first depth image.

由于在所述拍照模式为第二预设模式时,并不能确定此时3D摄像头的深度精度是否已被设置为最大值或者其他深度精度,因此,在确定所述拍照模式为第二预设模式时,需要先将所述3D摄像头的深度精度调整至预设精度值之后,再开启所述3D摄像头获取第二拍摄图像以及第一深度图像。Because when the photographing mode is the second preset mode, it cannot be determined whether the depth accuracy of the 3D camera has been set to the maximum value or other depth accuracy at this time. Therefore, when it is determined that the photographing mode is the second preset mode When the depth accuracy of the 3D camera is adjusted to a preset accuracy value, the 3D camera is turned on to obtain the second captured image and the first depth image.

其中,该预设精度可以为使深度精度和图像的分辨率达到平衡状态时的深度精度。例如,该预设深度精度可以根据实验进行获取。The preset precision may be the depth precision when the depth precision and the resolution of the image reach a balanced state. For example, the preset depth accuracy can be obtained according to experiments.

可选的,在本申请的一些实施方式中,上述步骤103中,开启所述3D摄像头获取第二拍摄图像以及第一深度图像,还可以包括:接收深度精度设置指令,根据所述深度精度设置指令对应的深度精度获取第二拍摄图像以及第一深度图像。Optionally, in some embodiments of the present application, in the above step 103, turning on the 3D camera to obtain the second captured image and the first depth image may further include: receiving a depth accuracy setting instruction, setting the depth accuracy according to the depth accuracy. The second captured image and the first depth image are acquired with the depth precision corresponding to the instruction.

例如,如图5所示,在所述拍照模式为第二预设模式时,可以在拍照预览界面21上显示深度精度设置条51,并接收根据用户对所述深度精度设置条51上的滑块52的滑动操作生成的深度精度设置指令,并根据所述深度精度设置指令对应的深度精度获取第二拍摄图像以及第一深度图像,从而实现根据所述第二拍摄图像以及所述第一深度图像输出的三维图像的分辨率与深度精度之间的动态调整,以满足用户不同的拍摄需求。For example, as shown in FIG. 5 , when the photographing mode is the second preset mode, a depth accuracy setting bar 51 may be displayed on the photographing preview interface 21 , and a user's sliding motion on the depth accuracy setting bar 51 may be received. The depth accuracy setting instruction generated by the sliding operation of block 52 is obtained, and the second captured image and the first depth image are acquired according to the depth accuracy corresponding to the depth accuracy setting instruction, so as to realize the second captured image and the first depth image according to the depth accuracy setting instruction. Dynamic adjustment between the resolution and depth accuracy of the 3D image output from the image to meet the different shooting needs of users.

应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

图6示出了本申请实施例提供的一种拍照装置600的结构示意图,所述拍照装置配置于终端,所述终端设置有双摄像头,所述双摄像头包括3D摄像头和RGB摄像头,所述拍照装置包括获取单元601、第一拍摄单元602和第二拍摄单元603。FIG. 6 shows a schematic structural diagram of a photographing apparatus 600 provided by an embodiment of the present application. The photographing apparatus is configured on a terminal, and the terminal is provided with dual cameras. The dual cameras include a 3D camera and an RGB camera. The apparatus includes an acquisition unit 601 , a first photographing unit 602 and a second photographing unit 603 .

获取单元601,用于获取终端当前的拍照模式;an obtaining unit 601, configured to obtain the current photographing mode of the terminal;

第一拍摄单元602,用于若所述拍照模式为第一预设模式,则开启所述RGB摄像头获取第一拍摄图像;A first photographing unit 602, configured to turn on the RGB camera to obtain a first photographed image if the photographing mode is a first preset mode;

第二拍摄单元603,用于若所述拍照模式为第二预设模式,则开启所述3D摄像头获取第二拍摄图像以及第一深度图像。The second photographing unit 603 is configured to turn on the 3D camera to obtain a second photographed image and a first depth image if the photographing mode is the second preset mode.

在本申请的一些实施方式中,所述拍照装置600还可以包括第三拍摄单元,用于若所述拍照模式为第三预设模式,则同时开启所述RGB摄像头和所述3D摄像头,并分别获取所述第一拍摄图像、第二拍摄图像以及所述第一深度图像;将所述第一深度图像携带的深度信息映射到所述第一拍摄图像中,得到携带深度信息的第一拍摄图像。In some embodiments of the present application, the photographing device 600 may further include a third photographing unit, configured to turn on the RGB camera and the 3D camera at the same time if the photographing mode is the third preset mode, and Obtain the first shot image, the second shot image, and the first depth image respectively; map the depth information carried by the first depth image to the first shot image to obtain the first shot carrying the depth information image.

可选的,所述第三拍摄单元,还用于对所述第一拍摄图像和所述第二拍摄图像进行对齐变换和裁剪处理,得到与所述第一拍摄图像对应的第三拍摄图像,以及与所述第二拍摄图像对应的第四拍摄图像;所述第三拍摄图像中的像素与所述第四拍摄图像中的像素一一对应;对所述第一深度图像进行与所述第二拍摄图像相同的对齐变换和裁剪处理,得到第二深度图像;将所述第二深度图像的深度信息映射到所述第三拍摄图像,得到携带深度信息的第三拍摄图像。Optionally, the third photographing unit is further configured to perform alignment transformation and cropping processing on the first photographed image and the second photographed image to obtain a third photographed image corresponding to the first photographed image, and a fourth captured image corresponding to the second captured image; pixels in the third captured image are in one-to-one correspondence with pixels in the fourth captured image; The second depth image is obtained by performing the same alignment transformation and cropping processing on the two captured images; the depth information of the second depth image is mapped to the third captured image to obtain the third captured image carrying the depth information.

可选的,所述第二拍摄单元,还用于在同时开启所述RGB摄像头和所述3D摄像头之前,将所述3D摄像头的深度精度调整至最大值。Optionally, the second shooting unit is further configured to adjust the depth accuracy of the 3D camera to a maximum value before turning on the RGB camera and the 3D camera at the same time.

可选的,所述第二拍摄单元,还用于若所述拍照模式为第二预设模式,则将所述3D摄像头的深度精度调整至预设精度值之后,开启所述3D摄像头获取第二拍摄图像以及第一深度图像。Optionally, the second photographing unit is further configured to, if the photographing mode is the second preset mode, after adjusting the depth accuracy of the 3D camera to a preset accuracy value, turn on the 3D camera to obtain the first 2. The captured image and the first depth image.

可选的,所述第二拍摄单元,还用于在所述获取第二拍摄图像以及第一深度图像之后,根据所述第二拍摄图像以及所述第一深度图像,输出三维图像。Optionally, the second photographing unit is further configured to output a three-dimensional image according to the second photographed image and the first depth image after acquiring the second photographed image and the first depth image.

需要说明的是,为描述的方便和简洁,上述描述的拍照装置600的具体工作过程,可以参考上述图1至图5中描述的方法的对应过程,在此不再赘述。It should be noted that, for the convenience and brevity of description, the specific working process of the photographing device 600 described above may refer to the corresponding processes of the methods described in the above-mentioned FIG. 1 to FIG. 5 , which will not be repeated here.

如图7所示,本申请提供一种用于实现上述拍照方法的终端,该终端可以为智能手机、平板电脑、个人电脑(PC)、学习机等终端,包括:处理器71、存储器72、一个或多个输入设备73(图7中仅示出一个)、一个或多个输出设备74(图7中仅示出一个)和双摄像头75。处理器71、存储器72、输入设备73、输出设备74和双摄像头75通过总线76连接。该双摄像头包括3D摄像头和RGB摄像头,用于根据采集外界光信号,生成第一拍摄图像、第二拍摄图像以及所述第一深度图像。As shown in FIG. 7 , the present application provides a terminal for realizing the above-mentioned photographing method. The terminal can be a terminal such as a smart phone, a tablet computer, a personal computer (PC), a learning machine, etc., and includes: a processor 71, a memory 72, One or more input devices 73 (only one is shown in FIG. 7 ), one or more output devices 74 (only one is shown in FIG. 7 ), and dual cameras 75 . The processor 71 , the memory 72 , the input device 73 , the output device 74 and the dual camera 75 are connected by a bus 76 . The dual camera includes a 3D camera and an RGB camera, and is used for generating a first captured image, a second captured image and the first depth image according to the collected external light signals.

应当理解,在本申请实施例中,所称处理器71可以是中央处理单元(CentralProcessing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(DigitalSignal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that, in the embodiments of the present application, the processor 71 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), special-purpose processors An integrated circuit (Application Specific Integrated Circuit, ASIC), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

输入设备73可以包括虚拟键盘、触控板、指纹采传感器(用于采集用户的指纹信息和指纹的方向信息)、麦克风等,输出设备74可以包括显示器、扬声器等。The input device 73 may include a virtual keyboard, a touch panel, a fingerprint sensor (for collecting user's fingerprint information and fingerprint direction information), a microphone, and the like, and the output device 74 may include a display, a speaker, and the like.

存储器72可以包括只读存储器和随机存取存储器,并向处理器71提供指令和数据。存储器72的一部分或全部还可以包括非易失性随机存取存储器。例如,存储器72还可以存储设备类型的信息。Memory 72 may include read-only memory and random access memory, and provides instructions and data to processor 71 . A portion or all of memory 72 may also include non-volatile random access memory. For example, memory 72 may also store device type information.

上述存储器72存储有计算机程序,上述计算机程序可在上述处理器71上运行,例如,上述计算机程序为拍照方法的程序。上述处理器71执行上述计算机程序时实现上述拍照方法实施例中的步骤,例如图1所示的步骤101至步骤103。或者,上述处理器71执行上述计算机程序时实现上述各装置实施例中各模块/单元的功能,例如图6所示单元601至603的功能。The above-mentioned memory 72 stores a computer program, and the above-mentioned computer program can be executed on the above-mentioned processor 71. For example, the above-mentioned computer program is a program of a photographing method. When the above-mentioned processor 71 executes the above-mentioned computer program, the steps in the above-mentioned embodiments of the photographing method are implemented, for example, steps 101 to 103 shown in FIG. 1 . Alternatively, when the above-mentioned processor 71 executes the above-mentioned computer program, the functions of each module/unit in the above-mentioned various apparatus embodiments, such as the functions of the units 601 to 603 shown in FIG. 6 , are realized.

上述计算机程序可以被分割成一个或多个模块/单元,上述一个或者多个模块/单元被存储在上述存储器72中,并由上述处理器71执行,以完成本申请。上述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述上述计算机程序在上述进行拍照的终端中的执行过程。例如,上述计算机程序可以被分割成获取单元、第一拍摄单元和第二拍摄单元,各单元具体功能如下:获取单元,用于获取终端当前的拍照模式;第一拍摄单元,用于若所述拍照模式为第一预设模式,则开启所述RGB摄像头获取第一拍摄图像;第二拍摄单元,用于若所述拍照模式为第二预设模式,则开启所述3D摄像头获取第二拍摄图像以及第一深度图像。The above-mentioned computer program can be divided into one or more modules/units, and the above-mentioned one or more modules/units are stored in the above-mentioned memory 72 and executed by the above-mentioned processor 71 to complete the present application. The above-mentioned one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the above-mentioned computer program in the above-mentioned photographing terminal. For example, the above computer program can be divided into an acquisition unit, a first photographing unit and a second photographing unit. The specific functions of each unit are as follows: the acquiring unit is used to acquire the current photographing mode of the terminal; the first photographing unit is used to obtain the current photographing mode of the terminal; If the photographing mode is the first preset mode, the RGB camera is turned on to obtain the first photographed image; the second photographing unit is configured to turn on the 3D camera to obtain the second photograph if the photographing mode is the second preset mode image and a first depth image.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将上述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the above device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above-mentioned system, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

在本申请所提供的实施例中,应该理解到,所揭露的装置/终端和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端实施例仅仅是示意性的,例如,上述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other manners. For example, the apparatus/terminal embodiments described above are only illustrative. For example, the division of the above modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components. May be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

上述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,上述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,上述计算机程序包括计算机程序代码,上述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。上述计算机可读介质可以包括:能够携带上述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、电载波信号、电信信号以及软件分发介质等。需要说明的是,上述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If the above-mentioned integrated modules/units are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the methods of the above-mentioned embodiments, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium. The computer program When executed by a processor, the steps of each of the above method embodiments can be implemented. Wherein, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code may be in the form of source code, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM), random Access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the above-mentioned computer-readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer-readable media does not Including electrical carrier signals and telecommunication signals.

以上上述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that the above-mentioned embodiments can still be used for The recorded technical solutions are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in the present application. within the scope of protection of the application.

Claims (6)

1.一种拍照方法,应用于终端,所述终端设置有双摄像头,其特征在于,所述双摄像头包括3D摄像头和RGB摄像头,所述拍照方法包括:1. A photographing method, applied to a terminal, wherein the terminal is provided with a dual camera, wherein the dual camera comprises a 3D camera and an RGB camera, and the photographing method comprises: 获取终端当前的拍照模式;Get the current camera mode of the terminal; 若所述拍照模式为第一预设模式,则开启所述RGB摄像头获取第一拍摄图像;If the photographing mode is the first preset mode, turning on the RGB camera to obtain a first photographed image; 若所述拍照模式为第二预设模式,则开启所述3D摄像头获取第二拍摄图像以及第一深度图像,包括:If the photographing mode is the second preset mode, turning on the 3D camera to obtain the second photographed image and the first depth image, including: 若所述拍照模式为第二预设模式,则将所述3D摄像头的深度精度调整至预设精度值之后,开启所述3D摄像头获取第二拍摄图像以及第一深度图像,其中,所述预设精度为使深度精度和图像的分辨率达到平衡状态时的深度精度;If the photographing mode is the second preset mode, after adjusting the depth accuracy of the 3D camera to a preset accuracy value, the 3D camera is turned on to obtain a second photographed image and a first depth image, wherein the preset Let the accuracy be the depth accuracy when the depth accuracy and the resolution of the image reach a balanced state; 若所述拍照模式为第三预设模式,则将所述3D摄像头的深度精度调整至最大值,以便尽可能的得到深度精度较高的三维图像,同时开启所述RGB摄像头和所述3D摄像头,并分别获取所述第一拍摄图像、第二拍摄图像以及所述第一深度图像;If the photographing mode is the third preset mode, adjust the depth accuracy of the 3D camera to the maximum value, so as to obtain a 3D image with higher depth accuracy as much as possible, and turn on the RGB camera and the 3D camera at the same time. , and obtain the first captured image, the second captured image and the first depth image respectively; 将所述第一深度图像携带的深度信息映射到所述第一拍摄图像中,得到携带深度信息的第一拍摄图像。The depth information carried by the first depth image is mapped to the first captured image to obtain a first captured image carrying depth information. 2.如权利要求1所述的拍照方法,其特征在于,所述将所述第一深度图像携带的深度信息映射到所述第一拍摄图像中,得到携带深度信息的第一拍摄图像,包括:2 . The photographing method according to claim 1 , wherein the mapping of the depth information carried by the first depth image to the first captured image to obtain the first captured image carrying the depth information, comprising: 2 . : 对所述第一拍摄图像和所述第二拍摄图像进行对齐变换和裁剪处理,得到与所述第一拍摄图像对应的第三拍摄图像,以及与所述第二拍摄图像对应的第四拍摄图像;所述第三拍摄图像中的像素与所述第四拍摄图像中的像素一一对应;Aligning, transforming and cropping the first captured image and the second captured image to obtain a third captured image corresponding to the first captured image and a fourth captured image corresponding to the second captured image ; The pixels in the third captured image correspond one-to-one with the pixels in the fourth captured image; 对所述第一深度图像进行与所述第二拍摄图像相同的对齐变换和裁剪处理,得到第二深度图像;performing the same alignment transformation and cropping processing on the first depth image as the second captured image to obtain a second depth image; 将所述第二深度图像的深度信息映射到所述第三拍摄图像,得到携带深度信息的第三拍摄图像。The depth information of the second depth image is mapped to the third captured image to obtain a third captured image carrying depth information. 3.如权利要求1所述的拍照方法,其特征在于,在所述获取第二拍摄图像以及第一深度图像之后,包括:3. The photographing method according to claim 1, wherein after the acquiring the second captured image and the first depth image, comprising: 根据所述第二拍摄图像以及所述第一深度图像,输出三维图像。A three-dimensional image is output according to the second captured image and the first depth image. 4.一种拍照装置,配置于终端,所述终端设置有双摄像头,其特征在于,所述双摄像头包括3D摄像头和RGB摄像头,所述拍照装置包括:4. A photographing device, configured in a terminal, wherein the terminal is provided with dual cameras, wherein the dual cameras comprise a 3D camera and an RGB camera, and the photographing device comprises: 获取单元,用于获取终端当前的拍照模式;an obtaining unit, used for obtaining the current photographing mode of the terminal; 第一拍摄单元,用于若所述拍照模式为第一预设模式,则开启所述RGB摄像头获取第一拍摄图像;a first photographing unit, configured to turn on the RGB camera to obtain a first photographed image if the photographing mode is the first preset mode; 第二拍摄单元,用于若所述拍照模式为第二预设模式,则开启所述3D摄像头获取第二拍摄图像以及第一深度图像,包括:A second photographing unit, configured to turn on the 3D camera to obtain a second photographed image and a first depth image if the photographing mode is the second preset mode, including: 若所述拍照模式为第二预设模式,则将所述3D摄像头的深度精度调整至预设精度值之后,开启所述3D摄像头获取第二拍摄图像以及第一深度图像,其中,所述预设精度为使深度精度和图像的分辨率达到平衡状态时的深度精度;If the photographing mode is the second preset mode, after adjusting the depth accuracy of the 3D camera to a preset accuracy value, the 3D camera is turned on to obtain a second photographed image and a first depth image, wherein the preset Let the accuracy be the depth accuracy when the depth accuracy and the resolution of the image reach a balanced state; 第三拍摄单元,用于若所述拍照模式为第三预设模式,则同时开启所述RGB摄像头和所述3D摄像头,并分别获取所述第一拍摄图像、第二拍摄图像以及所述第一深度图像;将所述第一深度图像携带的深度信息映射到所述第一拍摄图像中,得到携带深度信息的第一拍摄图像。A third photographing unit, configured to turn on the RGB camera and the 3D camera at the same time if the photographing mode is the third preset mode, and obtain the first photographed image, the second photographed image and the first photographed image respectively. a depth image; mapping the depth information carried by the first depth image to the first captured image to obtain a first captured image carrying depth information. 5.一种终端,包括双摄像头、存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述双摄像头包括一个3D摄像头和一个RGB摄像头,所述处理器执行所述计算机程序时实现如权利要求1至3任意一项所述方法的步骤。5. A terminal comprising dual cameras, a memory, a processor and a computer program stored in the memory and running on the processor, wherein the dual cameras comprise a 3D camera and an RGB camera , the processor implements the steps of the method according to any one of claims 1 to 3 when the processor executes the computer program. 6.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至3任意一项所述方法的步骤。6. A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented .
CN201910013723.8A 2019-01-03 2019-01-03 Photographing method, photographing device, terminal and computer-readable storage medium Expired - Fee Related CN109639983B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910013723.8A CN109639983B (en) 2019-01-03 2019-01-03 Photographing method, photographing device, terminal and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910013723.8A CN109639983B (en) 2019-01-03 2019-01-03 Photographing method, photographing device, terminal and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN109639983A CN109639983A (en) 2019-04-16
CN109639983B true CN109639983B (en) 2020-09-04

Family

ID=66058057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910013723.8A Expired - Fee Related CN109639983B (en) 2019-01-03 2019-01-03 Photographing method, photographing device, terminal and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN109639983B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467341A (en) * 2010-11-04 2012-05-23 Lg电子株式会社 Mobile terminal and method of controlling an image photographing therein
CN108764052A (en) * 2018-04-28 2018-11-06 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN109005348A (en) * 2018-08-22 2018-12-14 Oppo广东移动通信有限公司 Electronic device and control method for electronic device
CN208257980U (en) * 2018-06-04 2018-12-18 盎锐(上海)信息科技有限公司 Filming apparatus based on 2D camera and 3D camera
CN109040556A (en) * 2018-08-22 2018-12-18 Oppo广东移动通信有限公司 Imaging device and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9392262B2 (en) * 2014-03-07 2016-07-12 Aquifi, Inc. System and method for 3D reconstruction using multiple multi-channel cameras
US10009598B2 (en) * 2015-05-01 2018-06-26 Dell Products L.P. Dynamic mode switching of 2D/3D multi-modal camera for efficient gesture detection

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467341A (en) * 2010-11-04 2012-05-23 Lg电子株式会社 Mobile terminal and method of controlling an image photographing therein
CN108764052A (en) * 2018-04-28 2018-11-06 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN208257980U (en) * 2018-06-04 2018-12-18 盎锐(上海)信息科技有限公司 Filming apparatus based on 2D camera and 3D camera
CN109005348A (en) * 2018-08-22 2018-12-14 Oppo广东移动通信有限公司 Electronic device and control method for electronic device
CN109040556A (en) * 2018-08-22 2018-12-18 Oppo广东移动通信有限公司 Imaging device and electronic equipment

Also Published As

Publication number Publication date
CN109639983A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
EP3067746B1 (en) Photographing method for dual-camera device and dual-camera device
EP3435655B1 (en) Electronic device for acquiring image using plurality of cameras and method for processing image using the same
CN105554369B (en) Electronic device and method for processing image
KR102114377B1 (en) Method for previewing images captured by electronic device and the electronic device therefor
WO2020103604A1 (en) Method and device for photographing, terminal, and computer-readable storage medium
KR20150077646A (en) Image processing apparatus and method
JP2016165101A (en) Device with adaptive camera array
WO2015192547A1 (en) Method for taking three-dimensional picture based on mobile terminal, and mobile terminal
CN107637063B (en) Method and camera for controlling functions based on user's gestures
CN110324532A (en) Image blurring method and device, storage medium and electronic equipment
KR20200117695A (en) Electronic device and method for controlling camera using external electronic device
KR102748681B1 (en) Method for performing fucntion according to gesture input and electronic device performing thereof
CN116530090A (en) Method for taking pictures by using multiple cameras and device thereof
WO2021218551A1 (en) Photographing method and apparatus, terminal device, and storage medium
CN113542600A (en) Image generation method, device, chip, terminal and storage medium
CN107517369B (en) Stereoscopic image generation method and electronic device using same
CN109218709B (en) Holographic content adjusting method and device and computer readable storage medium
KR102418852B1 (en) Electronic device and method for controlling an image display
CN112508959B (en) Video object segmentation method, device, electronic device and storage medium
JP7261889B2 (en) Positioning method and device based on shared map, electronic device and storage medium
CN109639983B (en) Photographing method, photographing device, terminal and computer-readable storage medium
CN109862262A (en) Image weakening method, device, terminal and storage medium
CN111127539B (en) Parallax determination method and device, computer equipment and storage medium
CN118429231A (en) Image correction method, device, computer equipment and storage medium
CN110891131A (en) Camera module, processing method and device, electronic equipment, storage medium

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200904

CF01 Termination of patent right due to non-payment of annual fee