Shooting method and device and electronic equipment

By optimizing shooting parameters such as flash current, working mode, and exposure time, the problem of poor shooting results in high dynamic scenes of fireworks and people was solved, and the accurate capture of fireworks shapes and human details was achieved, thus improving the shooting quality.

CN121037701APending Publication Date: 2025-11-28VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511201902.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing electronic devices are ill-suited to shooting high-dynamic-range scenes such as fireworks and people, resulting in overexposure and distortion of the shapes of fireworks and underexposure of the people, leading to poor shooting results.

Method used

By receiving input from the shooting preview interface, the camera is controlled to shoot based on the parameters of the shooting scene, including adjusting the flash parameters and exposure parameters. The shooting parameters are optimized to adapt to high dynamic range scenes by using reference information such as ambient brightness, human proportion, focal length information and acoustic information of fireworks.

Benefits of technology

It effectively avoids overexposure in the fireworks area and underexposure in the people area, accurately captures the shape of fireworks and the details of people, and improves the shooting effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121037701A_ABST
    Figure CN121037701A_ABST
Patent Text Reader

Abstract

The invention discloses a shooting method and device and electronic equipment, and belongs to the technical field of camera shooting. The method comprises the following steps: receiving a first input for a shooting preview interface; in response to the first input, controlling the camera to shoot a first image based on a shooting parameter corresponding to the shooting scene; wherein the first image comprises fireworks and portraits.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of camera shooting, and particularly relates to a shooting method, a shooting device and an electronic device. BACKGROUND

[0002] With the continuous improvement of the performance of the camera of an electronic device, users have generally adopted shooting to record life. At present, users are no longer limited to single scene shooting in shooting, but perform complex scene shooting, for example, a fireworks portrait scene.

[0003] At present, when an electronic device shoots a high dynamic scene including fireworks and a person through a camera, the electronic device depends on a fixed shooting mode to perform image acquisition. Since the fixed shooting mode is difficult to adapt to the characteristics of the high dynamic scene, the fireworks region is overexposed to cause shape distortion, and the person region loses details due to insufficient exposure, thereby causing poor shooting effect. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a shooting method, a shooting device, an electronic device and a readable storage medium, which can improve imaging quality.

[0005] In a first aspect, the embodiments of the present application provide a shooting method, which comprises: receiving a first input to a shooting preview interface; in response to the first input, controlling a camera to shoot a first image based on shooting parameters corresponding to a shooting scene; wherein the first image includes fireworks and a portrait.

[0006] In some embodiments of the present application, the shooting parameters include a flash parameter; or the shooting parameters include an exposure parameter, or the shooting parameters include a flash parameter and an exposure parameter.

[0007] The flash parameter includes a current value of a flash module; or the flash parameter includes a working mode of the flash module; or the flash parameter includes the current value and the working mode of the flash module.

[0008] The exposure parameter includes an exposure time; or the exposure parameter includes an exposure gain; or the exposure parameter includes the exposure time and the exposure gain.

[0009] In some embodiments of the present application, before the camera is controlled to shoot according to the shooting parameters corresponding to the shooting scene, the method further comprises:

[0010] According to reference information, determining the shooting parameters corresponding to the shooting scene.

[0011] The reference information includes at least one of the following: environmental brightness information, a proportion of the portrait in a preview image collected by the camera, focal length information of the camera, and acoustic information of the fireworks.

[0012] In some embodiments of the present application, when the shooting parameter comprises a flash parameter, the reference information comprises:

[0013] ambient brightness information;

[0014] or, the ambient brightness information and the proportion of the portrait in the preview image captured by the camera;

[0015] or, the ambient brightness information, the proportion of the portrait in the preview image, and the focal length information of the camera;

[0016] or, a weighted brightness value of the preview image captured by the camera, the weighted brightness value being obtained based on weighted calculation of brightness values of a face region, a highlight region, and a transition region of the preview image;

[0017] or, the weighted brightness value of the preview image captured by the camera and the focal length information of the camera;

[0018] In some embodiments of the present application, when the shooting parameter comprises an exposure parameter, the reference information comprises:

[0019] the type of the fireworks;

[0020] or, acoustic information of the fireworks, the acoustic information being determined based on a sound wave signal of the fireworks captured by a microphone;

[0021] or, the type of the fireworks and the acoustic information of the fireworks.

[0022] In some embodiments of the present application, the shooting parameter comprises a current value of a flash module;

[0023] According to the reference information, the shooting parameter corresponding to the shooting scene is determined, comprising:

[0024] obtaining ambient brightness information, the ambient brightness information representing an ambient brightness value of the shooting scene;

[0025] determining the current value of the flash module according to the ambient brightness information and a first mapping relationship, the first mapping relationship being a mapping relationship between the ambient brightness value and the current value of the flash module.

[0026] In some embodiments of the present application, after determining the current value of the flash module according to the ambient brightness information and the first mapping relationship, the method further comprises:

[0027] calculating a proportion of a face region of the portrait in the preview image captured by the camera;

[0028] determining a current adjustment ratio according to the proportion of the face region and a second mapping relationship, the second mapping relationship being a mapping relationship between the proportion of the face region and the current adjustment ratio;

[0029] adjusting the current value of the flash module according to the current adjustment ratio.

[0030] In some embodiments of the present application, the shooting parameter includes a current value of the flash module;

[0031] According to the reference information, the shooting parameter corresponding to the shooting scene is determined, including:

[0032] The preview image captured by the camera is divided into a face region, a highlight region and a transition region;

[0033] The first luminance value of the face region, the second luminance value of the highlight region and the third luminance value of the transition region are counted; wherein the face region corresponds to a first luminance weight, the highlight region corresponds to a second luminance weight, and the transition region corresponds to a third luminance weight;

[0034] Based on the first luminance weight, the second luminance weight and the third luminance weight, the first luminance value, the second luminance value and the third luminance value are weighted and calculated to obtain a weighted luminance value of the preview image;

[0035] According to the weighted luminance value of the preview image and the third mapping relationship, the current value of the flash module is determined, and the third mapping relationship is a mapping relationship between the weighted luminance value of the preview image and the current value of the flash module.

[0036] In some embodiments of the present application, the shooting parameter includes a working mode of the flash module;

[0037] According to the reference information, the shooting parameter corresponding to the shooting scene is determined, including:

[0038] According to the focal length information of the camera, the working mode of the flash module is determined.

[0039] In some embodiments of the present application, the flash module includes a near-focus flash and a far-focus flash;

[0040] According to the focal length information of the camera, the working mode of the flash module is determined, including:

[0041] In the case that the shooting focal length of the camera is a first focal length, the near-focus flash is turned on, and the working current of the near-focus flash is set to a first current value;

[0042] In the case that the shooting focal length of the camera is a second focal length, the near-focus flash and the far-focus flash are turned on, and the current values of the working currents of the near-focus flash and the far-focus flash are set according to a first current ratio; the current ratio of the near-focus flash to the far-focus flash is 1:1;

[0043] In a case where the shooting focal length of the camera is the third focal length, the near-focus flash and the far-focus flash are turned on, and the current values of the working currents of the near-focus flash and the far-focus flash are set according to the second current ratio; the current ratio of the near-focus flash to the far-focus flash is 1:3.

[0044] In a case where the shooting focal length of the camera is the fourth focal length, the far-focus flash is turned on, and the working current of the far-focus flash is set as the second current value.

[0045] The first focal length is less than the second focal length, the second focal length is less than the third focal length, and the third focal length is less than the fourth focal length.

[0046] In some embodiments of the present application, the shooting parameter includes an exposure parameter.

[0047] According to the reference information, the shooting parameter corresponding to the shooting scene is determined, including:

[0048] Based on the preview image displayed by the shooting preview interface, the type of the fireworks is determined.

[0049] According to the type of the fireworks and the fourth mapping relationship, the exposure conversion coefficient is determined, the fourth mapping relationship being a mapping relationship between the type of the fireworks and the exposure conversion coefficient.

[0050] According to the exposure conversion coefficient, the reference exposure parameter is adjusted to obtain the exposure parameter corresponding to the shooting scene.

[0051] In some embodiments of the present application, the shooting parameter includes an exposure time, and the exposure time includes an exposure start time.

[0052] In response to the first input, before the shooting parameter corresponding to the shooting scene is determined according to the reference information, the method further includes:

[0053] Based on the acoustic information of the fireworks, the time when the light radiation of the fireworks reaches the maximum value is predicted, and the time when the light radiation of the fireworks reaches the maximum value is determined as the exposure start time.

[0054] In response to the first input, based on the shooting parameter corresponding to the shooting scene, the camera is controlled to shoot an image, including:

[0055] In response to the first input, at the exposure start time, the image sensor of the camera is controlled to be exposed to generate image data.

[0056] The image data is processed to generate a first image, and the first image is output.

[0057] In some embodiments of the present application, in response to the first input, based on the shooting parameter corresponding to the shooting scene, the camera is controlled to shoot a first image, including:

[0058] In response to the first input, the flash module is controlled to output a light pulse according to the flash parameter, and the camera is controlled to capture the first image according to the exposure parameter corresponding to the shooting scene.

[0059] In some embodiments of the present application, the camera is controlled to capture the first image based on the shooting parameter corresponding to the shooting scene, including:

[0060] The camera is controlled to capture a plurality of groups of image frames in a continuous exposure period based on the shooting parameter corresponding to the shooting scene, each group of image frames including a second image and a third image, wherein the second image is a high conversion gain (HCG) image captured in one exposure period, and the third image is a low conversion gain (LCG) image corresponding to the HCG image.

[0061] The first image is generated based on the plurality of groups of image frames, and the first image is output.

[0062] In some embodiments of the present application, the first image is generated based on the plurality of groups of image frames, including:

[0063] From the plurality of groups of image frames, a frame of HCG image with the highest image quality score is selected as a reference image frame, and the image quality score is determined based on a sharpness value and a motion blur value of the image.

[0064] Each frame of HCG image in the plurality of groups of image frames and the LCG image corresponding to the reference image frame are subjected to image synthesis processing to generate the first image.

[0065] In some embodiments of the present application, before receiving the first input to the shooting preview interface, the method further includes:

[0066] In the case of detecting fireworks, a first prompt information is displayed, and the first prompt information is used to recommend a shooting mode matched with the fireworks portrait scene.

[0067] A second input to the first prompt information is received.

[0068] In response to the second input, the fireworks portrait shooting mode is started.

[0069] In response to the first input, the camera is controlled to capture the first image based on the shooting parameter corresponding to the shooting scene, including:

[0070] In the fireworks portrait shooting mode, in response to the first input, the camera is controlled to capture the first image based on the shooting parameter corresponding to the shooting scene.

[0071] In some embodiments of the present application, the shooting preview interface includes a first control, and the first control is used to select or switch a flash mode.

[0072] In the case of starting the fireworks portrait shooting mode, the method further includes:

[0073] The flash function is turned on, and the first control is updated to a second control. The second control is used to prompt that the fireworks portrait shooting mode has been turned on.

[0074] In some embodiments of the present application, after updating the flash control in the shooting preview interface to the flash prompt control, the method further comprises:

[0075] After displaying the second control reference time length, the second control is updated to a third control. The third control is used to prompt that the shooting mode is the fireworks portrait shooting mode.

[0076] In a second aspect, the embodiments of the present application provide a shooting device. The device comprises a receiving module and a processing module, wherein: the receiving module is configured to receive a first input to a shooting preview interface; the processing module is configured to control a camera to shoot a first image based on shooting parameters corresponding to a shooting scene in response to the first input received by the receiving module; and the first image comprises fireworks and a portrait.

[0077] In some embodiments of the present application, the shooting parameters comprise flash parameters; or the shooting parameters comprise exposure parameters, or the shooting parameters comprise flash parameters and exposure parameters.

[0078] The flash parameters comprise a current value of a flash module; or the flash parameters comprise a working mode of the flash module; or the flash parameters comprise the current value and the working mode of the flash module.

[0079] The exposure parameters comprise an exposure time; or the exposure parameters comprise an exposure gain; or the exposure parameters comprise the exposure time and the exposure gain.

[0080] In some embodiments of the present application, the processing module is further configured to determine the shooting parameters corresponding to the shooting scene according to reference information before controlling the camera to shoot according to the shooting parameters corresponding to the shooting scene.

[0081] The reference information comprises at least one of the following: environmental brightness information, a proportion of the portrait in a preview image collected by the camera, focal length information of the camera, and acoustic information of the fireworks.

[0082] In some embodiments of the present application, in the case where the shooting parameters comprise flash parameters, the reference information comprises:

[0083] The environmental brightness information;

[0084] Or the environmental brightness information and the proportion of the portrait in the preview image collected by the camera.

[0085] Or the environmental brightness information, the proportion of the portrait in the preview image, and the focal length information of the camera.

[0086] alternatively, a weighted brightness value of the preview image captured by the camera, the weighted brightness value being obtained based on weighted calculation of brightness values of a face region, a highlight region and a transition region of the preview image;

[0087] alternatively, a weighted brightness value of the preview image captured by the camera, and focal length information of the camera;

[0088] In a case where the shooting parameter comprises an exposure parameter, the reference information comprises:

[0089] a type of the fireworks;

[0090] alternatively, acoustic information of the fireworks;

[0091] alternatively, the type of the fireworks and the acoustic information of the fireworks.

[0092] In some embodiments of the present application, the shooting parameter comprises a current value of a flash module; and the processing module is specifically configured to:

[0093] obtain environment brightness information, the environment brightness information representing an environment brightness value of a shooting scene;

[0094] determine the current value of the flash module according to the environment brightness value and a first mapping relationship, the first mapping relationship being a mapping relationship between the environment brightness value and the current value of the flash module.

[0095] In some embodiments of the present application, the processing module is further configured to:

[0096] after determining the current value of the flash module according to the environment brightness information and a preset mapping relationship, calculate a proportion of a face region of a portrait in the preview image captured by the camera;

[0097] determine a current adjustment proportion according to the proportion of the face region and a second mapping relationship, the second mapping relationship being a mapping relationship between the proportion of the face region and the current adjustment proportion;

[0098] adjust the current value of the flash module according to the current adjustment proportion.

[0099] In some embodiments of the present application, the shooting parameter comprises a current value of a flash module; and the processing module is specifically configured to:

[0100] divide a preview image captured by the camera into a face region, a highlight region and a transition region;

[0101] statistically obtain a first brightness value of the face region, a second brightness value of the highlight region and a third brightness value of the transition region; wherein the face region corresponds to a first brightness weight, the highlight region corresponds to a second brightness weight, and the transition region corresponds to a third brightness weight;

[0102] perform a weighted operation on the first luminance value, the second luminance value and the third luminance value based on the first luminance weight, the second luminance weight and the third luminance weight to calculate a weighted luminance value of the preview image;

[0103] determine the current value of the flash module according to the weighted luminance value of the preview image and a third mapping relationship, the third mapping relationship being a mapping relationship between the weighted luminance value of the preview image and the current value of the flash module.

[0104] In some embodiments of the present application, the shooting parameter includes a working mode of the flash module; and the processing module is specifically configured to:

[0105] determine the working mode of the flash module according to the focal length information of the camera.

[0106] In some embodiments of the present application, the flash module includes a close-focus flash and a tele-focus flash.

[0107] in a case where the shooting focal length of the camera is a first focal length, turn on the close-focus flash and set a working current of the close-focus flash as a first current value;

[0108] in a case where the shooting focal length of the camera is a second focal length, turn on the close-focus flash and the tele-focus flash and set current values of working currents of the close-focus flash and the tele-focus flash according to a first current ratio; the current ratio of the close-focus flash to the tele-focus flash is 1:1;

[0109] in a case where the shooting focal length of the camera is a third focal length, turn on the close-focus flash and the tele-focus flash and set current values of working currents of the close-focus flash and the tele-focus flash according to a second current ratio; the current ratio of the close-focus flash to the tele-focus flash is 1:3;

[0110] in a case where the shooting focal length of the camera is a fourth focal length, turn on the tele-focus flash and set a working current of the tele-focus flash as a second current value;

[0111] wherein the first focal length is smaller than the second focal length, the second focal length is smaller than the third focal length, and the third focal length is smaller than the fourth focal length.

[0112] In some embodiments of the present application, the processing module is specifically configured to:

[0113] determine the type of the fireworks based on the preview image displayed on the shooting preview interface;

[0114] determine the exposure conversion coefficient according to the type of the fireworks and a fourth mapping relationship, the third mapping relationship being a mapping relationship between the type of the fireworks and the exposure conversion coefficient;

[0115] adjust the reference exposure parameter according to the exposure conversion coefficient to obtain the exposure parameter corresponding to the shooting object.

[0116] In some embodiments of the present application, the shooting parameter includes an exposure time, and the exposure time includes an exposure start time;

[0117] The processing module is further configured to, before determining the shooting parameter corresponding to the shooting scene according to the reference information in response to the first input, predict a time at which the light radiation of the fireworks reaches a maximum value based on the acoustic information of the fireworks, and determine the time at which the light radiation of the fireworks reaches the maximum value as the exposure start time;

[0118] The processing module is specifically configured to, in response to the first input, control the image sensor of the camera to generate the image data at the exposure start time;

[0119] The processing module is specifically configured to process the image data to generate the first image and output the first image.

[0120] In some embodiments of the present application, the processing module is specifically configured to, in response to the first input, control the flash module to emit light according to the flash parameter;

[0121] The processing module is specifically configured to, during the period in which the flash module emits light, control the camera to shoot the first image according to the exposure parameter corresponding to the shooting scene.

[0122] In some embodiments of the present application, the processing module is specifically configured to:

[0123] control the camera to collect a plurality of groups of image frames in a continuous exposure period based on the shooting parameter corresponding to the shooting scene, each group of image frames including a second image and a third image, wherein the second image is a high conversion gain (HCG) image collected in one exposure period, and the third image is a low conversion gain (LCG) image corresponding to the HCG image;

[0124] generate the first image based on the plurality of groups of image frames and output the first image.

[0125] In some embodiments of the present application, the processing module is specifically configured to:

[0126] select, from the plurality of groups of image frames, an HCG image with the highest image quality score as a reference image frame, the image quality score being determined based on a sharpness value and a motion blur value of an image;

[0127] perform image synthesis processing on each HCG image in the plurality of groups of image frames and the LCG image corresponding to the reference image frame to generate the first image.

[0128] In some embodiments of the present application, the device further includes a display module;

[0129] The display module is configured to display first prompt information in response to detecting the fireworks, the first prompt information being configured to recommend a shooting mode matching the fireworks portrait scene.

[0130] The receiving module is further configured to receive a second input of the first prompt information.

[0131] The processing module is further configured to start the fireworks portrait shooting mode in response to the second input.

[0132] The processing module is specifically configured to control the camera to shoot a first image based on shooting parameters corresponding to the shooting scene in response to the first input in the fireworks portrait shooting mode.

[0133] In some embodiments of the present application, the shooting preview interface includes a first control, and the first control is configured to select or switch a flash mode.

[0134] The processing module is further configured to turn on a flash function and update the first control to a second control in response to starting the fireworks portrait shooting mode, and the second control is configured to prompt that the fireworks portrait shooting mode has been started.

[0135] In some embodiments of the present application, the processing module is further configured to update the second control to a third control after displaying the second control for a reference time length, and the third control is configured to prompt that the shooting mode is the fireworks portrait shooting mode.

[0136] In a third aspect, embodiments of the present application provide an electronic device, which includes a processor and a memory, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the method according to the first aspect.

[0137] In a fourth aspect, embodiments of the present application provide a readable storage medium, the readable storage medium stores programs or instructions, and the programs or instructions are executed by a processor to implement the steps of the method according to the first aspect.

[0138] In a fifth aspect, embodiments of the present application provide a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run programs or instructions to implement the method according to the first aspect.

[0139] In a sixth aspect, embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method according to the first aspect.

[0140] In the embodiments of the present application, a first input to a shooting preview interface is received, and in response to the first input, a first image is shot by the camera based on shooting parameters corresponding to a shooting scene; wherein the first image includes fireworks and a portrait; through the scheme, when a scene including fireworks and a person is shot, the electronic device can shoot according to the shooting parameters corresponding to the shooting scene. In this way, the overexposure of the fireworks area and the insufficient exposure of the person area are avoided, so that the shape of the fireworks and the details of the person can be accurately captured, and the shooting effect is improved. BRIEF DESCRIPTION OF DRAWINGS

[0141] Figure 1 A flowchart of a shooting method provided for some embodiments of the present application;

[0142] Figure 2A A schematic diagram of a shooting preview interface provided for some embodiments of the present application;

[0143] Figure 2B A schematic diagram of a shooting preview interface provided for some embodiments of the present application;

[0144] Figure 3 A schematic diagram of a linear relationship between a current value of a flash module and an ambient brightness value provided for some embodiments of the present application;

[0145] Figure 4 A schematic diagram of a face area proportion in a shooting preview interface provided for some embodiments of the present application;

[0146] Figure 5A A schematic diagram of a preview image of a face proportion provided for some embodiments of the present application;

[0147] Figure 5B A schematic diagram of a preview image of a face proportion provided for some embodiments of the present application;

[0148] Figure 5C A schematic diagram of a preview image of a face proportion provided for some embodiments of the present application;

[0149] Figure 6 A schematic diagram of a linear relationship between a face area proportion of a flash and a current adjustment ratio provided for some embodiments of the present application;

[0150] Figure 7A A schematic diagram of an image frame captured by a camera provided for some embodiments of the present application;

[0151] Figure 7B A schematic diagram of an image frame captured by a camera provided for some embodiments of the present application;

[0152] Figure 8A A schematic diagram of a shooting preview interface provided for some embodiments of the present application;

[0153] Figure 8B A schematic diagram of a shooting preview interface provided for some embodiments of the present application;

[0154] Figure 8C A schematic diagram of a shooting preview interface provided for some embodiments of the present application;

[0155] Figure 9 A flowchart of a shooting method provided for some embodiments of the present application;

[0156] Figure 10 A structural schematic diagram of a shooting device provided for some embodiments of the present application;

[0157] Figure 11 A structural schematic diagram of an electronic device provided for some embodiments of the present application;

[0158] Figure 12 A hardware structural schematic diagram of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION

[0159] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some, but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the present application.

[0160] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in an "or" relationship.

[0161] The terms "at least one", "at least one of", etc. in the specification and claims of the present application refer to any one of the objects, a combination of any two or more of the objects. For example, at least one of a, b and c can mean "a", "b", "c", "a and b", "a and c", "b and c", and "a, b and c", where a, b and c can be single or multiple. Similarly, "at least two" means two or more, and its meaning is similar to "at least one".

[0162] The terms used in the embodiments of the present application are used only to explain specific embodiments of the present application, and are not intended to limit the present application. The terms related to the embodiments of the present application are explained below.

[0163] The identifier in the present application is a word, symbol, image, etc. used to indicate information, which can take a control or other container as a carrier to display information, including but not limited to word identifier, symbol identifier, image identifier.

[0164] Control: refers to a graphical element that can be directly operated or perceived by the user in the interaction process, used to receive user input, trigger functions or display real-time information. It is a bridge for user interaction with device or application function, and realizes instruction transmission and state feedback through visual form.

[0165] Interface: refers to the graphical interaction layer seen by the user through the screen of the electronic device. That is, the "user interface (UI)", which is the medium interface for interaction and information exchange between the application program or operating system and the user, and it realizes the conversion between the internal form of information and the form that the user can accept. The user interface is the source code written by a specific computer language such as Java, XML, etc. The interface source code is parsed and rendered on the electronic device, and finally presented as content that the user can recognize. The common form of user interface is graphic user interface (GUI), which refers to the user interface related to computer operation displayed in a graphical manner. It can be a visible interface element such as text, icon, button, menu, tab, text box, dialog box, status bar, navigation bar, widget (Web widget, Widget) displayed in the display screen of the electronic device.

[0166] Application program: refers to a computer program developed and running on the operating system to complete one or more specific tasks. The application program runs in user mode, and it can interact with the user and has a visual user interface.

[0167] Shooting preview interface: is the interface that the user sees through the real-time viewfinder screen of the device before taking a photo, which is a visual interactive area rendered in real time after processing the image data captured by the camera sensor. It can be a GUI, and it can display visible interface elements such as buttons, navigation bars, Widgets, etc.

[0168] The execution subject of the shooting method provided by the embodiments of the present application can be a shooting device, which can be an electronic device, or a functional module or functional entity in an electronic device. The shooting method provided by the embodiments of the present application is described below by taking the shooting device as an example.

[0169] With reference to the accompanying drawings, the photographing method provided by the embodiments of the present application will be described in detail below in combination with specific examples and application scenarios.

[0170] The photographing method provided by the embodiments of the present application can be applied to a fireworks portrait photographing scenario. A specific scenario is to photograph a photo with blooming fireworks as the background and a person as the foreground, desiring that the photographed photo can accurately restore the shape of the fireworks, for example, the shape and color of the fireworks, and also ensure that the face and body details of the foreground person are clear; another specific scenario is to photograph a photo of a person A holding or closely contacting a small fireworks, for example, a photo of the person A holding a fairy wand type fireworks in a burning state, desiring that the photographed photo can accurately capture the shape and light effect of the small fireworks when burning, and also ensure that the person A holding the small fireworks is clear and detailed.

[0171] Figure 1 A flowchart of the photographing method provided by the embodiments of the present application is shown in FIG. 1, which can include the following steps 201 and 202. Figure 1

[0172] Step 201: The photographing device receives a first input to a photographing preview interface.

[0173] In some embodiments of the present application, the photographing preview interface can include a toolbar, a preview window, a camera mode option, an album shortcut control, a photographing control, and a camera flip control, as shown in FIG. 2. Figure 2A The photographing preview interface 20 includes a toolbar 21, a preview window 22, a “portrait” option, three photographing mode options of “photograph” and “video”, a preview pane 23, a photographing control 24, and a camera flip control 25.

[0174] For example, the toolbar 21 can be used to display one or more function controls, as shown in FIG. 3. Figure 2A The one or more function controls can include a flash control 21a, a live mode control 21b, an AI control 21c, a high pixel control 21d, a setting control 21e, and the like. It can be understood that the toolbar can also include more or fewer function controls, for example, it can also include a high dynamic range (HDR) control.

[0175] ​Exemplarily, the "photo" option is used to switch the shooting mode to the photo shooting mode; the "portrait" option is used to trigger the portrait shooting mode; the "video" option is used to switch the shooting mode to the video shooting mode; the preview pane 23 is used to preview the shooting effect in a smaller size; the shooting control 24 is used to trigger the shooting operation, when the user clicks the control, the electronic device will immediately shoot, record the picture in the current preview window, and generate a photo or video file; the camera flip control 25 is used to switch the front and rear cameras; the live mode control 21b is used to switch to the live shooting mode; the AI control 21c is used to start the AI-assisted shooting function; the high-pixel control 21d is used to start the high-pixel shooting mode; and the high dynamic range (HDR) control is used to turn on or off the high dynamic range shooting function.

[0176] Exemplarily, the preview window 22 can be used to display the preview image obtained after the image data is rendered in real time, and the preview window can also be referred to as a viewfinder. As shown in Figure 2A Exemplarily, in the scene of shooting a large fireworks portrait, the preview window 22 displays the preview image of the large fireworks and the portrait captured by the camera, which includes fireworks 26 and a portrait 27.

[0177] Exemplarily, the camera mode option can be a user-selectable preset function module, which is used to adapt to different shooting scenes or operation requirements, and realizes specific shooting effects or creative intentions by adjusting the combination of hardware parameters and software algorithms.

[0178] Exemplarily, in combination with Figure 2A As shown in Figure 2B Exemplarily, in the scene of shooting a small fireworks portrait, the preview window 22 displays the portrait 28 and the fairy wand type fireworks 29 held by the person A.

[0179] In some embodiments of the present application, the electronic device can display a shooting preview interface when starting the camera application, and the shooting preview interface is used to display the preview image captured by the camera.

[0180] In some embodiments of the present application, the above-mentioned shooting preview interface can be a shooting preview interface of the fireworks portrait shooting mode. Exemplarily, the above-mentioned shooting preview interface displays the preview image captured by the camera after entering the fireworks portrait shooting mode.

[0181] In some embodiments of the present application, the above-mentioned camera can include any one of the following: a wide-angle camera, a 2x camera, a telephoto camera, a long-range camera, and a depth-of-field camera, and the above-mentioned main camera can also be other cameras, and the embodiments of the present application do not make any limitation thereto.

[0182] In some embodiments of the present application, the above-mentioned camera can be a front camera or a rear camera of the electronic device, etc.

[0183] In some embodiments of the present application, the first input described above can include any of the following: a touch input of the user, a voice input, a gesture input, a folding or unfolding operation of the foldable screen, or other possible inputs, which are not limited in the embodiments of the present application. Further, the touch input described above can be a click input, a sliding input, a pressing input, etc. of the user. Further, the click operation described above can be any number of click operations. The sliding operation described above can be a sliding operation in any direction, such as upward sliding, downward sliding, leftward sliding, or rightward sliding, etc., which are not limited in the embodiments of the present application.

[0184] In some embodiments of the present application, the first input described above is used to trigger image shooting or video recording, that is, to control the electronic device to shoot a photo or record a video.

[0185] For example, the first input described above can be a touch input of the user on a shooting control in the shooting preview interface, or a folding input of folding the foldable screen, or a sliding input in the shooting preview interface. For example, in combination with the above Figure 2A Or Figure 2B The first input is a click input of the user on the shooting control 24 in the shooting preview interface.

[0186] Step 202: The shooting device controls the camera to shoot a first image based on the shooting parameter corresponding to the shooting scene in response to the first input.

[0187] The first image includes fireworks and a portrait.

[0188] It can be understood that the shooting scene described above includes fireworks and a person, and the brightness of the fireworks is greater than the brightness of the portrait.

[0189] In some embodiments of the present application, the fireworks described above can be large fireworks, medium fireworks, and fairy wand fireworks, etc.

[0190] It should be noted that the fireworks can be divided into large fireworks, medium fireworks, and small fireworks, etc. according to the size. Further, the small fireworks can be divided into small handheld fireworks, small airborne fireworks, and small ground rotating fireworks. For example, the small handheld fireworks can be fairy wand fireworks. For example, they can also be divided according to the effect of burning, such as jet fireworks, rotating fireworks, airborne fireworks, etc., which are not limited in the embodiments of the present application.

[0191] In some embodiments of the present application, the above-mentioned shooting scene is a real-time optical environment captured by the camera and containing specific luminance distribution characteristics. That is, the overall environment within the field of view of the camera, including the shooting object and its mutual relationship, such as luminance, light and dark contrast relationship, etc.

[0192] It can be understood that the difference between the luminance of the light-emitting area of the fireworks and the luminance of the body area of the person in the shooting scene is greater than the preset luminance threshold. That is, there are fireworks and portraits in the shooting scene with significant luminance difference.

[0193] In some examples, in a large fireworks portrait shooting scene, the shooting scene includes large fireworks set off in the sky and a person on the low-illumination ground. The average luminance of the set-off fireworks is usually greater than 1x10 4 lux, but the luminance of the person on the ground is usually less than 200 lux. Therefore, in the same shooting picture, there is a significant luminance difference between the light-emitting area of the set-off large fireworks and the body area of the person on the ground.

[0194] In some examples, in a small fireworks portrait shooting scene, the shooting scene includes a person A holding a fairy wand type fireworks in a set-off state. The luminance of the fairy wand type fireworks in the set-off state is usually greater than 1000 lux, but the luminance of the person in the dark is usually less than 200 lux. Therefore, in the same shooting picture, there is a significant luminance difference between the light-emitting area of the fairy wand type fireworks in the set-off state and the body area of the person holding the fairy wand type fireworks.

[0195] It should be noted that the light-emitting area of the fireworks can be the area where the high-light flame of the set-off fireworks is located, and the luminance of the light-emitting area of the fireworks can be the luminance of the area where the high-light flame of the fireworks is located.

[0196] In some embodiments of the present application, the above-mentioned fireworks can be background objects, and the above-mentioned portraits can be foreground objects. For example, in a large fireworks portrait shooting scene, the fireworks blooming in the sky are background objects, and the person on the ground is a foreground object.

[0197] In some embodiments of the present application, the above-mentioned fireworks can be foreground objects, and the above-mentioned portraits can be background objects. For example, in a small fireworks portrait shooting scene, small fireworks set off in front of a person are foreground objects, and the person is a background object.

[0198] In some embodiments of the present application, the above-mentioned fireworks and portraits can be located in the same space level, for example, the fireworks and the portraits are both foreground objects. For example, in a fairy wand type fireworks shooting scene, the fairy wand type fireworks in the set-off state and the person A holding the fairy wand are both foreground objects.

[0199] In some embodiments of the present application, the shooting parameter corresponding to the shooting scene includes a flash parameter; or the shooting parameter includes an exposure parameter, or the shooting parameter includes the flash parameter and the exposure parameter.

[0200] In some embodiments of the present application, the flash parameter includes a current value of the flash module; or the flash parameter includes a working mode of the flash module; or the flash parameter includes the current value and the working mode of the flash module.

[0201] In some embodiments of the present application, the exposure parameter includes an exposure time; or the exposure parameter includes an exposure gain; or the exposure parameter includes the exposure time and the exposure gain.

[0202] In some embodiments of the present application, the flash parameter can further include a power of the flash.

[0203] It should be noted that the current value of the flash module can be the current value for driving the flash to emit light.

[0204] In some embodiments of the present application, the working mode of the flash module can include a first working mode, a second working mode, a third working mode and a fourth working mode. In some examples, the working mode applied by the flash is related to the focal length of the camera, and different working modes correspond to different focal lengths of the camera.

[0205] It should be noted that the working mode of the flash module can be defined by the following parameter combinations:

[0206] 1) enabled illumination focal length components, such as starting a near-focus flash or a far-focus flash;

[0207] 2) driving current values of the illumination focal length components, such as a current value of the working current of the near-focus flash.

[0208] In some examples, the near-focus flash and the far-focus flash both use a Light Emitting Diode (LED) light source.

[0209] It should be noted that the near-focus flash can also be referred to as a near-field light supplement module, and the far-focus flash can also be referred to as a long-focus flash.

[0210] In some examples, in the first working mode, only the near-focus light LED1 is used, and the focal length of the camera can be 23mm.

[0211] It should be noted that the first working mode can also be referred to as a near-focus mode.

[0212] In some examples, in the second working mode, the near-focus lamp LED1 and the far-focus lamp LED2 are turned on simultaneously, and the current ratio of the near-focus lamp LED1 and the far-focus lamp LED2 is LED1:LED2=1:1, and the focal length of the camera can be 50mm.

[0213] In some examples, in the third working mode, the near-focus lamp LED1 and the far-focus lamp LED2 are turned on simultaneously, and the current ratio of the near-focus lamp LED1 and the far-focus lamp LED2 is LED1:LED2=1:3, and the focal length of the camera can be 85mm.

[0214] In some examples, in the third working mode, the far-focus lamp LED2 is turned on, and the focal length of the camera can be 200mm.

[0215] It should be noted that the beam angle of the near-focus LED is narrow, and the irradiation distance is short, the beam angle of the far-focus LED is wide, and the irradiation range is wide, and by enabling the near-focus LED or the far-focus LED, the optical focal length characteristics of the camera can be matched. For example, the near-focus lamp is adapted to a short focal length, such as 23mm, and the details of the objects at a short distance are illuminated by a narrow beam to shoot a clear image of the objects at a short distance, avoiding overexposure of the objects at a short distance. For another example, the far-focus lamp is adapted to a long focal length, such as 200mm, and the objects at a long distance are illuminated by a wide beam, so that a clear image of the objects at a long distance is captured.

[0216] It should be noted that when the flash module is turned on for light compensation, different current values are set for the near-focus flash and the far-focus flash to achieve accurate light compensation for the full focal length. When a medium-long focal length of 85mm is shot, the near-focus flash LED1 and the far-focus flash LED2 are turned on simultaneously, and the near-focus flash LED1 and the far-focus flash LED2 are set with different current values. High current is provided to the far-focus flash to make the far-focus flash output a high-intensity wide beam to cover the objects at a medium distance, so as to compensate for the insufficient light amount of the long-focus lens and ensure the overall brightness of the picture. Low current is provided to the near-focus flash to make the near-focus flash output a narrow beam to accurately capture the details of the objects at a short distance, avoiding overexposure caused by high light overflow. By controlling the current values of the working currents of the near-focus flash and the far-focus flash, the light output intensity and the irradiation range are accurately matched, so that accurate light compensation for the full focal length in a high dynamic scene is achieved.

[0217] In some embodiments of the present application, the exposure time described above can include at least one of an exposure start time, an exposure duration, and an exposure end time.

[0218] It should be noted that the exposure duration refers to the length of time during which the sensor of the camera continuously receives light, and the unit is usually seconds (s) or milliseconds (ms). For example, the exposure time is 1 / 500s, that is, the sensor completes light signal acquisition within 1 / 500 seconds.

[0219] It should be noted that the longer the exposure duration, the more light the sensor receives, the brighter the captured image, and vice versa.

[0220] In some embodiments of the present application, the above-mentioned exposure gain refers to the amplification multiple of the sensor output signal of the camera, and the size of the exposure gain affects the image brightness, and the unit is usually decibel (dB) or multiple, such as x2, x4.

[0221] It should be noted that in a high-brightness environment, the exposure gain is reduced to avoid overexposure of the image, and in a low-brightness environment, the exposure gain is increased to highlight the image details.

[0222] In some embodiments of the present application, the shooting device determines the shooting parameters corresponding to the shooting scene during the shooting preview process or after receiving the first input, and controls the camera to shoot the first image based on the shooting parameters.

[0223] In some examples, in a large fireworks portrait shooting scene, the shooting scene includes large fireworks fired in the sky and a person on the low-illumination ground, and the shooting device determines the flash parameters and exposure parameters of the large fireworks portrait shooting scene in response to the first input triggering shooting, and controls the camera to shoot the fireworks portrait photo based on the flash parameters and exposure parameters.

[0224] In some examples, in a small fireworks portrait shooting scene, the shooting scene includes a person A holding a fairy wand type fireworks in a firing state, and the shooting device determines the flash parameters and exposure parameters of the small fireworks portrait shooting scene in response to the first input triggering shooting, and controls the camera to shoot the fireworks portrait photo based on the flash parameters and exposure parameters.

[0225] The shooting method provided by the embodiments of the present application receives a first input to a shooting preview interface, and in response to the first input, controls the camera to shoot a first image based on shooting parameters corresponding to a shooting scene; wherein the first image includes fireworks and a portrait. Through this method, when a scene including fireworks and a portrait is shot, the electronic device can shoot according to the shooting parameters corresponding to the shooting scene, so that the shooting scene can be shot using shooting parameters matched with the shooting scene. In this way, overexposure of the fireworks area and insufficient exposure of the person area are avoided, so that the shape of the fireworks and the details of the person can be accurately captured, and the shooting effect is improved.

[0226] In some embodiments of the present application, before the step 202 of controlling the camera to shoot according to the shooting parameters corresponding to the shooting scene, the shooting method provided by the embodiments of the present application can further include the following step 203:

[0227] Step 203: The photographing apparatus determines the photographing parameter corresponding to the photographing scene according to the reference information.

[0228] The reference information includes at least one of the following: ambient brightness information, a proportion of the person in the preview image collected by the camera, focal length information of the camera, and acoustic information of the fireworks.

[0229] In some embodiments of the present application, when the photographing parameter includes a flash parameter, the reference information includes:

[0230] ambient brightness information;

[0231] or, the ambient brightness information and the proportion of the person in the preview image collected by the camera;

[0232] or, the ambient brightness information, the proportion of the person in the preview image, and the focal length information of the camera;

[0233] or, a weighted brightness value of the preview image collected by the camera, the weighted brightness value being obtained by weighting the brightness values of the face region, the highlight region, and the transition region in the preview image;

[0234] or, the weighted brightness value of the preview image collected by the camera and the focal length information of the camera.

[0235] In some embodiments of the present application, when the photographing parameter includes an exposure parameter, the reference information includes:

[0236] the type of the fireworks;

[0237] or, the acoustic information of the fireworks;

[0238] or, the type of the fireworks and the acoustic information of the fireworks.

[0239] In some embodiments of the present application, the photographing apparatus can determine the photographing parameter corresponding to the photographing scene according to the reference information after receiving the first input for triggering photographing, and control the camera to perform photographing according to the photographing parameter.

[0240] In some embodiments of the present application, the photographing apparatus can determine the photographing parameter corresponding to the photographing scene according to the reference information during the photographing preview process, control the camera to collect a preview image in real time through the photographing parameter, and display the preview image on a photographing preview interface.

[0241] In some examples, in a large fireworks portrait shooting scene, the shooting scene includes large fireworks fired in the sky and a person on the low-illumination ground. During shooting preview, the shooting device determines shooting parameters of the large fireworks portrait scene according to reference information, controls the camera to collect fireworks and portrait data in real time through the shooting parameters, and generates preview images in real time on the shooting preview interface.

[0242] In some examples, in a small fireworks portrait shooting scene, the shooting scene includes a person A holding a fairy wand type fireworks in a firing state. During shooting preview, the shooting device determines shooting parameters of the small fireworks portrait scene according to reference information, controls the camera to collect fairy wand type fireworks and portrait data in real time through the shooting parameters, and generates preview images in real time on the shooting preview interface.

[0243] In some embodiments of the present application, the environmental brightness information is used to represent the environmental brightness of the shooting scene.

[0244] In some embodiments of the present application, the shooting device can measure the incident light intensity through a light sensor to obtain environmental brightness information, such as an environmental brightness value. Illustratively, the above-mentioned light sensor can be a photodiode, a photoresistor, etc.

[0245] In some examples, in a scene of shooting large fireworks, the shooting device can measure the environmental brightness value through a photodiode to obtain the environmental brightness information.

[0246] In some embodiments of the present application, the shooting device can obtain the environmental brightness value by performing pixel-level analysis on the preview image collected by the camera and by counting the brightness information of the preview image.

[0247] In some examples, in a scene of shooting large fireworks, the shooting device can collect a preview image of the fired fireworks through the camera and count the brightness information of the preview image to obtain the environmental brightness value.

[0248] In some embodiments of the present application, the shooting device can determine the current value of the flash module according to the environmental brightness information, and different environmental brightness information can correspond to different current values.

[0249] It should be noted that the higher the environmental brightness, the smaller the current value to be used.

[0250] In some embodiments of the present application, the shooting device can use an automatic exposure control (AEC) algorithm to calculate the current value of the flash module according to the environmental brightness information.

[0251] It should be noted that the AEC is a closed-loop control algorithm in the camera system, which can be used to adjust the shooting parameters such as the flash current value, exposure time, sensor gain, etc.

[0252] In some embodiments of the present application, the proportion of the portrait in the preview image captured by the camera can be the proportion of the area where the complete portrait is located in the preview image, or the proportion of the face area in the portrait in the preview image.

[0253] In some embodiments of the present application, the shooting device can calculate the proportion of the portrait in the preview image captured by the camera, and adjust the current value of the flash module according to the proportion.

[0254] In some embodiments of the present application, the shooting device first determines the current value of the flash module according to the ambient brightness information, and then adjusts the current value according to the proportion of the portrait in the preview image captured by the camera.

[0255] In some examples, in the scene of shooting large fireworks, the shooting device can obtain the ambient brightness value through the light sensor, and determine the current value of the flash module according to the ambient brightness value, then count the proportion of the face of the person in the preview image in the entire preview image, and adjust the determined current value according to the proportion.

[0256] It should be noted that after the current value is initially calculated, it can be dynamically adjusted according to the distance of the object, so that the current value can be dynamically adjusted according to the distance of the object, and the precise light compensation of the flash can be realized.

[0257] In some embodiments of the present application, the focal length information of the camera can be the focal length used by the camera when shooting the first image.

[0258] In some embodiments of the present application, the shooting device can determine the working mode of the flash module according to the focal length information of the camera.

[0259] In some examples, the shooting device can determine the working mode of the flash module according to the determined current value of the flash module and the focal length information of the camera.

[0260] In some embodiments of the present application, the weighted brightness value of the preview image captured by the camera is the comprehensive brightness information generated by weighting and fusing the brightness values of the face area, the highlight area and the transition area in the preview image by giving different weight coefficients.

[0261] It should be noted that the face area refers to the face area of the portrait; the highlight area refers to the area where the high light of the fireworks is located, i.e. the bright area of the fireworks blooming; the transition area refers to the part in the image where the brightness gradually transitions from the highlight area to a darker area, such as the boundary area between the edge of the face and the background fireworks.

[0262] In some embodiments of the present application, the photographing apparatus can respectively count the luminance values of the face region, the highlight region and the transition region, perform a weighted operation on the luminance values of the multiple image regions to determine a final luminance value, and then calculate the current value of the flash module according to the final luminance value.

[0263] In some examples, in a large fireworks portrait shooting scene, the photographing apparatus divides the preview image into a face region, a highlight region of fireworks blooming in the air, and a transition region between the portrait and the highlight region of the fireworks, respectively counts the luminance values of the face region, the highlight region and the transition region, and finally gives different weights for the final light measurement calculation.

[0264] For example, assuming that the currently calculated luminance of the face region is L1, the luminance of the highlight region of the fireworks is L2, and the luminance of the transition region is L3, the final luminance value L = 0.65 x L1 + 0.3 x L2 + 0.05 x L3 is calculated according to the weight of the face region 0.65, the weight of the highlight region 0.3 and the weight of the transition region 0.05. For example, assuming that in a fireworks portrait shooting scene, the luminance L1 of the face region is 120 lux, the peak luminance L2 of the highlight region of the fireworks is 1000 lux, and the luminance L3 of the transition region between the portrait and the fireworks is 800 lux, the photographing apparatus calculates the weighted value according to the weight values a = 0.65, b = 0.3 and c = 0.05, and determines the weighted luminance value as 418 lux, i.e. L = 0.65 x 120 + 0.3 x 1000 + 0.05 x 800 = 418. In this way, when the luminance is counted, the exposure is more accurate by comprehensively considering the contents of the picture.

[0265] It should be noted that the weight values described above can also be referred to as weight coefficients.

[0266] It should be noted that the numerical values of the luminance listed in the embodiments of the present application are only used for exemplary description to intuitively show the luminance difference characteristics of different regions. In actual shooting, the specific luminance values may change due to the type of fireworks, environmental light and the like, and the embodiments of the present application do not make any limitation thereto.

[0267] In some embodiments of the present application, the photographing apparatus can use artificial intelligence (AI) scene detection to determine the type of fireworks.

[0268] In some embodiments of the present application, the photographing apparatus can determine the exposure parameter according to the type of fireworks, and different types correspond to different exposure parameters.

[0269] It should be noted that the explanation and description of the type of fireworks can refer to the description of the above embodiments, and will not be repeated here to avoid repetition.

[0270] In some embodiments of the present application, the photographing apparatus can collect a sound wave signal of the firework through a microphone, perform feature extraction processing on the sound wave signal, extract acoustic information, and determine an exposure time of the firework based on the acoustic information, and photograph the firework at the exposure time.

[0271] It should be noted that the sound wave signal can also be referred to as acoustic signal.

[0272] In some embodiments of the present application, the acoustic information of the firework can include frequency spectrum energy, frequency spectrum, amplitude spectrum, power spectrum, etc.

[0273] It can be understood that the exposure time of the firework can be a starting exposure time.

[0274] In some examples, in a large firework portrait photographing scene, the photographing apparatus can capture an explosion sound wave of the firework through a microphone, extract acoustic information of the firework based on the explosion sound wave, and predict a rising period, a peak period, and a decay period of the firework according to the acoustic information, prepare an exposure time for the peak period in advance at the rising period, so as to accurately capture the state of the firework at the peak period. In this way, the exposure is dynamically adjusted according to the firework at different periods, so that the exposure is more flexible and accurate.

[0275] In the embodiments of the present application, the photographing apparatus can determine photographing parameters such as exposure time, gain, and flash current that are suitable for an actual firework portrait photographing scene according to environmental brightness value, face proportion, focal length, weighted brightness value of a preview image, firework type, acoustic information of the firework, etc., and perform photographing through the photographing parameters, so as to accurately capture the shape of the firework and the details of the person, and further improve the photographing effect.

[0276] It should be noted that the above step 203 can be performed before the above step 201 or after the above step 201, and the embodiments of the present application do not limit this.

[0277] In some embodiments of the present application, the photographing parameters include a current value of a flash module; for example, the above step 203 can include the following step 203a1 and step 203a2:

[0278] Step 203a1: The photographing apparatus acquires environmental brightness information.

[0279] The above environmental brightness information represents an environmental brightness value of a photographing scene.

[0280] Step 203a2: The photographing apparatus determines the current value of the flash module according to the environmental brightness information and a first mapping relationship.

[0281] In some embodiments of the present application, the first mapping relationship is a mapping relationship between the ambient brightness value and the current value of the flash module.

[0282] It should be noted that the process of obtaining the ambient brightness information by the photographing apparatus can be described in the above embodiments, and thus will not be described herein again.

[0283] In some embodiments of the present application, the first mapping relationship is a functional relationship between the ambient brightness value and the flash current value.

[0284] In some examples, the first mapping relationship can be a linear relationship between the current value I of the flash module and the ambient brightness value L, which is represented as I=k×L+b; wherein k is a slope, b is an intercept, and k and b are preset values. For example, assuming that k is -1 and b is 700, when the photographing apparatus detects that the ambient brightness value L is equal to 100 lux through the ambient brightness sensor, the calculated flash current value I is equal to 600 mA, i.e., I=(-1)×100+700=600; when it is detected that the ambient brightness value L is equal to 450 lux, the calculated flash current value I is equal to 250 mA, i.e., I=(-1)×450+700=250.

[0285] In some examples, the first mapping relationship can be a nonlinear relationship between the current value I of the flash module and the ambient brightness value L.

[0286] In some examples, the first mapping relationship can be represented as an ambient brightness value-current value corresponding table, and the current value corresponding to the ambient brightness value is obtained by looking up the table.

[0287] In some embodiments of the present application, the current value of the flash module is less than or equal to a first current value, and the current value of the flash module is greater than or equal to a second current value.

[0288] In some embodiments of the present application, the photographing apparatus counts the ambient brightness value L through the light sensor, and calculates the current value I of the flash module according to the ambient brightness, so as to realize different current values under different ambient brightnesses by linear interpolation, and the higher the ambient brightness is, the smaller the current value to be used is.

[0289] It should be noted that the first current value can be a preset maximum current value, represented as Dmax, and the second current value can be a preset minimum current value, represented as Dmin. For example, the maximum current value Dmax is set to 600 mA, and the minimum current value Dmin is set to 100 mA.

[0290] Exemplarily, Figure 3 A schematic diagram of a linear relationship between the current value I of the flash module and the ambient brightness value L is shown in FIG. 1. Figure 3As shown, the vertical axis represents the current value of the flash module, wherein the minimum current value of the flash module is Dmin, and the maximum current value of the flash module is Dmax, the horizontal axis represents the ambient brightness value, the ambient brightness value L1 corresponds to Dmax, the ambient brightness value L2 corresponds to Dmin, and the broken line represents the linear relationship between the ambient brightness value and the current value of the flash module. Assuming that the maximum current value Dmax is set to 600 mA and the minimum value Dmin is 100 mA. Then the ambient brightness L1 is 100, and the ambient brightness L2 is 600. If the statistical ambient brightness L is 500 at this time, the current value I used is 200 mA.

[0291] It should be noted that, in order to prevent the flash from being burned out or the brightness being too low, the maximum value Dmax and the minimum value Dmin of the current are limited. The Dmax value can be determined by the hardware specifications of the flash itself and the maximum current that can be actually measured, and the Dmin value can be determined according to the effect requirement, for example, the image brightness captured in a dark environment cannot be less than a certain value, and the current value determined according to this value is the corresponding Dmin.

[0292] In the embodiments of the present application, the shooting device can control the light-emitting intensity of the flash based on the current value of the flash module, and then adjust the light compensation amount. For example, in a dark environment, assuming that the ambient brightness value is 50 lux, the flash current value I1 is equal to 600 mA; in a medium brightness environment, assuming that the ambient brightness value L2 is 200 lux, the flash current value I2 is equal to 500 mA; and in a high brightness environment, the ambient brightness value L3 is 450 lux, and the flash current value I3 is equal to 250 mA. In this way, the light-emitting intensity of the flash is controlled by the calculated current value, the greater the current value, the stronger the light-emitting intensity of the flash, and the greater the light compensation amount, so that when the ambient brightness is dark, the flash is driven with a larger current value to output a light pulse with a larger light intensity, thereby increasing the light compensation amount and avoiding the blur caused by underexposure of the portrait, and when the ambient brightness is bright, the flash is driven with a smaller current value to output a light pulse with a smaller light intensity, thereby reducing the light compensation amount and avoiding the loss of shape details caused by overexposure of the fireworks.

[0293] The process of determining the shooting parameters corresponding to the shooting scene is exemplarily described below in combination with the shooting scene.

[0294] Taking the shooting of a fireworks portrait scene as an example, when the shooting device shoots the fireworks portrait, the ambient brightness value L is counted by the light sensor, and the current value I of the flash module is calculated according to the ambient brightness. If the statistical ambient brightness value L is 500 lux at this time, the current value I used is 200 mA.

[0295] In some embodiments of the present application, the shooting device can send the current value of the flash module to the flash driving circuit to control the flash driving circuit to realize brightness compensation.

[0296] In the embodiments of the present application, the photographing apparatus detects the current environment, calculates a suitable current value of the flash module according to the brightness of the current environment and the distance of the person, and controls the flash to output a light pulse for light compensation through the current value, so as to ensure that the brightness of the photographed portrait is moderate, the facial details are clear, and the shape details of the photographed fireworks are clear, thereby improving the photographing effect.

[0297] In some embodiments of the present application, after the step 203a2, the photographing method provided by the embodiments of the present application can further include the following steps 203a3 to 203a5:

[0298] Step 203a3: The photographing apparatus calculates the proportion of the face region of the person in the preview image collected by the camera.

[0299] Step 203a4: The photographing apparatus determines the current adjustment ratio according to the proportion of the face region and a second mapping relationship.

[0300] The second mapping relationship is a mapping relationship between the proportion of the face region and the current adjustment ratio.

[0301] Step 203a5: The photographing apparatus adjusts the current value of the flash module according to the current adjustment ratio.

[0302] In some embodiments of the present application, the photographing apparatus can obtain the size of the face region in the preview image, and calculate the ratio of the size of the face region in the entire preview image to obtain the proportion of the face region.

[0303] In some embodiments of the present application, by defining the current adjustment ratio as R and the proportion of the face region in the preview image as S, the distance is determined according to the proportion of the face region in the preview image, that is, the larger the S is, the closer the current distance is, and a smaller current is used to avoid over-light compensation. On the contrary, it indicates that the distance is farther, and a larger current is needed to ensure sufficient light compensation.

[0304] In some examples, in combination with the above Figure 2A or Figure 2B For example Figure 4As shown, the portrait and fireworks are included in the shooting preview interface 20, and the rectangular frame 41 is the face region, and the face proportion S is calculated according to the upper frame position y, the left frame position x, the width Fx, the height Fy of the rectangular frame, and the pixel value of the picture. For example, S = Fx * Fy / picture pixel value, the larger S is, the larger the face in the picture or the preview image is. For example, assuming that the pixel value of the preview image is 1036800, and the face rectangular frame parameters are Fx = 400 and Fy = 400, the face region area is 160000, i.e., 400 * 400 = 160000, and the face region proportion is about 7.72%, i.e., S = 160000 / 1036800 ≈ 0.0772, which means that the face region occupies about 7.72% of the area of the preview image.

[0305] It should be noted that, Figure 4 The rectangular frame of the face of the portrait 27 in FIG. 6 is for the purpose of illustrating the face region in the preview image and the calculation of the face proportion, and the rectangular frame can not be displayed in the actual shooting preview interface.

[0306] In some examples, Figure 5A to Figure 5C The schematic diagram of the preview image for different face proportions is shown in FIG. 6. As shown in FIG. 6, Figure 5A As shown in FIG. 6, the preview image is displayed in the shooting preview interface 51, the upper body of the person in the preview image occupies about 50% of the area of the preview image, and the area proportion S of the face region 52 is about 0.25. At this time, the relative position relationship between the person subject and the background indicates that the person is close to the camera, and a small flash current value can be used to avoid overexposure to capture clear face details.

[0307] In some examples, as shown in FIG. 6, Figure 5B As shown in FIG. 6, the preview image is displayed in the shooting preview interface 51, the person in the image is in a full-body pose, and the area proportion S of the face region 53 is about 0.15. At this time, the relative position relationship between the person subject and the background indicates that the person is far from the camera, and the flash current value needs to be increased to increase the compensation exposure to capture clear face details.

[0308] In some examples, as shown in FIG. 6, Figure 5C As shown in FIG. 6, when the shooting distance is further increased, the full-body portrait occupies about 1 / 3 of the area of the preview image, and the area proportion S of the face region 54 is about 0.05. At this time, since the shooting distance is far, a larger flash current value needs to be used for compensation to ensure that a clearer portrait is captured.

[0309] It should be noted that after the current value is calculated based on the environmental brightness value, the current value can be dynamically adjusted according to the distance of the shooting object, thereby avoiding the problem that when a single fixed current value is used, the flash compensation light is too strong when the person subject is close, or the flash compensation light is insufficient when the person subject is far.

[0310] In some embodiments of the present application, the second mapping relationship described above can be a linear relationship between the proportion of the face region in the shooting preview interface and the current adjustment ratio R, represented as R=a*S+c; where a is the slope, c is the intercept, and a and c are preset values. For example, assuming a=-10 and c=3, when the proportion of the face region S=0.15, the current adjustment ratio R is equal to 1.175, i.e., R=(-10)*0.15+3=1.5.

[0311] Exemplarily, Figure 6 A schematic diagram of the linear relationship between the proportion S of the face region of the flash and the current adjustment ratio R is shown in FIG. 3. Figure 6 As shown in FIG. 3, the vertical axis represents the current adjustment ratio R, where the minimum value of the current adjustment ratio R is R1 and the maximum value of the current adjustment ratio R is R2. The horizontal axis represents the face proportion, i.e., the proportion of the face region, where the minimum value of the face proportion is S1 corresponding to the current adjustment value R2, and the maximum value of the face proportion is S2 corresponding to the current adjustment value R1. The broken line represents the linear relationship between the face proportion and the current adjustment value. Assuming that the current adjustment ratio R1=0.5 and R2=2.5 are set. The proportion of the face S1=0.25 and S2=0.05. If the calculated face proportion at this time is 0.25, the current adjustment ratio R value is 2.5.

[0312] In some embodiments of the present application, the shooting device can calculate the product of the current value determined by the current adjustment ratio to obtain a new current value, and adjust the current value of the flash module to the new current value.

[0313] In combination with the above example, in some examples, the current adjustment ratio R1=0.5 and R2=2.5 are set, the proportion of the face S1=0.25 and S2=0.05, where the face proportion S1 corresponds to the current adjustment ratio R2, and the face proportion S2 corresponds to the current adjustment ratio R1. If the calculated face proportion at this time is 0.1, according to the linear function R=a*S+c of the second mapping relationship, R is 2, i.e., R=(-10)*0.1+3. Assuming that the current value of the flash module determined is 200 mA, the final current value used is 400 mA, i.e., 200*2=400 mA. In this way, the current adjustment ratio and the face proportion are controlled through linear interpolation, and the calculated current value is multiplied by the ratio R to obtain a new current value to achieve adaptive light compensation according to the object distance.

[0314] In the embodiments of the present application, through the mapping relationship between the face proportion and the current value adjustment ratio, the current value can be dynamically adjusted according to the proportion of the face region of the person in the preview image, so as to ensure that the face details can be well preserved in the captured image when capturing persons at different distances, and the problems of underexposure of the face due to insufficient light or overexposure of the face due to excessive light compensation when the person is close can be avoided, thereby improving the shooting quality.

[0315] In some embodiments of the present application, the shooting parameter includes a current value of the flash module; for example, the step 203 can include the following steps 203b1 to 203b4:

[0316] Step 203b1: The shooting device divides the preview image captured by the camera into a face region, a highlight region, and a transition region.

[0317] Step 203b2: The shooting device counts a first brightness value of the face region, a second brightness value of the highlight region, and a third brightness value of the transition region.

[0318] The face region corresponds to a first brightness weight, the highlight region corresponds to a second brightness weight, and the transition region corresponds to a third brightness weight.

[0319] Step 203b3: The shooting device performs weighted operation on the first brightness value, the second brightness value, and the third brightness value based on the first brightness weight, the second brightness weight, and the third brightness weight to calculate a weighted brightness value of the preview image.

[0320] Step 203b4: The shooting device determines the current value of the flash module according to the weighted brightness value of the preview image and a third mapping relationship.

[0321] The third mapping relationship is a mapping relationship between the weighted brightness value of the preview image and the current value of the flash module.

[0322] It should be noted that the explanation of the face region, the highlight region, and the transition region can refer to the description of the above embodiments, and will not be repeated here to avoid repetition.

[0323] In some embodiments of the present application, the first brightness weight, the second brightness weight, and the third brightness weight can be different from each other or at least partially the same.

[0324] In some embodiments of the present application, the first brightness weight can be set according to the brightness characteristics of the face region and the target brightness value of the face region in the captured image, the second brightness weight can be set according to the brightness characteristics of the highlight region and the target brightness value of the highlight region in the captured image, and the third brightness weight can be set according to the brightness characteristics of the transition region.

[0325] It should be noted that in the fireworks portrait shooting scene, the face area is usually dark, in order to ensure that the face area is not too dark, a higher weight can be given to the face area, so as to improve the brightness of the face area in the photographed photo; the highlight area of the fireworks is usually bright, in order to ensure that the clear shape of the fireworks highlight can be photographed, the weight of the highlight area can be set to be lower than the weight of the face area and higher than the weight of the transition area, so that the brightness of the fireworks highlight in the photographed photo is moderate; the transition area is usually not the area of interest of the user, so a smaller weight can be given to ensure that the transition between the fireworks highlight area and the portrait area is natural.

[0326] It should be noted that the target brightness value of the face area refers to the expected brightness value of the face area in the preview image, that is, the ideal brightness value to be achieved. Similarly, the target brightness value of the highlight area refers to the expected brightness value of the highlight area in the preview image. The above target brightness value is only used for illustrative purposes and does not limit the protection scope of the present application. Those skilled in the art can set the target brightness value according to actual needs.

[0327] Table 1 is an example of the corresponding weight and target brightness of the face area, the highlight area and the transition area.

[0328] Table 1

[0329] Region Type Weight Target Brightness Value Face Region 65% 120-140 Highlight Region 30% 200-220 Transition Region 5% Adaptive

[0330] In some embodiments of the present application, the shooting device locates the face area in the preview image through a face detection algorithm, identifies the highlight area of the fireworks in the preview image through a detection algorithm, and classifies the remaining area as a transition area. Illustratively, the above detection algorithm can be a brightness threshold segmentation algorithm, a gradient analysis algorithm, etc.

[0331] In some embodiments of the present application, the shooting device intelligently divides the preview image into a face area, a fireworks highlight area and a transition area through an AI algorithm.

[0332] In some embodiments of the present application, the shooting device calculates the brightness value of each area, and calculates the final brightness value, i.e. the target brightness value of the preview image, based on the weight value and the brightness value of each area. In other words, the shooting device can calculate and count different areas, and finally give different weights for the final light measurement calculation.

[0333] In some examples, taking a large fireworks portrait shooting scene as an example, the preview image captured by the camera includes a large fireworks fired in the sky and a person on the ground in low illumination. The shooting device uses an AI algorithm to segment the preview image into a face region, a highlight region of the large fireworks, and a transition region, then calculates the brightness value L1 of the face region as 130, the brightness value L2 of the highlight region as 240, and the brightness value L3 of the transition region as 80, assuming that the brightness weight of the face region is 0.65, the brightness weight of the highlight region is 0.3, and the brightness weight of the transition region is 0.05, the shooting device performs weighted operation on L1, L2, and L3 based on the brightness weight of the face region as 0.65, the brightness weight of the highlight region, and the brightness weight of the transition region, and calculates the weighted brightness value of the preview image as 160.5, that is, L = 0.65 * 130 + 0.3 * 240 + 0.05 * 80.

[0334] In some examples, taking a small fireworks portrait shooting scene as an example, the preview image captured by the camera includes a person A holding a fairy wand type fireworks. The shooting device uses an AI algorithm to segment the preview image into a face region, a highlight region of the fairy wand type fireworks, and a transition region, then calculates the brightness value L1 of the face region as 100, the brightness value L2 of the highlight region as 140, and the brightness value L3 of the transition region as 120, assuming that the brightness weight of the face region is 0.65, the brightness weight of the highlight region is 0.3, and the brightness weight of the transition region is 0.05, the shooting device performs weighted operation on L1, L2, and L3 based on the brightness weight of the face region as 0.65, the brightness weight of the highlight region, and the brightness weight of the transition region, and calculates the weighted brightness value of the preview image as 113, that is, L = 0.65 * 100 + 0.3 * 140 + 0.05 * 120.

[0335] In some embodiments of the present application, the shooting device can determine the current value of the flash module based on the weighted brightness value and the third mapping relationship.

[0336] The third mapping relationship between the weighted brightness value of the preview image and the current value of the flash module can be represented as L = m * L + n; where m is the slope, n is the intercept, and m, n are preset values. For example, assuming that m is 0.15 and n is 100, when the shooting device calculates the weighted brightness value L of the preview image as 160.5, the flash current value I is calculated as 124.075 mA, that is, I = 0.15 * 160.5 + 100 = 124.075.

[0337] In the embodiments of the present application, when the brightness is counted, the brightness distribution characteristics and importance of the face region, the highlight region, and the transition region in the preview image can be considered comprehensively by combining AI detection partition weight metering, thereby improving the accuracy of exposure.

[0338] In some embodiments of the present application, the shooting parameter includes a working mode of the flash module; and the step 203 may, for example, include the following step 203c:

[0339] Step 203c: The shooting device determines the working mode of the flash module according to the focal length information of the camera.

[0340] In some embodiments of the present application, the focal length information of the camera may be 23mm, 50mm, 85mm or 200mm, etc.

[0341] It should be noted that the working mode of the flash module is explained in the description of the above embodiments, which will not be repeated here.

[0342] The process of determining the working mode of the flash module according to the focal length information of the camera is explained as follows.

[0343] In some examples, taking the shooting of fireworks portrait scene as an example, when shooting fireworks portrait at night, the traditional flash is prone to overexposure of the nearby person or underexposure of the fireworks due to the fixed beam angle.

[0344] In the embodiments of the present application, the shooting device dynamically adjusts the working mode of the flash module according to the focal length of the camera, realizes accurate light compensation, and thus takes into account both the light compensation of the face of the person and the level of the fireworks background. For example, the shooting device detects the ambient brightness through a light sensor, combines the proportion of the face area of the person in the preview image, and obtains a target current value. Then, the obtained target current value, such as 200mA, is sent to the flash driving module in real time, the focal length currently used by the camera module is obtained, for example, 50mm, and the working mode is matched according to the corresponding relationship between the focal length and the working mode.

[0345] For example, the corresponding relationship between the focal length and the working mode is as follows:

[0346] 1) The focal length is 23mm, and the near-focus lamp LED1 is used;

[0347] 2) The focal length is 50mm, the near-focus lamp LED1 and the far-focus lamp LED2 are turned on at the same time, and the current ratio is LED1:LED2=1:1;

[0348] 3) The focal length is 85mm, the near-focus lamp LED1 and the far-focus lamp LED2 are turned on at the same time, and the current ratio is LED1:LED2=1:3;

[0349] 4) The focal length is 200mm, and only the far-focus lamp LED2 is used.

[0350] It should be noted that the working mode of the flash in the photographing method provided in the present application can also be referred to as a light-on combination configuration.

[0351] In some embodiments of the present application, the flash module described above comprises a close-focus flash and a far-focus flash. For example, the step 203c described above can be implemented through at least one of the following steps 203c1 to 203c4.

[0352] Step 203c1: In the case where the photographing focal length of the camera is a first focal length, the photographing device turns on the close-focus flash and sets the working current of the close-focus flash to a first current value.

[0353] Step 203c2: In the case where the photographing focal length of the camera is a second focal length, the photographing device turns on the close-focus flash and the far-focus flash and sets the current values of the working currents of the close-focus flash and the far-focus flash according to a first current ratio; the current ratio of the close-focus flash to the far-focus flash is 1:1.

[0354] Step 203c3: In the case where the photographing focal length of the camera is a third focal length, the photographing device turns on the close-focus flash and the far-focus flash and sets the current values of the working currents of the close-focus flash and the far-focus flash according to a second current ratio; the current ratio of the close-focus flash to the far-focus flash is 1:3.

[0355] Step 203c4: In the case where the photographing focal length of the camera is a fourth focal length, the photographing device turns on the far-focus flash and sets the working current of the far-focus flash to a second current value.

[0356] Wherein, the first focal length is less than the second focal length, the second focal length is less than the third focal length, and the third focal length is less than the fourth focal length.

[0357] In some embodiments of the present application, the first focal length can be any focal length in the focal length range of [25mm, 50mm), the second focal length can be any focal length in the focal length range of [50mm, 85mm), the third focal length can be any focal length in the focal length range of [85mm, 200mm), and the fourth focal length can be any focal length of 200mm or more.

[0358] In some examples, the first focal length can be 23mm, the second focal length can be 50mm, the third focal length can be 85mm, and the fourth focal length can be 200mm.

[0359] It should be noted that the focal lengths described above are only used for illustrative purposes and do not constitute a limitation on the present application.

[0360] In some examples, when shooting a fireworks portrait scene, assuming that the person is about 0.8 m away from the lens, and the background is fireworks about 5 m away from the camera. When the shooting device detects that the current shooting focal length is 23 mm focal length, and the current of the flash module is 400 mA, the shooting device determines that the working mode of the flash module is: LED1 is turned on, and the current distribution is that LED1 is 400 mA. In this way, the wide beam of the telephoto lamp is prevented from diffusing to the background to cause overexposure of the fireworks, and the clarity of the close-range portrait in the fireworks portrait scene is ensured.

[0361] In some examples, when shooting a fireworks portrait scene, assuming that the user switches to 50 mm focal length to shoot a fireworks portrait, the person is 1.5 m away from the lens, and the background is medium-sized fireworks about 10 m away from the lens. When the shooting device detects that the current shooting focal length is 50 mm focal length, and the current of the flash module is 400 mA, the shooting device determines that the working mode of the flash module is: LED1 and LED2 are turned on at the same time, and the current ratio is 1:1. Then the shooting mode controls LED1 and LED2 to be turned on, and the current distribution is that LED1 is 200 mA and LED2 is 200 mA, i.e. 400 mA x 50% = 200 mA. In this way, by simultaneously illuminating LED1 and LED2, the close-range portrait details and the medium-distance fireworks are synchronously illuminated through beam angle superposition, so that the levels and textures of the medium-distance fireworks in the fireworks portrait scene are well preserved, and the close-range portrait details are clear.

[0362] It should be noted that if the calculated current value is 400 mA, and assuming that the current 50 mm focal length is turned on, the default settings are determined according to the focal length information 50 mm and the current value 400 mA obtained at present, and finally it is determined that the close-range LED1 and the telephoto LED2 are turned on at the same time, and the current values of the two lamps are 200 mA and 200 mA respectively.

[0363] In some examples, when shooting a fireworks portrait scene, assuming that 85 mm focal length is used to shoot a close-up of a person's face, the person is 2.5 m away from the lens, and the background is a long-distance fireworks 15 m away. When the shooting device detects that the current shooting focal length is 85 mm focal length, and the current of the flash module is 400 mA, the shooting device determines that the working mode of the flash module is: LED1 and LED2 are turned on at the same time, and the current ratio is 1:3. Then the shooting mode controls LED1 and LED2 to be turned on, and the current distribution is that LED1 is 100 mA and LED2 is 300 mA, so that the exposure of the person's face is preferentially ensured, and the long-distance fireworks is illuminated, thereby improving the overall shooting effect.

[0364] In some examples, when shooting a fireworks portrait scene, it is assumed that the full body of the person and the panoramic view of the fireworks in the distance are shot by switching to a 200mm focal length, the person is 8m away from the lens, and the fireworks are 20m away from the lens. When the shooting device detects that the current shooting focal length is 200mm focal length and the current of the flash module is 400mA, the shooting device only starts the telephoto LED 2 and allocates a current of 400mA, thereby compensating for the distance attenuation by using a super-wide light beam to light the farther fireworks, while avoiding the interference of the close-up lamp with the person subject.

[0365] Currently, in night or complex lighting scenes, such as fireworks portrait shooting scenes, the flash in the related art adopts a fixed beam angle and a single light compensation strategy, which can cause problems such as overexposure of the person and underexposure of the background.

[0366] In the embodiments of the present application, by acquiring the focal length information of the camera in real time and dynamically adjusting the working mode of the flash based on the focal length information of the camera, the linkage of the focal length and the working mode of the flash is realized, so that the beam angle of the flash can match the change of the focal length, avoiding the disjointedness of avoiding the foreground being too dark or the background being overexposed, thereby providing a more accurate and effective light compensation solution for complex lighting scenes, and further improving the shooting effect.

[0367] In some embodiments of the present application, the shooting parameter includes an exposure parameter; and the step 203 can include the following steps 203d1 to 203d3:

[0368] Step 203d1: The shooting device determines the type of fireworks based on the preview image displayed on the shooting preview interface.

[0369] Step 203d2: The shooting device determines the exposure conversion coefficient according to the type of fireworks and a fourth mapping relationship.

[0370] The fourth mapping relationship is a mapping relationship between the type of fireworks and the exposure conversion coefficient.

[0371] Step 203d3: The shooting device adjusts the reference exposure parameter according to the exposure conversion coefficient to obtain the exposure parameter corresponding to the shooting object.

[0372] In some examples, the type of fireworks can be large fireworks, medium fireworks, fairy wand fireworks, etc.

[0373] It should be noted that the explanation of the type of fireworks can be referred to the description of the above embodiments, which will not be repeated here.

[0374] In some embodiments of the present application, the fourth mapping relationship can be a mapping relationship between the type of fireworks and the exposure conversion coefficient, wherein one type can correspond to one exposure conversion coefficient.

[0375] In some examples, the correspondence between the firework type and the exposure conversion coefficient Coef is shown in Table 2.

[0376] Table 2

[0377] Firework Type Coef Value Type 1 = Large Firework Coef 1 = 0.2 Type 2 = Fairy Rod Firework Coef 2 = 2 … … Type N Coef N = N

[0378] As shown in Table 2, when the firework type is large fireworks, the corresponding exposure conversion coefficient Coef value is 0.2; when the firework type is fairy wand fireworks, the corresponding exposure conversion coefficient Coef value is 2.

[0379] It should be noted that Table 2 is only an exemplary description of the correspondence between the firework type and the exposure conversion coefficient, and in actual application, the correspondence between the firework type and the exposure conversion coefficient can be set according to actual needs, and the embodiments of the present application do not limit this.

[0380] It should be noted that Table 2 includes the correspondence between the firework type and the exposure conversion coefficient. Therefore, Table 2 can also be referred to as a conversion coefficient configuration table.

[0381] In some examples, in a large firework portrait shooting scene, the shooting scene includes large fireworks fired in the sky and a person on the low-illumination ground, and the exposure conversion coefficient can be 0.2.

[0382] In some examples, in a small firework portrait shooting scene, the shooting scene includes a person A holding a fairy wand firework in a firing state, and the exposure conversion coefficient can be 2.

[0383] In some embodiments of the present application, the above-mentioned exposure conversion coefficient is used to adjust the reference exposure parameter, so that the exposure parameter matches the actual shooting object.

[0384] In some embodiments of the present application, the above-mentioned reference exposure parameter can include at least one of an exposure time and an exposure gain.

[0385] It should be noted that the exposure time can be represented as Exp0, and the exposure gain can be represented as Gain0.

[0386] It should be noted that the reference exposure parameter can be a preset exposure parameter or a default exposure parameter, and the reference exposure parameter can also be referred to as an initial exposure combination.

[0387] In some embodiments of the present application, the reference exposure parameter can include an exposure time, and the reference exposure parameter can also include an exposure gain. The shooting device can calculate the ratio of the exposure time and the exposure conversion coefficient to obtain the exposure time corresponding to the shooting object; the shooting device can calculate the product of the exposure gain and the exposure conversion coefficient to obtain the exposure gain corresponding to the shooting object.

[0388] In some examples, the photographing device sets the initial exposure combination to be an exposure time Exp0 and an exposure gain Gain0, and an exposure conversion coefficient Coef. When the photographing device detects the firework type through AI, and according to the current firework type, the exposure conversion coefficient configuration table, i.e., the above-mentioned table 2, is searched, and a new exposure combination Exp1 and Gain1 are calculated according to the corresponding exposure conversion coefficient value. The calculation formula of the new exposure combination Exp1 and Gain1 is as follows: Exp1 = Exp0 / Coef, Gain1 = Gain0*Coef.

[0389] In some examples, taking the photographing of a large firework portrait scene as an example, the preview image collected by the camera includes a large firework fired in the sky and a person on the low-illumination ground. The photographing device detects the firework type through AI to be a large firework, and determines the exposure conversion coefficient to be 0.2 by searching the exposure conversion coefficient configuration table. Assuming that the current initial exposure combination is: an exposure time Exp0 = 10 and a gain Gain0 = 20, then the new exposure parameters are determined based on the exposure conversion coefficient of 0.2 and the initial exposure combination as follows: an exposure time Exp1 = 50, i.e., Exp1 = Exp0 / Coef = 10 / 0.2 = 50; and a gain Gain1 = 4, i.e., Gain1 = Gain0*Coef = 20*0.2 = 4.

[0390] It should be noted that for the scene of photographing a large firework, the new exposure parameters Exp1 and Gain1 determined by the photographing device based on the type of the large firework have a longer exposure time and a smaller gain relative to the initial exposure parameters Exp0 and Gain0. In this way, by increasing the exposure time and reducing the gain, the trajectory of the firework flying in the air can be captured due to the long exposure time, a bright line is drawn in the night sky, and the effect of the firework pulling a string is accurately captured. At the same time, by reducing the gain, the loss of high-light details caused by overexposure of the firework is avoided, and thus the details of the firework can be accurately captured.

[0391] In some examples, taking the photographing of a small firework portrait scene as an example, the preview image collected by the camera includes a person A holding a fairy wand type firework. The photographing device detects the firework type through AI to be a fairy wand type firework, and determines the exposure conversion coefficient to be 2 by searching the exposure conversion coefficient configuration table. Assuming that the current initial exposure combination is: an exposure time Exp0 = 10 and a gain Gain0 = 20, then the new exposure parameters are determined based on the exposure conversion coefficient of 2 and the initial exposure combination as follows: an exposure time Exp1 = 5, i.e., Exp1 = Exp0 / Coef = 10 / 2 = 5; and a gain Gain1 = 40, i.e., Gain1 = Gain0*Coef = 20*2 = 40.

[0392] It should be noted that for the scene of shooting the fairy wand type small fireworks, the exposure time is reduced and the gain is increased for the new exposure parameters Exp1 and Gain1 determined by the shooting device based on the type of the fireworks relative to the initial exposure parameters Exp0 and Gain0. In this way, by increasing the exposure time, reducing the gain and shortening the exposure time, the fast bursting fireworks can be captured, the effect of improving the freeze ability is achieved, and the details of the fireworks can be accurately captured.

[0393] In some embodiments of the present application, the shooting device can determine the type of fireworks according to the AI scene detection result in the case of controlling the flash module to output a light pulse based on the current value of the flash module, and automatically convert the exposure parameters according to the type of fireworks, and then perform 3A convergence, and issue a shooting and frame grabbing instruction after the convergence is completed.

[0394] In some examples, taking the shooting of large fireworks portrait scene as an example, the shooting device controls the driving output current value, and after the flash is turned on, the AEC algorithm is used to determine the type of fireworks as large burst fireworks according to the AI scene detection result, and automatically convert the exposure parameters according to the type of fireworks, so as to achieve the effect of freezing and fireworks stringing, and then perform 3A convergence, and issue a shooting and frame grabbing instruction after the convergence is completed.

[0395] In some examples, taking the shooting of small fireworks portrait scene as an example, the shooting device controls the driving output current value, and after the flash is turned on, the AEC algorithm is used to determine the type of fireworks as fairy wand type fireworks according to the AI scene detection result, and automatically convert the exposure parameters according to the type of fireworks, so as to achieve the effect of accurate fireworks form, and then perform 3A convergence, and issue a shooting and frame grabbing instruction after the convergence is completed.

[0396] In the embodiments of the present application, the shooting device can perform AI detection on the shooting scene, and determine the type of fireworks according to different AI scene detection results, and then adaptively convert the exposure according to the type of fireworks. In this way, through shooting object type recognition and exposure parameter conversion, targeted exposure control is realized, overexposure of fireworks and underexposure of the person are avoided, the level of detail of the fireworks can be accurately captured, the fireworks form freezing or fireworks stringing effect is achieved, and the facial expression details of the person are accurately captured, so as to improve the shooting effect.

[0397] In some embodiments of the present application, the above shooting parameters include an exposure time, and the exposure time includes an exposure start time; for example, before the step 202, the shooting method provided by the embodiments of the present application can further include the following step 204:

[0398] Step 204: The shooting device predicts the time when the light radiation of the fireworks reaches the maximum value based on the acoustic information of the fireworks collected by the microphone, and determines the time when the light radiation of the fireworks reaches the maximum value as the exposure start time.

[0399] Exemplarily, in combination with step 204, step 202 can include steps 202a1 and 202a2 as follows:

[0400] Step 202a1: In response to the first input, the photographing apparatus controls the image sensor of the camera to be exposed at the exposure starting moment to generate image data.

[0401] Step 202a2: The photographing apparatus processes the image data to generate a first image and outputs the first image.

[0402] In some embodiments of the present application, the photographing apparatus can collect the acoustic wave signal of the firework in real time through the microphone during the preview shooting process, and perform feature analysis and extraction processing on the acoustic wave signal to determine the acoustic information of the firework.

[0403] It should be noted that the explanation of the acoustic information of the firework can be referred to the description of the above embodiments, and will not be repeated here.

[0404] In some embodiments of the present application, the photographing apparatus can capture the acoustic wave signal of the firework through the built-in microphone array.

[0405] In some embodiments of the present application, the photographing apparatus can collect the acoustic wave signal of the firework through the microphone when the firework in the burning state is detected through the light sensor or image recognition; or the photographing apparatus can continuously monitor the acoustic wave signal of the firework after starting the firework portrait shooting mode.

[0406] In some embodiments of the present application, the firework reaching the expected stage can be the firework reaching the peak period.

[0407] In some embodiments of the present application, the photographing apparatus can perform acoustic feature extraction on the acoustic wave signal of the firework to obtain acoustic features. Then, the acoustic features are analyzed by spectrum to determine the current stage of the firework and predict the moment when the firework reaches the expected stage.

[0408] In some embodiments of the present application, the photographing apparatus can analyze the acoustic signal of the firework explosion based on the acoustic energy release characteristics of the firework through the AI timing model to predict the moment when the firework reaches the peak period.

[0409] In some examples, taking the shooting of the firework portrait scene as an example, the photographing apparatus performs acoustic feature extraction on the explosion acoustic wave during the burning of the firework, and predicts the rising period, peak period or decay period of the firework according to the spectrum distribution of the acoustic wave signal.

[0410] In the embodiment of the present application, in the scene of shooting fireworks portrait, the shooting device realizes stage recognition by analyzing the time-frequency characteristics of the explosion sound wave of fireworks.

[0411] It should be noted that different burning stages of fireworks correspond to different energy release sizes, so the spectrum distribution of the sound wave signal of different stages has characteristic changes. Specifically, during the rising period of the fireworks, the high-frequency energy of the sound wave signal rapidly increases, the low-frequency energy proportion suddenly increases during the peak period, and both the high-frequency energy and the low-frequency energy rapidly decay during the decay period.

[0412] In some embodiments of the present application, the shooting device controls the image sensor of the camera to perform photoelectric conversion processing at the exposure starting moment to obtain original image data. Then, the image data is processed by the image processor for denoising, enhancement, etc. Finally, the processed image data is encoded by the encoder to generate the first image.

[0413] In some examples, in combination with the above examples, taking the scene of shooting fireworks portrait as an example, the shooting device extracts the acoustic characteristics of the explosion sound wave during the fireworks burning process, and predicts that the fireworks will reach the peak period after 50 ms according to the spectrum distribution, so as to configure the exposure parameter in advance and control the image sensor to expose at the 50th ms to complete the collection of image data. Then, the image data is compressed and encoded to obtain an image of the fireworks with bright and clear details of the high-light flame.

[0414] It should be noted that it takes a certain time for the fireworks to rise and explode completely. According to the explosion sound wave of the fireworks captured by the microphone of the mobile phone, the rising period, the peak period and the decay period of the fireworks are predicted, the exposure time for the peak period is prepared in advance during the rising period, and the state of the fireworks at the peak period is accurately captured. In this way, the development stage of the fireworks is predicted by capturing the sound wave of the fireworks by the mobile phone, and the exposure is dynamically adjusted according to the fireworks at different periods, for example, the exposure parameter is prepared in advance during the rising period, and the fireworks are captured at the moment when the fireworks reach the peak period, so that the details of the fireworks at the peak period can be captured, the exposure is more flexible and accurate, and the imaging quality is improved.

[0415] In the embodiment of the present application, the shooting device captures the sound wave signal of the fireworks, and realizes stage recognition and prediction of the life cycle of the fireworks by feature extraction and analysis of the sound wave signal, so as to accurately determine the exposure starting moment, and thus accurately capture the image of the fireworks at the peak period during shooting.

[0416] In some embodiments of the present application, the above step 202 can be implemented by the following step 202b1.

[0417] Step 202b1: The shooting device responds to the first input, controls the flash module to output a light pulse according to the flash parameter, and controls the camera to shoot the first image according to the exposure parameter corresponding to the shooting scene.

[0418] In some embodiments of the present application, during the light-emitting period of the flash module, the shooting device controls the sensor of the camera to expose according to the exposure parameters corresponding to the shooting scene, such as exposure time, exposure gain, etc., to shoot the first image.

[0419] The shooting method provided by the embodiments of the present application is explained and described below through specific examples.

[0420] In some examples, in combination with the above examples, taking shooting a large fireworks portrait scene as an example, the shooting scene includes large fireworks fired in the sky and a person on the low-illumination ground. The shooting device controls the camera to capture a preview image of the fireworks portrait. After the user clicks the shooting control, the shooting device detects that the environmental brightness value is 500, and determines that the current value of the flash module is 200 mA. Then, the face proportion in the preview image is 0.1, according to which the current adjustment ratio is determined to be 2, and the final current value of the flash module is determined to be 400 mA, i.e. 200 mA x 2 = 400 mA. Then, the determined current value is sent to the drive, and the drive controls the working mode of the flash according to the current value and the focal length of the camera, i.e. multi-focal length light-on combination. Assuming that the current focal length is 50 mm, according to 50 mm and the current determined current value 400 mA, it is determined that the near-focus flash LED1 and the far-focus flash LED2 are turned on at the same time, and the current values of the near-focus flash LED1 and the far-focus flash LED2 are 200 mA respectively. Then, the drive current value is sent, and after the flash is turned on, the shooting device determines that the fireworks type is large fireworks according to the AI scene detection result, and determines that the exposure conversion coefficient is 0.2. The converted new exposure combination is as follows: the exposure time is 50, and the exposure gain is 4. Then, after the shooting device issues the frame grabbing instruction, the flash is turned on, the 3A convergence is completed, and the camera is controlled to shoot the fireworks portrait image.

[0421] In some examples, taking the small firework portrait scene as an example in combination with the above examples, the shooting scene includes a person A holding a fairy wand type firework in a burning state. After the user clicks the shooting control, the shooting device detects that the ambient brightness value is 50, and determines that the current value of the flash module is 107.5 mA. Then, the face proportion in the preview image is 0.1, and the current adjustment ratio is determined to be 2, and the final current value of the flash module is determined to be 215 mA, i.e. 107.5 mA x 2 = 215 mA. Then, the determined current value is sent to the drive, and the drive determines the working mode of the flash according to the current value and the focal length of the camera, i.e. the multi-focal length light-on combination. Assuming that the current focal length is 25 mm, the near-focus flash LED1 is turned on according to the 25 mm focal length and the current current value 215 mA, and the current value of the near-focus flash LED1 is set to 215 mA. Then, the drive current value is sent, the flash is turned on, the shooting device determines the firework type to be a fairy wand type firework according to the AI scene detection result, and the exposure parameter conversion is performed according to the firework type, and the exposure conversion coefficient is determined to be 2. The new exposure combination after conversion is as follows: the exposure time is 5, and the exposure gain is 40. Then, the shooting device sends a frame grabbing instruction, controls the flash to turn on, 3A converges, and controls the camera to shoot the firework portrait image.

[0422] In some embodiments of the present application, the shooting device can also control the flash module to emit light during the shooting preview process according to the flash parameter, and control the camera to collect preview images in real time according to the exposure parameter corresponding to the shooting scene to preview the image effect after light compensation in real time.

[0423] In the embodiments of the present application, the shooting device can determine the flash parameter and the exposure parameter suitable for the current shooting scene, so as to avoid underexposure of the face of the person or overexposure of the background during shooting, and thus improve the shooting effect.

[0424] In some embodiments of the present application, the process of controlling the camera to shoot and output the first image based on the shooting parameter corresponding to the shooting scene in step 202 can include the following steps 202c and 202d:

[0425] Step 202c: The shooting device controls the camera to collect a plurality of groups of image frames in a continuous exposure period based on the shooting parameter corresponding to the shooting scene.

[0426] Each group of image frames includes a second image and a third image, wherein the second image is a high conversion gain (HCG) image collected in one exposure period, and the third image is a low conversion gain (LCG) image corresponding to the HCG image.

[0427] Step 202d: The photographing apparatus generates a first image based on the multiple sets of image frames and outputs the first image.

[0428] In some embodiments of the present application, the continuous exposure period includes at least one continuous exposure period.

[0429] In some embodiments of the present application, the photographing apparatus can employ the DCG technology to control the camera to collect multiple sets of image frames in the continuous exposure period based on the photographing parameters corresponding to the photographing scene.

[0430] In some embodiments of the present application, the photographing apparatus can determine the first exposure parameter according to the type of the fireworks, the first exposure parameter being used to collect the HCG image. Then, the second exposure parameter is determined based on the first exposure parameter, the second exposure parameter being used to collect the LCG image.

[0431] It should be noted that the HCG image can be referred to as an EV0 frame, and the LCG image can be referred to as an EV- frame.

[0432] In some examples, taking a large fireworks portrait photographing scene as an example, the photographing apparatus determines the exposure parameters according to the type of the fireworks as: Exp1 = 5 and Gain1 = 40. Assuming that the preset ratio of the exposure parameters of the HCG and the LCG is Ratio = 8, the exposure parameters of the HCG image are: Exp1 = 5 and Gain1 = 40. Based on the EV0 frame and the relationship between the EV0 frame and the EV- frame Gain2 = Gain1 / Ratio, Exp2 = Exp1, the exposure parameters of the LCG image are determined as: Gain2 = 5, i.e., Gain2 = 40 / 8 = 5, Gain2 = 5, i.e., Exp2 = Exp1 = 5.

[0433] The photographing method provided by the embodiments of the present application is exemplarily described below through specific examples.

[0434] In some examples, in a large fireworks portrait photographing scene, the photographing apparatus generates a photographing instruction in response to a first input. After detecting that the flash module outputs a light pulse and the 3A parameter converges stably, the photographing instruction is triggered. The photographing apparatus acquires image frames from the time point of the photographing instruction, i.e., backward frame grabbing. The DCG long-short exposure is employed to perform synchronous frame grabbing, and the specific steps are as follows: when the DCG synchronous frame grabbing is performed, the long exposure HCG is used as the input frame EV0 of the photographing HDR, and the short exposure LCG is used as the EV-. According to the dynamic range requirement, N sets of EV0 and EV- frame image pairs can be continuously collected to obtain multiple sets of image frames, so as to construct a multi-exposure image sequence for the synthesis of a high dynamic range image, where N is a positive integer.

[0435] In some embodiments of the present application, one exposure period is a time interval from an exposure start time to an exposure end time. For example, the exposure start time can be time point t1.

[0436] In some examples, in the fireworks portrait shooting scene, the shooting device collects a first group of image frames at time point T1, the first group of image frames including HCG image 1 and LCG image 1, and the first group of image frames is represented as [HCG1, LCG1]; collects a second group of image frames at time point T2, and the second group of image frames is represented as [HCG2, LCG2]; similarly, collects an Nth group of image frames [HCGN, LCGN] at time point Tn.

[0437] In some embodiments of the present application, after the shooting device completes the collection of the multiple groups of image frames, the shooting device controls the flash to stop outputting light pulses, and processes the collected multiple groups of image frames to generate a first image.

[0438] In some embodiments of the present application, the shooting device can determine one target image frame from the multiple groups of image frames as a reference image frame. Then, the HCG image in each group of image frames and the LCG image corresponding to the target image frame are subjected to synthesis processing to generate a first image.

[0439] In some embodiments of the present application, the process of generating a first image based on multiple groups of image frames in step 202d can include the following steps 202d1 and 202d2:

[0440] Step 202d1: The shooting device selects one frame of HCG image with the highest definition value and the smallest motion blur value from the multiple groups of image frames as a reference image frame.

[0441] Step 202d2: The shooting device subjects each frame of HCG image in the multiple groups of image frames and the LCG image corresponding to the reference image frame to image synthesis processing to generate a first image.

[0442] In some embodiments of the present application, the shooting device can determine the definition value of each HCG image and the motion blur value of each HCG image by analyzing image gradients, then normalize the definition value of each HCG image and the motion blur value of each HCG image, calculate the image quality score of each HCG image, and select the HCG image with the highest image quality score as a reference image frame.

[0443] In some embodiments of the present application, the shooting device can input each HCG image into an image quality evaluation model for processing to determine the image quality score of each HCG image, and select the HCG image with the highest image quality score as a reference image frame.

[0444] In some examples, in combination with the above examples, when the DCG is synchronized, the long-exposure HCG is taken as the input frame EV0 of the photo HDR, and the short-exposure LCG is taken as EV-. According to the quality requirement, N groups of EV0 and EV- frames can be captured. Then, the N frames of EV0 are selected as the reference frame from the perspective of clarity noise and motion blur, and the frame with the best clarity and the smallest motion blur is selected as the reference frame. After the reference frame is selected, the EV- frame corresponding to the reference frame EV0 is retained and dynamically expanded to eliminate the motion displacement caused by the time difference. Finally, the multiple frames of EV0 and the reference frame are synthesized by the photo HDR multi-frame algorithm to generate the first image.

[0445] For example, in combination with the above examples, assuming that the image quality score of each HCG image is evaluated, and the HCGk with the highest image quality score is selected as the reference image frame, then the LCG corresponding to the reference image frame is LCGk. Then, all HCG1 to HCGN are aligned with the reference HCGk, and all the aligned image frames are synthesized with the LCGk frame to generate the first image.

[0446] It should be noted that the multiple frames of EV0 are used for image noise reduction, and the EV- is used for restoring the fireworks highlights. By synthesizing the multiple frames of EV0 and one frame of EV-, the fireworks portrait photo image is obtained, so as to improve the dynamic range and optimize the motion artifacts, and thus improve the shooting effect.

[0447] In some examples, in combination with the above examples, in the fireworks portrait shooting scene, 5 groups of image frames are captured by the camera in a continuous exposure period, that is, 5 groups of HCG and LCG image pairs are captured. Assuming that the current exposure parameters are: the exposure time Exp1 corresponding to EV0 is equal to 5, and the exposure gain Gain1 is equal to 40; the exposure time Exp2 corresponding to EV- is equal to 5, and the exposure gain Gain2 is equal to 5. The shooting device simultaneously captures EV0 and EV- at the same time according to the exposure time Exp1 and the exposure gain Gain1 corresponding to EV0, and according to the exposure time Exp2 and the exposure gain Gain2 corresponding to EV-. Five groups of image frames are continuously captured, each group of image frames including one frame of EV0 and one frame of EV-. After capturing 5 groups of EV0 and EV- frames, assuming that the 3rd group of EV0 is selected as the reference frame, the 3rd group of EV- frame is retained, and the other EV- frames are discarded. Finally, all EV0 frames and the EV- corresponding to the reference frame are sent to the photo HDR algorithm for fusion to generate a fused image.

[0448] For example, Figure 7A The schematic diagram for capturing multiple groups of image frames is as follows: Figure 7AAs shown, the first row of images is each EV0 frame in the 5 groups of image frames, and the second row of images is each EV- frame in the 5 groups of image frames. Assuming that the EV0 frame 71 in the third group of image frames is selected as the reference frame, the corresponding EV- frame 72 of the EV0 frame 71 is retained, and then the HDR fusion processing is performed on all the EV0 frames and the EV- frame 72 corresponding to the EV0 frame 71, to generate the image 73 eliminating the motion displacement.

[0449] It should be noted that in the related art, image frames are collected from the time point of photographing, for example, 5 frames of EV0 and 1 frame of EV- are collected, and a total of 6 frames are collected from the start of collecting the first frame of EV0 to the end of collecting the EV-, Figure 7B A schematic diagram of the image generated by the related art for performing HDR fusion on the collected EV0 and EV- frames is as shown in Figure 7B As shown, there is a certain time difference between EV0 and EV-, which causes the displacement of objects between different frames, so that ghosting, i.e., motion artifacts, is generated when multiple frames are fused together.

[0450] In the embodiments of the present application, since the EV0 and EV- frames are captured at the same time, the motion displacement caused by the time difference is eliminated, so that there is no ghosting when the images are synthesized, and the purpose of optimizing artifacts is achieved.

[0451] In the embodiments of the present application, the photographing device restores the dynamic range, optimizes the motion artifact problem, improves the brightness of the relatively dark portrait, and restores the level details of the relatively bright shooting object, so that the face details of the person, the level, shape and color details of the fireworks, and the like can be accurately captured, and the shooting effect is improved.

[0452] In some embodiments of the present application, before the step 201, the photographing method provided by the embodiments of the present application can further include the following steps 207 to 209:

[0453] Step 207: The photographing device displays first prompt information when detecting the fireworks.

[0454] The first prompt information is used to recommend a shooting mode matched with the fireworks portrait scene.

[0455] Step 208: The photographing device receives a second input on the first prompt information.

[0456] Step 209: The photographing device starts the fireworks portrait shooting mode in response to the second input.

[0457] Exemplarily, in combination with the steps 207 to 209, the step 201 can be implemented by the following step 201a.

[0458] Step 201a: In response to the first input, the photographing device controls the camera to capture a first image based on photographing parameters corresponding to the photographing scene in the fireworks portrait photographing mode.

[0459] In some embodiments of the present application, the photographing device can detect whether there is fireworks in the preview image when the portrait mode is started, and display first prompt information when fireworks are detected.

[0460] In some embodiments of the present application, the photographing device receives a third input to start the portrait mode.

[0461] In some examples, the third input is a user's sliding input on the photographing preview interface, or the third input is a user's clicking input on the "portrait" option.

[0462] In some examples, in combination with the above Figure 2A or Figure 2B , the user can click the "portrait" option to enter the portrait mode, as shown in Figure 8A In the portrait mode, the photographing device displays prompt information 81 in the photographing preview interface 22 after detecting fireworks, and the content of the prompt information is "try flash fireworks portrait", to prompt the user whether to start the fireworks portrait photographing mode. Further, the photographing preview interface 80 can also include the focal length of the camera, "35" indicates that the focal length is 35mm, "50" indicates that the focal length is 50mm, "85" indicates that the focal length is 85mm, and "135" indicates that the focal length is 135mm.

[0463] It should be noted that Figure 8A the "50" is highlighted in bold in

[0464] In some embodiments of the present application, the second input described above can include any of the following: a user's touch input, voice input, gesture input, folding or unfolding operation of a foldable screen, or other feasible input, and the embodiments of the present application do not make any limitation on this. Further, the touch input described above can be: a user's clicking input, sliding input, pressing input, etc. Further, the clicking operation described above can be any number of clicking operations. The sliding operation described above can be a sliding operation in any direction, such as upward sliding, downward sliding, leftward sliding, or rightward sliding, etc., and the embodiments of the present application do not make any limitation on this.

[0465] In some embodiments of the present application, the second input described above is used to trigger the start of the fireworks portrait photographing mode.

[0466] For example, the second input described above can be a user's sliding input on the photographing preview interface, or a user's clicking input on the first prompt information in the photographing preview interface.

[0467] In some examples, in combination with the above Figure 8A In the example of the above, if the user wants to start the fireworks portrait shooting mode, the user clicks the above prompt information 81, and the shooting device starts the fireworks portrait shooting mode.

[0468] In some embodiments of the present application, the shooting device determines at least one of the flash parameter and the exposure parameter according to the reference information in the image preview process when the fireworks portrait shooting mode is started, and then controls the preview image collected by the camera in real time according to the flash parameter and the exposure parameter, so that the user can preview the image effect in real time in the shooting preview interface.

[0469] In some embodiments of the present application, the shooting device determines at least one of the flash parameter and the exposure parameter according to the reference information in response to the first input when the fireworks portrait shooting mode is started, and then controls the camera to shoot the first image according to the flash parameter and the exposure parameter.

[0470] In the embodiments of the present application, the electronic device can start the fireworks portrait shooting mode according to the user's needs, so that the shooting can be performed according to the shooting parameters corresponding to the fireworks portrait scene in the fireworks portrait shooting mode, avoiding overexposure of fireworks and underexposure of portraits, thereby improving the brightness of the portrait in the picture, ensuring the clarity of the portrait, and preserving the details such as the shape and color of the fireworks, and further improving the shooting quality of the fireworks portrait scene.

[0471] In some embodiments of the present application, the shooting preview interface includes a first control for selecting or switching the flash mode. For example, in the case of starting the fireworks portrait shooting mode, the shooting method provided by the embodiments of the present application can further include the following step 211:

[0472] Step 211: The shooting device turns on the flash function and updates the first control to a second control.

[0473] The second control is used to prompt that the fireworks portrait shooting mode has been started.

[0474] In some embodiments of the present application, the shooting device receives a second input of the user, starts the fireworks portrait shooting mode, and turns on the flash function, so as to supplement light through the flash when shooting to improve the brightness of the portrait in the image.

[0475] In some embodiments of the present application, the forms of the above-mentioned first control and second control can be patterns, characters, symbols, or combinations of patterns and characters, etc., which are not limited in the embodiments of the present application.

[0476] In some embodiments of the present application, the first control and the second control are user-operable controls; or, the first control and the second control are user-inoperable controls, such as controls for prompting.

[0477] In some examples, the first control can be a flash control for receiving a user operation to select or switch a flash mode. For example, to turn on or turn off the flash function.

[0478] In some examples, the second control can be an information prompting control for displaying flash state information. For example, the second control can include the text prompt “Flash Portrait On” to indicate that the current flash mode is in an on state, i.e., the fireworks portrait shooting mode has been turned on.

[0479] In some examples, in combination with the above Figure 8A , when the user clicks the prompt information 81, the shooting device turns on the flash function and displays the information prompting control 82 in the upper left corner, which includes the text prompt “Flash Portrait On” to prompt the user to enter the fireworks portrait shooting mode, as shown in Figure 8B .

[0480] In the embodiments of the present application, the shooting device can update the flash control to an information prompting control when starting the fireworks portrait shooting mode, so as to more intuitively prompt the user that the fireworks portrait shooting mode has been started, thereby improving the human-computer interaction performance.

[0481] In some embodiments of the present application, after the step 211, the shooting method provided by the embodiments of the present application can further include the following step 212:

[0482] Step 212: The shooting device updates the second control to a third control after displaying the second control for a second control reference time.

[0483] The third control is used to prompt that the shooting mode is the fireworks portrait shooting mode.

[0484] In some embodiments of the present application, the third control can be in the form of a pattern, a text, a symbol, or a combination of a pattern and a text, and the embodiments of the present application do not limit the same.

[0485] In some embodiments of the present application, the third control is a user-operable control; or, the first control and the second control are user-inoperable controls, such as controls for prompting.

[0486] In some embodiments of the present application, the reference time is a preset time. For example, the reference time can be 1s, 1.5s, or 2s.

[0487] It should be noted that the reference time length can be set according to actual needs, and the value thereof is not limited in the embodiments of the present application.

[0488] In some examples, in combination with the above Figure 8B , the shooting device turns on the flash function and updates the information prompt control 82 to the flash portrait control 83 after 1.5s to prompt the user to enter the fireworks portrait shooting mode, as shown in Figure 8C .

[0489] In the embodiments of the present application, after the shooting device starts the fireworks portrait shooting mode, it first displays the information prompt control for a reference time length, such as 1.5s, so that the user knows the current mode; then it updates the information prompt control to the flash portrait control. By updating the information prompt control to the flash portrait control, the information prompt control is avoided from occupying too much interface space for a long time, thereby optimizing the shooting interface layout.

[0490] In combination with the above embodiments, the shooting process provided by the embodiments of the present application is exemplarily described by examples as follows.

[0491] Exemplarily, as shown in Figure 9 , the shooting method provided by the embodiments of the present application can include the following steps:

[0492] Step 11: The shooting device detects the fireworks scene.

[0493] Step 12: The shooting device starts the fireworks portrait shooting mode and receives the shooting input.

[0494] Step 13: The shooting device detects the environmental brightness value through the AEC algorithm and calculates the flash current value.

[0495] Exemplarily, the flash current value is related to the light compensation intensity.

[0496] Step 14: The shooting device reads the current value through the APP and sends it to the driver.

[0497] Step 15: The shooting device controls the driver to decide the light-on combination according to the focal length and perform the subject lighting.

[0498] Step 16: The shooting device performs exposure calculation and conversion according to the AI scene detection result through the AEC algorithm.

[0499] Step 17: The shooting device adopts DCG to take a picture synchronously.

[0500] Step 18: The shooting device completes the frame grabbing and notifies the APP to turn off the flash.

[0501] The application breaks through the traditional HDR timing restriction through DCG hardware level double exposure synchronous frame grabbing, optimizes the artifact problem, combines automatic light compensation and multi-frame HDR shooting technology, realizes accurate light control and image quality improvement of the character and background in the fireworks portrait scene, and improves the competitiveness and user experience of the product.

[0502] The various method embodiments or various possible implementation manners in each method embodiment can be executed alone or, in the absence of contradiction, can also be executed in combination with each other. The actual use requirements can be determined, and the embodiments of the application do not limit this.

[0503] The execution subject of the shooting method provided in the embodiments of the application can be a shooting device. In the embodiments of the application, the shooting device is taken as an example to illustrate the shooting device provided in the embodiments of the application.

[0504] Figure 10 The structure diagram of the shooting device provided in the embodiments of the application is shown in FIG. 1, which includes a receiving module 601 and a processing module 602. Figure 10 The receiving module 601 is configured to receive a first input of a shooting preview interface. The processing module 602 is configured to control a camera to shoot a first image based on a shooting parameter corresponding to a shooting scene in response to the first input received by the receiving module 601. The first image includes fireworks and a portrait.

[0505] In some embodiments of the application, the shooting parameter includes a flash parameter; or the shooting parameter includes an exposure parameter, or the shooting parameter includes a flash parameter and an exposure parameter.

[0506] The flash parameter includes a current value of a flash module; or the flash parameter includes a working mode of the flash module; or the flash parameter includes the current value and the working mode of the flash module.

[0507] The exposure parameter includes an exposure time; or the exposure parameter includes an exposure gain; or the exposure parameter includes the exposure time and the exposure gain.

[0508] In some embodiments of the application, the processing module is further configured to determine the shooting parameter corresponding to the shooting scene according to reference information before controlling the camera to shoot according to the shooting parameter corresponding to the shooting scene.

[0509] The reference information includes at least one of the following: environmental brightness information, a proportion of the portrait in a preview image collected by the camera, focal length information of the camera, and acoustic information of the fireworks.

[0510] In some embodiments of the application, in the case where the shooting parameter includes the flash parameter, the reference information includes:

[0511] environmental brightness information;

[0512] or, the environmental brightness information, the proportion of the portrait in the preview image captured by the camera, and the focal length information of the camera;

[0513] or, the environmental brightness information, the proportion of the portrait in the preview image, and the focal length information of the camera;

[0514] or, a weighted brightness value of the preview image captured by the camera, the weighted brightness value being obtained based on weighted calculation of brightness values of a face region, a highlight region and a transition region of the preview image;

[0515] or, the weighted brightness value of the preview image captured by the camera and the focal length information of the camera;

[0516] In a case where the shooting parameter comprises an exposure parameter, the reference information comprises:

[0517] a type of the fireworks;

[0518] or, acoustic information of the fireworks;

[0519] or, the type of the fireworks and the acoustic information of the fireworks.

[0520] In some embodiments of the present application, the shooting parameter comprises a current value of a flash module; and the processing module is specifically configured to:

[0521] obtain environmental brightness information, the environmental brightness information representing an environmental brightness value of a shooting scene;

[0522] determine the current value of the flash module according to the environmental brightness value and a first mapping relationship, the first mapping relationship being a mapping relationship between the environmental brightness value and the current value of the flash module.

[0523] In some embodiments of the present application, the processing module is further configured to:

[0524] after determining the current value of the flash module according to the environmental brightness information and a preset mapping relationship, calculate a proportion of a face region of the portrait in a preview image captured by the camera;

[0525] determine a current adjustment ratio according to the proportion of the face region and a second mapping relationship, the second mapping relationship being a mapping relationship between the proportion of the face region and the current adjustment ratio;

[0526] adjust the current value of the flash module according to the current adjustment ratio.

[0527] In some embodiments of the present application, the shooting parameter comprises a current value of a flash module; and the processing module is specifically configured to:

[0528] Divide the preview image captured by the camera into a face region, a highlight region, and a transition region;

[0529] Statistically, the first brightness value of the face region, the second brightness value of the highlight region, and the third brightness value of the transition region; wherein the face region corresponds to the first brightness weight, the highlight region corresponds to the second brightness weight, and the transition region corresponds to the third brightness weight;

[0530] Based on the first brightness weight, the second brightness weight, and the third brightness weight, the first brightness value, the second brightness value, and the third brightness value are weighted and calculated to obtain the weighted brightness value of the preview image;

[0531] According to the weighted brightness value of the preview image and the third mapping relationship, the current value of the flash module is determined, and the third mapping relationship is the mapping relationship between the weighted brightness value of the preview image and the current value of the flash module.

[0532] In some embodiments of the present application, the shooting parameter includes the working mode of the flash module; the processing module is specifically configured to:

[0533] According to the focal length information of the camera, the working mode of the flash module is determined.

[0534] In some embodiments of the present application, the flash module includes: a near-focus flash and a far-focus flash;

[0535] In the case that the shooting focal length of the camera is the first focal length, the near-focus flash is turned on, and the working current of the near-focus flash is set to the first current value;

[0536] In the case that the shooting focal length of the camera is the second focal length, the near-focus flash and the far-focus flash are turned on, and the current values of the working currents of the near-focus flash and the far-focus flash are set according to the first current ratio; the current ratio of the near-focus flash to the far-focus flash is 1:1;

[0537] In the case that the shooting focal length of the camera is the third focal length, the near-focus flash and the far-focus flash are turned on, and the current values of the working currents of the near-focus flash and the far-focus flash are set according to the second current ratio; the current ratio of the near-focus flash to the far-focus flash is 1:3;

[0538] In the case that the shooting focal length of the camera is the fourth focal length, the far-focus flash is turned on, and the working current of the far-focus flash is set to the second current value;

[0539] Wherein, the first focal length is less than the second focal length, the second focal length is less than the third focal length, and the third focal length is less than the fourth focal length.

[0540] In some embodiments of the present application, the processing module is specifically configured to:

[0541] determine the type of the fireworks based on a preview image displayed on a preview interface of the shooting preview interface;

[0542] determine an exposure conversion coefficient according to the type of the fireworks and a fourth mapping relationship, the third mapping relationship being a mapping relationship between the type of the fireworks and the exposure conversion coefficient;

[0543] adjust the reference exposure parameter according to the exposure conversion coefficient to obtain the exposure parameter corresponding to the shooting object.

[0544] In some embodiments of the present application, the shooting parameter includes an exposure time, and the exposure time includes an exposure starting time;

[0545] The processing module is further configured to, before determining the shooting parameter corresponding to the shooting scene according to the reference information in response to the first input, predict a time at which the light radiation of the fireworks reaches a maximum value based on the acoustic information of the fireworks, and determine the time at which the light radiation of the fireworks reaches the maximum value as the exposure starting time;

[0546] The processing module is specifically configured to, in response to the first input, control an image sensor of the camera to generate image data at the exposure starting time;

[0547] The processing module is specifically configured to process the image data to generate a first image and output the first image.

[0548] In some embodiments of the present application, the processing module is specifically configured to, in response to the first input, control the flash module to emit light according to the flash parameter;

[0549] The processing module is specifically configured to control the camera to shoot the first image according to the exposure parameter corresponding to the shooting scene during the period in which the flash module emits light.

[0550] In some embodiments of the present application, the processing module is specifically configured to:

[0551] control the camera to collect a plurality of groups of image frames in a continuous exposure period based on the shooting parameter corresponding to the shooting scene, each group of image frames including a second image and a third image, wherein the second image is a high conversion gain (HCG) image collected in one exposure period, and the third image is a low conversion gain (LCG) image corresponding to the HCG image;

[0552] generate the first image based on the plurality of groups of image frames and output the first image.

[0553] In some embodiments of the present application, the processing module is specifically configured to:

[0554] select, from the plurality of groups of image frames, an HCG image with the highest image quality score as a reference image frame, the image quality score being determined based on a sharpness value and a motion blur value of the image;

[0555] perform image synthesis processing on the LCG image corresponding to each frame HCG image in the plurality of groups of image frames and the reference image frame, to generate a first image.

[0556] In some embodiments of the present application, the apparatus further includes a display module;

[0557] The display module is configured to display first prompt information in response to detecting the fireworks, the first prompt information being configured to recommend a shooting mode matching the fireworks and portrait scene.

[0558] The receiving module is further configured to receive a second input on the first prompt information.

[0559] The processing module is further configured to start the fireworks and portrait shooting mode in response to the second input.

[0560] The processing module is specifically configured to control the camera to shoot the first image based on the shooting parameters corresponding to the shooting scene in response to the first input in the fireworks and portrait shooting mode.

[0561] In some embodiments of the present application, the shooting preview interface includes a first control, and the first control is configured to select or switch a flash mode.

[0562] The processing module is further configured to turn on a flash function and update the first control to a second control in response to starting the fireworks and portrait shooting mode, and the second control is configured to prompt that the fireworks and portrait shooting mode has been started.

[0563] In some embodiments of the present application, the processing module is further configured to update the second control to a third control after displaying the second control for a reference time length, and the third control is configured to prompt that the shooting mode is the fireworks and portrait shooting mode.

[0564] The shooting device provided by the embodiments of the present application receives a first input on a shooting preview interface, controls a camera to shoot a first image based on shooting parameters corresponding to a shooting scene in response to the first input, and the first image includes fireworks and a portrait. Through the present solution, the shooting device can shoot according to the shooting parameters corresponding to the shooting scene when shooting a scene including fireworks and a portrait. In this way, the fireworks area is prevented from being overexposed and the portrait area is prevented from being underexposed, so that the shape of the fireworks and the details of the portrait can be accurately captured, and the shooting effect is improved.

[0565] The photographing apparatus in the embodiments of the present applicationapplicationbe an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic deviceapplicationbe a terminal, or another device other than a terminal. For example, the electronic deviceapplicationbe a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), andapplicationbe a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like. The embodiments of the present application do not make a specific limitation.

[0566] The photographing apparatus in the embodiments of the present applicationapplicationbe a device having an operating system. The operating systemapplicationbe an Android operating system, an ios operating system, or another possible operating system, and the embodiments of the present application do not make a specific limitation.

[0567] The photographing apparatus provided in the embodiments of the present applicationapplicationimplement each process of the method embodiments of the photographing method described above, and thus repeated description is not given herein.

[0568] Optionally, as shown in Figure 11 The embodiments of the present application also provide an electronic device 700, whichapplicationinclude a processor 701 and a memory 702. The memory 702applicationstore a program or an instruction, whichapplicationbe run on the processor 701. The program or the instructionapplicationbe executed by the processor 701 to implement each step of the photographing method embodiments described above, and achieve the same technical effects. Thus, repeated description is not given herein.

[0569] It should be noted that the electronic device in the embodiments of the present applicationapplicationinclude the mobile electronic device and the non-mobile electronic device described above.

[0570] Figure 12 A hardware structure diagram of an electronic device according to an embodiment of the present application is shown in FIG. 7.

[0571] The electronic device 100 includes, but is not limited to, a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110, etc.

[0572] Those skilled in the art can understand that the electronic device 100 can further include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 110 through a power management system, so that the power management system can realize functions such as management of charging, discharging, and power consumption management. Figure 12 The electronic device structure shown in the figure is not a limitation on the electronic device, and the electronic device can include more or fewer components than the figure, or combine certain components, or different component arrangements, which are not described here.

[0573] The user input unit 107 is configured to receive a first input to the shooting preview interface, and the processor 110 is configured to control the camera to shoot a first image based on a shooting parameter corresponding to the shooting scene in response to the first input received by the user input unit 107, wherein the first image includes fireworks and a portrait.

[0574] In some embodiments of the present application, the shooting parameter includes a flash parameter, or the shooting parameter includes an exposure parameter, or the shooting parameter includes a flash parameter and an exposure parameter.

[0575] The flash parameter includes a current value of a flash module, or the flash parameter includes a working mode of the flash module, or the flash parameter includes a current value and a working mode of the flash module.

[0576] The exposure parameter includes an exposure time, or the exposure parameter includes an exposure gain, or the exposure parameter includes an exposure time and an exposure gain.

[0577] In some embodiments of the present application, the processor 110 is further configured to determine the shooting parameter corresponding to the shooting scene according to reference information before controlling the camera to shoot according to the shooting parameter corresponding to the shooting scene.

[0578] The reference information includes at least one of the following: environmental brightness information, a proportion of a portrait in a preview image collected by the camera, focal length information of the camera, and acoustic information of the fireworks.

[0579] In some embodiments of the present application, in the case where the shooting parameter includes a flash parameter, the reference information includes:

[0580] The environmental brightness information;

[0581] Or, the ambient brightness information, the proportion of the portrait in the preview image captured by the camera, and the focal length information of the camera.

[0582] Or, the ambient brightness information, the proportion of the portrait in the preview image, and the focal length information of the camera.

[0583] Or, the weighted brightness value of the preview image captured by the camera, the weighted brightness value being obtained based on weighted calculation of the brightness values of the face region, the highlight region, and the transition region in the preview image.

[0584] Or, the weighted brightness value of the preview image captured by the camera and the focal length information of the camera.

[0585] In a case where the shooting parameter includes an exposure parameter, the reference information includes:

[0586] The type of the fireworks;

[0587] Or, the acoustic information of the fireworks;

[0588] Or, the type of the fireworks and the acoustic information of the fireworks.

[0589] In some embodiments of the present application, the shooting parameter includes a current value of a flash module; the processor 110 is specifically configured to:

[0590] Obtain ambient brightness information, the ambient brightness information representing an ambient brightness value of a shooting scene;

[0591] Determine the current value of the flash module according to the ambient brightness value and a first mapping relationship, the first mapping relationship being a mapping relationship between the ambient brightness value and the current value of the flash module.

[0592] In some embodiments of the present application, the processor 110 is further configured to:

[0593] After determining the current value of the flash module according to the ambient brightness information and a preset mapping relationship, calculate a proportion of a face region of a portrait in a preview image captured by the camera;

[0594] Determine a current adjustment ratio according to the proportion of the face region and a second mapping relationship, the second mapping relationship being a mapping relationship between the proportion of the face region and the current adjustment ratio;

[0595] Adjust the current value of the flash module according to the current adjustment ratio.

[0596] In some embodiments of the present application, the shooting parameter includes a current value of a flash module; the processor 110 is specifically configured to:

[0597] Divide a preview image captured by the camera into a face region, a highlight region, and a transition region;

[0598] statistically determine a first luminance value of a face region, a second luminance value of a highlight region, and a third luminance value of a transition region; the face region corresponds to a first luminance weight, the highlight region corresponds to a second luminance weight, and the transition region corresponds to a third luminance weight;

[0599] perform weighted operation on the first luminance value, the second luminance value, and the third luminance value based on the first luminance weight, the second luminance weight, and the third luminance weight, to calculate a weighted luminance value of the preview image;

[0600] determine a current value of the flash module according to the weighted luminance value of the preview image and a third mapping relationship, the third mapping relationship being a mapping relationship between the weighted luminance value of the preview image and the current value of the flash module.

[0601] In some embodiments of the present application, the shooting parameter includes a working mode of the flash module; the processor 110 is specifically configured to:

[0602] determine the working mode of the flash module according to the focal length information of the camera.

[0603] In some embodiments of the present application, the flash module includes a close-focus flash and a tele-focus flash.

[0604] when the shooting focal length of the camera is a first focal length, turn on the close-focus flash and set a working current of the close-focus flash to a first current value;

[0605] when the shooting focal length of the camera is a second focal length, turn on the close-focus flash and the tele-focus flash and set current values of working currents of the close-focus flash and the tele-focus flash according to a first current ratio; the current ratio of the close-focus flash to the tele-focus flash is 1:1;

[0606] when the shooting focal length of the camera is a third focal length, turn on the close-focus flash and the tele-focus flash and set current values of working currents of the close-focus flash and the tele-focus flash according to a second current ratio; the current ratio of the close-focus flash to the tele-focus flash is 1:3;

[0607] when the shooting focal length of the camera is a fourth focal length, turn on the tele-focus flash and set a working current of the tele-focus flash to a second current value;

[0608] wherein the first focal length is smaller than the second focal length, the second focal length is smaller than the third focal length, and the third focal length is smaller than the fourth focal length.

[0609] In some embodiments of the present application, the processor 110 is specifically configured to:

[0610] determine a type of the fireworks based on a preview image displayed on the shooting preview interface;

[0611] determine the exposure conversion coefficient according to the type of the fireworks and the fourth mapping relationship, the third mapping relationship being a mapping relationship between the type of the fireworks and the exposure conversion coefficient;

[0612] adjust the reference exposure parameter according to the exposure conversion coefficient to obtain the exposure parameter corresponding to the shooting object.

[0613] In some embodiments of the present application, the shooting parameter includes an exposure time, and the exposure time includes an exposure start time;

[0614] The processor 110 is further configured to, before determining the shooting parameter corresponding to the shooting scene according to the reference information in response to the first input, predict a time at which the light radiation of the fireworks reaches a maximum value based on the acoustic information of the fireworks, and determine the time at which the light radiation of the fireworks reaches the maximum value as the exposure start time;

[0615] The processor 110 is specifically configured to, in response to the first input, control the image sensor of the camera to generate image data at the exposure start time;

[0616] The processor 110 is specifically configured to process the image data to generate a first image and output the first image.

[0617] In some embodiments of the present application, the processor 110 is specifically configured to, in response to the first input, control the flash module to emit light according to the flash parameter;

[0618] The processor 110 is specifically configured to control the camera to shoot the first image according to the exposure parameter corresponding to the shooting scene during the period in which the flash module emits light.

[0619] In some embodiments of the present application, the processor 110 is specifically configured to:

[0620] control the camera to collect a plurality of groups of image frames in a continuous exposure period based on the shooting parameter corresponding to the shooting scene, each group of image frames including a second image and a third image, wherein the second image is a high conversion gain (HCG) image collected in one exposure period, and the third image is a low conversion gain (LCG) image corresponding to the HCG image;

[0621] generate the first image based on the plurality of groups of image frames and output the first image.

[0622] In some embodiments of the present application, the processor 110 is specifically configured to:

[0623] select, from the plurality of groups of image frames, an HCG image with the highest image quality score as a reference image frame, the image quality score being determined based on a sharpness value and a motion blur value of the image;

[0624] The HCG image and the LCG image corresponding to each frame of image frame in the plurality of groups of image frames are subjected to image synthesis processing to generate a first image.

[0625] In some embodiments of the present application, the display unit 106 is configured to display first prompt information in response to detecting the fireworks, the first prompt information being used to recommend a shooting mode matching the fireworks portrait scene.

[0626] The user input unit 107 is further configured to receive a second input on the first prompt information.

[0627] The processor 110 is further configured to start the fireworks portrait shooting mode in response to the second input.

[0628] The processor 110 is specifically configured to control the camera to shoot the first image based on the shooting parameters corresponding to the shooting scene in response to the first input in the fireworks portrait shooting mode.

[0629] In some embodiments of the present application, the shooting preview interface includes a first control, and the first control is used to select or switch a flash mode.

[0630] The processor 110 is further configured to turn on the flash function and update the first control to a second control in response to starting the fireworks portrait shooting mode, and the second control is used to prompt that the fireworks portrait shooting mode has been started.

[0631] In some embodiments of the present application, the processor 110 is further configured to update the second control to a third control after displaying the second control for a reference time, and the third control is used to prompt that the shooting mode is the fireworks portrait shooting mode.

[0632] The shooting device provided by the embodiments of the present application receives a first input on a shooting preview interface, and controls a camera to shoot a first image based on shooting parameters corresponding to a shooting scene in response to the first input, wherein the first image includes fireworks and a portrait. Through the present solution, when a scene including fireworks and a person is shot, the shooting device can shoot according to the shooting parameters corresponding to the shooting scene. In this way, the fireworks area is prevented from being overexposed and the person area is prevented from being underexposed, so that the shape of the fireworks and the details of the person can be accurately captured, and the shooting effect is improved.

[0633] It should be understood that in the embodiments of the present application, the input unit 104 can include a graphics processing unit (GPU) 1041 and a microphone 1042. The graphics processing unit 1041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 can include a display panel 1061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also referred to as a touch screen. The touch panel 1071 can include two parts of a touch detection device and a touch controller. The other input devices 1072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), a trackball, a mouse, a joystick, and the like, which will not be described here.

[0634] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 109 can include a volatile memory or a non-volatile memory, or the memory 109 can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link DRAM (SLDRAM), and a direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 109 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0635] The processor 110 can include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes a wireless communication signal, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 110.

[0636] The embodiment of the present application further provides a readable storage medium, and the readable storage medium stores a program or instructions, the program or instructions are executed by a processor to realize each process of the above-mentioned photographing method embodiment, and the same technical effects can be achieved, and details are not repeated here.

[0637] The processor is the processor in the electronic device in the above-mentioned embodiment. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0638] The embodiment of the present application further provides a chip, and the chip includes a processor and a communication interface, the communication interface is coupled with the processor, and the processor is used to run a program or instructions to realize each process of the above-mentioned photographing method embodiment, and the same technical effects can be achieved, and details are not repeated here.

[0639] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system level chip, a system chip, a chip system or a system on chip, etc.

[0640] The embodiment of the present application provides a computer program product, and the program product is stored in a storage medium, and the program product is executed by at least one processor to realize each process of the above-mentioned photographing method embodiment, and the same technical effects can be achieved, and details are not repeated here.

[0641] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element. Furthermore, it is to be understood that the method and apparatus of the present application can be carried out by more than one process, method, article, or apparatus either simultaneously, concurrently, or with intervening action that are carried out at the same time, either in a simultaneous fashion or in a fashion that is interleaved in time. For example, the described methods can be performed in a different order from that described, and / or various steps can be combined or omitted, and / or additional steps can be added, without departing from the scope of the present application. Also, features described with respect to certain examples can be combined in other examples.

[0642] From the above description of the embodiments, it is apparent that the above-described method of the embodiments can be realized by means of software and general-purpose hardware platforms, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such an understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk), and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.

[0643] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-described specific embodiments, and the above-described specific embodiments are merely illustrative, rather than limiting, and those of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims, which all belong to the protection of the present application.

Claims

1. A shooting method, characterized in that, The method includes: Receive the first input to the shooting preview interface; In response to the first input, the camera is controlled to capture the first image based on the shooting parameters corresponding to the shooting scene; The first image includes fireworks and human figures.

2. The method according to claim 1, characterized in that, The shooting parameters include flash parameters; or, the shooting parameters include exposure parameters; or, the shooting parameters include both flash parameters and exposure parameters. Wherein, the flash parameters include the current value of the flash module; or, the flash parameters include the operating mode of the flash module; or, the flash parameters include both the current value and the operating mode of the flash module. The exposure parameters include exposure time; or, the exposure parameters include exposure gain; or, the exposure parameters include both exposure time and exposure gain.

3. The method according to claim 1, characterized in that, Before controlling the camera to take a picture according to the shooting parameters corresponding to the shooting scene, the method further includes: Based on the reference information, determine the shooting parameters corresponding to the shooting scene; The reference information includes at least one of the following: ambient brightness information, the proportion of the human figure in the preview image captured by the camera, the focal length information of the camera, and the acoustic information of the fireworks.

4. The method according to claim 3, characterized in that, When the shooting parameters include flash parameters, the reference information includes: Ambient brightness information; Alternatively, the ambient brightness information and the proportion of the human figure in the preview image captured by the camera; Alternatively, the ambient brightness information, the proportion of the human figure in the preview image, and the focal length information of the camera; Alternatively, the weighted brightness value of the preview image captured by the camera is obtained by weighting the brightness values ​​of the face area, highlight area and transition area of ​​the preview image. Alternatively, the weighted brightness value of the preview image captured by the camera, or the focal length information of the camera; When the shooting parameters include exposure parameters, the reference information includes: The type of fireworks; Alternatively, the acoustic information of the fireworks, which is determined based on the sound wave signals of the fireworks collected by a microphone; Alternatively, the type of fireworks and the acoustic information of the fireworks.

5. The method according to claim 3, characterized in that, The shooting parameters include the current value of the flash module; The step of determining the shooting parameters corresponding to the shooting scene based on the reference information includes: Acquire ambient brightness information, wherein the ambient brightness information represents the ambient brightness value of the shooting scene; The current value of the flash module is determined based on the ambient brightness information and the first mapping relationship, wherein the first mapping relationship is the mapping relationship between the ambient brightness value and the current value of the flash module.

6. The method according to claim 5, characterized in that, After determining the current value of the flash module based on the ambient brightness information and the first mapping relationship, the method further includes: Calculate the percentage of the human face region in the preview image captured by the camera; Based on the proportion of the face region and the second mapping relationship, the current adjustment ratio is determined, where the second mapping relationship is the mapping relationship between the proportion of the face region and the current adjustment ratio. Adjust the current value of the flash module according to the current adjustment ratio.

7. The method according to claim 3, characterized in that, The shooting parameters include the current value of the flash module; The step of determining the shooting parameters corresponding to the shooting scene based on the reference information includes: The preview image captured by the camera is divided into a face area, a highlight area, and a transition area; The first brightness value of the face region, the second brightness value of the highlight region, and the third brightness value of the transition region are statistically analyzed; wherein, the face region corresponds to the first brightness weight, the highlight region corresponds to the second brightness weight, and the transition region corresponds to the third brightness weight. Based on the first brightness weight, the second brightness weight, and the third brightness weight, a weighted operation is performed on the first brightness value, the second brightness value, and the third brightness value to calculate the weighted brightness value of the preview image; The current value of the flash module is determined based on the weighted brightness value of the preview image and the third mapping relationship, wherein the third mapping relationship is the mapping relationship between the weighted brightness value of the preview image and the current value of the flash module.

8. The method according to claim 3, characterized in that, The shooting parameters include the operating mode of the flash module; The step of determining the shooting parameters corresponding to the shooting scene based on the reference information includes: The operating mode of the flash module is determined based on the focal length information of the camera.

9. The method according to claim 8, characterized in that, The flash module includes: a near-focus flash and a far-focus flash; Determining the operating mode of the flash module based on the focal length information of the camera includes: When the camera's shooting focal length is the first focal length, the close-focus flash is turned on, and the operating current of the close-focus flash is set to the first current value; When the camera's shooting focal length is the second focal length, the near-focus flash and the far-focus flash are turned on, and the operating current values ​​of the near-focus flash and the far-focus flash are set according to the first current ratio; the current ratio of the near-focus flash to the far-focus flash is 1:

1. When the camera's shooting focal length is the third focal length, the near-focus flash and the far-focus flash are turned on, and the operating current values ​​of the near-focus flash and the far-focus flash are set according to the second current ratio; the current ratio of the near-focus flash to the far-focus flash is 1:

3. When the camera's shooting focal length is the fourth focal length, turn on the telephoto flash and set the telephoto flash's operating current to the second current value. Wherein, the first focal length is less than the second focal length, the second focal length is less than the third focal length, and the third focal length is less than the fourth focal length.

10. The method according to claim 3, characterized in that, The shooting parameters include exposure parameters; The step of determining the shooting parameters corresponding to the shooting scene based on the reference information includes: Based on the preview image displayed on the shooting preview interface, determine the type of fireworks; The exposure conversion factor is determined based on the type of fireworks and the fourth mapping relationship, whereby the fourth mapping relationship is the mapping relationship between the type of fireworks and the exposure conversion factor. Based on the exposure conversion factor, the reference exposure parameters are adjusted to obtain the exposure parameters corresponding to the shooting scene.

11. The method according to claim 1, characterized in that, The shooting parameters include exposure time, which includes the exposure start time; Before determining the shooting parameters corresponding to the shooting scene based on the reference information in response to the first input, the method further includes: Based on the acoustic information of the fireworks, the time when the light radiation of the fireworks reaches its maximum value is predicted, and the time when the light radiation of the fireworks reaches its maximum value is determined as the exposure start time; The step of controlling the camera to capture images in response to the first input, based on the shooting parameters corresponding to the shooting scene, includes: In response to the first input, at the exposure start time, the image sensor of the camera is controlled to expose, generating image data; The image data is processed to generate a first image, and the first image is output.

12. The method according to claim 2, characterized in that, The step of controlling the camera to capture a first image in response to the first input, based on the shooting parameters corresponding to the shooting scene, includes: In response to the first input, the flash module is controlled to output light pulses according to the flash parameters, and the camera is controlled to capture a first image according to the exposure parameters corresponding to the shooting scene.

13. The method according to claim 1, characterized in that, The step of controlling the camera to capture the first image based on the shooting parameters corresponding to the shooting scene includes: Based on the shooting parameters corresponding to the shooting scene, the camera is controlled to acquire multiple sets of image frames within a continuous exposure cycle. Each set of image frames includes a second image and a third image. The second image is a high conversion gain HCG image acquired within one exposure cycle, and the third image is a low conversion gain LCG image corresponding to the HCG image. Based on the multiple sets of image frames, a first image is generated and output.

14. The method according to claim 11, characterized in that, The step of generating a first image based on the multiple sets of image frames includes: From the multiple sets of image frames, the HCG image with the highest image quality score is selected as the reference image frame. The image quality score is determined based on the image's sharpness value and motion blur value. Image synthesis processing is performed on each HCG image in the multiple sets of image frames and the LCG image corresponding to the reference image frame to generate a first image.

15. The method according to claim 1, characterized in that, Before receiving the first input to the shooting preview interface, the method further includes: If fireworks are detected, a first prompt message is displayed, which is used to recommend a shooting mode that matches the fireworks portrait scene; Receive a second input regarding the first prompt message; In response to the second input, the fireworks portrait shooting mode is activated; The step of controlling the camera to capture a first image in response to the first input, based on the shooting parameters corresponding to the shooting scene, includes: In the fireworks portrait shooting mode, in response to the first input, the camera is controlled to capture the first image based on the shooting parameters corresponding to the shooting scene.

16. The method according to claim 15, characterized in that, The shooting preview interface includes a first control, which is used to select or switch the flash mode; When the fireworks portrait shooting mode is activated, the method further includes: Turn on the flash function and update the first control to the second control, which is used to indicate that the fireworks portrait shooting mode has been turned on.

17. The method according to claim 16, characterized in that, After updating the flash control in the shooting preview interface to a flash indicator control, the method further includes: After displaying the reference duration of the second control, the second control is updated to the third control, which is used to indicate that the shooting mode is fireworks portrait shooting mode.

18. A shooting device, characterized in that, The device includes: The receiving module is used to receive the first input to the shooting preview interface; The processing module is used to respond to the first input received by the receiving module and control the camera to capture the first image based on the shooting parameters corresponding to the shooting scene; The first image includes fireworks and human figures.

19. The apparatus according to claim 18, characterized in that, The shooting parameters include flash parameters; or, the shooting parameters include exposure parameters; or, the shooting parameters include both flash parameters and exposure parameters. Wherein, the flash parameters include the current value of the flash module; or, the flash parameters include the operating mode of the flash module; or, the flash parameters include both the current value and the operating mode of the flash module. The exposure parameters include exposure time; or, the exposure parameters include exposure gain; or, the exposure parameters include both exposure time and exposure gain.

20. The apparatus according to claim 18, characterized in that, The processing module is further configured to determine the shooting parameters corresponding to the shooting scene based on reference information before controlling the camera to shoot according to the shooting parameters corresponding to the shooting scene. The reference information includes at least one of the following: ambient brightness information, the proportion of the human figure in the preview image captured by the camera, the focal length information of the camera, and the acoustic information of the fireworks.

21. The method according to claim 20, characterized in that, When the shooting parameters include flash parameters, the reference information includes: Ambient brightness information; Alternatively, the ambient brightness information and the proportion of the human figure in the preview image captured by the camera; Alternatively, the ambient brightness information, the proportion of the human figure in the preview image, and the focal length information of the camera; Alternatively, the weighted brightness value of the preview image captured by the camera is obtained by weighting the brightness values ​​of the face area, highlight area and transition area of ​​the preview image. Alternatively, the weighted brightness value of the preview image captured by the camera, or the focal length information of the camera; When the shooting parameters include exposure parameters, the reference information includes: The type of fireworks; Alternatively, the acoustic information of the fireworks; Alternatively, the type of fireworks and the acoustic information of the fireworks.

22. The apparatus according to claim 20, characterized in that, The shooting parameters include the current value of the flash module; the processing module is specifically used for: Acquire ambient brightness information, wherein the ambient brightness information represents the ambient brightness value of the shooting scene; The current value of the flash module is determined based on the ambient brightness value and the first mapping relationship, wherein the first mapping relationship is the mapping relationship between the ambient brightness value and the current value of the flash module.

23. The apparatus according to claim 22, characterized in that, The processing module is further configured to: After determining the current value of the flash module based on the ambient brightness information and the preset mapping relationship, the proportion of the face area of ​​the human figure in the preview image captured by the camera is calculated. Based on the proportion of the face region and the second mapping relationship, the current adjustment ratio is determined, where the second mapping relationship is the mapping relationship between the proportion of the face region and the current adjustment ratio. Adjust the current value of the flash module according to the current adjustment ratio.

24. The apparatus according to claim 20, characterized in that, The shooting parameters include the current value of the flash module; the processing module is specifically used for: The preview image captured by the camera is divided into a face area, a highlight area, and a transition area; The first brightness value of the face region, the second brightness value of the highlight region, and the third brightness value of the transition region are statistically analyzed; wherein, the face region corresponds to the first brightness weight, the highlight region corresponds to the second brightness weight, and the transition region corresponds to the third brightness weight. Based on the first brightness weight, the second brightness weight, and the third brightness weight, a weighted operation is performed on the first brightness value, the second brightness value, and the third brightness value to calculate the weighted brightness value of the preview image; The current value of the flash module is determined based on the weighted brightness value of the preview image and the third mapping relationship, wherein the third mapping relationship is the mapping relationship between the weighted brightness value of the preview image and the current value of the flash module.

25. The apparatus according to claim 20, characterized in that, The shooting parameters include the operating mode of the flash module; the processing module is specifically used for: The operating mode of the flash module is determined based on the focal length information of the camera.

26. The apparatus according to claim 25, characterized in that, The flash module includes: a near-focus flash and a far-focus flash; When the camera's shooting focal length is the first focal length, the close-focus flash is turned on, and the operating current of the close-focus flash is set to the first current value; When the camera's shooting focal length is the second focal length, the near-focus flash and the far-focus flash are turned on, and the operating current values ​​of the near-focus flash and the far-focus flash are set according to the first current ratio; the current ratio of the near-focus flash to the far-focus flash is 1:

1. When the camera's shooting focal length is the third focal length, the near-focus flash and the far-focus flash are turned on, and the operating current values ​​of the near-focus flash and the far-focus flash are set according to the second current ratio; the current ratio of the near-focus flash to the far-focus flash is 1:

3. When the camera's shooting focal length is the fourth focal length, turn on the telephoto flash and set the operating current of the telephoto flash to the second current value; Wherein, the first focal length is less than the second focal length, the second focal length is less than the third focal length, and the third focal length is less than the fourth focal length.

27. The apparatus according to claim 20, characterized in that, The processing module is specifically used for: Based on the preview image displayed on the shooting preview interface, determine the type of fireworks; The exposure conversion coefficient is determined based on the type of fireworks and the fourth mapping relationship, wherein the third mapping relationship is the mapping relationship between the type of fireworks and the exposure conversion coefficient; The exposure parameters corresponding to the photographed object are obtained by adjusting the reference exposure parameters according to the exposure conversion factor.

28. The apparatus according to claim 18, characterized in that, The shooting parameters include exposure time, which includes the exposure start time; The processing module is further configured to, before determining the shooting parameters corresponding to the shooting scene based on the reference information in response to the first input, predict the moment when the light radiation of the fireworks reaches its maximum value based on the acoustic information of the fireworks, and determine the moment when the light radiation of the fireworks reaches its maximum value as the exposure start time; The processing module is specifically used to respond to the first input and, at the exposure start time, control the image sensor of the camera to generate image data; The processing module is specifically used to process the image data, generate a first image, and output the first image.

29. The apparatus according to claim 19, characterized in that, The processing module is specifically used to respond to the first input and control the flash module to emit light according to the flash parameters; The processing module is specifically used to control the camera to capture a first image based on the exposure parameters corresponding to the shooting scene during the period when the flash module emits light.

30. The apparatus according to claim 18, characterized in that, The processing module is specifically used for: Based on the shooting parameters corresponding to the shooting scene, the camera is controlled to acquire multiple sets of image frames within a continuous exposure cycle. Each set of image frames includes a second image and a third image. The second image is a high conversion gain HCG image acquired within one exposure cycle, and the third image is a low conversion gain LCG image corresponding to the HCG image. Based on the multiple sets of image frames, a first image is generated and output.

31. The apparatus according to claim 28, characterized in that, The processing module is specifically used for: From the multiple sets of image frames, the HCG image with the highest image quality score is selected as the reference image frame. The image quality score is determined based on the image's sharpness value and motion blur value. Image synthesis processing is performed on each HCG image in the multiple sets of image frames and the LCG image corresponding to the reference image frame to generate a first image.

32. The apparatus according to claim 18, characterized in that, The device also includes a display module; The display module is used to display a first prompt message when fireworks are detected, the first prompt message being used to recommend a shooting mode that matches the fireworks portrait scene; The receiving module is also configured to receive a second input to the first prompt information; The processing module is also configured to activate the fireworks portrait shooting mode in response to the second input; The processing module is specifically used, in the fireworks portrait shooting mode, in response to the first input, to control the camera to capture the first image based on the shooting parameters corresponding to the shooting scene.

33. The apparatus according to claim 32, characterized in that, The shooting preview interface includes a first control, which is used to select or switch the flash mode; The processing module is also used to turn on the flash function when the fireworks portrait shooting mode is started, and update the first control to the second control, which is used to indicate that the fireworks portrait shooting mode has been started.

34. The apparatus according to claim 33, characterized in that, The processing module is further configured to update the second control to a third control after displaying the reference duration of the second control, the third control being used to indicate that the shooting mode is fireworks portrait shooting mode.

35. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the shooting method as described in any one of claims 1-17.