Shooting method and electronic equipment
By displaying the preview thumbnail image only when the preset conditions are met, the problem of the preview thumbnail image being unable to fully play the shooting motion effect and the shooting image not being generated due to pre-displaying, improving the user experience.
Patent Information
- Application Number
- CN202411326893.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-09-23
AI Technical Summary
During the shooting process of electronic devices, pre-view thumbnail images will be displayed too early to cause the shooting motion effect to be played completely, and there may even be problems with the shooting image not being generated.
Avoid premature display by displaying preview thumbnail images only when preset conditions are met. The preset conditions include the timer that reaches the delay time value after receiving the preview request, the reception of the shooting frame information or the response message.
It effectively avoids the problems of shooting motion effects that cannot be fully played and the shooting image is not generated due to premature display of preview thumbnail images, and improves the user experience.
Smart Images

Figure CN118870186B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a shooting method and electronic equipment. Background Art
[0002] With the rapid development of camera functions in electronic devices, electronic devices will display different animation effects (referred to as shooting effects) when shooting in different shooting scenarios. When the electronic device completes a shot, it will display a preview thumbnail image corresponding to the shot on the gallery control of the camera application, and immediately stop playing the corresponding shooting effects. The preview thumbnail image is an image with a smaller resolution and size cached in the electronic device. In response to the user clicking the gallery control, the electronic device jumps from the interface of the current camera application to the program interface of the gallery application, and the program interface displays the shot image of the shot corresponding to the preview thumbnail image. Summary of the invention
[0003] The present application provides a shooting method and electronic device. In the method, a preview thumbnail image is generated based on a preview image, and the preview thumbnail image is displayed only when a preset condition is met, so as to avoid the problem that the preview thumbnail image is displayed too early and the shooting effect cannot be fully played, or even the shooting image is not generated.
[0004] In a first aspect, an embodiment of the present application provides a shooting method. The method is applied to an electronic device, comprising:
[0005] Displaying a preview interface of a camera application, wherein the preview interface includes a preview image; wherein the shooting scene of the camera application is a target scene;
[0006] In response to a shooting operation performed on the preview interface, a target shooting animation corresponding to the target scene is played; wherein the shooting operation is used to trigger the electronic device to collect image data, generate a shot image corresponding to the image data, and store the shot image;
[0007] During the playback of the target shooting dynamic effect, a preview thumbnail image is generated based on the preview image, and when a preset condition is met, the preview thumbnail image is displayed;
[0008] When displaying the preview thumbnail image, stop playing the target shooting animation.
[0009] For example, the target scene can be Figure 1 A photo shooting scene in the aperture mode shown. Fig.13 A photo scene in the photo mode shown. Fig.14 The target shooting effect can be a certain shooting scene in the portrait mode shown in the figure. Figure 1 The first shot of the scene shown, Fig.13The second shooting effect shown, Fig.14 The third shooting effect shown, etc., is not limited to this.
[0010] Exemplarily, the image data collected by the electronic device may be the second image data mentioned below.
[0011] In this way, the electronic device displays the preview thumbnail image only when the preset conditions are met. This method can avoid the problem that the preview thumbnail image is displayed too early, resulting in the shooting animation not being fully played or even the shooting image not being generated.
[0012] According to the first aspect, the preview interface includes a gallery control;
[0013] Displaying the preview thumbnail image, including: displaying the preview thumbnail image on the gallery control;
[0014] When displaying a preview thumbnail image on a gallery control, it also includes:
[0015] In response to a click operation on the gallery control, a program interface of the gallery application is displayed; the program interface includes a captured image.
[0016] In this way, when the preset conditions are met, the preview thumbnail image is displayed on the gallery control; in response to a click operation on the gallery control, the program interface of the gallery application is displayed, and the program interface includes the captured images; the gallery control facilitates users to browse and manage the preview thumbnail images and captured images.
[0017] According to the first aspect, or any implementation of the first aspect above, the electronic device includes: a camera application, a first module;
[0018] In the process of playing the target shooting dynamic effect, generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met includes:
[0019] When the camera application plays the target shooting animation, the camera application sends a first request to the first module;
[0020] The first module generates a preview thumbnail image according to the first request, and sends the preview thumbnail image to the camera application when a first preset condition is met; wherein the first preset condition is that the first module starts timing when the first request is received, and the timing duration reaches a first threshold;
[0021] The camera app displays preview thumbnail images on the gallery control.
[0022] Exemplarily, the first request is the preview thumbnail request mentioned below. The first module is the preview module mentioned below. The first threshold is the delay time value mentioned below.
[0023] In this way, the first module generates a preview thumbnail image according to the first request, and starts timing from the time the first request is received. When the timing reaches a first threshold, the preview thumbnail image is sent to the camera application; the camera application displays the preview thumbnail image on the gallery control; this method can avoid the problem of premature display of the preview thumbnail image resulting in the shooting animation not being fully played or even the shooting image not being generated.
[0024] According to the first aspect, or any implementation of the first aspect above, the electronic device includes: a camera application, a first module;
[0025] In the process of playing the target shooting dynamic effect, generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met includes:
[0026] The first module generates a preview thumbnail image based on the preview image, and sends the preview thumbnail image to the camera application when a second preset condition is met; wherein the second preset condition is that the first module receives shooting frame information; the shooting frame information is metadata used to describe the shot image;
[0027] The camera app displays preview thumbnail images on the gallery control.
[0028] In this way, when the first module receives the shooting frame information, it sends a preview thumbnail image to the camera application; the camera application displays the preview thumbnail image on the gallery control; this method can avoid the problem of displaying the preview thumbnail image too early, resulting in the shooting animation not being fully played, or even the shooting image not being generated.
[0029] According to the first aspect, or any implementation of the first aspect above, the electronic device includes: a camera application, a first module;
[0030] In the process of playing the target shooting dynamic effect, generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met includes:
[0031] The first module generates a preview thumbnail image based on the preview image, and sends the preview thumbnail image to the camera application when a third preset condition is met; wherein the third preset condition is that the first module receives a response message; the response message indicates that the electronic device is generating a captured image based on the captured image frame, or the electronic device starts to generate a captured image based on the captured image frame;
[0032] The camera app displays preview thumbnail images on the gallery control.
[0033] It should be noted that the electronic device generates a captured image based on the captured image frame, including but not limited to: transmitting the captured image frame, performing beautification, format conversion and other processing on the captured image frame to generate the captured image.
[0034] In this way, when the first module receives the response message, it sends a preview thumbnail image to the camera application; the camera application displays the preview thumbnail image on the gallery control; this method can avoid the problem of displaying the preview thumbnail image too early and causing the shooting animation to not be fully played or even the shooting image not being generated.
[0035] According to the first aspect, or any implementation of the first aspect above, generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met, includes:
[0036] sequentially generating at least one preview image;
[0037] Generate a preview thumbnail image corresponding to each preview image according to the order in which the preview images are generated;
[0038] When the preset conditions are met, the latest generated preview thumbnail image is obtained;
[0039] Displays a preview thumbnail image.
[0040] In this way, the first module generates at least one preview image in sequence, generates a preview thumbnail image corresponding to each preview image according to the order in which the preview images are generated, obtains the latest generated preview thumbnail image when a preset condition is met, sends the latest generated preview thumbnail image to the camera application, and the camera application displays the preview thumbnail image. This method can efficiently display the corresponding preview thumbnail image when the preset condition is met.
[0041] According to the first aspect, or any implementation of the first aspect above, before playing the target shooting animation corresponding to the target scene, the method further includes:
[0042] Obtaining a target preview image frame and target preview frame information; wherein the target preview image frame and target preview frame information correspond to the latest generated preview image;
[0043] The target preview image frame and the target preview frame information are detected to determine that the shooting scene of the camera application is the target scene.
[0044] In this way, the camera application detects the latest generated preview image and determines that the current shooting scene is the target scene, so that the target shooting motion effect can be determined according to the target scene, thereby improving the user experience.
[0045] According to the first aspect, or any implementation of the first aspect above, before playing the target shooting animation corresponding to the target scene, the method further includes:
[0046] Determine the frame output time of the captured image corresponding to the target scene;
[0047] The shooting animation that matches the frame output time is used as the target shooting animation.
[0048] In this way, the electronic device determines the frame time of the captured image corresponding to the target scene, uses the shooting animation that matches the frame time as the target shooting animation, and plays the target shooting animation, which can improve the user experience.
[0049] According to the first aspect, or any implementation of the first aspect above, the first threshold is greater than or equal to the frame output time of the captured image in the target scene, and the first threshold is greater than or equal to the duration of the target shooting animation.
[0050] In this way, the first threshold is greater than or equal to the frame time of the captured image in the target scene, and the first threshold is greater than or equal to the duration of the target shooting animation, which can avoid the problem of displaying the preview thumbnail image too early and causing the shooting animation to not be fully played or even the shooting image not being generated.
[0051] In a second aspect, an embodiment of the present application provides an electronic device. The electronic device includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device executes the shooting method of the first aspect and any one of the first aspects.
[0052] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.
[0053] In a third aspect, an embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium includes a computer program, and when the computer program is executed on an electronic device, the electronic device executes the shooting method of the first aspect and any one of the first aspects.
[0054] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.
[0055] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed, enables a computer to execute a shooting method as described in the first aspect or any one of the items in the first aspect.
[0056] The fourth aspect and any implementation of the fourth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fourth aspect and any implementation of the fourth aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.
[0057] In a fifth aspect, the present application provides a chip, the chip comprising a processing circuit and a transceiver pin, wherein the transceiver pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the shooting method of the first aspect or any one of the first aspects to control the receiving pin to receive a signal, and to control the sending pin to send a signal.
[0058] The fifth aspect and any implementation of the fifth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fifth aspect and any implementation of the fifth aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 This is a schematic diagram of an application scenario showing an exemplary display of preview thumbnail images and shooting motion effects;
[0060] Figure 2 A schematic diagram of another application scenario for displaying preview thumbnail images and shooting motion effects is shown as an example;
[0061] Figure 3 A schematic diagram of another application scenario for displaying preview thumbnail images and shooting motion effects is shown as an example;
[0062] Figure 4 is a schematic diagram showing an exemplary method of viewing a captured image;
[0063] Figure 5 is a schematic diagram showing another exemplary method of viewing a captured image;
[0064] Figure 6 The figure is a schematic diagram of a hardware structure of an electronic device shown as an example;
[0065] Figure 7 A schematic diagram of a software structure of an electronic device is shown as an example;
[0066] Figure 8 is a schematic diagram of an exemplary shooting method;
[0067] Fig. 9 is a schematic diagram of an exemplary photographing device;
[0068] Fig.10 is a schematic diagram of another exemplary shooting method;
[0069] Fig.11 is a schematic diagram of another exemplary shooting method;
[0070] Fig.12 is a schematic diagram of another photographing device shown as an example;
[0071] Fig.13 is a schematic diagram of an application scenario showing an exemplary display of a preview thumbnail image and a second shooting animation effect;
[0072] Fig.14 This is a schematic diagram of an application scenario showing an exemplary display of a preview thumbnail image and a third shooting animation effect;
[0073] Fig.15 The figure is a schematic diagram showing another exemplary method of viewing a captured image. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0075] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0076] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.
[0077] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0078] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
[0079] It should be noted that the method for processing an image provided in the embodiment of the present application can be applied to any electronic device with an image processing function.
[0080] In some embodiments of the present application, the electronic device may be a mobile phone, a smart screen, a tablet computer, a wearable device, a television, an in-vehicle electronic device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, etc., or may be other devices or apparatuses capable of scene recognition. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.
[0081] In order to better understand the image processing method provided in the embodiments of the present application, some terms involved in the embodiments of the present application are first explained below to facilitate understanding by those skilled in the art.
[0082] 1. Preview thumbnail images
[0083] A preview thumbnail image refers to an image with a lower resolution cached in an electronic device, and the image quality of the preview thumbnail image is lower than that of the captured image; compared with the captured image in the electronic device, the resolution of the preview thumbnail image is smaller, and the display size of the preview thumbnail image is smaller than the display size of the captured image.
[0084] Optionally, by clicking on a preview thumbnail image on the display interface of the camera application, the actually captured image corresponding to the preview thumbnail image can be viewed.
[0085] 2. Image Buffer
[0086] The image buffer can be regarded as a memory area for temporarily storing image data. It has enough capacity to store a complete frame of image data.
[0087] Optionally, once the image data is stored in the image buffer, the camera in the electronic device can subsequently process or save it.
[0088] 3. Preview Buffer
[0089] The preview buffer can be thought of as a memory area in the camera that is used to display the preview image in real time.
[0090] Before shooting, the electronic device usually displays images of the picture to be shot in the electronic device; these images showing the picture to be shot are called preview images; wherein, the electronic device can cache the preview images in a preview buffer.
[0091] The above is a brief introduction to the terms involved in the embodiments of the present application, which will not be repeated below.
[0092] With the rapid development of camera functions in electronic devices, the frame-out time corresponding to the captured images in different shooting scenes is different; the frame-out time refers to the time required for the electronic device to respond to the user's shooting operation, the camera HAL module to obtain the image data collected by the image sensor, and the camera HAL module to obtain the time required for the captured image frame based on the image data. In different shooting scenes, electronic devices will display different animation effects (referred to as shooting effects) when shooting. When the electronic device completes a shooting, it will display a preview thumbnail image on the gallery control in the preview interface, and immediately stop playing the corresponding shooting effects. The preview thumbnail image is an image with a smaller resolution and size cached in the electronic device. In response to the user clicking the gallery control, the electronic device jumps from the interface of the current camera application to the program interface of the gallery application, and the program interface displays the actual captured image corresponding to the preview thumbnail image.
[0093] It should be noted that the shooting scene is the actual scene where the electronic device is in the shooting mode, and the shooting scene includes but is not limited to: shooting mode, magnification, photographed object, ambient brightness, focus mode, etc. Shooting modes include but are not limited to: aperture mode, photo mode, portrait mode, professional mode, etc. Magnifications include but are not limited to: 1.0x, 2.0x, 3.0x, etc. The photographed objects include but are not limited to: people, buildings, scenery, etc. For example, although the electronic device is in professional mode, when it detects that the photographed object is a person, it will focus on the face. Ambient brightness includes but is not limited to: dark light environment, bright light environment, etc. Focus modes include but are not limited to: single-point focus, continuous focus, etc. For example, when the shooting scene is photo mode and the shooting brightness is a dark light environment, you can reduce the shutter speed, set a high ISO, select a larger aperture, enable the flash, and adjust the white balance.
[0094] It is understandable that different shooting scenes have different quality requirements for the generated captured images, and the frame output time corresponding to the captured images in different shooting scenes is different.
[0095] For example, refer to Figure 1 , when the shooting scene is in aperture mode and the magnification is 1.0x, etc., this scene corresponds to the first shooting effect. Figure 2, when the shooting scene is in photo mode and the magnification is 3.0x, the scene corresponds to the second shooting effect. Figure 3 When the shooting scene is a portrait mode and the magnification is 3.0x, the scene corresponds to the third shooting effect. The following describes the application scenario of the shooting method provided in the embodiment of the present application in conjunction with the accompanying drawings.
[0096] See also Figure 1 , Figure 1 A schematic diagram of an application scenario for displaying preview thumbnail images and shooting motion effects shown in an embodiment of the present application.
[0097] In the embodiment of the present application, the electronic device is described as a mobile phone. For example, after the electronic device runs the camera application, the preview interface 101 is displayed. Figure 1 As shown in (1) in the figure; the preview interface 101 may include a preview image, a gallery control 102, a shooting control 103 and a shooting mode option area 104.
[0098] Among them, the preview image is an image collected by the electronic device in real time through the camera. The gallery control 102 is a control for displaying and managing pictures in the camera application, such as for displaying a preview thumbnail image of the last shot, and the electronic device jumps from the interface of the current camera application to the program interface of the gallery application in response to the user clicking the operation of the gallery control, and the program interface displays the actual shot image corresponding to the preview thumbnail image. The shooting control 103 is a functional component for shooting in the camera application. One or more shooting mode options may be displayed in the shooting mode option area 104. The one or more shooting mode options may include: aperture mode option, night scene mode option, portrait mode option, photo mode option, video mode option, professional option mode and more options.
[0099] For example, Figure 1 As shown in (1) in FIG. 1 , taking the shooting scene as: aperture mode, with a magnification of 1.0x and single-point focus as an example, the gallery control 102 displays a preview thumbnail image of the last shot completed; the electronic device detects that the user clicks the shooting control 103. Figure 1 As shown in (2) in FIG. 1 , in response to the user's hand-off operation, the electronic device plays the first shooting effect. After the first shooting effect is played, the electronic device displays a preview interface 101, and the gallery control 102 in the preview interface 101 displays a preview thumbnail image of the shot image that has been shot this time, such as Figure 1 As shown in (4) in .
[0100] For example, refer to Figure 1 (2) to Figure 1In (4), the second shooting animation includes a transition process from the preview interface 101 to the display interface 105, and from the display interface 105 to the preview interface 101. Figure 1 As shown in (3), the display interface 105 is a black interface.
[0101] In this shooting scene, when the electronic device finishes playing the first shooting animation effect, the electronic device can display a preview image corresponding to the shot image that has been shot this time in the gallery control 102 and generate the shot image this time.
[0102] See also Figure 2 , Figure 2 This is a schematic diagram of another application scenario for displaying preview thumbnail images and shooting animations according to an embodiment of the present application.
[0103] After the electronic device runs the camera application, a preview interface 201 is displayed. Figure 2 As shown in (1) in the figure; the preview interface 201 may include a preview image, a gallery control 202, a shooting control 203, and a shooting mode option area 204. The preview interface 201 may refer to Figure 1 The preview interface 101 shown is not described in detail.
[0104] For example, Figure 2 As shown in (1), taking the shooting scene as: photo mode, and the magnification is 3.0x as an example, the gallery control 202 displays a preview thumbnail image of the last shot completed; the electronic device detects that the user clicks the shooting control 203. Figure 2 As shown in (2) in FIG. 1 , in response to the user's hand-off operation, the electronic device plays the second shooting effect. After the second shooting effect is played, the electronic device displays a preview interface 201, and a gallery control 202 in the preview interface 201 displays a preview thumbnail image of the shot image that has been shot this time, such as Figure 2 As shown in (4) in .
[0105] For example, refer to Figure 2 (2) to Figure 2 In (4), the second shooting animation includes a transition process from the preview interface 201 to the display interface 205, and from the display interface 205 to the preview interface 201. Figure 2As shown in (3), the shooting control 203 in the display interface 205 includes a first area and a second area, the first area is a circle, and the second area is a ring. When the electronic device starts to play the second shooting effect, the first area of the shooting control 203 changes from white to gray, and the second area of the shooting control 203 is initially white. Starting from the 12 o'clock position of the second area, the gray color is gradually filled in the clockwise direction at a uniform speed, and the color of the second area changes from white to gray. After the second area is completely filled with gray, the display interface 205 changes to a black interface. From the black display interface 205 to Figure 2 When the preview interface 201 shown in (4) is displayed, it indicates that the second shooting animation effect is played.
[0106] For example, Figure 2 As shown in (3), the second area in the display interface 205 is half filled with gray, and the electronic device directly switches from the display interface 205 to the preview interface 101. That is, when the second shooting animation is halfway played, the electronic device displays the following Figure 2 In the preview interface 201 shown in (4), the gallery control 202 in the preview interface 201 displays the preview thumbnail images of the images shot this time.
[0107] In this shooting scene, when the second shooting animation is halfway through playing, the electronic device generates a preview thumbnail image corresponding to the currently captured image, and then displays the preview thumbnail image. The second shooting animation ends prematurely due to the premature display of the preview thumbnail image, and the second shooting animation cannot continue until the electronic device generates the captured image. If the user operates to view the captured image corresponding to the preview thumbnail image, since the electronic device does not have enough time to generate the captured image corresponding to the preview thumbnail image, there may be a large deviation between the preview thumbnail image and the corresponding captured image, or even the captured image may not be generated. For example, the user cannot view the captured image generated by this shooting by clicking the gallery control 202, or cannot view the captured image generated by this shooting in the gallery application.
[0108] See also Figure 3 , Figure 3 A schematic diagram of another application scenario for displaying preview thumbnail images and shooting animations according to an embodiment of the present application.
[0109] After the electronic device runs the camera application, a preview interface 301 is displayed, such as Figure 3 As shown in (1) of FIG. 3 ; the preview interface 301 may include a preview image, a gallery control 302, a shooting control 303, and a shooting mode option area 304. The preview interface 301 may refer to Figure 1 The preview interface 101 shown is not described in detail.
[0110] For example, Figure 3 As shown in (1) in FIG. 1 , taking the shooting scene as portrait mode and the magnification as 3.0x as an example, the gallery control 302 displays a preview thumbnail image of the last shot completed; the electronic device detects that the user clicks the shooting control 303. Figure 3 As shown in (2) in FIG. 1 , in response to the user's hand-off operation, the electronic device plays the third shooting effect. After the third shooting effect is played, the electronic device displays a preview interface 301, and a gallery control 302 in the preview interface 301 displays a preview thumbnail image of the shot image that has been shot this time, such as Figure 3 As shown in (4) in .
[0111] For example, refer to Figure 3 (2) to Figure 3 In (4), the third shooting animation includes a transition process from the preview interface 301 to the display interface 305, and from the display interface 305 to the preview interface 301. Figure 3 As shown in (3), the display interface 305 includes prompt information, countdown information, and a countdown progress dial 306. The prompt information is text information that prompts the user; the countdown information is a digital form that indicates the specific seconds of the countdown. For example, when the third shooting animation is completed, the countdown information is 0.0s; the countdown progress dial 306 is a circle that presents the progress. The electronic device starts from the 12 o'clock position of the countdown progress dial 306 and changes the state of the lines of the countdown progress dial 306 in a clockwise direction at a uniform speed, changing the lines of the countdown progress dial 306 from solid lines to dashed lines. The angle corresponding to the dashed lines of the countdown progress dial 306 represents the playback progress of the third shooting animation. For example, the angle corresponding to the dashed lines of the countdown progress dial 306 is 180 degrees, indicating that the third shooting animation is in the state of being halfway through playback. After all the lines of the countdown progress dial 306 become dashed lines, the display interface 305 becomes a black interface. From a black display interface 305 to a Figure 3 When the preview interface 301 shown in (4) is displayed, it indicates that the third shooting animation effect is played.
[0112] For example, Figure 3 As shown in (3) in the figure, the prompt message in the display interface 305 is "Please hold the camera steady"; the countdown message is 0.8s; the dotted line of the countdown progress dial 306 corresponds to an angle of 180 degrees; the electronic device directly switches from the display interface 305 to the preview interface 301. That is, when the third shooting animation is halfway played, the electronic device displays the following Figure 3 In the preview interface 301 shown in (4), the gallery control 302 in the preview interface 301 displays the preview thumbnail images of the images shot this time.
[0113] In this shooting scene, when the third shooting animation is halfway through playing, the electronic device generates a preview thumbnail image corresponding to the image shot this time, and then displays the preview thumbnail image. The third shooting animation ends prematurely due to the premature display of the preview thumbnail image, and the third shooting animation cannot continue until the electronic device generates the shot image. If the user operates to view the shot image corresponding to the preview thumbnail image, since the electronic device does not have enough time to generate the shot image corresponding to the preview thumbnail image, there may be a large deviation between the preview thumbnail image and the corresponding shot image, or even the shot image may not be generated. For example, the user cannot view the shot image generated by this shooting by clicking the gallery control 302, or cannot view the shot image generated by this shooting in the gallery application.
[0114] It should be noted that when the shooting effect is displayed on the display interface, the electronic device can play the shooting effect audio corresponding to the shooting effect.
[0115] In the above embodiment, Figure 2 The shooting scene shown, and Figure 3 In the shooting scene shown, the electronic device generates a preview thumbnail image corresponding to the captured image before the shooting animation is fully played, and then displays the preview thumbnail image. The shooting animation is stopped prematurely due to the premature display of the preview thumbnail image; and these shooting scenes have high requirements on the quality of the generated captured images, and the corresponding frame output of the captured images takes a long time, resulting in the electronic device having a large deviation between the preview thumbnail image and the corresponding captured image, or even the captured image is not generated. For example, the user cannot view the captured image generated by this shooting by clicking the gallery control, or cannot view the captured image generated by this shooting in the gallery application.
[0116] For ease of understanding, the following describes several application scenarios where image loss occurs. Figure 4 , Figure 4 This is a schematic diagram of viewing a captured image according to an embodiment of the present application. Figure 2 The shooting scene shown is used as an example for explanation.
[0117] In one embodiment, Figure 4 (1) to Figure 4 For reference, see (3) Figure 2 (1) to Figure 2 (3) in the above text, I will not elaborate on this. Figure 4As shown in (4) in FIG. 1 , the electronic device displays a preview interface 401, and a gallery control 402 in the preview interface 401 displays a preview thumbnail image of the image that has been shot this time. The user clicks the gallery control 402. The electronic device responds to the user clicking the gallery control 402, and the electronic device displays a program interface 406 of the gallery application. Since the electronic device does not have enough time to generate the image corresponding to the preview thumbnail image, the image generated by this shooting cannot be viewed, and the last shot image is displayed in the program interface 406, such as Figure 4 As shown in (5) in .
[0118] In another embodiment, Figure 5 As shown in (1) in FIG. 5 , a user clicks on a gallery application icon 502 on a system desktop 501, and the electronic device responds to the user's click on the gallery application icon 502 by displaying a gallery preview interface 503. The gallery preview interface 503 includes a thumbnail image. The user clicks on the thumbnail image. Figure 5 As shown in (2) in FIG. 1 . The electronic device responds to the user's click operation to shoot a thumbnail image and displays a program interface 504 of the gallery application. The program interface 504 displays the captured image corresponding to the captured thumbnail image clicked by the user, such as Figure 5 However, since the electronic device does not have enough time to generate the shooting thumbnail image and the shooting image corresponding to the preview thumbnail image, the shooting thumbnail image and the shooting image of this shooting are not displayed in the interface of the gallery application.
[0119] In the above embodiments, the frame output time corresponding to the captured image in different shooting scenes is different. In different shooting scenes, the electronic device will display different shooting effects when shooting. In some shooting scenes, the electronic device generates a preview thumbnail image corresponding to the captured image before the shooting effect is completely played, and then displays the preview thumbnail image. The shooting effect is stopped prematurely due to the premature display of the preview thumbnail image; and these shooting scenes have high requirements on the quality of the generated captured images, and the frame output time corresponding to the captured images is relatively long. At this time, the electronic device has problems such as a large deviation between the preview thumbnail image and the corresponding captured image, or even the captured image is not generated. For example, the user cannot view the captured image generated by this shooting by clicking the gallery control, or cannot view the captured image generated by this shooting in the gallery application.
[0120] In order to solve the above problems, an embodiment of the present application provides a shooting method. A shooting effect is determined according to the shooting scene of the camera application, and the shooting effect is played in response to the shooting operation performed on the preview interface. When playing the shooting effect, the electronic device generates a preview thumbnail image, and displays the preview thumbnail image when the preset conditions are met; wherein the preset conditions include at least one of the following: the preview module starts timing when receiving the preview thumbnail request, and the timing duration reaches the delay time value; the preview module receives the shooting frame information, and the shooting frame information is metadata used to describe the shot image; the preview module receives a response message; the response message indicates that the electronic device is generating a shot image based on the shot image frame, or the electronic device starts to generate a shot image based on the shot image frame. Avoid the problem that the preview thumbnail image is displayed too early, resulting in the shooting effect not being fully played, the preview thumbnail image has a large deviation from the corresponding shot image, and the electronic device has not yet generated the actual shot image.
[0121] The shooting method provided in the embodiments of the present application can be applied to electronic devices, and the electronic devices may be wearable electronic devices (such as watches), portable computers (such as mobile phones), tablet computers, laptop computers, personal computers, augmented reality devices, virtual reality devices, car computers and other devices. The following embodiments do not impose any special restrictions on the specific form of the electronic device.
[0122] Before describing the technical solution of the embodiment of the present application, the electronic device of the embodiment of the present application is first described with reference to the accompanying drawings. Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. It should be understood that: Figure 6 The illustrated electronic device 600 is merely one example of an electronic device, and the electronic device 600 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 6 The various components shown may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0123] The electronic device 600 may include: a processor 610, an external memory interface 620, an internal memory 621, a universal serial bus (USB) interface 630, a charging management module 640, a power management module 641, a battery 642, an antenna 6, an antenna 2, a mobile communication module 650, a wireless communication module 610, an audio module 670, a speaker 670A, a receiver 670B, a microphone 670C, an earphone interface 670D, a sensor module 680, a button 690, a motor 691, an indicator 692, a camera 693, a display screen 694, and a subscriber identification module (SIM) card interface 695, etc. The sensor module 680 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0124] The processor 610 may include one or more processing units, for example, the processor 610 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0125] The controller may be the nerve center and command center of the electronic device 600. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0126] The processor 610 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 610 is a cache memory. The memory may store instructions or data that the processor 610 has just used or cyclically used. If the processor 610 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 610, and thus improves the efficiency of the system.
[0127] In some embodiments, the processor 610 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0128] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 600. In other embodiments of the present application, the electronic device 600 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0129] The charging management module 640 is used to receive charging input from a charger. While the charging management module 640 is charging the battery 642 , it can also supply power to the electronic device 600 through the power management module 641 .
[0130] The power management module 641 is used to connect the battery 642, the charging management module 640 and the processor 610. The power management module 641 receives input from the battery 642 and / or the charging management module 640, and supplies power to the processor 610, the internal memory 621, the external memory, the display screen 694, the camera 693, and the wireless communication module 610. In some other embodiments, the power management module 641 may also be provided in the processor 610. In other embodiments, the power management module 641 and the charging management module 640 may also be provided in the same device.
[0131] The wireless communication function of the electronic device 600 can be implemented through the antenna 6, the antenna 2, the mobile communication module 650, the wireless communication module 610, the modem processor and the baseband processor.
[0132] Antenna 6 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0133] The mobile communication module 650 can provide wireless communication solutions including 2G / 3G / 4G / 5G etc. applied on the electronic device 600 .
[0134] In some embodiments, antenna 6 of electronic device 600 is coupled to mobile communication module 650, and antenna 2 is coupled to wireless communication module 610, so that electronic device 600 can communicate with the network and other devices through wireless communication technology.
[0135] The electronic device 600 implements the display function through a GPU, a display screen 694, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 694 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 610 may include one or more GPUs, which execute program instructions to generate or change display information.
[0136] The display screen 694 is used to display images, videos, etc. The display screen 694 includes a display panel. In some embodiments, the electronic device 600 may include 6 or N display screens 694, where N is a positive integer greater than 6.
[0137] The electronic device 600 can realize the shooting function through the ISP, the camera 693, the video codec, the GPU, the display screen 694 and the application processor, etc. Among them, the camera 693 is used to capture a static image or a video.
[0138] The external memory interface 620 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 600. The external memory card communicates with the processor 610 through the external memory interface 620 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0139] The internal memory 621 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 610 executes various functional applications and data processing of the electronic device 600 by running the instructions stored in the internal memory 621. The internal memory 621 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 600 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 621 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0140] The electronic device 600 can implement audio functions such as music playing and recording through the audio module 670, the speaker 670A, the receiver 670B, the microphone 670C, the headphone jack 670D, and the application processor.
[0141] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be set on the display screen 694. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor, the capacitance between the electrodes changes. The electronic device 600 determines the intensity of the pressure based on the change in capacitance. The electronic device 600 can also calculate the touch position based on the detection signal of the pressure sensor. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions.
[0142] The ambient light sensor is used to sense the brightness of the ambient light. The electronic device 600 can adaptively adjust the brightness of the display screen 694 according to the perceived brightness of the ambient light. The ambient light sensor can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor can also cooperate with the proximity light sensor to detect whether the electronic device 600 is in a pocket to prevent accidental touches.
[0143] The fingerprint sensor is used to collect fingerprints. The electronic device 600 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.
[0144] The display screen 694 in the embodiment of the present application may be a touch screen. A touch sensor may be integrated in the display screen 694. The touch sensor may also be referred to as a "touch panel". In other words, the display screen 694 may include a display panel and a touch panel, and the touch sensor and the display screen 694 form a touch screen, also referred to as a "touch screen". The touch sensor is used to detect touch operations acting on or near it. After the touch operation is detected by the touch sensor, it may be passed to the upper layer by the kernel layer driver (such as the TP driver) to determine the type of touch event. Visual output related to the touch operation may be provided through the display screen 694. In other embodiments, the touch sensor may also be disposed on the surface of the electronic device 600, which is different from the position of the display screen 694.
[0145] In an embodiment of the present application, the touch sensor detects a user's touch operation. For example, when a user touches the display screen 694, the touch sensor detects the user's touch operation, which is passed to the upper layer by the driver of the kernel layer (such as the TP driver) to determine the type of touch event, such as a click-to-shoot control event. For another example, when the user no longer touches the display screen 694, the touch sensor detects that the user has lifted his finger, which is passed to the upper layer by the driver of the kernel layer (such as the TP driver) to determine the type of touch event. In response to the user's touch operation, the processor 610 provides visual output related to the touch operation through the display screen 694, such as the display screen 694 displays a preview interface, which includes a preview image, a gallery control, a gallery control, and a shooting control, etc.
[0146] The shooting method provided in the embodiment of the present application can be implemented in the electronic device 600 having the above hardware structure.
[0147] The following is a brief introduction to the software structure involved in the embodiment of this application. Figure 7 , Figure 7 The software structure block diagram of the electronic device shown in an exemplary embodiment of the present application. The software system of the electronic device 600 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 600.
[0148] The layered architecture of the electronic device 600 divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android Runtime) and the system library, and the kernel layer.
[0149] The application layer can include a series of application packages.
[0150] like Figure 7 As shown, the application package may include applications such as camera, gallery, etc. The application package may also include applications such as call, calendar, map, navigation, music, video, Bluetooth, etc.
[0151] The camera application in the embodiment of the present application is used to send image preview requests, image capture requests, preview thumbnail requests, etc.; determine the capture animation according to the received detection results, and play the capture animation; when a preview thumbnail image is received, update the preview thumbnail image, and stop playing the capture animation. The camera application is also used to display preview images, captured images, and captured thumbnail images, etc.
[0152] The gallery application in the embodiment of the present application is used to respond to user operations and display captured images and captured thumbnail images.
[0153] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0154] like Figure 7 As shown, the application framework layer may include a window manager, a content provider, a phone manager, a resource manager, a notification manager, a post-processing algorithm module, a camera service module, and the like.
[0155] A window manager is used to manage window programs.
[0156] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0157] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0158] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0159] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0160] The camera service module in the embodiment of the present application is used to receive information sent by the post-processing algorithm module, the camera application, and the camera HAL module (such as image preview requests, image shooting requests, preview image frames, shot image frames, image frame information, etc.), or to transmit information to the post-processing algorithm module and the camera application (such as image preview requests, image shooting requests, preview image frames, shot image frames, image frame information, etc.).
[0161] The post-processing algorithm module in the embodiment of the present application is used to receive preview image frames and preview frame information, and generate preview thumbnail images and preview images; the post-processing algorithm module is also used to receive captured image frames and captured frame information, and generate captured images and captured thumbnail images.
[0162] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.
[0163] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0164] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0165] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0166] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0167] The hardware abstraction layer (HAL) is an interface layer between the application framework layer and the kernel layer, which is used to provide a virtual hardware platform for the operating system. The hardware abstraction layer may include camera HAL, audio HAL, storage HAL, etc.
[0168] The camera HAL module in the disclosed embodiment receives image capture requests, image preview requests, etc., triggering the image sensor to collect raw image data, i.e., first image data and second image data. The camera HAL module preprocesses the collected image data, such as converting the collected Raw image into a YUV image, denoising, color correction, light adjustment and other preprocessing, generating preview image frames and captured image frames, etc. Among them, the preview image frame is used to generate a preview image and a preview thumbnail image. The captured image frame is used to generate a captured image and a captured thumbnail image.
[0169] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, audio driver, Wi-Fi driver, sensor driver, etc. Among them, the hardware includes at least processor, display, Wi-Fi module, sensor, etc.
[0170] Understandably, Figure 7 The layers in the software structure shown and the components included in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the present application.
[0171] It is understandable that in order to implement the shooting method in the embodiment of the present application, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0172] Figure 8 FIG. 1 is a schematic diagram showing an exemplary shooting method. Figure 8 The process of the shooting method provided in the embodiment of the present application specifically includes:
[0173] S801: The electronic device generates an image preview request in response to a user's operation of starting a camera application.
[0174] Exemplarily, the user may instruct the electronic device to start the camera application by clicking the camera application icon on the system desktop.
[0175] Exemplarily, when the electronic device is in a lock screen state, the user can instruct the electronic device to start the camera application by double-clicking the volume down button on the electronic device. Alternatively, when the electronic device is in a lock screen state, the lock screen interface includes an icon of the camera application, and the user instructs the electronic device to start the camera application by clicking the icon of the camera application. Alternatively, when the electronic device starts other applications, the other applications have the permission to call the camera application; the user can instruct the electronic device to start the camera application by clicking the corresponding control in the other application. For example, when the electronic device is starting an instant messaging application, the user can instruct the electronic device to start the camera application by selecting the control of the camera function.
[0176] It should be understood that the above is an example of the operation of starting the camera application; the camera application can also be started by instructing the electronic device through voice instructions or other operations; this application does not impose any limitation on this.
[0177] For example, Fig. 9 As shown, the camera application may include a camera manager module, a camera capture session module, and a camera device module. The camera manager module is used to obtain camera parameters, such as the number of cameras, shooting capabilities, and other parameters. The camera capture session module is used to create sessions, such as image capture request sessions, image preview request sessions, and the like. The camera device module is used to obtain user setting parameters, such as flash settings, image ratios, filter effects, and other parameters.
[0178] Exemplarily, after the camera application is started, the camera management module, camera device module and camera capture session module are called; camera parameters such as the number of cameras, shooting capabilities and other parameters are obtained through the camera management module; user setting parameters such as flash settings, image ratio, filter effects and other parameters are obtained through the camera device module; an image preview request session is created through the camera capture session module, and an image preview request is sent to the camera service module through the image preview request session; wherein the image preview request includes but is not limited to the request type, exposure parameters (such as EV value, ISO value, etc.), resolution, jitter amount, etc.
[0179] S802: The camera application sends an image preview request to the camera service module.
[0180] Exemplarily, the camera application sends an image preview request to the camera service module at a preset frequency (eg, dozens of times per second).
[0181] For example, Fig. 9 As shown, the application framework layer includes a camera service module and a post-processing algorithm module. The camera service module is used to read various information of the camera application, such as camera parameters, user setting parameters, image capture requests, image preview requests, etc.
[0182] Exemplarily, the camera capture session module sends an image preview request to the camera component module; the camera management module sends camera parameters to the device service module, and the device service module sends camera parameters to the camera component module; the camera device module sends user setting parameters to the camera component module.
[0183] Optionally, the camera device module corresponds to a camera component module in the application layer.
[0184] S803: The camera service module captures the image preview request and sends the image preview request to the camera HAL module.
[0185] For example, Fig. 9 As shown, the camera component module sends camera parameters, user setting parameters, image preview requests, etc. to the camera HAL module.
[0186] S804: The camera HAL module obtains first image data collected by the image sensor, and preprocesses the first image data to obtain a preview image frame and preview frame information.
[0187] For example, Fig. 9 As shown, the camera HAL module receives an image preview request and stores the image preview request in a request queue. The request queue sequentially stores requests from the camera application, including but not limited to image preview requests and image capture requests. The request queue is a first-in-first-out queue. The camera HAL module processes the raw image data collected by the image sensor based on each request in the request queue to obtain an image frame, for example, preprocessing the first image data collected by the image sensor to obtain a preview image frame; preprocessing the second image data collected by the image sensor to obtain a captured image frame.
[0188] Exemplarily, preprocessing includes but is not limited to converting the acquired Raw image into a YUV image, parsing image data, denoising, color correction, light adjustment, etc., without limitation.
[0189] Exemplarily, the camera HAL module receives camera parameters, user setting parameters, image preview requests, etc. The camera HAL module sends the image preview request to the image sensor driver module, so that the image sensor driver module drives the image sensor to collect the first image data according to the image acquisition parameters matching the image preview request, etc., and the first image data is a Raw image. The image sensor sends the first image data to the camera HAL module. The camera HAL module obtains the first image data, pre-processes the first image data, and obtains a preview image frame and preview frame information.
[0190] The preprocessing includes converting the Raw image into the YUV color space as an example for explanation. The algorithm may be a black level correction processing, a lens shading correction algorithm, etc. The camera HAL module may process the first image data (Raw image), convert the Raw image into a YUV image, and obtain a preview image frame. It is understandable that the preview image frame is a YUV image after the first image data (Raw image) is converted.
[0191] For example, black level correction is used to correct black level, which refers to the video signal level without a line of light output on a calibrated display device. The reason for black level correction is: on the one hand, due to the dark current of the image sensor, the pixel also has the problem of voltage output in the absence of light; on the other hand, due to the insufficient accuracy of the image sensor when performing analog-to-digital conversion. Lens Shading Correction (LSC) is used to eliminate the problem of inconsistent color and brightness around the image and the center of the image caused by the lens optical system.
[0192] The preprocessing may also include a parsing algorithm, which is a parsing algorithm specific to the Raw file format. The camera HAL module parses the first image data (Raw image) based on the parsing algorithm to obtain preview frame information.
[0193] The preview frame information is metadata related to the preview image frame, and is metadata used to describe the preview image. For example, face feature metadata, scene metadata, image metadata, etc. Face feature metadata is the location data of the feature points of the face (such as the location of the eyes, nose, and mouth). Scene metadata is the description data of the scene, such as lighting, background, scene, etc. Image metadata is the description data of the image, such as image name, image size, camera model, shooting time, geographic location, image size, resolution, image type, etc.
[0194] S805. The camera HAL module sends a preview image frame and preview frame information to the camera service module.
[0195] For example, Fig. 9 As shown, the camera HAL module sends the preview image frame and preview frame information to the camera component module, and the camera component module sends the preview image frame and preview frame information to the camera output stream module.
[0196] S806. The camera service module sends the preview image frame and preview frame information to the post-processing algorithm module.
[0197] For example, Fig. 9 As shown, the process running in the camera output stream module captures the preview image frame and preview frame information, and sends the preview image frame and preview frame information to the post-processing algorithm module.
[0198] S807: The post-processing algorithm module performs preview processing on the preview image frame and the preview frame information to obtain a preview image.
[0199] Before shooting, an electronic device usually displays images of the picture to be shot in the electronic device; these images showing the picture to be shot are called preview images.
[0200] Exemplarily, the camera service module sends the preview image frame and the preview frame information to the post-processing algorithm module, and the post-processing algorithm module includes at least one preview buffer, and one preview buffer can be used to store a complete preview image frame and corresponding preview frame information, and multiple preview buffers constitute a preview buffer queue. For example, the first preview buffer stores the first preview image frame and the first preview frame information, and the second preview buffer stores the second preview image frame and the second preview frame information, and the first preview buffer and the second preview buffer constitute a preview buffer queue.
[0201] For example, Fig. 9 As shown, the post-processing algorithm module may include a camera data source module, a preview link module and a shooting link module. The preview link module is used to generate a preview image and a preview thumbnail image. The shooting link module is used to generate a shooting image and a shooting thumbnail image.
[0202] It should be noted that the image frame information is metadata related to the image frame, which is metadata used to describe the image. The image frame information includes preview frame information and shooting frame information. The preview frame information can be transmitted to the preview link module and the shooting link module through the camera data source module. The shooting frame information can be transmitted to the preview link module and the shooting link module through the camera data source module.
[0203] The preview link module includes a diversion module, a detection module, a preview algorithm module and a preview module. The shooting link module includes a data transmission module, a shooting data source module, a shooting algorithm module and a shooting thumbnail image module.
[0204] Exemplarily, the camera output stream module sends the preview image frame and preview frame information to the camera data source module, and the camera data source module transmits the preview image frame and preview frame information to the shunt module. The shunt module copies the preview image frame and preview frame information, transmits one preview image frame and preview frame information to the detection module, and transmits another preview image frame and preview frame information to the preview algorithm module.
[0205] The preview algorithm module may include a beauty algorithm for performing beauty processing on the preview image frame to obtain a processed image frame to obtain an image that meets user requirements. The preview algorithm module sends the preview frame information and the processed image frame to the preview module.
[0206] The preview module includes an algorithm for converting a YUV image into an image of another format. For example, the preview module converts a processed image frame (YUV image) into an image of another format (eg, RGB format, JPEG format (JPG format), GIF format, DNG format, etc.) to obtain a preview image.
[0207] It should be understood that the preview image in RGB format can be used for display on the display screen of the electronic device. Images in JPEG format (JPG format), GIF format, DNG format, etc. can be used for storage, such as in an electronic device.
[0208] S808. The post-processing algorithm module sends the preview image to the camera application.
[0209] S809: The camera application receives the preview image and displays the preview image.
[0210] For example, Fig. 9 As shown, the preview module sends the preview image in RGB format to the camera application, and the camera application can display the preview image in RGB format through the display screen.
[0211] Optionally, the preview module sends the preview frame information to the camera application, and the camera application displays the preview frame information in the preview interface. For example, the scene corresponding to the preview image is indoors, the resolution is 1920x1080, and the shooting time is October 1, 2023, etc.
[0212] S810, the post-processing algorithm module detects and processes the preview image frame and the preview frame information to obtain a detection result. It should be noted that step S807 and step S810 can be performed simultaneously, or any one of the steps can be performed first, and there is no limitation on this.
[0213] S811. The post-processing algorithm module sends the detection result to the camera application.
[0214] The detection module is used to implement face detection, shooting scene detection, gesture recognition, behavior recognition, etc. For example, Fig. 9 As shown, the detection module receives the preview image frame and the preview frame information sent by the diversion module, and detects the preview image frame and the preview frame information to obtain a detection result.
[0215] The detection results include but are not limited to: shooting scenes, facial features, gestures, behaviors (such as walking, running), etc. The shooting scene is the actual scene where the electronic device is in shooting mode. The shooting scene includes but is not limited to: shooting mode, magnification, photographed object, ambient brightness, focus mode, etc. The shooting modes include but are not limited to: aperture mode, photo mode, portrait mode, professional mode, etc. The magnification includes but is not limited to: 1.0x, 2.0x, 3.0x, etc. The photographed objects include but are not limited to: people, buildings, scenery, etc. For example, although the electronic device is in professional mode, when it detects that the photographed object is a person, it will focus on the face. The ambient brightness includes but is not limited to: dark light environment, bright light environment, etc. The focus mode includes but is not limited to: single-point focus, continuous focus, etc. For example, when the shooting scene is photo mode and the shooting brightness is a dark light environment, the shutter speed can be reduced, the high ISO setting can be used, a larger aperture can be selected, the flash can be enabled, and the white balance can be adjusted.
[0216] The detection module sends the detection results to the camera application. For example, the preview frame information contains metadata information of the shooting scene, and the detection module can analyze the metadata information to determine the shooting scene corresponding to the preview frame information; the detection module can analyze the brightness, contrast, color distribution and other information of the preview frame image to determine the shooting scene corresponding to the preview frame image.
[0217] It should be noted that the camera service module transmits the preview frame information to the shooting link module. Specifically, the camera output stream module sends the preview frame information to the shooting link module. Specifically, the camera output stream module sends the preview frame information to the camera data source module, the camera data source module sends the preview frame information to the data transmission module, the data transmission module sends the preview frame information to the shooting data source module, and the shooting data source module sends the preview frame information to the shooting algorithm module.
[0218] Optionally, the shooting algorithm module sends the preview frame information to the shooting thumbnail image module, and the shooting thumbnail image module sends the preview frame information to the camera application.
[0219] Optionally, the shooting algorithm module sends the preview frame information to the camera application.
[0220] S812: The camera application determines a shooting motion effect according to the detection result.
[0221] Exemplarily, taking three shooting effects as an example, the three shooting effects are divided by the first time threshold and the second time threshold. The frame-out time of the captured image corresponding to the shooting scene is less than the first time threshold, and the shooting scene corresponds to the first shooting effect. The frame-out time of the captured image corresponding to the shooting scene is greater than or equal to the first time threshold, and less than or equal to the second time threshold, and the shooting scene corresponds to the second shooting effect. The frame-out time of the captured image corresponding to the shooting scene is greater than the second time threshold, and the shooting scene corresponds to the third shooting effect.
[0222] It can be understood that the second time threshold is greater than the first time threshold. For example, the first time threshold may be 400 ms, and the second time threshold may be 1 s.
[0223] Exemplarily, the post-processing algorithm module detects and processes the latest generated preview image frame and preview frame information in real time to obtain a detection result, determines the current shooting scene based on the detection result, and determines the shooting effect based on the frame output time of the shot image corresponding to the shooting scene. For example, according to the first detection result, it is determined that the shooting mode in the first shooting scene is the aperture mode, and the magnification is 1.0x. According to the first shooting scene and the frame output time of the shot image corresponding to the first shooting scene, the shooting effect is determined to be the first shooting effect. According to the second detection result, it is determined that the shooting mode in the second shooting scene is the aperture mode, and the magnification is 3.0x. According to the second shooting scene and the frame output time of the shot image corresponding to the second shooting scene, the shooting effect is determined to be the second shooting effect.
[0224] Specifically, Fig. 9 As shown, the camera HAL module reports different shooting scenes and the frame time corresponding to each shooting scene through the shutterOptimizationParam parameter, that is, the frame time corresponding to each shooting scene is sent to the camera application. The camera application determines the current shooting scene based on the detection results corresponding to the latest received preview image frame and the preview frame information, and determines the frame time corresponding to the current shooting scene based on the frame time corresponding to each shooting scene sent by the camera HAL module. Determine the shooting effect based on the frame time, and display the shooting effect. For example, the camera application determines that the current shooting scene is professional mode based on the detection results, the flash is turned on, and the magnification is 1.0x, and determines that the frame time corresponding to the current shooting scene is 1.5s based on the frame time corresponding to each shooting scene sent by the camera HAL module. If the frame time is greater than the second time threshold, the shooting effect is determined to be the third shooting effect, and the third shooting effect is displayed.
[0225] S813: The camera application plays a shooting animation in response to the user's triggering operation of shooting.
[0226] Exemplarily, the shooting operation is used to indicate starting shooting, and the shooting operation may be a photo operation. Figure 1 As shown in (1), the shooting operation may be a click operation on the shooting control. The shooting operation may also be an operation of instructing shooting by voice; or, the shooting operation may also be an operation of instructing shooting by face recognition; or, the shooting operation may also be an operation of instructing shooting by gesture recognition; or, the shooting operation may also be an operation of instructing shooting by pressing a physical button (such as a volume button), etc. This application does not impose any limitation on this.
[0227] Exemplarily, the camera application starts shooting in response to different types of shooting operations triggered by the user.
[0228] It is worth noting that in the embodiments of the present application, when the shooting operation is a click operation, the shooting operation can be divided into a click operation of the shooting control and a hand-off operation. Generally, when the camera application detects the click operation of the shooting control, the shooting starts; when the camera application detects the hand-off operation, the shooting ends.
[0229] S814: The camera application sends an image capture request to the camera service module.
[0230] Exemplarily, the camera application sends a photographing parameter request to the post-processing algorithm module. The post-processing algorithm module receives the photographing parameter request, determines the photographing parameters, and sends the photographing parameters to the camera application. The camera application sends an image capture request to the camera service module, wherein the image capture request includes the photographing parameters.
[0231] Specifically, Fig. 9 As shown, the camera application sends a photo parameter request to the shooting link module. The shooting link module receives the photo parameter request and determines the photo parameters (such as exposure, ISO, aperture, white balance, etc.) corresponding to the shooting link module according to environmental information, user settings, and preset rules. The shooting link module sends the determined photo parameters to the camera capture session module. The camera capture session module creates an image capture request session and sends an image capture request to the camera component module through the image capture request session, wherein the image capture request includes the photo parameters.
[0232] S815: The camera service module captures the image capture request and sends the image capture request to the camera HAL module.
[0233] For example, Fig. 9 As shown, the camera component module captures the image capture request sent by the camera application in real time, and sends the image capture request to the camera HAL module.
[0234] S816. The camera HAL module obtains the second image data collected by the image sensor, and preprocesses the second image data to obtain a captured image frame and captured frame information.
[0235] Preprocessing includes but is not limited to converting the acquired Raw image into a YUV image, parsing image data, denoising, color correction, light adjustment, etc., and there is no restriction on this.
[0236] For example, Fig. 9 As shown, the camera HAL module receives the image capture request and stores the image capture request in the request queue. The camera HAL module sends the image capture request to the image sensor driver module, so that the image sensor driver module drives the image sensor to capture the second image data according to the image capture parameters matching the image capture request, etc., and the second image data is a Raw image. The image sensor sends the second image data to the camera HAL module. The camera HAL module obtains the second image data, pre-processes the second image data, and obtains the captured image frame and the captured frame information.
[0237] Exemplarily, the preprocessing may include an algorithm for converting a Raw image into a YUV color space. The algorithm may be an algorithm for black level correction processing, lens shading correction, and the like. The camera HAL module may process the second image data (Raw image), convert the Raw image into a YUV image, and obtain a captured image frame. It is understandable that the captured image frame is a YUV image after the second image data (Raw image) is converted.
[0238] For example, black level correction is used to correct black level, which refers to the video signal level without a line of light output on a calibrated display device. The reason for black level correction is: on the one hand, due to the dark current of the image sensor, the pixel also has the problem of voltage output in the absence of light; on the other hand, due to the insufficient accuracy of the image sensor when performing analog-to-digital conversion. Lens Shading Correction (LSC) is used to eliminate the problem of inconsistent color and brightness around the image and the center of the image caused by the lens optical system.
[0239] The preprocessing may also include a parsing algorithm, which is a parsing algorithm specific to the Raw file format. The camera HAL module parses the second image data (Raw image) based on the parsing algorithm to obtain shooting frame information.
[0240] The shooting frame information is metadata related to the shooting image frame, which is metadata used to describe the shot image. For example, face feature metadata, scene metadata, image metadata, etc. Face feature metadata is the location data of the feature points of the face (such as the location of the eyes, nose, and mouth). Scene metadata is the description data of the scene, such as lighting, background, scene, etc. Image metadata is the description data of the image, such as image name, image size, camera model, shooting time, geographic location, image size, resolution, image type, etc.
[0241] S817: The camera HAL module sends the captured image frame and the captured frame information to the camera service module.
[0242] For example, Fig. 9 As shown, the camera HAL module sends the captured image frames and the captured frame information to the camera component module, and the camera component module sends the captured image frames and the captured frame information to the camera output stream module.
[0243] S818. The camera service module sends the captured image frame and captured frame information to the post-processing algorithm module.
[0244] For example, Fig. 9 As shown, the process running in the camera output stream module captures the captured image frame and the captured frame information, and sends the captured image frame and the captured frame information to the post-processing algorithm module.
[0245] S819, the post-processing algorithm module performs image processing on the captured image frame and the captured frame information to obtain a captured thumbnail image and a captured image.
[0246] Exemplarily, the camera service module sends the captured image frame and the captured frame information to the post-processing algorithm module, and the post-processing algorithm module includes at least one image buffer, and one image buffer can be used to store a complete captured image frame and corresponding captured frame information, and multiple image buffers constitute an image buffer queue. For example, the first image buffer stores the first frame captured image frame and the first frame captured frame information, and the second image buffer stores the second frame captured image frame and the second frame captured frame information, and the first image buffer and the second image buffer constitute an image buffer queue.
[0247] For example, Fig. 9 As shown, the post-processing algorithm module may include a camera data source module, a preview link module and a shooting link module. The preview link module is used to generate a preview image and a preview thumbnail image. The shooting link module is used to generate a shooting image and a shooting thumbnail image.
[0248] The preview link module includes a diversion module, a detection module, an image algorithm module and an image module. The shooting link module includes a data transmission module, a shooting data source module, a shooting algorithm module and a shooting thumbnail image module.
[0249] For example, Fig. 9 As shown, the camera output stream module sends the captured image frame and the captured frame information to the camera data source module, and the camera data source module transmits the captured image frame and the captured frame information to the data transmission module. The data transmission module transmits the captured image frame and the captured frame information to the capture data source module. The capture data source module transmits the captured image frame and the captured frame information to the capture algorithm module.
[0250] The shooting algorithm module may include a beauty algorithm for performing beauty processing on the captured image frame. The shooting algorithm module may also include an algorithm for converting a YUV image into an image in another format. For example, the captured image frame (YUV image) is converted into an image in another format (e.g., RGB format, JPEG format (JPG format), GIF format, DNG format, etc.) through the shooting algorithm module to obtain a captured image.
[0251] It should be understood that the preview image in RGB format can be used for display on the display screen of the electronic device. Images in JPEG format (JPG format), GIF format, DNG format, etc. can be used for storage, such as in an electronic device.
[0252] Exemplarily, the shooting algorithm module sends the shot image to the shooting thumbnail image module, and the shooting thumbnail image module processes the shot image in terms of size, resolution, etc. to obtain the shot thumbnail image.
[0253] Exemplarily, the camera output stream module sends the shooting frame information to the preview link module. Specifically, the camera output stream module sends the shooting frame information to the camera data source module, and the camera data source module sends the shooting frame information to the shunt module. The shunt module copies the shooting frame information and transmits one copy of the shooting frame information to the detection module. The detection module sends the shooting frame information to the camera application. Another copy of the shooting frame information is transmitted to the preview algorithm module, the preview algorithm module transmits the shooting frame information to the preview module, and the preview module sends the shooting frame information to the camera application.
[0254] S820. The post-processing algorithm module sends the captured thumbnail image and the captured image to the camera application.
[0255] For example, Fig. 9 As shown in the figure, the post-processing algorithm module calls the captured thumbnail image and the captured image to the camera application by monitoring the global event (onGlobalEvent) function. After the camera application obtains the captured thumbnail image and the captured image, it can notify the gallery application to store, rename, and perform other operations on the captured thumbnail image and the captured image.
[0256] S821. The camera application displays the captured thumbnail image and the captured image.
[0257] For example, Fig. 9 As shown, the shooting algorithm module sends the shot image in RGB format to the camera application, and the camera application can display the shot image in RGB format through the display screen, such as Figure 5 As shown in (3) in .
[0258] Exemplarily, the shooting thumbnail image module sends the shooting thumbnail image in RGB format to the camera application, and the camera application can display the shooting thumbnail image in RGB format through the display screen, such as Figure 5 As shown in (2) in .
[0259] Optionally, the shooting algorithm module sends the shooting frame information to the camera application, and the camera application displays the shooting frame information in the display interface. For example, the scene corresponding to the shot image is indoors, the resolution is 1920x1080, and the shooting time is October 1, 2023, etc.
[0260] S822: After the camera application sends an image capture request to the camera service module, it sends a preview thumbnail request to the post-processing algorithm module.
[0261] For example, Fig. 9 As shown, after the camera application sends an image capture request to the camera service module, the camera application sends a preview thumbnail request to the preview module of the post-processing algorithm module. Specifically, the camera capture session module calls the requestPreviewImage interface to send a preview thumbnail request to the preview module of the post-processing algorithm module.
[0262] S823: The post-processing algorithm module processes the preview image to obtain a preview thumbnail image.
[0263] S824: When the time for the post-processing algorithm module to receive the preview thumbnail request reaches the delay time value, the preview thumbnail image is sent to the camera application. Fig. 9 As shown, the preview module of the post-processing algorithm module captures the preview thumbnail request sent by the camera application in real time, and the preview module generates at least one preview image in sequence. According to the order in which the preview images are generated, each preview image is scaled and processed, and a preview thumbnail image corresponding to each preview image is generated, and the preview thumbnail image is stored in the preview thumbnail buffer. When the time when the preview module receives the preview thumbnail request reaches the delay time value, the latest generated preview thumbnail image (the preview thumbnail image last stored in the preview thumbnail buffer) is obtained from the preview thumbnail buffer, and the preview thumbnail image is sent to the camera application.
[0264] In one embodiment, the preview module can store the preview thumbnail image corresponding to each preview image in the preview thumbnail buffer, and record the generation time of each preview image. When the time when the preview module receives the preview thumbnail request reaches the delay time value, the latest generated preview thumbnail image is obtained from the preview thumbnail buffer, and the preview thumbnail image is sent to the camera application.
[0265] In another embodiment, the preview thumbnail buffer only stores the latest generated preview thumbnail image, and the latest generated preview thumbnail image replaces the original preview thumbnail image in the preview thumbnail buffer.
[0266] It should be noted that different shooting effects have different delay time values, the delay time value is greater than or equal to the shooting effect duration, and the delay time value is greater than or equal to the frame time of the captured image. For example, the third shooting effect duration is 1s, the frame time of the captured image is 0.9s, and the delay time value is greater than or equal to 1s. In this way, it is possible to avoid problems such as the preview thumbnail image being displayed too early, resulting in the shooting effect not being fully played, and the electronic device not yet generating the actual captured image.
[0267] S825. The camera application updates the preview thumbnail image and stops playing the shooting animation.
[0268] It should be understood that in the preview interface of the camera application, what is originally displayed is a preview thumbnail image of the last shot completed, such as Figure 1 As shown in (2) in ; when a new preview thumbnail image is generated, the preview thumbnail image of the last captured image is replaced with the new preview thumbnail image, as shown in Figure 1 As shown in (4) in the figure, the preview thumbnail image is updated.
[0269] Exemplarily, the user triggers an operation to exit the camera application, wherein the operation to exit the camera application may be an operation to exit the camera application through voice instructions; or, the operation to exit the camera application may be an operation to return; or, the operation to exit the camera application may be an operation to open other applications, etc.; this application does not impose any limitation on this.
[0270] When the user triggers the operation of exiting the camera application, the camera application responds to the user operation and releases the previously established sessions, such as the image capture request session, the image preview request session, etc. At the same time, the camera application sends a termination acquisition instruction to the camera service module, the post-processing algorithm module, and the camera HAL module. Among them, the termination acquisition instruction is used for the camera service module, the post-processing algorithm module, and the camera HAL module to clear their respective current processing links. The image sensor in the electronic device will no longer collect the original image data (first image data, second image data). In this implementation method, the electronic device executes the end of the shooting process, releases each link in the shooting process, and prepares for the next shooting.
[0271] Exemplarily, the processing links corresponding to the camera service module may be a link for capturing image shooting requests, a link for capturing image preview requests, a link for sending preview image frames and preview frame information to a post-processing algorithm module, a link for sending captured image frames and captured frame information to a post-processing algorithm module, etc.
[0272] Exemplarily, the processing link corresponding to the post-processing algorithm module may be a link of generating a preview thumbnail image, a preview image, shooting a thumbnail image, shooting an image, and the like.
[0273] Exemplarily, the processing link corresponding to the camera HAL module can be a link for preprocessing the first image data, a link for sending the preview image frame and preview frame information to the camera service module, a link for preprocessing the second image data, a link for sending the captured image frame and captured frame information to the camera service module, etc.
[0274] Fig.10 FIG. 1 is a schematic diagram showing another exemplary shooting method. Fig.10 The process of the shooting method provided in the embodiment of the present application specifically includes:
[0275] S1001: The electronic device generates an image preview request in response to a user's operation of starting a camera application.
[0276] S1002: The camera application sends an image preview request to the camera service module.
[0277] S1003: The camera service module captures the image preview request and sends the image preview request to the camera HAL module.
[0278] S1004: The camera HAL module obtains first image data collected by the image sensor, and preprocesses the first image data to obtain a preview image frame and preview frame information.
[0279] S1005. The camera HAL module sends a preview image frame and preview frame information to the camera service module.
[0280] S1006. The camera service module sends the preview image frame and preview frame information to the post-processing algorithm module.
[0281] S1007: The post-processing algorithm module performs preview processing on the preview image frame and the preview frame information to obtain a preview image.
[0282] S1008. The post-processing algorithm module sends the preview image to the camera application.
[0283] S1009: The camera application receives the preview image and displays the preview image.
[0284] S1010: The post-processing algorithm module performs detection processing on the preview image frame and the preview frame information to obtain a detection result.
[0285] It should be noted that step S1007 and step S1010 can be performed simultaneously, or any one of the steps can be performed first, and there is no limitation on this.
[0286] S1011. The post-processing algorithm module sends the detection results to the camera application.
[0287] S1012: The camera application determines a shooting motion effect according to the detection result.
[0288] S1013: The camera application plays a shooting animation in response to the user's triggering operation of shooting.
[0289] S1014: The camera application sends an image capture request to the camera service module.
[0290] S1015. The camera service module captures the image capture request and sends the image capture request to the camera HAL module.
[0291] S1016. The camera HAL module obtains the second image data collected by the image sensor, and preprocesses the second image data to obtain a captured image frame and captured frame information.
[0292] S1017. The camera HAL module sends the captured image frame and captured frame information to the camera service module.
[0293] S1018. The camera service module sends the captured image frame and captured frame information to the post-processing algorithm module.
[0294] S1019: The post-processing algorithm module performs image processing on the captured image frame and the captured frame information to obtain a captured thumbnail image and a captured image.
[0295] S1020. The post-processing algorithm module sends the captured thumbnail image and the captured image to the camera application.
[0296] S1021. The camera application displays the captured thumbnail image and the captured image.
[0297] S1022: After the camera application sends an image capture request to the camera service module, it sends a preview thumbnail request to the post-processing algorithm module.
[0298] S1023: The post-processing algorithm module processes the preview image to obtain a preview thumbnail image.
[0299] For example, Fig. 9 As shown, after receiving the preview thumbnail request, the preview module of the post-processing algorithm module sets the flag of the preview module to true. The preview module generates at least one preview image in sequence. Each time the preview module generates a preview image, it is determined whether the flag of the preview module is set to true. If so, the preview module performs scaling and other processing on the preview image to obtain a preview thumbnail image, and stores the preview thumbnail image in the preview thumbnail buffer. Otherwise, no processing is performed.
[0300] S1024: When the post-processing algorithm module receives the captured frame information, it sends a preview thumbnail image to the camera application.
[0301] For example, Fig. 9 As shown, the post-processing algorithm module may include a camera data source module, a preview link module and a shooting link module. The preview link module is used to generate a preview image and a preview thumbnail image. The shooting link module is used to generate a shooting image and a shooting thumbnail image.
[0302] It should be noted that the image frame information includes preview frame information and shooting frame information. The preview frame information is metadata used to generate the preview image, and the preview frame information can be transmitted to the preview link module and the shooting link module through the camera data source module. The shooting frame information is metadata used to describe the shot image, and the shooting frame information can be transmitted to the preview link module and the shooting link module through the camera data source module.
[0303] The preview link module includes a diversion module, a detection module, a preview algorithm module and a preview module. The shooting link module includes a data transmission module, a shooting data source module, a shooting algorithm module and a shooting thumbnail image module.
[0304] Exemplarily, the camera output stream module sends the shooting frame information to the preview link module. Specifically, the camera output stream module sends the shooting frame information to the camera data source module, and the camera data source module sends the shooting frame information to the shunt module. The shunt module copies the shooting frame information and transmits one copy of the shooting frame information to the detection module. The detection module sends the shooting frame information to the camera application. Another copy of the shooting frame information is transmitted to the preview algorithm module, and the preview algorithm module transmits the shooting frame information to the preview module.
[0305] In one embodiment, when the preview module receives the captured frame information, it obtains the latest generated preview thumbnail image from the preview thumbnail buffer, and sends the preview thumbnail image to the camera application.
[0306] In another embodiment, the preview module obtains the latest generated preview thumbnail image from the preview thumbnail buffer at the target time, and sends the preview thumbnail image to the camera application. The target time value is determined according to the sending time value A of the shooting frame information and the target delay time value B, and the target time value is A+B. The sending time value of the shooting frame information may be: the sending time value of the shooting frame information sent by the camera HAL to the camera service module, the sending time value of the shooting frame information sent by the camera service module to the post-processing algorithm module, the sending time value of the shooting frame information sent by the preview algorithm module to the preview module, etc. Exemplarily, when the target time value is A+B, the preview module obtains the latest generated preview thumbnail image from the preview thumbnail buffer, and sends the preview thumbnail image to the camera application.
[0307] It should be noted that the target delay time values corresponding to different shooting scenes may be different, and the target time value is determined according to the sending time value of the shooting frame information and the target delay time value. At the target time, the preview module obtains the latest generated preview thumbnail image from the preview thumbnail buffer and sends the preview thumbnail image to the camera application. In abnormal scenarios, such as when the preview module does not receive the shooting frame information, or the preview module times out when receiving the shooting frame information, the preview thumbnail image can be sent to the camera application.
[0308] It should be noted that after the preview module previews the thumbnail image to the camera application, the flag of the preview module will be set to false.
[0309] S1025. The camera application updates the preview thumbnail image and stops playing the shooting animation.
[0310] It should be noted that step S1001 to step S1025 may refer to step S801 to step S825, and no further description is given for comparison.
[0311] Fig.11 FIG. 1 is a schematic diagram showing another exemplary shooting method. Fig.11 The process of the shooting method provided in the embodiment of the present application specifically includes:
[0312] S1101: The electronic device generates an image preview request in response to a user's operation of starting a camera application.
[0313] S1102: The camera application sends an image preview request to the camera service module.
[0314] S1103: The camera service module captures the image preview request and sends the image preview request to the camera HAL module.
[0315] S1104: The camera HAL module obtains first image data collected by the image sensor, and preprocesses the first image data to obtain a preview image frame and preview frame information.
[0316] S1105. The camera HAL module sends a preview image frame and preview frame information to the camera service module.
[0317] S1106. The camera service module sends the preview image frame and preview frame information to the post-processing algorithm module.
[0318] S1107 . The post-processing algorithm module performs preview processing on the preview image frame and the preview frame information to obtain a preview image.
[0319] S1108. The post-processing algorithm module sends the preview image to the camera application.
[0320] S1109: The camera application receives the preview image and displays the preview image.
[0321] S1110 , the post-processing algorithm module performs detection processing on the preview image frame and the preview frame information to obtain a detection result.
[0322] It should be noted that step S1107 and step S1110 can be performed simultaneously, or any one of the steps can be performed first, and there is no limitation on this.
[0323] S1111. The post-processing algorithm module sends the detection result to the camera application.
[0324] S1112: The camera application determines a shooting motion effect according to the detection result.
[0325] S1113: The camera application plays a shooting animation in response to the user's triggering operation of shooting.
[0326] S1114. The camera application sends an image capture request to the camera service module.
[0327] S1115. The camera service module captures the image capture request and sends the image capture request to the camera HAL module.
[0328] S1116. The camera HAL module obtains the second image data collected by the image sensor, and preprocesses the second image data to obtain a captured image frame and captured frame information.
[0329] S1117. The camera HAL module sends the captured image frame and the captured frame information to the camera service module.
[0330] S1118. The camera service module sends the captured image frame and captured frame information to the post-processing algorithm module.
[0331] S1119, the post-processing algorithm module performs image processing on the captured image frame and the captured frame information to obtain a captured thumbnail image and a captured image.
[0332] S1120. The post-processing algorithm module sends the captured thumbnail image and the captured image to the camera application.
[0333] S1121. The camera application displays the captured thumbnail image and the captured image.
[0334] S1122: After the camera application sends an image capture request to the camera service module, it sends a preview thumbnail request to the post-processing algorithm module.
[0335] S1123: The post-processing algorithm module processes the preview image to obtain a preview thumbnail image.
[0336] Exemplarily, after receiving a preview thumbnail request, the preview module of the post-processing algorithm module sets the flag of the preview module to true. The preview module generates at least one preview image in sequence, and each time the preview module generates a preview image, it is determined whether the flag of the preview module is set to true. If so, the preview module performs scaling and other processing on the preview image to obtain a preview thumbnail image, and stores the preview thumbnail image in the preview thumbnail buffer. Otherwise, no processing is performed.
[0337] S1124: When the post-processing algorithm module receives the response message, it sends the preview thumbnail image to the camera application.
[0338] It should be noted that the response message indicates that the electronic device is generating a captured image according to the captured image frame, or the electronic device starts to generate a captured image according to the captured image frame.
[0339] For example, Fig.12 As shown, the post-processing algorithm module may include a camera data source module, a preview link module and a shooting link module. The preview link module is used to generate a preview image and a preview thumbnail image. The shooting link module is used to generate a shooting image and a shooting thumbnail image.
[0340] The preview link module includes a diversion module, a detection module, a preview algorithm module and a preview module. The shooting link module includes a data transmission module, a shooting data source module, a shooting algorithm module and a shooting thumbnail image module.
[0341] The camera data source module sends the captured image frame to the capture link module. When the capture link module starts to generate the captured image according to the captured image frame or is generating the captured image according to the captured image frame, it sends a response message to the preview link module. After receiving the response message, the preview link module sends the preview thumbnail image to the camera application. When the camera application displays the preview thumbnail image, the capture link module has completed generating the captured image according to the captured image frame.
[0342] It should be noted that the shooting link module receives the shooting image frame, which indicates that the electronic device starts to generate the shooting image according to the shooting image frame; the shooting link module processes the shooting image frame, which indicates that the electronic device is generating the shooting image according to the shooting image frame.
[0343] Specifically, the camera output stream module sends the captured image frame and the captured frame information to the camera data source module, and the camera data source module transmits the captured image frame and the captured frame information to the data transmission module. The data transmission module transmits the captured image frame and the captured frame information to the captured data source module. The captured data source module transmits the captured image frame and the captured frame information to the captured algorithm module, and the captured algorithm module performs beautification, format conversion and other processing on the captured image frame and the captured frame information to generate a captured image.
[0344] Among them, the electronic device generates a captured image based on the captured image frame, including but not limited to: transmitting the captured image frame to the shooting algorithm module, and the shooting algorithm module performs beautification, format conversion and other processing on the captured image frame to generate the captured image. That is, the shooting data source module receives the captured image frame and the shooting frame information, and the shooting data source module transmits the captured image frame and the shooting frame information to the shooting algorithm module, and the shooting algorithm module performs beautification, format conversion and other processing on the captured image frame and the shooting frame information to generate the captured image.
[0345] For example, the shooting data source module receives the shooting image frame, indicating that the electronic device starts to generate the shooting image according to the shooting image frame, and the shooting data source module sends a response message to the preview module. When the preview module receives the response message, it obtains the latest generated preview thumbnail image from the preview thumbnail buffer and sends the preview thumbnail image to the camera application.
[0346] For example, the shooting algorithm module receives a shooting image frame, indicating that the electronic device is generating a shooting image based on the shooting image frame, and the shooting algorithm module sends a response message to the preview module. When the preview module receives the response message, it obtains the latest generated preview thumbnail image from the preview thumbnail buffer and sends the preview thumbnail image to the camera application. It should be noted that after the preview module sends the preview thumbnail image to the camera application, the flag of the preview module will be set to false.
[0347] S1125. The camera application updates the preview thumbnail image and stops playing the shooting animation.
[0348] It should be noted that step S1101 to step S1125 may refer to step S801 to step S825, and no further description is given for comparison.
[0349] See also Fig.13 , Fig.13A schematic diagram of an application scenario for displaying a preview thumbnail image and a second shooting animation is shown in an embodiment of the present application.
[0350] After the electronic device runs the camera application, a preview interface 1301 is displayed. Fig.13 As shown in (1) of FIG. 1 , the preview interface 1301 may include a preview image, a gallery control 1302, a shooting control 1303, and a shooting mode option area 1304. The preview interface 1301 may refer to Figure 1 The preview interface 101 shown is not described in detail.
[0351] For example, Fig.13 As shown in (1), the current shooting scene is the photo mode, and the magnification is 3.0x. The gallery control 1302 displays a preview thumbnail image of the last shot. The electronic device detects that the user clicks the shooting control 1303. Fig.13 As shown in (2) in FIG. 1 , in response to the user's hand-off operation, the electronic device plays the second shooting effect. After the second shooting effect is played, the electronic device displays the following Fig.13 In the preview interface 1301 shown in (6), the gallery control 1302 in the preview interface 1301 displays the preview thumbnail images of the images shot this time.
[0352] For example, refer to Fig.13 (2) to Fig.13 In (6), the second shooting animation includes a transition process from the preview interface 1301 to the display interface 1305, and from the display interface 1305 to the preview interface 1301. Fig.13 (3) and Fig.13 As shown in (4), the shooting control 1303 in the display interface 1305 includes a first area and a second area, the first area is a circle, and the second area is a ring.
[0353] For example, when the electronic device starts playing the second shooting animation, the first area of the shooting control 1303 changes from white to gray, and the second area of the shooting control 1303 is initially white. Starting from the 12 o'clock position of the second area, the gray color is gradually filled in the clockwise direction at a uniform speed, and the color of the second area changes from white to gray. Fig.13 As shown in (5) in FIG. 1 , after the second area is completely filled with gray, the display interface 1305 changes to a black interface. Fig.13 When the preview interface 1301 shown in (6) is displayed, it indicates that the second shooting animation effect is played.
[0354] In the shooting scene, when the electronic device plays the second shooting effect, it generates a preview thumbnail image corresponding to the image shot this time; and displays the preview thumbnail image when the preset conditions are met; wherein the preset conditions include at least one of the following: the preview module starts timing when receiving the preview thumbnail request, and the timing duration reaches the delay time value; the preview module receives the shooting frame information, and the shooting frame information is metadata used to describe the shot image; the preview module receives a response message; the response message indicates that the electronic device is generating a shot image based on the shot image frame, or the electronic device starts to generate a shot image based on the shot image frame. Avoid problems such as the preview thumbnail image being displayed too early, resulting in the shooting effect not being fully played, the preview thumbnail image having a large deviation from the corresponding shot image, and the electronic device not yet generating the actual shot image.
[0355] See also Fig.14 , Fig.14 A schematic diagram of an application scenario for displaying a preview thumbnail image and a third shooting animation effect shown in an embodiment of the present application.
[0356] After the electronic device runs the camera application, a preview interface 1401 is displayed. Fig.14 As shown in (1) of FIG. 1 , the preview interface 1401 may include a preview image, a gallery control 1402, a shooting control 1403, and a shooting mode option area 1404. The preview interface 1401 may refer to Figure 1 The preview interface 101 shown is not described in detail.
[0357] For example, Fig.14 As shown in (1), the current shooting scene is portrait mode, and the magnification is 3.0x. The gallery control 1402 displays a preview thumbnail image of the last shot completed; the electronic device detects that the user clicks the shooting control 1403. Fig.14 As shown in (2) of FIG. 1 , in response to the user's hand-off operation, the electronic device plays the third shooting effect. After the third shooting effect is played, the electronic device displays the following Fig.14 The preview interface 1401 shown in (6) is shown in FIG.
[0358] For example, refer to Fig.14 (2) to Fig.14 In (6), the third shooting animation includes a transition process from the preview interface 1401 to the display interface 1405, and from the display interface 1405 to the preview interface 1401. Fig.14 (3) and Fig.14As shown in (4), the prompt message in the display interface 1405 is "Please hold the camera steady"; the countdown information is from 0.8s to 0.0s; the electronic device changes the state of the countdown progress dial 1406 at a uniform speed along the clockwise direction from the solid line to the dotted line, and the angle corresponding to the dotted line of the countdown progress dial 1406 represents the playback progress of the third shooting animation. Fig.14 As shown in (3) in FIG. 1 , the line portion of the countdown progress dial 1406 becomes a dotted line. Fig.14 As shown in (4) in FIG. 1 , all the lines of the countdown progress dial 1406 become dotted lines. Fig.14 As shown in (5) in FIG. 14 , after all the lines of the countdown progress dial 1406 in the display interface 1405 become dashed lines, the display interface 1405 becomes a black interface. Fig.14 When the preview interface 1401 shown in (6) is displayed, it indicates that the third shooting animation effect is played.
[0359] It should be noted that when a shooting effect (such as a first shooting effect, a second shooting effect, and a third shooting effect) is displayed on a display interface, the electronic device may display the shooting effect audio corresponding to the shooting effect.
[0360] In this shooting scene, when the electronic device plays the third shooting effect, it generates a preview thumbnail image corresponding to the image shot this time; and displays the preview thumbnail image when the preset conditions are met; wherein the preset conditions include at least one of the following: the preview module starts timing when receiving the preview thumbnail request, and the timing duration reaches the delay time value; the preview module receives shooting frame information, which is metadata used to describe the shot image; the preview module receives a response message; the response message indicates that the electronic device is generating a shot image based on the shot image frame, or the electronic device starts to generate a shot image based on the shot image frame. Avoid problems such as the preview thumbnail image being displayed too early, resulting in the shooting effect not being fully played, the preview thumbnail image having a large deviation from the corresponding shot image, and the electronic device not yet generating the actual shot image.
[0361] In the above embodiment, the preview module of the electronic device sends the preview thumbnail image to the camera application only when certain preset conditions are met, and the camera application displays the preview thumbnail image. This avoids the problem that the preview thumbnail image is displayed too early, resulting in the shooting effect not being fully played, the preview thumbnail image has a large deviation from the corresponding shooting image, and the electronic device has not yet generated the actual shooting image.
[0362] Fig.15 This is a schematic diagram of another method of viewing a captured image according to an embodiment of the present application. Fig.15 (1) to Fig.15 For reference, see (6) Fig.13(1) to Fig.13 (6) in the above text, we will not elaborate on this. Fig.15 As shown in (6), the electronic device displays a preview interface 1501, and the preview thumbnail image displayed in the gallery control 1502 in the preview interface 1501 is the preview thumbnail image of the image captured this time. The user clicks the gallery control 1502 in the display interface 1504. The electronic device responds to the user's operation of clicking the gallery control 1502, and the electronic device displays a program interface 1506 of the gallery application. Since the preview thumbnail image displayed in the gallery control 1502 is the preview thumbnail image of the image captured this time, the electronic device generates a captured image corresponding to the preview thumbnail image, and the captured image generated by this capture can be viewed, and the captured image generated by this capture is displayed in the program interface 1506, as shown in FIG. Fig.15 As shown in (7) in .
[0363] Exemplarily, a user clicks on a gallery application icon on the system desktop, and the electronic device responds to the user's click operation and displays a gallery preview interface. The gallery preview interface includes a thumbnail image of the image shot this time, and the user clicks on the thumbnail image. The electronic device responds to the user's click operation and displays a program interface of the gallery application, and the program interface displays the image shot this time.
[0364] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the shooting method in the above-mentioned embodiment.
[0365] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the shooting method in the above-mentioned embodiment.
[0366] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the shooting method in the above-mentioned method embodiments.
[0367] Among them, the electronic device (such as a mobile phone, etc.), computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0368] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0369] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0370] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A shooting method, characterized in that: Applied to electronic equipment, the method comprises: Displaying a preview interface of a camera application, wherein the preview interface includes a preview image; wherein the shooting scene of the camera application is a target scene; In response to a shooting operation performed on the preview interface, a target shooting animation corresponding to the target scene is played; wherein the shooting operation is used to trigger the electronic device to collect image data, generate a shot image corresponding to the image data, and store the shot image; During the playing of the target shooting motion effect, generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met; When displaying the preview thumbnail image, stop playing the target shooting animation effect; Wherein, the preset condition includes at least one of the following: a first preset condition, a second preset condition, and a third preset condition; The first preset condition is that the first module of the electronic device starts timing when receiving the first request, and the timing duration reaches a first threshold; the first request is a request sent by the camera application to the first module when the camera application plays the target shooting animation; the first threshold is greater than or equal to the frame output time of the captured image in the target scene, and the first threshold is greater than or equal to the duration of the target shooting animation; The second preset condition is that the first module receives shooting frame information; the shooting frame information is metadata used to describe the shot image; The third preset condition is that the first module receives a response message; the response message indicates that the electronic device is generating the captured image according to the captured image frame, or the electronic device starts to generate the captured image according to the captured image frame.
2. The method according to claim 1, characterized in that The preview interface includes a gallery control; Displaying the preview thumbnail image includes: displaying the preview thumbnail image on the gallery control; Wherein, when displaying the preview thumbnail image on the gallery control, the method further includes: In response to a click operation on the gallery control, a program interface of a gallery application is displayed; the program interface includes the captured image.
3. The method according to claim 1, characterized in that In the process of playing the target shooting motion effect, generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met includes: When the camera application plays the target shooting animation, the first module generates the preview thumbnail image according to the first request, and sends the preview thumbnail image to the camera application when the first preset condition is met; The camera application displays the preview thumbnail image on a gallery control.
4. The method according to claim 1, characterized in that: In the process of playing the target shooting motion effect, generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met includes: During the process of playing the target shooting animation effect, the first module generates the preview thumbnail image based on the preview image, and sends the preview thumbnail image to the camera application when the second preset condition is met; The camera application displays the preview thumbnail image on a gallery control.
5. The method according to claim 1, characterized in that In the process of playing the target shooting motion effect, generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met includes: During the process of playing the target shooting animation, the first module generates the preview thumbnail image based on the preview image, and sends the preview thumbnail image to the camera application when the third preset condition is met; The camera application displays the preview thumbnail image on a gallery control.
6. The method according to claim 1, characterized in that Generating a preview thumbnail image based on the preview image, and displaying the preview thumbnail image when a preset condition is met, includes: sequentially generating at least one preview image; Generate a preview thumbnail image corresponding to each preview image according to the order in which the preview images are generated; When the preset condition is met, obtaining the latest generated preview thumbnail image; The preview thumbnail image is displayed.
7. The method according to claim 1, characterized in that Before playing the target shooting animation corresponding to the target scene, the method further includes: Acquire a target preview image frame and target preview frame information; wherein the target preview image frame and the target preview frame information correspond to the latest generated preview image; The target preview image frame and the target preview frame information are detected to determine that the shooting scene applied by the camera is the target scene.
8. The method according to claim 1, characterized in that Before playing the target shooting animation corresponding to the target scene, the method further includes: Determine the frame output time of the captured image corresponding to the target scene; The shooting motion effect that matches the frame output time is used as the target shooting motion effect.
9. An electronic device, characterized in that: include: a memory and a processor, the memory and the processor being coupled; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the shooting method as described in any one of claims 1 to 8.
10. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program runs on an electronic device, the electronic device executes the shooting method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Thumbnail generation method and user terminal
CN106657765A
Shooting method and terminal
CN110401766A