[go: up one dir, main page]

CN114339016A - Camera shooting method, device and medium - Google Patents

Camera shooting method, device and medium Download PDF

Info

Publication number
CN114339016A
CN114339016A CN202011051246.3A CN202011051246A CN114339016A CN 114339016 A CN114339016 A CN 114339016A CN 202011051246 A CN202011051246 A CN 202011051246A CN 114339016 A CN114339016 A CN 114339016A
Authority
CN
China
Prior art keywords
shooting
lightning
images
parameters
pictures
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011051246.3A
Other languages
Chinese (zh)
Inventor
许�鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202011051246.3A priority Critical patent/CN114339016A/en
Publication of CN114339016A publication Critical patent/CN114339016A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)

Abstract

本公开是关于一种相机拍摄方法、装置及介质。该方法包括:在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。采用该方法可以获取拍摄效果较好的包括闪电的多媒体文件,从而使得用户不需使用专业的相机,通过手机就能拍到闪电,提高了用户的使用体验。

Figure 202011051246

The present disclosure relates to a camera shooting method, device and medium. The method includes: in a lightning shooting scene, acquiring N background images of shooting pictures based on a first set of shooting parameters, where N is a positive integer greater than or equal to 1; acquiring M images based on a second set of shooting parameters For the lightning images of the shooting screen, M is a positive integer greater than or equal to 1; according to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, and L is a positive integer greater than or equal to 1. Integer, and L≤M. By adopting this method, a multimedia file including lightning with better shooting effect can be obtained, so that the user can photograph the lightning through a mobile phone without using a professional camera, thereby improving the user's use experience.

Figure 202011051246

Description

相机拍摄方法、装置及介质Camera shooting method, device and medium

技术领域technical field

本公开涉及照相技术领域,尤其涉及一种相机拍摄方法、装置及介质。The present disclosure relates to the field of photography technology, and in particular, to a camera shooting method, device, and medium.

背景技术Background technique

在拍摄变化较快的场景时(例如闪电),通常需要采用传统单反相机配合三脚架、光控快门触发器等辅助设备进行拍摄,并且需要对单反相机进行专业的参数设置。即使这样,拍摄的成图容易出现过曝和虚焦的情况,要想获得理想的照片,还需要后期的修图处理。When shooting scenes with rapid changes (such as lightning), it is usually necessary to use a traditional SLR camera with auxiliary equipment such as a tripod and a light-controlled shutter trigger to shoot, and professional parameter settings for the SLR camera are required. Even so, the pictures taken are prone to overexposure and blurred focus. In order to obtain ideal photos, post-processing is required.

目前,尚不能通过移动终端(例如手机)上设置的相机通过一键拍摄得到效果较好的闪电照片。At present, it is still impossible to obtain lightning photos with better effects through one-click shooting with a camera set on a mobile terminal (eg, a mobile phone).

发明内容SUMMARY OF THE INVENTION

为克服相关技术中存在的问题,本公开提供一种相机拍摄方法、装置及介质。In order to overcome the problems existing in the related art, the present disclosure provides a camera shooting method, device and medium.

根据本公开实施例的第一方面,提供一种相机拍摄方法,应用于设置有相机的终端,所述方法包括:According to a first aspect of the embodiments of the present disclosure, there is provided a camera shooting method, which is applied to a terminal provided with a camera, and the method includes:

在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;In the lightning shooting scene, obtain background images of N shooting pictures based on the first set of shooting parameters, where N is a positive integer greater than or equal to 1;

获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;Obtaining M lightning images of the shooting pictures based on the second group of shooting parameters, where M is a positive integer greater than or equal to 1;

根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。According to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, where L is a positive integer greater than or equal to 1, and L≤M.

其中,所述在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像之前,还包括:Wherein, in the lightning shooting scene, before acquiring the background images of N shooting pictures taken based on the first group of shooting parameters, the method further includes:

在所述相机被开启的情况下,获取拍摄区域的天气状况;When the camera is turned on, obtain the weather conditions of the shooting area;

在所述天气状况为与闪电相关的天气的情况下,确定当前拍摄场景为所述闪电拍摄场景。In the case that the weather condition is weather related to lightning, it is determined that the current shooting scene is the lightning shooting scene.

其中,所述获取拍摄区域的天气状况,包括:Wherein, the obtaining the weather conditions of the shooting area includes:

获取所述终端的当前位置信息;基于所述当前位置信息,确定所述拍摄区域的天气状况;obtaining the current location information of the terminal; determining the weather conditions of the shooting area based on the current location information;

或者,or,

确定拍摄对象与所述终端的距离,基于所述距离确定拍摄对象所在拍摄区域的天气状况。The distance between the shooting object and the terminal is determined, and the weather condition of the shooting area where the shooting object is located is determined based on the distance.

其中,所述获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,包括:Wherein, the acquiring the lightning images of M pieces of the shooting pictures taken based on the second set of shooting parameters, includes:

获取基于所述第二组拍摄参数、以连拍方式拍摄的M张所述拍摄画面的闪电图像。Acquisition of M lightning images of the shooting pictures based on the second set of shooting parameters in a continuous shooting manner.

其中,所述获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,包括:Wherein, the acquiring the lightning images of M pieces of the shooting pictures taken based on the second set of shooting parameters, includes:

获取在本次拍摄的第一时间段内基于所述第二组拍摄参数拍摄的、所述拍摄画面的第一组闪电图像;Acquiring a first group of lightning images of the shooting picture, shot based on the second set of shooting parameters within the first time period of the current shooting;

获取在本次拍摄之前的第二时间段内,基于所述第二组拍摄参数拍摄的、所述拍摄画面的第二组闪电图像;Acquiring a second group of lightning images of the shooting picture, shot based on the second set of shooting parameters, in a second time period before this shooting;

基于所述第一组闪电图像和所述第二组闪电图像,获取M张所述拍摄画面的闪电图像。Based on the first group of lightning images and the second group of lightning images, M pieces of lightning images of the shooting pictures are acquired.

其中,所述根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,包括:Wherein, according to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, including:

通过图像识别技术,确定各闪电图像中的闪电在所述闪电图像中的位置;Determine the position of the lightning in each lightning image in the lightning image through image recognition technology;

选取闪电在所述闪电图像中的位置不同的L张所述闪电图像;L pieces of the lightning images with different positions of the lightning in the lightning images are selected;

根据所述N张背景图像和所述L张闪电图像,合成多媒体文件。According to the N background images and the L lightning images, a multimedia file is synthesized.

其中,所述根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,包括下述方式中至少之一:Wherein, according to N background images and L lightning images in the M lightning images, the synthetic multimedia file includes at least one of the following methods:

方式一,将所述N张背景图像中P张背景图像与所述L张闪电图像合成为一张图片,P为大于或等于1的正整数,且P≤N;Mode 1: Synthesize P background images and the L lightning images into one picture in the N background images, where P is a positive integer greater than or equal to 1, and P≤N;

方式二,将所述N张背景图像中P张背景图像与所述L张闪电图像合成为一段视频。In a second manner, P background images and the L lightning images among the N background images are synthesized into a video.

其中,所述获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像以及获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,包括:Wherein, the acquiring the background images of N shots based on the first set of shooting parameters and acquiring the lightning images of M shots based on the second set of shooting parameters includes:

通过所述相机的同一个摄像头,获取所述N张拍摄画面的背景图像和所述M张所述拍摄画面的闪电图像;或者Obtain the background images of the N shooting pictures and the M lightning images of the shooting pictures through the same camera of the camera; or

当所述相机包括至少两个摄像头时,通过两个不同的摄像头分别获取所述N张拍摄画面的背景图像和所述M张所述拍摄画面的闪电图像。When the camera includes at least two cameras, the background images of the N shooting pictures and the lightning images of the M shooting pictures are respectively acquired through two different cameras.

其中,所述方法还包括:Wherein, the method also includes:

获取所述闪电图像的拍摄时刻;obtaining the shooting moment of the lightning image;

通过所述终端上的音频模块获取监听到雷声的第一时刻;Obtain the first moment when thunder is heard through the audio module on the terminal;

基于所述闪电图像的拍摄时刻和所述第一时刻,确定闪电位置与所述终端的距离;determining the distance between the lightning position and the terminal based on the shooting moment of the lightning image and the first moment;

显示所述距离。The distance is displayed.

其中,所述方法还包括:Wherein, the method also includes:

在确定所述距离小于设定距离的情况下,将所述终端的工作模式切换为飞行模式。In the case that it is determined that the distance is less than the set distance, the working mode of the terminal is switched to the airplane mode.

其中,所述方法还包括:Wherein, the method also includes:

在所述闪电拍摄场景下,获取所述终端的当前位置信息和定位信号强度;In the lightning shooting scene, obtain the current location information and positioning signal strength of the terminal;

基于所述当前位置信息和所述定位信号强度,判断所述终端是否位于户外;Based on the current location information and the positioning signal strength, determine whether the terminal is located outdoors;

在所述终端位于户外的情况下,输出用于提示安全拍摄的提示消息。When the terminal is located outdoors, a prompt message for prompting safety shooting is output.

根据本公开实施例的第二方面,提供一种拍摄装置,应用于设置有相机的终端,所述装置包括:According to a second aspect of the embodiments of the present disclosure, there is provided a photographing apparatus, which is applied to a terminal provided with a camera, and the apparatus includes:

第一获取模块,被设置为在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;The first acquisition module is configured to acquire background images of N shooting pictures taken based on the first group of shooting parameters in a lightning shooting scene, where N is a positive integer greater than or equal to 1;

第二获取模块,被设置为获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;A second acquisition module, configured to acquire M lightning images of the shooting pictures based on the second set of shooting parameters, where M is a positive integer greater than or equal to 1;

合成模块,被设置为根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。The synthesis module is configured to synthesize a multimedia file according to the N background images and L lightning images in the M lightning images, where L is a positive integer greater than or equal to 1, and L≤M.

其中,所述装置还包括确定模块,被设置为:Wherein, the device further includes a determining module, which is set to:

在所述相机被开启的情况下,获取拍摄区域的天气状况;When the camera is turned on, obtain the weather conditions of the shooting area;

在所述天气状况为与闪电相关的天气的情况下,确定当前拍摄场景为所述闪电拍摄场景。In the case that the weather condition is weather related to lightning, it is determined that the current shooting scene is the lightning shooting scene.

其中,所述确定模块还被设置为:Wherein, the determining module is also set to:

获取所述终端的当前位置信息;基于所述当前位置信息,确定所述拍摄区域的天气状况;obtaining the current location information of the terminal; determining the weather conditions of the shooting area based on the current location information;

或者,or,

确定拍摄对象与所述终端的距离,基于所述距离确定拍摄对象所在拍摄区域的天气状况。The distance between the shooting object and the terminal is determined, and the weather condition of the shooting area where the shooting object is located is determined based on the distance.

其中,所述第二获取模块还被设置为:Wherein, the second acquisition module is also set to:

获取基于所述第二组拍摄参数、以连拍方式拍摄的M张所述拍摄画面的闪电图像。Acquisition of M lightning images of the shooting pictures based on the second set of shooting parameters in a continuous shooting manner.

其中,所述第二获取模块还被设置为:Wherein, the second acquisition module is also set to:

获取在本次拍摄的第一时间段内基于所述第二组拍摄参数拍摄的、所述拍摄画面的第一组闪电图像;Acquiring a first group of lightning images of the shooting picture, shot based on the second set of shooting parameters within the first time period of the current shooting;

获取在本次拍摄之前的第二时间段内,基于所述第二组拍摄参数拍摄的、所述拍摄画面的第二组闪电图像;Acquiring a second group of lightning images of the shooting picture, shot based on the second set of shooting parameters, in a second time period before this shooting;

基于所述第一组闪电图像和所述第二组闪电图像,获取M张所述拍摄画面的闪电图像。Based on the first group of lightning images and the second group of lightning images, M pieces of lightning images of the shooting pictures are acquired.

其中,所述合成模块还被设置为:Wherein, the synthesis module is also set to:

通过图像识别技术,确定各闪电图像中的闪电在所述闪电图像中的位置;Determine the position of the lightning in each lightning image in the lightning image through image recognition technology;

选取闪电在所述闪电图像中的位置不同的L张所述闪电图像;L pieces of the lightning images with different positions of the lightning in the lightning images are selected;

根据所述N张背景图像和所述L张闪电图像,合成多媒体文件。According to the N background images and the L lightning images, a multimedia file is synthesized.

其中,所述合成模块还被设置为采用下述方式中至少之一合成所述多媒体文件,包括:Wherein, the synthesizing module is further configured to synthesize the multimedia file in at least one of the following manners, including:

方式一,将所述N张背景图像中P张背景图像与所述L张闪电图像合成为一张图片,P为大于或等于1的正整数,且P≤N;Mode 1: Synthesize P background images and the L lightning images into one picture in the N background images, where P is a positive integer greater than or equal to 1, and P≤N;

方式二,将所述N张背景图像中P张背景图像与所述L张闪电图像合成为一段视频。In a second manner, P background images and the L lightning images among the N background images are synthesized into a video.

其中,所述第一获取模块和所述第二获取模块还被设置为:Wherein, the first acquisition module and the second acquisition module are also set to:

通过所述相机的同一个摄像头,获取所述N张拍摄画面的背景图像和所述M张所述拍摄画面的闪电图像;或者Obtain the background images of the N shooting pictures and the M lightning images of the shooting pictures through the same camera of the camera; or

当所述相机包括至少两个摄像头时,通过两个不同的摄像头分别获取所述N张拍摄画面的背景图像和所述M张所述拍摄画面的闪电图像。When the camera includes at least two cameras, the background images of the N shooting pictures and the lightning images of the M shooting pictures are respectively acquired through two different cameras.

其中,所述装置还包括距离确定模块,被设置为:Wherein, the device also includes a distance determination module, which is set to:

获取所述闪电图像的拍摄时刻;obtaining the shooting moment of the lightning image;

通过所述终端上的音频模块获取监听到雷声的第一时刻;Obtain the first moment when thunder is heard through the audio module on the terminal;

基于所述闪电图像的拍摄时刻和所述第一时刻,确定闪电位置与所述终端的距离;determining the distance between the lightning position and the terminal based on the shooting moment of the lightning image and the first moment;

显示所述距离。The distance is displayed.

其中,所述装置还包括切换模块,被设置为:Wherein, the device further includes a switching module, which is set to:

在确定所述距离小于设定距离的情况下,将所述终端的工作模式切换为飞行模式。In the case that it is determined that the distance is less than the set distance, the working mode of the terminal is switched to the airplane mode.

其中,所述装置还包括安全提示模块,被设置为:Wherein, the device further includes a safety prompt module, which is set to:

在所述闪电拍摄场景下,获取所述终端的当前位置信息和定位信号强度;In the lightning shooting scene, obtain the current location information and positioning signal strength of the terminal;

基于所述当前位置信息和所述定位信号强度,判断所述终端是否位于户外;Based on the current location information and the positioning signal strength, determine whether the terminal is located outdoors;

在所述终端位于户外的情况下,输出用于提示安全拍摄的提示消息。When the terminal is located outdoors, a prompt message for prompting safety shooting is output.

根据本公开实施例的第三方面,提供一种相机拍摄装置,包括:According to a third aspect of the embodiments of the present disclosure, there is provided a camera photographing apparatus, including:

处理器;processor;

用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;

其中,所述处理器被配置为在运行所述可执行指令时实现以下步骤:wherein the processor is configured to implement the following steps when executing the executable instructions:

在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;In the lightning shooting scene, obtain background images of N shooting pictures based on the first set of shooting parameters, where N is a positive integer greater than or equal to 1;

获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;Obtaining M lightning images of the shooting pictures based on the second group of shooting parameters, where M is a positive integer greater than or equal to 1;

根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。According to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, where L is a positive integer greater than or equal to 1, and L≤M.

根据本公开实施例的第四方面,提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由装置的处理器执行时,使得装置能够执行一种相机拍摄方法,所述方法包括:According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, when instructions in the storage medium are executed by a processor of an apparatus, the apparatus can execute a camera shooting method, the Methods include:

在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;In the lightning shooting scene, obtain background images of N shooting pictures based on the first set of shooting parameters, where N is a positive integer greater than or equal to 1;

获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;Obtaining M lightning images of the shooting pictures based on the second group of shooting parameters, where M is a positive integer greater than or equal to 1;

根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。According to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, where L is a positive integer greater than or equal to 1, and L≤M.

采用本公开的上述方法,在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像;以及获取基于第二组拍摄参数拍摄的、M张拍摄画面的闪电图像。根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件。Using the above method of the present disclosure, in a lightning shooting scene, background images of N shooting pictures taken based on the first set of shooting parameters are obtained; and lightning images of M shooting pictures taken based on the second set of shooting parameters are obtained. According to the N background images and the L lightning images in the M lightning images, a multimedia file is synthesized.

采用上述方法,在拍摄闪电时,基于不同的拍摄参数分别拍摄背景图像和包含闪电的图像。然后将背景图像与闪电图像进行合成,以获取拍摄效果较好的包括闪电的多媒体文件,从而使得用户不需使用专业的相机,通过手机就能拍到闪电,提高了用户的使用体验。Using the above method, when photographing lightning, a background image and an image containing lightning are respectively photographed based on different photographing parameters. Then, the background image and the lightning image are synthesized to obtain a multimedia file including lightning with better shooting effect, so that the user can capture the lightning through the mobile phone without using a professional camera, which improves the user experience.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description serve to explain the principles of the invention.

图1是根据一示例性实施例示出的一种相机拍摄方法的流程图。Fig. 1 is a flow chart of a method for shooting with a camera according to an exemplary embodiment.

图2是根据一示例性实施例示出的一种相机拍摄方法的流程图。Fig. 2 is a flow chart of a camera shooting method according to an exemplary embodiment.

图3是根据一示例性实施例示出的一种相机拍摄装置的框图。Fig. 3 is a block diagram of a camera photographing apparatus according to an exemplary embodiment.

图4是根据一示例性实施例示出的一种装置的框图。Fig. 4 is a block diagram of an apparatus according to an exemplary embodiment.

具体实施方式Detailed ways

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with some aspects of the invention as recited in the appended claims.

在拍摄变化较快的场景(例如闪电)时,普通用户用手机很难直接拍到闪电。即使捕捉到闪电,拍摄效果可能也不佳,例如,容易出现画面过曝的情况。When shooting fast-changing scenes (such as lightning), it is difficult for ordinary users to directly capture lightning with their mobile phones. Even if lightning is captured, the result may not be good, for example, the frame is prone to overexposure.

本公开提供了一种相机拍摄方法,该方法应用于设置有相机的移动终端。移动终端可以是手机、PAD、穿戴设备等。在该方法中,在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像;以及获取基于第二组拍摄参数拍摄的、M张拍摄画面的闪电图像。根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件。The present disclosure provides a camera shooting method, which is applied to a mobile terminal provided with a camera. The mobile terminal may be a mobile phone, a PAD, a wearable device, or the like. In the method, in a lightning shooting scene, background images of N shooting pictures taken based on the first set of shooting parameters are obtained; and lightning images of M shooting pictures taken based on the second set of shooting parameters are obtained. According to the N background images and the L lightning images in the M lightning images, a multimedia file is synthesized.

采用上述方法,在拍摄闪电时,基于不同的拍摄参数分别拍摄背景图像和包含闪电的图像。例如在拍摄背景图像时采用针对普通场景的拍摄参数进行拍摄,在拍摄闪电图像时采用针对闪电这种高亮度场景的拍摄参数进行拍摄。然后将背景图像与闪电图像进行合成,以获取拍摄效果较好的包括闪电的多媒体文件,从而使得用户不需使用专业的相机,通过手机就能拍到闪电,提高了用户的使用体验。Using the above method, when photographing lightning, a background image and an image containing lightning are respectively photographed based on different photographing parameters. For example, when shooting a background image, shooting parameters for a common scene are used for shooting, and when shooting a lightning image, shooting parameters for a high-brightness scene such as lightning are used for shooting. Then, the background image and the lightning image are synthesized to obtain a multimedia file including lightning with better shooting effect, so that the user can capture the lightning through the mobile phone without using a professional camera, which improves the user experience.

图1是根据一示例性实施例示出的一种相机拍摄方法的流程图,该方法应用于设置有相机的终端。如图1所示,该方法包括以下步骤:FIG. 1 is a flow chart of a camera shooting method according to an exemplary embodiment, and the method is applied to a terminal provided with a camera. As shown in Figure 1, the method includes the following steps:

步骤101,在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;Step 101, in the lightning shooting scene, acquire background images of N shooting pictures based on the first set of shooting parameters, where N is a positive integer greater than or equal to 1;

步骤102,获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;Step 102, acquiring M lightning images of the shooting pictures based on the second set of shooting parameters, where M is a positive integer greater than or equal to 1;

步骤103,根据N张所述背景图像和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。Step 103: Synthesize a multimedia file according to the N background images and L lightning images among the M lightning images, where L is a positive integer greater than or equal to 1, and L≤M.

在该实施例中,设置有相机的终端可以是手机等智能终端。我们知道,闪电产生的速度非常快,人类生理反射神经速度根本跟不上,因此为了拍摄闪电,在闪电拍摄场景下,采用本实施例提供的方法。In this embodiment, the terminal provided with the camera may be a smart terminal such as a mobile phone. We know that the speed of lightning is very fast, and the speed of human physiological reflex nerves can't keep up. Therefore, in order to shoot lightning, the method provided in this embodiment is adopted in the lightning shooting scene.

在步骤101中,在闪电拍摄场景下,基于用于拍摄普通照片的第一组拍摄参数拍摄背景图像,例如出现闪电的天空。这里可以获取一张或多张背景图像。当获取多张背景图像时,相机可以以设定的时间间隔拍摄多张背景图像。这里,采用第一组拍摄参数拍摄一张或多张背景图像可以通过本领域中相机的常规拍摄方式实现,因此不再赘述。In step 101, in a lightning shooting scene, a background image is captured based on the first set of shooting parameters used for shooting ordinary photos, such as a sky where lightning appears. One or more background images can be obtained here. When acquiring multiple background images, the camera can capture multiple background images at set time intervals. Here, the shooting of one or more background images by using the first set of shooting parameters can be implemented by conventional shooting methods of cameras in the art, and thus will not be described again.

在步骤102中,基于用于拍摄闪电的第二组拍摄参数拍摄闪电图像,这里的闪电图像是指包括闪电的图像。这里的第二组拍摄参数可以采用本领域技术人员已知的适用于拍摄闪电的拍摄参数,例如曝光时间、平衡光圈、感光度等。In step 102, a lightning image is captured based on the second set of capturing parameters for capturing lightning, where the lightning image refers to an image including lightning. The second set of shooting parameters here may use shooting parameters known to those skilled in the art that are suitable for shooting lightning, such as exposure time, balance aperture, sensitivity, and the like.

这里,第一组拍摄参数和第二组拍摄参数可以基于拍摄画面的不同亮度范围来设置,即,通过获取的拍摄画面的亮度范围来设置第一组拍摄参数和第二拍摄参数。例如,当确定拍摄画面的亮度低于第一设定亮度阈值时,确定使用第一组拍摄参数进行拍摄;当确定拍摄画面的亮度高于第二设定亮度阈值时,确定使用第二组拍摄参数进行拍摄。第一设定亮度阈值和第二设定亮度阈值可以基于具体实施例的情况进行设置。Here, the first set of shooting parameters and the second set of shooting parameters may be set based on different brightness ranges of the shooting pictures, that is, the first set of shooting parameters and the second shooting parameters are set by the acquired brightness ranges of the shooting pictures. For example, when it is determined that the brightness of the shooting picture is lower than the first set brightness threshold, it is determined to use the first set of shooting parameters to shoot; when it is determined that the brightness of the shooting picture is higher than the second set brightness threshold, it is determined to use the second set of shooting parameters parameters to shoot. The first set brightness threshold and the second set brightness threshold may be set based on the situation of the specific embodiment.

另外,第一组拍摄参数和第二组拍摄参数还可以针对拍摄的照片的色调等进行不同的设置。例如,将第一组拍摄参数设置为照片的色调为暗色调,将第二组拍摄参数设置为照片的色调为白色色调。In addition, the first set of shooting parameters and the second set of shooting parameters may also be set differently for the color tone and the like of the photographed photos. For example, the first set of shooting parameters is set so that the color tone of the photo is dark, and the second set of shooting parameters is set so that the color tone of the photo is white.

在步骤103中,将上述得到的闪电图像与背景图像合成为多媒体文件,例如静态图片、动态图片或视频。如果合成为图片,则合成的图片为拍摄场景中出现闪电的图片;如果合成为视频,则合成的视频为各帧画面上均有闪电出现的视频。这里将多张图像合成为图片或视频的方法,可以采用本领域技术人员已知的方法,在此不再赘述。In step 103, the lightning image obtained above and the background image are synthesized into a multimedia file, such as a static picture, a dynamic picture or a video. If it is synthesized into a picture, the synthesized picture is a picture in which lightning appears in the shooting scene; if it is synthesized into a video, the synthesized video is a video in which lightning appears on each frame. Here, the method for synthesizing multiple images into a picture or a video may adopt a method known to those skilled in the art, and details are not described herein again.

需要说明的是,在将闪电图像和背景图像合成为多媒体文件时,可以是用一张背景图像与一张闪电图像合成为多媒体文件,也可以是用一张背景图像和多张闪电图像合成为多媒体文件,还可以是用多张背景图像和一张闪电图像合成为多媒体文件,还可以是用多张背景图像和多张闪电图像合成为多媒体文件。It should be noted that when synthesizing a lightning image and a background image into a multimedia file, a background image and a lightning image can be synthesized into a multimedia file, or a background image and multiple lightning images can be synthesized into a multimedia file. The multimedia file can also be composed of a plurality of background images and a lightning image to form a multimedia file, and can also be composed of a plurality of background images and a plurality of lightning images to form a multimedia file.

采用上述方法,在拍摄闪电时,基于不同的拍摄参数分别拍摄背景图像和包含闪电的图像。例如在拍摄背景图像时采用针对普通场景的拍摄参数进行拍摄,在拍摄闪电图像时采用针对闪电这种高亮度场景的拍摄参数进行拍摄。然后将背景图像与闪电图像进行合成,以获取拍摄效果较好的包括闪电的多媒体文件,从而使得用户不需使用专业的相机,通过手机就能拍到闪电,提高了用户的使用体验。Using the above method, when photographing lightning, a background image and an image containing lightning are respectively photographed based on different photographing parameters. For example, when shooting a background image, shooting parameters for a common scene are used for shooting, and when shooting a lightning image, shooting parameters for a high-brightness scene such as lightning are used for shooting. Then, the background image and the lightning image are synthesized to obtain a multimedia file including lightning with better shooting effect, so that the user can capture the lightning through the mobile phone without using a professional camera, which improves the user experience.

在可选实施方式中,所述在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像之前,还包括:In an optional implementation manner, in the lightning shooting scene, before acquiring the background images of N shooting pictures taken based on the first set of shooting parameters, the method further includes:

在所述相机被开启的情况下,获取拍摄区域的天气状况;When the camera is turned on, obtain the weather conditions of the shooting area;

在所述天气状况为与闪电相关的天气的情况下,确定当前拍摄场景为所述闪电拍摄场景。In the case that the weather condition is weather related to lightning, it is determined that the current shooting scene is the lightning shooting scene.

在该实施方式中,在相机被开启的情况下,可以判断当前的拍摄场景是否是闪电拍摄场景。In this embodiment, when the camera is turned on, it can be determined whether the current shooting scene is a lightning shooting scene.

具体地,监测到相机被开启时,获取拍摄区域的天气状况。假如天气状况为雷雨天气等与闪电相关的天气,则确定当前的拍摄场景为闪电拍摄场景。Specifically, when it is detected that the camera is turned on, the weather conditions of the shooting area are acquired. If the weather condition is lightning-related weather such as thunderstorm weather, it is determined that the current shooting scene is a lightning shooting scene.

需要说明的是,确定当前的拍摄场景为闪电拍摄场景,还可以包括:It should be noted that determining that the current shooting scene is a lightning shooting scene may also include:

判断天气状况为与闪电相关的天气时,向用户提示确认当前的拍摄场景是否为闪电拍摄场景(例如通过显示提示框和确认按钮的方式);When judging that the weather condition is lightning-related weather, prompt the user to confirm whether the current shooting scene is a lightning shooting scene (for example, by displaying a prompt box and a confirmation button);

当接收到用户的确认消息时(用户按下确认按钮),确定为闪电拍摄场景。When a confirmation message from the user is received (the user presses the confirmation button), it is determined to be a lightning shooting scene.

在可选实施方式中,所述获取拍摄区域的天气状况,包括:In an optional implementation manner, the acquiring the weather conditions of the shooting area includes:

获取所述终端的当前位置信息;基于所述当前位置信息,确定所述拍摄区域的天气状况;obtaining the current location information of the terminal; determining the weather conditions of the shooting area based on the current location information;

或者,or,

确定拍摄对象与所述终端的距离,基于所述距离确定拍摄对象所在拍摄区域的天气状况。The distance between the shooting object and the terminal is determined, and the weather condition of the shooting area where the shooting object is located is determined based on the distance.

该实施方式中,考虑到终端使用者与拍摄区域位于相同位置区域内,即终端使用者距离拍摄对象较近的情况,以及终端使用者距离拍摄对象较远的情况。In this embodiment, it is considered that the terminal user and the shooting area are located in the same location area, that is, the situation where the terminal user is close to the shooting object, and the situation where the terminal user is far away from the shooting object.

当终端使用者距离拍摄对象较近时,可以将终端的当前位置信息作为拍摄对象的拍摄区域的位置信息,即通过获取终端的当前位置信息确定拍摄对象的拍摄区域的位置信息,例如通过终端上的定位模块获取终端的当前位置信息。基于当前位置信息,获取当前位置处的天气状况作为拍摄区域的天气状况。当终端使用者距离拍摄对象较远时,确定拍摄对象与终端的距离以及拍摄对象相对于终端的方位,基于上述距离和方位以及终端的当前位置来获取拍摄对象的所在区域,并进一步获取拍摄对象所在区域的天气状况。这里,拍摄对象与终端的距离可以通过拍摄图像的深度距离或者相机的对焦距离来获取;拍摄对象相对于终端的方位可以通过相机所在终端上设置的陀螺仪来获取。可以理解地,在确定位置信息之后即可通网络或者终端上安装的天气应用程序获取相应位置的天气状况。When the terminal user is close to the shooting object, the current position information of the terminal can be used as the position information of the shooting area of the shooting object, that is, the position information of the shooting area of the shooting object can be determined by acquiring the current position information of the terminal, for example, through the terminal on the terminal. The positioning module obtains the current location information of the terminal. Based on the current location information, the weather condition at the current location is acquired as the weather condition of the shooting area. When the terminal user is far away from the shooting object, determine the distance between the shooting object and the terminal and the orientation of the shooting object relative to the terminal, obtain the area where the shooting object is based on the above distance and orientation and the current position of the terminal, and further obtain the shooting object Weather conditions in your area. Here, the distance between the shooting object and the terminal can be obtained through the depth distance of the shooting image or the focusing distance of the camera; the orientation of the shooting object relative to the terminal can be obtained through the gyroscope set on the terminal where the camera is located. Understandably, after the location information is determined, the weather conditions of the corresponding location can be obtained through the network or a weather application installed on the terminal.

采用该实施方式的方法确定闪电拍摄场景,实现了闪电拍摄场景的自动识别,方便了用户的使用。Using the method of this embodiment to determine the lightning shooting scene, the automatic identification of the lightning shooting scene is realized, and the use of the user is convenient.

在可选实施方式中,所述获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,包括:In an optional implementation manner, the obtaining of M lightning images of the shooting pictures taken based on the second set of shooting parameters includes:

获取基于所述第二组拍摄参数、以连拍方式拍摄的M张所述拍摄画面的闪电图像。Acquisition of M lightning images of the shooting pictures based on the second set of shooting parameters in a continuous shooting manner.

在该实施方式中,为了获取多张闪电图像,需要基于适于拍摄闪电的拍摄参数以短时曝光、无间隔连拍方式进行拍摄。这是因为,闪电出现的时间极短,变化极快,人类自己拍摄的话很难能抓拍上,而通过相机自身的连拍功能则可能拍摄到。In this embodiment, in order to acquire a plurality of lightning images, it is necessary to shoot in a short-time exposure and continuous shooting mode without interval based on shooting parameters suitable for shooting lightning. This is because lightning appears for a very short period of time and changes very quickly. It is difficult for humans to capture photos by themselves, but it may be captured by the camera's own continuous shooting function.

但是在通过相机连拍方式拍摄的多张照片中,可能会有一些照片上没有拍摄到闪电。这就需要通过图像识别的方式,例如判断照片是否包括亮度较高的部分,来识别出包括闪电的照片,并从中选取一张或多张以进行后续的图像合成。这里通过图像识别的方式识别包括闪电的图像可以采用AI图像识别方法实现,在此不再赘述。But there may be some shots that don't show lightning in the multiple shots taken with the camera burst. This requires an image recognition method, such as judging whether the photo includes a part with high brightness, to identify the photos including lightning, and select one or more photos for subsequent image synthesis. Here, the recognition of images including lightning by means of image recognition can be realized by the AI image recognition method, which will not be repeated here.

该实施方式中通过相机连拍方式拍摄闪电图像,不需要用户紧张地抓拍闪电,就可以确保相机拍摄到包括闪电的图像,方便了用户的使用。In this embodiment, the lightning image is captured by the camera in a continuous shooting manner, and the user does not need to nervously capture the lightning, and the camera can ensure that the image including the lightning is captured, which is convenient for the user to use.

在可选实施方式中,所述获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,包括:In an optional implementation manner, the obtaining of M lightning images of the shooting pictures taken based on the second set of shooting parameters includes:

获取在本次拍摄的第一时间段内基于所述第二组拍摄参数拍摄的、所述拍摄画面的第一组闪电图像;Acquiring a first group of lightning images of the shooting picture, shot based on the second set of shooting parameters within the first time period of the current shooting;

获取在本次拍摄之前的第二时间段内,基于所述第二组拍摄参数拍摄的、所述拍摄画面的第二组闪电图像;Acquiring a second group of lightning images of the shooting picture, shot based on the second set of shooting parameters, in a second time period before this shooting;

基于所述第一组闪电图像和所述第二组闪电图像,获取M张所述拍摄画面的闪电图像。Based on the first group of lightning images and the second group of lightning images, M pieces of lightning images of the shooting pictures are acquired.

在该实施方式中,第一时间段的拍摄为一次连拍操作,第二时间段内的拍摄为另一次连拍操作。因此,M张闪电图像可以是来自于不止一次连拍操作,例如来自于两次连拍操作或者更多次连拍操作。采用这种方式,能够获得闪电群图片或视频,即得到效果更加震撼的合成多媒体文件。这是因为,当选取多次连拍的闪电图像时,会有很大可能获取出现位置差距较大的闪电图像,因此最终合成的多媒体文件(图片或视频)中,就会得到更多位置上的闪电,从而得到闪电更多的合成的多媒体文件,实现更加强烈的震撼效果。In this embodiment, the shooting in the first time period is one continuous shooting operation, and the shooting in the second time period is another continuous shooting operation. Therefore, the M lightning images may come from more than one continuous shooting operation, for example, from two continuous shooting operations or more continuous shooting operations. In this way, pictures or videos of lightning groups can be obtained, that is, a composite multimedia file with a more shocking effect can be obtained. This is because, when selecting multiple consecutive lightning images, it is very possible to obtain lightning images with large differences in position, so in the final composite multimedia file (picture or video), more positions will be obtained. The lightning, so as to get more lightning composite multimedia files, to achieve a more intense shock effect.

在可选实施方式中,所述根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,包括:In an optional implementation manner, the multimedia files are synthesized according to N background images and L lightning images in the M lightning images, including:

通过图像识别技术,确定各闪电图像中的闪电在所述闪电图像中的位置;Determine the position of the lightning in each lightning image in the lightning image through image recognition technology;

选取闪电在所述闪电图像中的位置不同的L张所述闪电图像;L pieces of the lightning images with different positions of the lightning in the lightning images are selected;

根据所述N张背景图像和所述L张闪电图像,合成多媒体文件。According to the N background images and the L lightning images, a multimedia file is synthesized.

如上所述,为了实现更加震撼的效果,希望合成的多媒体文件中在较多的位置上出现闪电。因此,在选取闪电图像时,尽量选取闪电位置不同的图像。而如果选取两张闪电位置相同的闪电图像,其合成效果则等同于选取了一张闪电图像。As mentioned above, in order to achieve a more shocking effect, it is desirable that lightnings appear in more positions in the synthesized multimedia file. Therefore, when selecting lightning images, try to select images with different lightning positions. However, if two lightning images with the same lightning position are selected, the composite effect is equivalent to selecting one lightning image.

在可选实施方式中,所述根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,包括下述方式中至少之一:In an optional implementation manner, the multimedia file is synthesized according to N background images and L lightning images in the M lightning images, including at least one of the following methods:

方式一,将所述N张背景图像中P张背景图像与所述L张闪电图像合成为一张图片,P为大于或等于1的正整数,且P≤N;Mode 1: Synthesize P background images and the L lightning images into one picture in the N background images, where P is a positive integer greater than or equal to 1, and P≤N;

方式二,将所述N张背景图像中P张背景图像与所述L张闪电图像合成为一段视频。In a second manner, P background images and the L lightning images among the N background images are synthesized into a video.

方式一中,将背景图像与闪电图像合成为的图片可以是静态图片也可以是动态图片(例如GIF格式图片),这里合成的方式可以采用本领域技术人员已知的方式,在此不再赘述。方式二中,可以按照L张闪电图像的拍摄时刻的顺序合成视频,示例地,考虑到在通常闪电场景中闪电出现时长有限,该视频可以为时长在预设时长内的短片视频,例如该预设时长可以为60秒、2分钟或者5分钟等。In the first way, the picture synthesized by the background image and the lightning image can be a static picture or a dynamic picture (for example, a GIF format picture), and the method of synthesis here can be a method known to those skilled in the art, which will not be repeated here. . In the second way, the video can be synthesized in the order of the shooting moments of L lightning images. For example, considering that the lightning duration is limited in a typical lightning scene, the video can be a short video with a duration within a preset duration, such as the pre-set video. The set duration can be 60 seconds, 2 minutes, or 5 minutes.

这里合成图片和/或视频,可以由用户选择合成图片或视频或图片加视频,也可以基于系统的设置进行选择。Here, to synthesize pictures and/or videos, the user may choose to synthesize pictures or videos, or pictures plus videos, or may be selected based on system settings.

这里提供了多种合成方式,可以满足用户的多方面需求,提升了用户的使用体验。A variety of synthesis methods are provided here, which can meet the various needs of users and improve the user experience.

在可选实施方式中,所述获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像以及获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,可以包括:In an optional implementation manner, the acquiring the background images of N shots based on the first set of shooting parameters and acquiring the lightning images of M shots based on the second set of shooting parameters may include:

通过所述相机的同一个摄像头,获取所述N张拍摄画面的背景图像和所述M张所述拍摄画面的闪电图像;或者Obtain the background images of the N shooting pictures and the M lightning images of the shooting pictures through the same camera of the camera; or

当所述相机包括至少两个摄像头时,通过两个不同的摄像头分别获取所述N张拍摄画面的背景图像和所述M张所述拍摄画面的闪电图像。When the camera includes at least two cameras, the background images of the N shooting pictures and the lightning images of the M shooting pictures are respectively acquired through two different cameras.

当终端上的相机仅包括一个摄像头时,可以通过该摄像头分别基于第一组拍摄参数拍摄背景图像和基于第二组拍摄参数拍摄闪电图像,从而实现通过一个摄像头无法实现的闪电拍摄效果。背景图像可以在闪电图像之前拍摄,也可以在闪电图像之后拍摄。When the camera on the terminal includes only one camera, the camera can be used to shoot the background image based on the first set of shooting parameters and the lightning image based on the second set of shooting parameters, thereby realizing the lightning shooting effect that cannot be achieved by one camera. The background image can be taken before the lightning image or after the lightning image.

当终端上的相机包括至少两个摄像头时,例如两个不同的摄像头时,则可以通过一个摄像头基于第一组拍摄参数拍摄背景图像,通过另一个摄像头基于第二组拍摄参数拍摄闪电图像。这两个摄像头的拍摄可以同时进行也可以不同时进行。When the camera on the terminal includes at least two cameras, for example, two different cameras, one camera can shoot the background image based on the first set of shooting parameters, and the other camera can shoot the lightning image based on the second set of shooting parameters. The two cameras can shoot at the same time or not at the same time.

在可选实施方式中,所述方法还包括:In an optional embodiment, the method further includes:

获取所述闪电图像的拍摄时刻;obtaining the shooting moment of the lightning image;

通过所述终端上的音频模块获取监听到雷声的第一时刻;Obtain the first moment when thunder is heard through the audio module on the terminal;

基于所述闪电图像的拍摄时刻和所述第一时刻,确定闪电位置与所述终端的距离;determining the distance between the lightning position and the terminal based on the shooting moment of the lightning image and the first moment;

显示所述距离。The distance is displayed.

我们知道,光传播的速度远高于声音传播的速度。并且,由于光传播的速度非常快,可以近似地认为我们看到闪电的时刻就是闪电发生的时刻。因此,记录拍摄到闪电图像的时刻以及监听到雷声的时刻,这两个时刻的差值就是雷声从出现闪电或雷声的地点传播到用户所在地点所用的时间。基于声音传播的速度,就可以计算得到出现闪电或雷声地点与用户所在地点的距离,即闪电位置与终端之间的距离。然后,显示该距离,以使用户获知闪电与自己的距离,增加用户拍摄的趣味性,提升用户的使用体验。We know that light travels much faster than sound. And, because light travels so fast, it can be approximated that the moment we see lightning is the moment when it happens. Therefore, record the moment when the lightning image is captured and the moment when the thunder is heard, and the difference between these two moments is the time it takes for the thunder to travel from the place where the lightning or thunder occurs to the user's location. Based on the speed of sound propagation, the distance between the location where lightning or thunder occurs and the location of the user can be calculated, that is, the distance between the location of lightning and the terminal. Then, the distance is displayed, so that the user knows the distance between the lightning and himself, which increases the interest of the user's shooting and improves the user's use experience.

在可选实施方式中,所述方法还可以包括:在确定所述距离小于设定距离的情况下,将所述终端的工作模式切换为飞行模式。In an optional implementation manner, the method may further include: in the case that it is determined that the distance is less than a set distance, switching the working mode of the terminal to an airplane mode.

在该实施方式中,当闪电位置与终端较近时,用户使用终端是非常危险的,此时将终端的工作模式切换为飞行模式,以避免用户使用终端带来的风险。In this embodiment, when the lightning position is close to the terminal, it is very dangerous for the user to use the terminal. In this case, the working mode of the terminal is switched to the airplane mode to avoid the risk brought by the user using the terminal.

在可选实施方式中,所述方法还可以包括:在所述闪电拍摄场景下,获取所述终端的当前位置信息和定位信号强度;基于所述当前位置信息和所述定位信号强度,判断所述终端是否位于户外;在所述终端位于户外的情况下,输出用于提示安全拍摄的提示消息。In an optional embodiment, the method may further include: in the lightning shooting scene, acquiring the current location information and positioning signal strength of the terminal; based on the current location information and the positioning signal strength, judging the whether the terminal is located outdoors; if the terminal is located outdoors, output a prompt message for prompting safe shooting.

采用该实施方式的方法,不仅可以实现闪电的拍摄,还可以确保用户进行安全的拍摄。在雷雨天气中,使用终端(尤其是可以接打电话的手机)在户外拍摄,对于用户来说是相对危险的。因此,当确定用户拍摄闪电且位于户外时,对用户进行安全拍摄的提醒,例如,提醒用户将终端设置为飞行模式,以避免雷击的风险;提醒用户选择安全的拍摄场地,避开高压线、铁塔、大树;等等。在判断相机是否位于户外时,可以结合当前位置信息和定位信号强度来进行判断。例如,当前位置信息表示位于空旷地区且定位信号强度较高(例如,高于设定强度阈值)时,则判断相机位于户外。By adopting the method of this embodiment, not only the shooting of lightning can be realized, but also the safe shooting of the user can be ensured. In thunderstorm weather, it is relatively dangerous for users to use a terminal (especially a mobile phone that can make and receive calls) to shoot outdoors. Therefore, when it is determined that the user is shooting lightning and is located outdoors, remind the user to shoot safely. For example, remind the user to set the terminal to the flight mode to avoid the risk of lightning strikes; remind the user to choose a safe shooting location and avoid high-voltage lines and iron towers. , tree; etc. When judging whether the camera is located outdoors, the judgment can be made in combination with the current location information and the strength of the positioning signal. For example, when the current location information indicates that the camera is located in an open area and the strength of the positioning signal is high (eg, higher than a set strength threshold), it is determined that the camera is located outdoors.

下面结合具体的应用场景描述根据本公开的具体实施例。在该实施例中,相机设置于手机上,使用手机进行闪电的拍摄,该相机包括两个摄像头:摄像头A和摄像头B。如图2所示,该方法包括以下步骤:Specific embodiments according to the present disclosure will be described below with reference to specific application scenarios. In this embodiment, the camera is set on the mobile phone, and the mobile phone is used to shoot lightning. The camera includes two cameras: camera A and camera B. As shown in Figure 2, the method includes the following steps:

步骤201,监测到相机被开启时,获取手机的当前位置信息。In step 201, when it is detected that the camera is turned on, the current location information of the mobile phone is acquired.

步骤202,基于位置信息,获取当前位置处的天气状况为雷雨天气,确定当前拍摄场景为闪电拍摄场景。Step 202: Based on the location information, obtain the weather condition at the current location as thunderstorm weather, and determine that the current shooting scene is a lightning shooting scene.

步骤203,使用摄像头A,获取基于适于常规拍摄场景的拍摄参数拍摄的拍摄画面的一张背景图像。Step 203 , using the camera A, to acquire a background image of the shooting picture based on the shooting parameters suitable for the conventional shooting scene.

步骤204,使用摄像头B,获取基于适于拍摄闪电的拍摄参数以连拍方式拍摄的拍摄画面的多张图像。Step 204 , using the camera B to acquire a plurality of images of the shooting images shot in a continuous shooting manner based on shooting parameters suitable for shooting lightning.

步骤205,采用图像识别技术,从上述多张图像中,获取包括闪电的图像,即闪电图像。In step 205, an image including lightning, that is, a lightning image, is acquired from the above-mentioned multiple images by using an image recognition technology.

步骤206,采用图像识别技术,确定闪电在这些闪电图像中的位置。Step 206, using image recognition technology to determine the position of lightning in these lightning images.

步骤207,选取具有不同闪电位置的5张闪电图像。Step 207, select 5 lightning images with different lightning positions.

步骤208,采用图像合成技术,将1张背景图像和选取的5张闪电图像合成为一张动态图片。Step 208 , using an image synthesis technology to synthesize one background image and five selected lightning images into a dynamic picture.

采用上述方法,不需要使用专业的相机,普通用户通过手机就能拍摄出闪电图片。并且,当该图片是由多张包括闪电的图像合成时,图片的震撼效果更加强烈,从而提升了用户的使用体验。With the above method, ordinary users can take pictures of lightning through their mobile phones without using a professional camera. Moreover, when the picture is composed of a plurality of images including lightning, the shocking effect of the picture is more intense, thereby improving the user experience.

本公开还提供了一种拍摄装置,应用于设置有相机的终端,如图3所示,所述装置包括:The present disclosure also provides a photographing device, which is applied to a terminal provided with a camera. As shown in FIG. 3 , the device includes:

第一获取模块301,被设置为在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;The first acquisition module 301 is configured to acquire background images of N shots based on the first set of shooting parameters in a lightning shooting scene, where N is a positive integer greater than or equal to 1;

第二获取模块302,被设置为获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;The second acquisition module 302 is configured to acquire M lightning images of the shooting pictures based on the second set of shooting parameters, where M is a positive integer greater than or equal to 1;

合成模块303,被设置为根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。The synthesis module 303 is configured to synthesize a multimedia file according to the N background images and L lightning images in the M lightning images, where L is a positive integer greater than or equal to 1, and L≤M.

在可选实施方式中,所述装置还包括确定模块,被设置为:In an optional implementation manner, the apparatus further includes a determining module configured to:

在所述相机被开启的情况下,获取拍摄区域的天气状况;When the camera is turned on, obtain the weather conditions of the shooting area;

在所述天气状况为与闪电相关的天气的情况下,确定当前拍摄场景为所述闪电拍摄场景。In the case that the weather condition is weather related to lightning, it is determined that the current shooting scene is the lightning shooting scene.

在可选实施方式中,所述确定模块还被设置为:In an optional implementation manner, the determining module is further configured to:

获取所述终端的当前位置信息;基于所述当前位置信息,确定所述拍摄区域的天气状况;obtaining the current location information of the terminal; determining the weather conditions of the shooting area based on the current location information;

或者,or,

确定拍摄对象与所述终端的距离,基于所述距离确定拍摄对象所在拍摄区域的天气状况。The distance between the shooting object and the terminal is determined, and the weather condition of the shooting area where the shooting object is located is determined based on the distance.

在可选实施方式中,所述第二获取模块302还被设置为:In an optional implementation manner, the second obtaining module 302 is further configured to:

获取基于所述第二组拍摄参数、以连拍方式拍摄的M张所述拍摄画面的闪电图像。Acquisition of M lightning images of the shooting pictures based on the second set of shooting parameters in a continuous shooting manner.

在可选实施方式中,所述第二获取模块302还被设置为:In an optional implementation manner, the second obtaining module 302 is further configured to:

获取在本次拍摄的第一时间段内基于所述第二组拍摄参数拍摄的、所述拍摄画面的第一组闪电图像;Acquiring a first group of lightning images of the shooting picture, shot based on the second set of shooting parameters within the first time period of the current shooting;

获取在本次拍摄之前的第二时间段内,基于所述第二组拍摄参数拍摄的、所述拍摄画面的第二组闪电图像;Acquiring a second group of lightning images of the shooting picture, shot based on the second set of shooting parameters, in a second time period before this shooting;

基于所述第一组闪电图像和所述第二组闪电图像,获取M张所述拍摄画面的闪电图像。Based on the first group of lightning images and the second group of lightning images, M pieces of lightning images of the shooting pictures are acquired.

在可选实施方式中,所述合成模块303还被设置为:In an optional implementation manner, the synthesis module 303 is further configured to:

通过图像识别技术,确定各闪电图像中的闪电在所述闪电图像中的位置;Determine the position of the lightning in each lightning image in the lightning image through image recognition technology;

选取闪电在所述闪电图像中的位置不同的L张所述闪电图像;L pieces of the lightning images with different positions of the lightning in the lightning images are selected;

根据所述N张背景图像和所述L张闪电图像,合成多媒体文件。According to the N background images and the L lightning images, a multimedia file is synthesized.

在可选实施方式中,所述合成模块303还被设置为采用下述方式中至少之一合成所述多媒体文件,包括:In an optional implementation manner, the synthesizing module 303 is further configured to synthesize the multimedia file in at least one of the following manners, including:

方式一,将所述N张背景图像中P张背景图像与所述L张闪电图像合成为一张图片,P为大于或等于1的正整数,且P≤N;Mode 1: Synthesize P background images and the L lightning images into one picture in the N background images, where P is a positive integer greater than or equal to 1, and P≤N;

方式二,将所述N张背景图像中P张背景图像与所述L张闪电图像合成为一段视频。In a second manner, P background images and the L lightning images among the N background images are synthesized into a video.

在可选实施方式中,所述第一获取模块301和所述第二获取模块302还被设置为:In an optional implementation manner, the first obtaining module 301 and the second obtaining module 302 are further configured as:

通过所述相机的同一个摄像头,获取所述N张拍摄画面的背景图像和所述M张所述拍摄画面的闪电图像;或者Obtain the background images of the N shooting pictures and the M lightning images of the shooting pictures through the same camera of the camera; or

当所述相机包括至少两个摄像头时,通过两个不同的摄像头分别获取所述N张拍摄画面的背景图像和所述M张所述拍摄画面的闪电图像。When the camera includes at least two cameras, the background images of the N shooting pictures and the lightning images of the M shooting pictures are respectively acquired through two different cameras.

在可选实施方式中,所述装置还包括距离确定模块,被设置为:In an optional implementation manner, the device further includes a distance determination module configured to:

获取所述闪电图像的拍摄时刻;obtaining the shooting moment of the lightning image;

通过所述终端上的音频模块获取监听到雷声的第一时刻;Obtain the first moment when thunder is heard through the audio module on the terminal;

基于所述闪电图像的拍摄时刻和所述第一时刻,确定闪电位置与所述终端的距离;determining the distance between the lightning position and the terminal based on the shooting moment of the lightning image and the first moment;

显示所述距离。The distance is displayed.

在可选实施方式中,所述装置还包括切换模块,被设置为:In an optional implementation manner, the apparatus further includes a switching module configured to:

在确定所述距离小于设定距离的情况下,将所述终端的工作模式切换为飞行模式。In the case that it is determined that the distance is less than the set distance, the working mode of the terminal is switched to the airplane mode.

在可选实施方式中,所述装置还包括安全提示模块,被设置为:In an optional implementation manner, the device further includes a safety prompt module configured to:

在所述闪电拍摄场景下,获取所述终端的当前位置信息和定位信号强度;In the lightning shooting scene, obtain the current location information and positioning signal strength of the terminal;

基于所述当前位置信息和所述定位信号强度,判断所述终端是否位于户外;Based on the current location information and the positioning signal strength, determine whether the terminal is located outdoors;

在所述终端位于户外的情况下,输出用于提示安全拍摄的提示消息。When the terminal is located outdoors, a prompt message for prompting safety shooting is output.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.

采用上述装置,在拍摄闪电时,基于不同的拍摄参数分别拍摄背景图像和包含闪电的图像。例如在拍摄背景图像时采用针对普通场景的拍摄参数进行拍摄,在拍摄闪电图像时采用针对闪电这种高亮度场景的拍摄参数进行拍摄。然后将背景图像与闪电图像进行合成,以获取拍摄效果较好的包括闪电的多媒体文件,从而使得用户不需使用专业的相机,通过手机就能拍到闪电,提高了用户的使用体验。With the above device, when photographing lightning, a background image and an image containing lightning are respectively photographed based on different photographing parameters. For example, when shooting a background image, shooting parameters for a common scene are used for shooting, and when shooting a lightning image, shooting parameters for a high-brightness scene such as lightning are used for shooting. Then, the background image and the lightning image are synthesized to obtain a multimedia file including lightning with better shooting effect, so that the user can capture the lightning through the mobile phone without using a professional camera, which improves the user experience.

图4是根据一示例性实施例示出的一种用于相机拍摄装置400的框图。FIG. 4 is a block diagram of a camera photographing apparatus 400 according to an exemplary embodiment.

参照图4,装置400可以包括以下一个或多个组件:处理组件402,存储器404,电力组件406,多媒体组件408,音频组件410,输入/输出(I/O)的接口412,传感器组件414,以及通信组件416。4, the apparatus 400 may include one or more of the following components: a processing component 402, a memory 404, a power component 406, a multimedia component 408, an audio component 410, an input/output (I/O) interface 412, a sensor component 414, and communication component 416 .

处理组件402通常控制装置400的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件402可以包括一个或多个处理器420来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件402可以包括一个或多个模块,便于处理组件402和其他组件之间的交互。例如,处理组件402可以包括多媒体模块,以方便多媒体组件408和处理组件402之间的交互。The processing component 402 generally controls the overall operation of the device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or some of the steps of the methods described above. Additionally, processing component 402 may include one or more modules that facilitate interaction between processing component 402 and other components. For example, processing component 402 may include a multimedia module to facilitate interaction between multimedia component 408 and processing component 402.

存储器404被配置为存储各种类型的数据以支持在设备400的操作。这些数据的示例包括用于在装置400上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器404可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。Memory 404 is configured to store various types of data to support operation at device 400 . Examples of such data include instructions for any application or method operating on device 400, contact data, phonebook data, messages, pictures, videos, and the like. Memory 404 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.

电力组件406为装置400的各种组件提供电力。电力组件406可以包括电源管理系统,一个或多个电源,及其他与为装置400生成、管理和分配电力相关联的组件。Power component 406 provides power to various components of device 400 . Power components 406 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 400 .

多媒体组件408包括在所述装置400和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件408包括一个前置摄像头和/或后置摄像头。当设备400处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。Multimedia component 408 includes screens that provide an output interface between the device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, multimedia component 408 includes a front-facing camera and/or a rear-facing camera. When the device 400 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.

音频组件410被配置为输出和/或输入音频信号。例如,音频组件410包括一个麦克风(MIC),当装置400处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器404或经由通信组件416发送。在一些实施例中,音频组件410还包括一个扬声器,用于输出音频信号。Audio component 410 is configured to output and/or input audio signals. For example, audio component 410 includes a microphone (MIC) that is configured to receive external audio signals when device 400 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 404 or transmitted via communication component 416 . In some embodiments, audio component 410 also includes a speaker for outputting audio signals.

I/O接口412为处理组件402和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 412 provides an interface between the processing component 402 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.

传感器组件414包括一个或多个传感器,用于为装置400提供各个方面的状态评估。例如,传感器组件414可以检测到设备400的打开/关闭状态,组件的相对定位,例如所述组件为装置400的显示器和小键盘,传感器组件414还可以检测装置400或装置400一个组件的位置改变,用户与装置400接触的存在或不存在,装置400方位或加速/减速和装置400的温度变化。传感器组件414可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件414还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件414还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。Sensor assembly 414 includes one or more sensors for providing status assessment of various aspects of device 400 . For example, the sensor assembly 414 can detect the open/closed state of the device 400, the relative positioning of components, such as the display and keypad of the device 400, and the sensor assembly 414 can also detect a change in the position of the device 400 or a component of the device 400 , the presence or absence of user contact with the device 400 , the orientation or acceleration/deceleration of the device 400 and the temperature change of the device 400 . Sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

通信组件416被配置为便于装置400和其他设备之间有线或无线方式的通信。装置400可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件416经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件416还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。Communication component 416 is configured to facilitate wired or wireless communication between apparatus 400 and other devices. Device 400 may access wireless networks based on communication standards, such as WiFi, 2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

在示例性实施例中,装置400可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, apparatus 400 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.

在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器404,上述指令可由装置400的处理器420执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory 404 including instructions, executable by the processor 420 of the apparatus 400 to perform the method described above. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

一种非临时性计算机可读存储介质,当所述存储介质中的指令由移动终端的处理器执行时,使得移动终端能够执行一种相机拍摄方法,所述方法包括:确定所述相机采用闪电模式进行拍摄;在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。A non-transitory computer-readable storage medium, when an instruction in the storage medium is executed by a processor of a mobile terminal, enables the mobile terminal to execute a camera shooting method, the method comprising: determining that the camera adopts a lightning bolt mode; in the lightning shooting scene, obtain the background images of N shooting pictures taken based on the first set of shooting parameters, where N is a positive integer greater than or equal to 1; obtain M pictures taken based on the second set of shooting parameters For the lightning images of the shooting pictures, M is a positive integer greater than or equal to 1; according to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, and L is a positive integer greater than or equal to 1. Integer, and L≤M.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or techniques in the art not disclosed by this disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the invention being indicated by the following claims.

应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。It should be understood that the present invention is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from its scope. The scope of the present invention is limited only by the appended claims.

Claims (15)

1.一种相机拍摄方法,应用于设置有相机的终端,其特征在于,所述方法包括:1. A camera shooting method, applied to a terminal provided with a camera, wherein the method comprises: 在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;In the lightning shooting scene, obtain background images of N shooting pictures based on the first set of shooting parameters, where N is a positive integer greater than or equal to 1; 获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;Obtaining M lightning images of the shooting pictures based on the second group of shooting parameters, where M is a positive integer greater than or equal to 1; 根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。According to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, where L is a positive integer greater than or equal to 1, and L≤M. 2.如权利要求1所述的方法,其特征在于,所述在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像之前,还包括:2. The method according to claim 1, wherein, before acquiring the background images of N shooting pictures taken based on the first group of shooting parameters under the lightning shooting scene, the method further comprises: 在所述相机被开启的情况下,获取拍摄区域的天气状况;When the camera is turned on, obtain the weather conditions of the shooting area; 在所述天气状况为与闪电相关的天气的情况下,确定当前拍摄场景为所述闪电拍摄场景。In the case that the weather condition is weather related to lightning, it is determined that the current shooting scene is the lightning shooting scene. 3.如权利要求2所述的方法,其特征在于,所述获取拍摄区域的天气状况,包括:3. The method according to claim 2, wherein the acquiring the weather conditions of the shooting area comprises: 获取所述终端的当前位置信息;基于所述当前位置信息,确定所述拍摄区域的天气状况;obtaining the current location information of the terminal; determining the weather conditions of the shooting area based on the current location information; 或者,or, 确定拍摄对象与所述终端的距离,基于所述距离确定拍摄对象所在拍摄区域的天气状况。The distance between the shooting object and the terminal is determined, and the weather condition of the shooting area where the shooting object is located is determined based on the distance. 4.如权利要求1所述的方法,其特征在于,所述获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,包括:4. The method according to claim 1, wherein the acquiring the lightning images of the M pictures of the shooting pictures based on the second group of shooting parameters, comprising: 获取基于所述第二组拍摄参数、以连拍方式拍摄的M张所述拍摄画面的闪电图像。Acquisition of M lightning images of the shooting pictures based on the second set of shooting parameters in a continuous shooting manner. 5.如权利要求1所述的方法,其特征在于,所述获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,包括:5. The method according to claim 1, wherein the acquiring the lightning images of the M pictures of the shooting pictures taken based on the second group of shooting parameters, comprises: 获取在本次拍摄的第一时间段内基于所述第二组拍摄参数拍摄的、所述拍摄画面的第一组闪电图像;Acquiring a first group of lightning images of the shooting picture, shot based on the second set of shooting parameters within the first time period of the current shooting; 获取在本次拍摄之前的第二时间段内,基于所述第二组拍摄参数拍摄的、所述拍摄画面的第二组闪电图像;Acquiring a second group of lightning images of the shooting picture, shot based on the second set of shooting parameters, in a second time period before this shooting; 基于所述第一组闪电图像和所述第二组闪电图像,获取M张所述拍摄画面的闪电图像。Based on the first group of lightning images and the second group of lightning images, M pieces of lightning images of the shooting pictures are acquired. 6.如权利要求1、4或5所述的方法,其特征在于,所述根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,包括:6. The method according to claim 1, 4 or 5, wherein the synthetic multimedia file comprises: N background images and L lightning images in the M lightning images. 通过图像识别技术,确定各闪电图像中的闪电在所述闪电图像中的位置;Determine the position of the lightning in each lightning image in the lightning image through image recognition technology; 选取闪电在所述闪电图像中的位置不同的L张所述闪电图像。L pieces of the lightning images with different positions of the lightning in the lightning images are selected. 7.如权利要求1所述的方法,其特征在于,所述方法还包括:7. The method of claim 1, wherein the method further comprises: 获取所述闪电图像的拍摄时刻;obtaining the shooting moment of the lightning image; 通过所述终端上的音频模块获取监听到雷声的第一时刻;Obtain the first moment when thunder is heard through the audio module on the terminal; 基于所述闪电图像的拍摄时刻和所述第一时刻,确定闪电位置与所述终端的距离;determining the distance between the lightning position and the terminal based on the shooting moment of the lightning image and the first moment; 显示所述距离。The distance is displayed. 8.一种拍摄装置,应用于设置有相机的终端,其特征在于,所述装置包括:8. A photographing device, applied to a terminal provided with a camera, wherein the device comprises: 第一获取模块,被设置为在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;The first acquisition module is configured to acquire background images of N shots based on the first set of shooting parameters in a lightning shooting scene, where N is a positive integer greater than or equal to 1; 第二获取模块,被设置为获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;A second acquisition module, configured to acquire M lightning images of the shooting pictures based on the second set of shooting parameters, where M is a positive integer greater than or equal to 1; 合成模块,被设置为根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。The synthesis module is configured to synthesize a multimedia file according to the N background images and L lightning images in the M lightning images, where L is a positive integer greater than or equal to 1, and L≤M. 9.如权利要求8所述的装置,其特征在于,所述装置还包括确定模块,被设置为:9. The apparatus of claim 8, wherein the apparatus further comprises a determining module configured to: 在所述相机被开启的情况下,获取拍摄区域的天气状况;When the camera is turned on, obtain the weather conditions of the shooting area; 在所述天气状况为与闪电相关的天气的情况下,确定当前拍摄场景为所述闪电拍摄场景。In the case that the weather condition is weather related to lightning, it is determined that the current shooting scene is the lightning shooting scene. 10.如权利要求9所述的装置,其特征在于,所述确定模块还被设置为:10. The apparatus of claim 9, wherein the determining module is further configured to: 获取所述终端的当前位置信息;基于所述当前位置信息,确定所述拍摄区域的天气状况;obtaining the current location information of the terminal; determining the weather conditions of the shooting area based on the current location information; 或者,or, 确定拍摄对象与所述终端的距离,基于所述距离确定拍摄对象所在拍摄区域的天气状况。The distance between the shooting object and the terminal is determined, and the weather condition of the shooting area where the shooting object is located is determined based on the distance. 11.如权利要求8所述的装置,其特征在于,所述第二获取模块还被设置为:11. The apparatus of claim 8, wherein the second acquisition module is further configured to: 获取基于所述第二组拍摄参数、以连拍方式拍摄的的M张所述拍摄画面的闪电图像。Acquiring the lightning images of M pictures of the shooting pictures taken in a continuous shooting manner based on the second set of shooting parameters. 12.如权利要求8所述的装置,其特征在于,所述第二获取模块还被设置为:12. The apparatus of claim 8, wherein the second acquisition module is further configured to: 获取在本次拍摄的第一时间段内基于所述第二组拍摄参数拍摄的、所述拍摄画面的第一组闪电图像;Acquiring a first group of lightning images of the shooting picture, shot based on the second set of shooting parameters within the first time period of this shooting; 获取在本次拍摄之前的第二时间段内,基于所述第二组拍摄参数拍摄的、所述拍摄画面的第二组闪电图像;Acquiring a second group of lightning images of the shooting picture, shot based on the second set of shooting parameters, in a second time period before this shooting; 基于所述第一组闪电图像和所述第二组闪电图像,获取M张所述拍摄画面的闪电图像。Based on the first group of lightning images and the second group of lightning images, M pieces of lightning images of the shooting pictures are acquired. 13.如权利要求8、11或12所述的装置,其特征在于,所述合成模块还被设置为:13. The apparatus according to claim 8, 11 or 12, wherein the synthesis module is further configured to: 通过图像识别技术,确定各闪电图像中的闪电在所述闪电图像中的位置;Determine the position of the lightning in each lightning image in the lightning image through image recognition technology; 选取闪电在所述闪电图像中的位置不同的L张所述闪电图像;L pieces of the lightning images with different positions of the lightning in the lightning images are selected; 根据所述N张背景图像和所述L张闪电图像,合成多媒体文件。According to the N background images and the L lightning images, a multimedia file is synthesized. 14.一种相机拍摄装置,其特征在于,包括:14. A camera photographing device, comprising: 处理器;processor; 用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions; 其中,所述处理器被配置为在运行所述可执行指令时实现以下步骤:wherein the processor is configured to implement the following steps when executing the executable instructions: 在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;In the lightning shooting scene, acquire background images of N shooting pictures based on the first set of shooting parameters, where N is a positive integer greater than or equal to 1; 获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;Obtaining the lightning images of M pieces of the shooting pictures taken based on the second group of shooting parameters, where M is a positive integer greater than or equal to 1; 根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。According to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, where L is a positive integer greater than or equal to 1, and L≤M. 15.一种非临时性计算机可读存储介质,当所述存储介质中的指令由装置的处理器执行时,使得装置能够执行一种相机拍摄方法,所述方法包括:15. A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an apparatus, enabling the apparatus to execute a camera shooting method, the method comprising: 在闪电拍摄场景下,获取基于第一组拍摄参数拍摄的、N张拍摄画面的背景图像,N为大于或等于1的正整数;In the lightning shooting scene, acquire background images of N shooting pictures based on the first set of shooting parameters, where N is a positive integer greater than or equal to 1; 获取基于第二组拍摄参数拍摄的、M张所述拍摄画面的闪电图像,M为大于或等于1的正整数;Obtaining the lightning images of M pieces of the shooting pictures taken based on the second group of shooting parameters, where M is a positive integer greater than or equal to 1; 根据N张背景图像,和M张所述闪电图像中的L张闪电图像,合成多媒体文件,L为大于或等于1的正整数,且L≤M。According to N background images and L lightning images in the M lightning images, a multimedia file is synthesized, where L is a positive integer greater than or equal to 1, and L≤M.
CN202011051246.3A 2020-09-29 2020-09-29 Camera shooting method, device and medium Pending CN114339016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011051246.3A CN114339016A (en) 2020-09-29 2020-09-29 Camera shooting method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011051246.3A CN114339016A (en) 2020-09-29 2020-09-29 Camera shooting method, device and medium

Publications (1)

Publication Number Publication Date
CN114339016A true CN114339016A (en) 2022-04-12

Family

ID=81010771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011051246.3A Pending CN114339016A (en) 2020-09-29 2020-09-29 Camera shooting method, device and medium

Country Status (1)

Country Link
CN (1) CN114339016A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001066378A (en) * 1999-08-30 2001-03-16 Sharp Corp Lightning surge warning device and electronic equipment equipped with lightning surge warning device
CN104104886A (en) * 2014-07-24 2014-10-15 深圳市中兴移动通信有限公司 Overexposure shooting method and device
CN107087106A (en) * 2017-04-19 2017-08-22 深圳市金立通信设备有限公司 A kind of image pickup method and terminal
CN107490781A (en) * 2016-08-26 2017-12-19 深圳大学 Use mobile terminal detection and the method for co-located lightning

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001066378A (en) * 1999-08-30 2001-03-16 Sharp Corp Lightning surge warning device and electronic equipment equipped with lightning surge warning device
CN104104886A (en) * 2014-07-24 2014-10-15 深圳市中兴移动通信有限公司 Overexposure shooting method and device
CN107490781A (en) * 2016-08-26 2017-12-19 深圳大学 Use mobile terminal detection and the method for co-located lightning
CN107087106A (en) * 2017-04-19 2017-08-22 深圳市金立通信设备有限公司 A kind of image pickup method and terminal

Similar Documents

Publication Publication Date Title
CN107426502B (en) Shooting method and device, electronic equipment and storage medium
CN104038704B (en) The shooting processing method and processing device of backlight portrait scene
CN106210496B (en) Photo shooting method and device
CN106031147B (en) For using the method and system of corneal reflection adjustment camera setting
CN104113691A (en) Shooting method and device
CN108040204B (en) A multi-camera-based image capturing method, device and storage medium
WO2018121185A1 (en) Method for adjusting power of infrared lamp, and photographic equipment
CN110995993B (en) Star trail video shooting method, star trail video shooting device and storage medium
CN111586280B (en) Shooting method, device, terminal and readable storage medium
CN113315903A (en) Image acquisition method and device, electronic equipment and storage medium
CN107820025B (en) Method and device for photographing processing
KR102512787B1 (en) Method and apparatus for displaying captured preview image, and medium
CN111461950B (en) Image processing methods and devices
CN108156381B (en) Photographing method and device
CN106572306A (en) Image shooting method and electronic equipment
CN114339016A (en) Camera shooting method, device and medium
WO2023236215A1 (en) Image processing method and apparatus, and storage medium
CN116843603A (en) Image processing method and device, electronic equipment, storage medium
CN111277754B (en) Mobile terminal shooting method and device
CN111225158B (en) Image generation method and apparatus, electronic device, computer-readable storage medium
CN108683838B (en) Shooting method, device, terminal and computer-readable storage medium
CN114697595A (en) Video recording method, device and storage medium
CN111464753B (en) Picture shooting method and device and storage medium
CN109862252B (en) Image shooting method and device
CN112752010B (en) Shooting method, device and 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220412

RJ01 Rejection of invention patent application after publication