Photographing method and device

By predicting the frame collection time and adjusting the photo animation display time, the problem of stuck preview interface after the photo animation is completed is solved, the photo fluency and efficiency are improved, and the frame collection time is adapted to different scenarios.

CN118042274BActive Publication Date: 2024-09-20HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410338244.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2024-09-20
Estimated Expiration
2044-03-25

AI Technical Summary

Technical Problem

During the photo-taking process, the preview interface is prone to freezes after the photo-taking animation ends, which affects the user experience. The display duration of the photo-taking animation in the existing technology cannot be adapted to the frame collection duration in different photo-taking scenarios, resulting in fluency and efficiency issues.

Method used

By predicting the frame collection time of the photo operation, the frame collection strategy is determined based on the scene information, and the photo animation is displayed according to the predicted frame collection time after the photo trigger operation is detected, and the display time of the photo animation and the frame collection time are synchronously adjusted to reduce preview lags Pause and camera performance are degraded.

Benefits of technology

It effectively reduces preview lag after the photo animation ends, improves the fluency and user experience of the photo process, adapts to the frame collection time in different photo scenarios, and improves photo efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118042274B
    Figure CN118042274B
Patent Text Reader

Abstract

The present invention discloses a photographing method and device, the photographing method comprising: displaying a preview interface for photographing. Upon detecting a photographing trigger operation, displaying a first animation in a preview area of ​​the preview interface according to a first duration, wherein the first duration is a predicted value of a frame acquisition duration of a photographing operation triggered by the photographing trigger operation. Through the above implementation, the synchronization between the frame acquisition duration and the photographing animation duration in different photographing scenes can be improved, which can reduce preview freezes caused by too short a photographing animation duration, and can reduce degradation of photographing performance caused by too long a photographing animation duration, on the one hand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of terminal technology, and in particular to a photographing method and device. Background Art

[0002] In the photo-taking scenario, when the user presses the photo-taking button, the preview interface of the camera application will flash once, which is called the "photo-taking animation". The "photo-taking animation" can be used to prompt that the device is currently performing a photo-taking action, so that the user can intuitively perceive the photo-taking process and optimize the photo-taking experience.

[0003] During the actual photo-taking process, after the "photo-taking animation" ends, the preview may sometimes freeze, that is, the display content in the preview interface remains frozen at the previous preview image and is not updated to the current subject, affecting the user experience. Summary of the invention

[0004] The purpose of the present invention is to provide a photographing method and device, so as to reduce the preview freeze phenomenon after the photographing animation ends and improve the fluency of the photographing process.

[0005] In a first aspect, the present invention provides a photographing method, including: displaying a preview interface for photographing, the preview interface including a preview area, the preview area being used to display a preview video; detecting a photographing trigger operation, displaying a first animation in the preview area according to a first duration, the first duration being a predicted value of a frame acquisition duration of the photographing operation triggered by the photographing trigger operation.

[0006] The frame acquisition duration is the total acquisition duration of each image frame used to generate the target image. The target image is the image that is finally presented to the user in the photo scene, and the number of target images generated by one photo request is one. For different photo scenes, the number of image frames required to generate a target image is different, which may be a single frame or multiple frames. Correspondingly, the required frame acquisition duration is also different. When the number of image frames acquired is multiple frames, a target image can be generated based on multi-frame fusion technology, which can be used to improve the imaging effect in photo scenes such as low ambient brightness and moving objects.

[0007] In the above implementation, the frame acquisition duration of the photo operation is predicted, and then after the photo trigger operation is detected, the photo animation is displayed according to the predicted frame acquisition duration. This allows the display duration of the photo animation to be synchronized with the frame acquisition duration in different photo scenes as much as possible. On the one hand, it can reduce preview freezes caused by the photo animation duration being shorter than the frame acquisition duration, and on the other hand, it can reduce the degradation of photo performance caused by the photo animation duration being longer than the frame acquisition duration.

[0008] In some implementations of the first aspect of the photographing method as described above, the method further includes: acquiring scene information; and predicting, based on the scene information, a frame acquisition time required for the photographing operation.

[0009] In this implementation, the frame acquisition duration that matches the current photographing scene can be determined by collecting information related to the photographing scene.

[0010] In some implementations of the first aspect of the photographing method as described above, the scene information includes environmental information and / or device information; the environmental information includes environmental brightness, and the device information includes photographing mode information and / or currently called camera information.

[0011] A photographing method as described above, in certain implementations of the first aspect, predicts the frame acquisition time required for the photographing operation based on scene information, including: determining the frame acquisition strategy corresponding to the photographing operation based on the scene information; determining the frame acquisition time corresponding to the frame acquisition strategy based on a mapping relationship between each preset frame acquisition strategy and the frame acquisition time.

[0012] In this implementation, the mapping relationship between each frame acquisition strategy and the frame acquisition duration can be pre-stored. Then, after determining the frame acquisition strategy of the current scene, the mapping relationship can be directly queried to determine the corresponding frame acquisition duration, without having to calculate the frame acquisition duration during each method execution, which can shorten the execution time of the solution.

[0013] In a photographing method as described above, in certain implementations of the first aspect, the method further includes: calculating, according to each preset frame acquisition strategy, the frame acquisition duration corresponding to each preset frame acquisition strategy; and generating a mapping relationship between each preset frame acquisition strategy and the frame acquisition duration.

[0014] In this implementation, the frame acquisition duration of each preset scene can be calculated in advance according to the frame acquisition strategy, and a mapping relationship can be generated and stored. By pre-storing the mapping relationship in advance, it is beneficial to directly obtain and use relevant data during the execution of the photography method provided by the present application, without having to repeat the calculation during each execution.

[0015] A photographing method as described above, in certain implementations of the first aspect, according to each preset frame acquisition strategy, the frame acquisition duration corresponding to each preset frame acquisition strategy is calculated respectively, including: according to each preset frame acquisition strategy, the estimated frame acquisition duration corresponding to each preset frame acquisition strategy is calculated respectively; using a correction parameter to correct the estimated frame acquisition duration to obtain the frame acquisition duration corresponding to each preset frame acquisition strategy; wherein the correction parameter is determined according to the duration error of the actual frame acquisition process.

[0016] In this implementation, the calculated frame acquisition duration can be corrected to address the duration error that may exist in the actual frame acquisition process, thereby reducing the error between the calculated frame acquisition duration and the actual frame acquisition duration, and improving the accuracy of the frame acquisition duration value, which in turn helps to improve the synchronization between the display process of the photo animation and the actual frame acquisition process.

[0017] In a photographing method as described above, in certain implementations of the first aspect, the frame acquisition strategy includes at least one or more of the number of frames to be acquired, the exposure time of each frame, and the exposure interval of each frame.

[0018] A photographing method as described above, in certain implementations of the first aspect, displays a first animation in a preview area according to a first duration, including: displaying a prompt animation in the preview area according to the first duration, the prompt animation including prompt information, and the prompt information is used to prompt the remaining time until the frame acquisition ends.

[0019] In this implementation, a prompt animation is displayed according to the frame acquisition time, and the remaining time of the frame acquisition can be prompted during the frame acquisition process, thereby improving the user experience while the user is waiting for taking a photo.

[0020] In some implementations of the first aspect of the photographing method as described above, displaying a first animation in a preview area according to a first duration includes: displaying a photographing animation in the preview area according to the first duration.

[0021] In this implementation, the photo shooting animation is displayed according to the frame acquisition duration, which can effectively block the preview jam during the frame acquisition process and improve the smoothness of the photo shooting process.

[0022] A photographing method as described above, in certain implementations of the first aspect, displays a photographing animation in a preview area according to a first duration, including: displaying a black image in a layer above the layer where the preview video is located in the preview area; controlling the transparency of the black image according to a first preset function, the first preset function being used to describe the transparency of the black image at different times within the first duration.

[0023] In this implementation, the camera animation can be displayed by covering a layer and controlling the transparency of the covered layer. The first preset function can be a parabolic function, a linear function, a constant function, etc. with a bottom opening.

[0024] A photographing method as described above, in certain implementations of the first aspect, displays a photographing animation in a preview area according to a first duration, including: controlling the blurriness of the preview video in the preview area according to a second preset function, the second preset function being used to describe the blurriness of the preview video at different moments within the first duration.

[0025] In this implementation, the photo animation can be displayed by controlling the blur level of the preview interface. The second preset function can be a parabolic function, a linear function, a constant function, etc. with a bottom opening.

[0026] In some implementations of the first aspect of the photographing method as described above, the photographing method further includes: after detecting a photographing trigger operation, playing a photographing sound effect according to a frame acquisition duration.

[0027] In this implementation, the playback duration of the shutter sound in different shooting scenes can also be synchronized with the frame acquisition duration.

[0028] In a second aspect, the present technical solution provides an electronic device, comprising: 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 the one or more computer programs include instructions, which, when executed by the device, enable the device to execute the method in the first aspect or any possible implementation of the first aspect.

[0029] In a third aspect, the present invention further provides a chip, comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute the method in the first aspect or any possible implementation of the first aspect.

[0030] Optionally, as an implementation method, the chip may also include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in the first aspect or any possible implementation method of the first aspect.

[0031] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable medium stores a program code for execution by a device, wherein the program code includes instructions for executing the method in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 This is a schematic diagram of a scene of the photographing method provided in an embodiment of the present application;

[0033] Figure 2 is a schematic flow chart of a photographing method provided in an embodiment of the present application;

[0034] Figure 3 is another schematic flow chart of the photographing method provided in an embodiment of the present application;

[0035] Figure 4 is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0036] Figure 5 is a schematic flow chart of a photographing method provided in an embodiment of the present application;

[0037] Figure 6 is another schematic diagram of a scene of the photographing method provided in an embodiment of the present application;

[0038] Figure 7 is another schematic diagram of a scene of the photographing method provided in an embodiment of the present application;

[0039] Figure 8 is another schematic diagram of a scene of the photographing method provided in an embodiment of the present application;

[0040] Fig. 9 is another schematic flow chart of the photographing method provided in an embodiment of the present application;

[0041] Fig.10 is another schematic diagram of a scene of the photographing method provided in an embodiment of the present application;

[0042] Fig.11 is a schematic diagram of the software structure of the electronic device provided in the embodiment of the present application;

[0043] Fig.12 is another schematic flow chart of the photographing method provided in an embodiment of the present application;

[0044] Fig.13 It is another schematic flow chart of the photographing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] Nowadays, mobile phones, tablet computers and other electronic devices are equipped with camera applications. Figure 1 As shown, the user can start the camera application and enter the application interface of the camera application by triggering the camera application icon in the main interface of the electronic device. The application interface of the camera application may include a preview interface of the photo mode, such as Figure 1 As shown in the preview interface 11 in FIG. 1 , the preview area 111 in the preview interface 11 can be used to display a preview video of the current object. Figure 1 As shown, the preview interface 11 may also include a photo button 112 , and the user may trigger the camera application to take photos in the photo mode through the photo button 112 .

[0046] When the user presses the photo button 112, the camera application starts to collect one or more frames of images to generate a target image. In some related technologies, the target image is also called a "photo" or "photo image". During the image acquisition process, since the camera application cannot obtain the preview video of the current shooting object from the camera, the preview area 111 will always display the preview image corresponding to the time when the user presses the photo button 112. This phenomenon can be called "preview freeze". That is to say, at this time, even if the user points the camera at other shooting objects, the display content of the preview area 111 will not be updated synchronously. In other words, the preview area 111 will not display the preview video of the above-mentioned other shooting objects, but will always display the preview image corresponding to the time when the user presses the photo button 112. The time period from pressing the photo button 112 to the completion of image acquisition can be called the frame acquisition duration. During the above frame acquisition duration, the preview area 111 has "preview freeze".

[0047] In order to reduce the user's perception of the above-mentioned "preview freeze" and enable the user to intuitively perceive the photo-taking process, currently, when the user presses the photo-taking button, the preview area of ​​the preview interface will flash once, which is referred to as "photo-taking animation" in this application.

[0048] However, in the actual photo-taking process, after the "photo-taking animation" ends, the preview may sometimes freeze. That is, after the "photo-taking animation" ends, the displayed content in the preview area is still frozen at a preview image corresponding to when the user presses the photo button, and is not updated to the preview video of the current subject. As a result, from the user's perspective, the photo-taking process is not smooth, thus affecting the user experience.

[0049] After research, it was found that the display duration of the current photo animation is fixed, for example, 150ms. However, when the camera is used to take pictures, the frame acquisition duration varies with the different photo scenes. In other words, the frame acquisition duration in different photo scenes may be different. The display duration of the above-mentioned photo animation cannot be adapted to the frame acquisition duration when taking pictures, which is the main reason for the above-mentioned unsmooth photo process.

[0050] Specifically, in some photo-taking scenarios, the frame acquisition time is relatively long. When the photo-taking animation ends, the frame acquisition process is still continuing. The camera application cannot obtain the preview video of the current subject, so there is still preview jamming. As a result, the preview jamming cannot be completely blocked by the photo-taking animation. Users still perceive the preview jamming, and the photo-taking experience is not smooth enough.

[0051] For example Figure 2As shown, in some low-light environments and rear-camera photo-taking scenarios, the camera application displays a preview video of the current photographed object in the preview interface of the camera application before detecting the photo trigger operation. After the photo trigger operation is detected, there are the following parallel processes: First, the camera application starts to collect several frames of images to generate the target image. For this scenario, the frame acquisition time is relatively long, for example, 300ms. Second, while collecting images, preview freezes, that is, the camera application cannot obtain the preview video, and when the frame acquisition is completed, the preview freeze can stop, and the camera application can obtain the preview video of the current photographed object. Third, the preview area of ​​the camera application displays the photo animation, and the display time of the photo animation is 150ms. It can be seen that in this scenario, the photo animation time is less than the image frame acquisition time and the preview freeze time. When the photo animation ends, the image frame acquisition is not over yet, so the preview is not restored. The preview area needs to display a frame of preview image corresponding to when the user presses the photo button until the preview is restored. In other words, the preview freeze cannot be completely blocked by the photo animation, so that the preview freeze phenomenon is perceived by the user, affecting the user experience.

[0052] In addition, the display duration of the above-mentioned photo animation cannot be adapted to the frame acquisition duration during photo shooting, and it will also affect the user's photo efficiency in some photo shooting scenes. Specifically, for photo shooting scenes with a short frame acquisition duration, when the frame acquisition has ended, the photo animation is still displayed. Although the photo animation can block the preview jam, it affects the photo shooting efficiency, especially in the scene of continuous shooting, the time of the photo shooting process will be significantly extended, which significantly affects the user's photo shooting experience.

[0053] For example Figure 2 As shown, in some high-brightness environments and front-facing camera photo scenes, before the photo trigger operation is detected, the preview video of the current subject is displayed in the preview area of ​​the camera application. After the photo trigger operation is detected, there are the following parallel processes: First, the camera application starts to collect several frames of images to generate the target image. For this scene, the frame acquisition time is short, for example, 100ms. Second, while collecting images, preview freezes, that is, the camera application cannot obtain the preview video, and when the frame acquisition is completed, the preview freeze can stop, and the camera application can obtain the preview video of the current subject. Third, the preview area of ​​the camera application displays a photo animation, and the display time of the photo animation is 150ms. It can be seen that in this photo scene, the photo animation duration is longer than the image frame acquisition duration and the preview freeze duration. When the image frame acquisition and preview freeze are over, the photo animation is still not over, resulting in the restored preview video being blocked by the photo animation, and the user's perspective will mistakenly believe that the image acquisition is still not completed. It can be seen that when the duration of the photo animation is longer than the image acquisition duration, the delay from when the photo button is pressed to when the preview is restored is extended by the photo animation, affecting the photo performance.

[0054] Based on the above problems, this application is filed.

[0055] In the implementation scheme of the embodiment of the present application, the frame acquisition duration of each photo can be predicted. After the photo trigger operation is detected, the photo animation is displayed according to the predicted frame acquisition duration, so that the display duration of the photo animation is adapted to the frame acquisition duration of the photo each time a photo is taken, thereby reducing the problem of an unsmooth photo process in the above-mentioned photo shooting scenario with a long frame acquisition time.

[0056] In addition, since the display duration of the photo animation is adapted to the frame acquisition duration of the photo each time a photo is taken, the user's photo efficiency can be improved in photo scenes with a short frame acquisition duration.

[0057] Specifically, the camera application may support a variety of different photographing scenarios. Different photographing scenarios are configured with different frame acquisition strategies, and different frame acquisition strategies require different frame acquisition durations.

[0058] For example, when the ambient light brightness is high, only one frame of image may be needed to generate the target image presented to the user, and a shorter exposure time can be set when collecting the single frame of image. In this case, the image collection process takes less time, that is, the frame collection time is shorter.

[0059] When the ambient light is low, in order to improve the image quality, it may be necessary to collect multiple frames of images, and then generate the target image presented to the user through multi-frame fusion technology, and some of the image frames need to be exposed for a long time. In this case, the image acquisition process takes a long time, that is, the frame acquisition time is long.

[0060] Based on the above description, in the embodiments of the present application, refer to the attached Figure 3 After the camera application is started, a preview video of the current shooting object can be displayed in the preview interface. At this time, the preview video changes in real time with the change of the shooting object. At the same time, the electronic device can predict the frame acquisition time required to perform the shooting operation in the current shooting scene based on the current scene information. In response to the user pressing the shooting button, there are the following three processes: First, several frames of images required for shooting are collected. Second, according to the predicted frame acquisition time, the shooting animation is displayed in the preview area. Third, while collecting images, preview freezes, that is, the camera application cannot obtain the preview video, and when the image acquisition is completed, the preview freeze can stop, and the camera application can obtain the preview video of the current shooting object.

[0061] In the embodiment of the present application, since the display duration of the photo animation is set based on the predicted frame acquisition duration, the display duration of the photo animation can be made as close as possible to the frame acquisition duration of the photo. On the one hand, it can reduce the preview freeze caused by the photo animation duration being too short. On the other hand, it can reduce the degradation of photo performance caused by the photo animation duration being too long, thereby achieving the purpose of improving the smoothness of the photo process and improving the photo efficiency.

[0062] It can be understood that the embodiments of the present application can be applicable to displaying a photo animation when taking photos in the photo mode, and can also be applicable to other photo modes provided by the camera application, such as portrait mode, night scene mode, etc., to realize the display of the photo animation when taking photos in the above-mentioned photo modes.

[0063] Figure 4 A schematic structural diagram of an electronic device 100 provided in an embodiment of the present application is shown.

[0064] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a fingerprint sensor 180H, a touch sensor 180K, an ambient light sensor 180L, and a distance sensor 180F.

[0065] It is to be understood that the structure illustrated in the embodiment of the present invention does 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 components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0066] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, 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.

[0067] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0068] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0069] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0070] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0071] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0072] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1, including a front camera and a rear camera.

[0073] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0074] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0075] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 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 an unlocking function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as fingerprint data, lock screen interface data, etc.), etc. In addition, the internal memory 121 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. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0076] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement application locks for accessing camera applications, fingerprint photography, etc.

[0077] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. For example, the touch sensor 180K can detect a touch operation acting on the camera application icon in the main interface, and then pass the touch operation to the application processor to display the camera application interface on the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0078] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, 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 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions.

[0079] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. Exemplarily, in a photo shooting scene, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake.

[0080] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, in a shooting scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0081] The ambient light sensor 180L is used to sense the brightness of the ambient light. When the camera application is started, the ambient light sensor 180L can be used to detect the brightness of the ambient light so that the camera application can decide the corresponding photo scene. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking photos.

[0082] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button or a touch button. The electronic device 100 may receive a button input and generate a key signal input related to the user settings and function control of the electronic device 100. For example, when the camera application is started, the electronic device 100 may trigger a photo-taking operation by receiving a button input to the volume button.

[0083] The following embodiments of this application will be based on Figure 4 Taking the electronic device 100 of the structure shown as an example, the photographing method provided in the embodiment of the present application is specifically described.

[0084] Figure 5 is a schematic flow chart of a photographing method provided in an embodiment of the present application, such as Figure 5 As shown, the photographing method provided in the embodiment of the present application includes:

[0085] S101, after detecting that the camera application is started, obtaining current scene information.

[0086] like Figure 5 As shown in the figure, from the start of the camera application to the receipt of the photo request, and then to the end of the frame acquisition process, the key nodes during this period include: the camera application is started, the phone is pressed (onClickDown), the finger is lifted (onClickUp), the frame acquisition starts (doCapture), and the frame acquisition is completed (onImageAvailable).

[0087] Among them, reference Figure 1 , the camera application can be started after detecting the user's trigger operation on the camera application icon in the main interface of the electronic device. When the camera application is started, the preview interface 11 of the camera application can be displayed. The preview interface 11 of the camera application can include a photo button 112 and a preview area 111. The preview area 111 can be used to display a preview video. onClickDown is used to indicate that the user's finger presses the photo button 112, and onClickUp is used to indicate that the user's finger leaves the photo button 112. The delay between onClickDown and onClickUp indicates the duration of triggering the shutter. doCapture is used to indicate the starting time of frame acquisition, and onImageAvailable is used to indicate the end time of frame acquisition, at which time the image data acquisition is completed. The delay between doCaptureon and ImageAvailable indicates the frame acquisition duration. For different photo-taking scenarios, the delay between doCaptureon and ImageAvailable is different.

[0088] After the camera application is started, the electronic device can obtain current scene information.

[0089] In a possible implementation, the scene information may include environmental information, which may include, for example, the brightness of the environment, and / or the motion state of the object being photographed in the environment. In this implementation, after detecting that the camera application is started, the electronic device may control the ambient light sensor to detect the brightness of the current environment, and / or may determine the motion state of the object being photographed in the environment based on the collected preview video.

[0090] In another possible implementation, the scene information may include device information, and the device information may include, for example, camera mode information and / or currently called camera information. The camera mode may include, for example, but is not limited to, photo mode, portrait mode, night scene mode, etc. The currently called camera information may be a front camera or a rear camera. Figure 6 As shown, the preview interface of the camera application may include multiple mode setting buttons 501 such as night scene mode, portrait mode, and photo mode. The camera application can switch to the corresponding photo mode in response to the triggering operation of any of the mode setting buttons 501. At the same time, the preview interface of the camera application may also include a camera switching button 502. In response to the triggering operation of the camera switching button 502, the camera application can switch the currently called camera, such as the front camera and the rear camera. In this implementation, after the camera application is started, the electronic device can obtain information about the current photo mode and / or information about the currently called camera.

[0091] Alternatively, in another implementation, the scene information may also include the above-mentioned environment information and device information at the same time.

[0092] S102, predicting the frame acquisition time required for the photo-taking operation according to the scene information.

[0093] Different photo-taking scenes correspond to different frame acquisition strategies. The frame acquisition strategy may include, for example, any one or a combination of the number of frames to be acquired, the exposure time of each frame image, the exposure interval of each frame, and the like.

[0094] Specifically, refer to Figure 5 The key nodes shown, one onClickDown and one onClickUp can be used to represent a photo triggering operation of the user acting on the photo button. At this time, the camera application receives a photo request. For a photo request, the number of target images finally generated and presented to the user is only one, but the image data actually collected may be more than one frame, and the number of frames of the image actually collected is related to the photo scene. That is to say, in response to a received photo request, in photo scene 1, it may only be necessary to collect one frame of image data, and generate a target image through image processing; in photo scene 2, it may also be necessary to continuously collect multiple frames of image data, and perform image processing on multiple frames of image data to generate a target image.

[0095] Based on the above description, it can be understood that based on different photo-taking scenes, different frame acquisition strategies are adopted, and different frame acquisition times are required. The more frames to be acquired, the longer the exposure time of each frame image, and the larger the exposure interval of each frame, the longer the required frame acquisition time. Exemplarily, for the rear camera scene in a high-brightness environment, the number of frames to be acquired is small, and the exposure time of the frame image is short, and the corresponding frame acquisition time can be, for example, 150ms; for the rear camera scene in a low-brightness environment, the number of frames to be acquired is large, and the exposure time of the frame image is long, and the corresponding frame acquisition time can be, for example, 300ms; for the front camera scene in a high-brightness environment, the number of frames to be acquired is smaller, and the exposure time of the frame image is shorter, and the corresponding frame acquisition time can be, for example, 100ms.

[0096] It should be understood that the above-mentioned photographing scenes and the corresponding frame acquisition durations are only used as an exemplary illustration. In other implementations, the factors referred to when distinguishing photographing scenes may not only be the ambient brightness and the called camera, and the granularity of the values ​​​​of each factor when distinguishing different photographing scenes can be smaller, and the divided photographing scenes can be more.

[0097] In an embodiment of the present application, in a possible implementation method, a mapping relationship between various frame acquisition strategies and frame acquisition durations may be pre-stored in an electronic device. The frame acquisition duration may be calculated based on the frame acquisition strategy. Then, after the current scene information is acquired based on the above step S101, first, the frame acquisition strategy corresponding to the photo operation may be determined based on the scene information. Specifically, different photo scenes correspond to different frame acquisition strategies. After acquiring the current scene information, the frame acquisition strategy corresponding to the current photo scene may be matched from various frame acquisition strategies based on the scene information. Furthermore, based on the above mapping relationship, the frame acquisition duration required for the currently determined frame acquisition strategy may be queried.

[0098] In another possible implementation, after the scene information of the current photographing scene is obtained based on the above step S101, first, a frame acquisition strategy corresponding to the photographing operation can be determined based on the scene information. Then, the required frame acquisition duration can be calculated according to the frame acquisition strategy.

[0099] The following is an explanation of the calculation method of the frame acquisition duration.

[0100] In a possible implementation, based on the frame acquisition strategy, the frame acquisition duration T corresponding to the frame acquisition strategy can be calculated according to the formula T=T1+T2, where T1 represents the sum of the exposure durations of the frames to be acquired, and T2 represents the sum of the exposure intervals of the frames to be acquired.

[0101] In another possible implementation, considering that there may be a duration error in the actual frame acquisition process, the actual frame acquisition duration may not be consistent with the frame acquisition duration calculated based on the frame acquisition strategy. The display duration of the photo animation should be as consistent as possible with the actual frame acquisition duration. Therefore, in this implementation, the frame acquisition duration T can be calculated according to the formula T=T1+T2+Te. Among them, T1 represents the sum of the exposure durations of each frame to be acquired, T2 represents the sum of the exposure intervals of each frame to be acquired, and Te represents the error constant corresponding to the frame acquisition process in the current photo scene. Different photo scenes can be configured with different error constants. The value of Te can be determined according to the duration error of the frame acquisition process in the corresponding photo scene, for example, it can be the average of the duration errors of multiple frame acquisition processes. Through this implementation, the accuracy of the frame acquisition duration value can be improved, which is conducive to improving the synchronization between the display process of the photo animation and the actual frame acquisition process.

[0102] S103, after detecting the photo triggering operation, displaying the photo animation in the preview area according to the frame acquisition duration.

[0103] refer to Figure 1 The preview interface may include a photo button, and detecting a photo trigger operation may include detecting a click operation on the photo button, corresponding to Figure 5 The onClickDown and onClickUp nodes are shown.

[0104] After detecting the photo trigger operation, refer to Figure 5 During the time period between onClickUp and doCapture, the camera application can perform 3A settings, including automatic focus (AF), automatic white balance (AWB), and automatic exposure (AE). After the settings are completed, the doCapture node is entered to start the frame acquisition process according to the preset frame acquisition strategy. At the same time, the photo-taking animation is displayed in the preview area according to the frame acquisition duration that matches the current frame acquisition strategy.

[0105] In a possible implementation, a black image may be displayed above the layer where the preview video is located in the preview area, and the photo animation may be implemented by controlling the transparency of the black image.

[0106] In this implementation, the transparency control function corresponding to different frame acquisition strategies can be pre-set, and the transparency control function can be used to describe the transparency of the black image at different times within the frame acquisition duration. Displaying the photo animation in the preview area can specifically be to add a black image to the layer above the layer where the preview video is located in the preview area. Then, determine the transparency control function corresponding to the current frame acquisition strategy, and control the transparency of the black image at each moment within the frame acquisition duration according to the determined transparency control function. Exemplarily, the transparency control function can be, for example, a parabolic function with an upper opening. Then, within the frame acquisition duration, the transparency of the black image gradually changes from the highest value to the lowest value, and then gradually changes from the lowest value to the highest value. Among them, the lowest value can be, for example, 0, and the highest value can be, for example, 100%. Based on this implementation, the user's perspective will observe that the preview video is gradually covered and gradually appears, presenting a "flash black animation" effect. When the "flash black animation" ends, the frame acquisition process also ends at the same time, and the preview area preview is restored. Alternatively, the transparency control function can also be any linear function including a constant function, which is not limited in this application.

[0107] In another possible implementation, displaying the photo-taking animation may be achieved by blurring the preview video in the preview area.

[0108] In this implementation, the blur control function corresponding to different frame acquisition strategies can be pre-set, and the blur control function can be used to describe the blur of the preview video at different times within the frame acquisition duration. Displaying the photo animation in the preview area can be specifically to control the blur of the preview video at each moment within the frame acquisition duration according to the blur control function. Exemplarily, the blur control function can be, for example, a parabolic function with a lower opening. Then, within the frame acquisition duration, the blur of the preview video gradually changes from the lowest value to the highest value, and then gradually changes from the highest value to the lowest value. Among them, the lowest value can be 0, for example, and the highest value can be 100%. Alternatively, in another implementation, the blur control function can also be, for example, any linear function including a constant function, which is not limited in this application. Based on this implementation, for the user's perspective, within the frame acquisition duration, the preview area enters a blurred state. When the blurred state ends, the frame acquisition ends at the same time, and the preview area preview is restored.

[0109] Through the above technical solution, the display duration of the photo animation can be adaptively adjusted based on the specific photo scene, so that the display duration of the photo animation in different photo scenes can be synchronized with the frame acquisition duration as much as possible, thereby improving the smoothness of the photo process and improving the user's photo experience.

[0110] In another embodiment of the present application, the method for determining the display duration of the above-mentioned photo animation is further explained.

[0111] In actual application scenarios, refer to Figure 5 , from the camera application startup node to the onClickDown node, the scene information of the photo scene, such as environmental information and device information, is not always unchanged. In one example, the user starts the camera application. At this time, the camera application is in the photo mode by default and calls the rear camera. Then, the user switches the photo mode to the portrait mode through the mode setting button, and presses the photo button to trigger the photo. Obviously, from the camera application startup node to the onClickDown node, the photo mode has changed once, from the photo mode to the portrait mode. Or, in another example, after the user starts the camera application, without changing the photo mode, the user switches the rear camera to the front camera and presses the photo button to trigger the photo. Obviously, from the camera application startup node to the onClickDown node, although the photo mode has not changed, the called camera has changed. Or, the user starts the camera application in a scene with lighting indoors, and then, without changing the photo mode, turns off the lighting device and presses the photo button to trigger the photo. Obviously, from the camera application startup node to the onClickDown node, the ambient brightness has changed once, switching from the high-brightness state to the low-brightness state.

[0112] It can be seen that after the camera application is started, relying solely on scene information detection once may not accurately represent the photo scene when the user presses the photo button, which in turn affects the reliability of the set photo animation duration.

[0113] In the embodiment of the present application, after starting the camera application, the scene information of the current photo scene can be detected, including environmental information and device information. Then, the frame acquisition duration that matches the scene information can be determined. Furthermore, before the photo trigger operation is detected, when the scene information changes, the frame acquisition duration can be re-determined according to the changed scene information.

[0114] Specifically, in the embodiment of the present application, after starting the camera application, the device information and the current environment information can be detected, and the frame acquisition duration matching the current photo scene can be determined based on the device information and the environment information. Furthermore, before detecting the user's photo triggering operation, the following two aspects of the method flow are executed:

[0115] On the one hand, the user's switching operation on the camera mode and the called camera can be detected. When the switching operation on the camera mode or the called camera is detected, the frame acquisition time of the current camera scene can be re-determined according to the switched camera mode and the camera information.

[0116] On the other hand, in any camera mode, the environmental information can be periodically detected at a set time interval, and it is determined whether the difference between the re-detected environmental information and the previously detected environmental information exceeds the set threshold. If the difference does not exceed the preset value, it means that the photographic environment has not changed significantly, and no processing is performed. If the difference exceeds the preset value, it means that the photographic environment has changed significantly. At this time, the frame acquisition duration of the current photographic scene can be re-determined based on the changed environmental information.

[0117] In the embodiment of the present application, when a new frame acquisition duration is determined, the previously determined frame acquisition duration can be deleted accordingly. Furthermore, when a photo trigger operation is detected, the latest determined frame acquisition duration can be obtained and used as the duration of the photo animation.

[0118] The following is an illustration with reference to the accompanying drawings.

[0119] Exemplary, reference Figure 7 At time point t1, the user starts the camera application, which is in photo mode by default and calls the rear camera; at time point t2, the user switches the photo mode to portrait mode; at time point t3, the user presses the photo button to start the photo operation.

[0120] Corresponding to the user behavior, at time point t1, the electronic device detects scene information, including environmental information and device information, in response to the startup of the camera application, and determines the matching frame acquisition duration L1. After determining the frame acquisition duration L1, before time point t3, the electronic device can detect the setting operation of the device information. Since the user's setting operation of the device information was not detected before time point t2, no processing was performed before time point t2. At time point t2, the user switched the camera mode, then, in response to the user's setting operation of the camera mode, the electronic device can redetermine the frame acquisition duration L2 according to the information of the changed camera mode. And, the electronic device can also delete the frame acquisition duration L1. At time point t3, in response to the photo trigger operation, the electronic device can display the photo animation based on the re-determined frame acquisition duration L2.

[0121] Exemplary, reference Figure 8 At time point t1, the user starts the camera application in a scene with indoor lighting; at time point t2, the user turns off the indoor lighting device; at time point t3, the user presses the photo button to start the photo operation.

[0122] Corresponding to the user behavior, at time point t1, the electronic device detects the current scene information, including environmental information and device information, in response to the start of the camera application, and determines the matching frame acquisition duration L1. After determining the frame acquisition duration L1, the electronic device can periodically detect environmental information before time point t3. Since the photo environment has not changed before time point t2, the difference between the value of each detected environmental information and the first detected environmental information before time point t2 is less than the set threshold. No processing is done at this time. At time point t2, the photo environment changes, then the difference between the environmental information detected again and the environmental information detected for the first time is greater than the set threshold. At this time, the electronic device can redetermine the frame acquisition duration as L2 based on the changed environmental information. And, the electronic device can also delete the frame acquisition duration L1. At time point t3, in response to the photo trigger operation, the electronic device can display a photo animation based on the re-determined frame acquisition duration L2.

[0123] In another embodiment of the present application, after detecting the photo triggering operation, the scene information of the current photo scene may be detected, and the frame acquisition duration of the current scene may be determined based on the scene information.

[0124] Specifically, refer to Fig. 9 After detecting the photo triggering operation, that is, after the onClickUp node, the time interval between the onClickUp node and the doCapture node can be used to obtain the scene information of the current photo scene and determine the frame acquisition duration corresponding to the scene information. Then, after the doCapture node, the photo animation is displayed in the preview area according to the determined frame acquisition duration.

[0125] In an embodiment of the present application, after detecting that the user has triggered a photo-taking operation, the scene information is detected again. This can improve the accuracy of the photo-taking scene detection results without the need for multiple detections, and is also beneficial for saving power consumption.

[0126] Furthermore, in a photo-taking scenario, when the system is not in silent mode, when the user triggers the photo-taking button, the electronic device will play a photo-taking sound effect, i.e., a "click" shutter sound.

[0127] Regarding the photo sound effects, based on the above embodiment, after the photo trigger operation is detected, if it is determined that the system is not in silent mode, the photo sound effects can also be played according to the determined frame acquisition duration. Thus, the playback duration of the photo sound effects in different photo scenes can also be synchronized with the frame acquisition duration, further improving the user's photo experience.

[0128] For example, the electronic device may pre-store the photo sound effects and the playback speed of the photo sound effects under the frame acquisition duration corresponding to different photo scenes. When the photo trigger operation is detected, the electronic device may determine the corresponding playback speed according to the determined frame acquisition duration, and then, while displaying the photo animation in the preview area, the photo sound effects may be played at the determined playback speed. In this way, the display duration of the photo animation and the playback duration of the photo sound effects can be synchronized with the frame acquisition duration, thereby improving the smoothness of the photo process.

[0129] In another embodiment of the present application, for a specific photo scene, such as a scene where the rear camera shoots a night scene, the corresponding frame acquisition time is long. At this time, if the photo animation is displayed according to the frame acquisition time, the display time of the photo animation is long, which will appear as a freeze in the user's perspective, affecting the user experience. Therefore, for such a photo scene, Fig.10 As shown, after the photo triggering operation is detected, a prompt animation may be displayed in the preview area according to the determined frame acquisition duration. The prompt animation may include, for example, a countdown prompt information for indicating the remaining time until the frame acquisition ends. Alternatively, the prompt animation may also include prompt information requesting the user to hold the device steady.

[0130] Furthermore, after the frame acquisition is completed and the prompt animation stops displaying, the preview is resumed, and at this time, the above-mentioned photo animation can also be displayed in the preview area. At this time, the display duration of the photo animation can be a preset fixed value, which is independent of the specific frame acquisition duration, such as 100ms. At this time, the photo animation can be used only for the user to perceive the photo process.

[0131] In a photo-taking scenario where the frame acquisition time is long, the above implementation method can, on the one hand, improve the user experience during the waiting process through the countdown prompt information, and on the other hand, the prompt information of holding the device steady can help improve the final image quality. In addition, by displaying the countdown prompt information based on the predicted frame acquisition time, the match between the countdown prompt information displayed in the preview interface and the actual frame acquisition process can be improved.

[0132] The software system of the electronic device provided in the embodiment of the present application 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 illustrate the software structure of the electronic device.

[0133] Fig.11 It is a schematic diagram of the software structure of the electronic device provided in the embodiment of the present application.

[0134] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system includes an application layer, an application framework layer, a hardware abstraction layer, and a kernel layer from top to bottom.

[0135] The application layer can include a series of application packages.

[0136] like Fig.11 As shown, the application package may include applications such as camera, gallery, WLAN, Bluetooth, music, video, short message, etc.

[0137] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0138] like Fig.11 As shown, the application framework layer may include a window manager, a content provider, a view system, a resource manager, and the like.

[0139] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0140] Content providers are used to store and retrieve data and make it accessible to applications. The data may include images and videos taken by camera applications, data transmitted by the kernel layer, etc.

[0141] The view system includes visual controls, such as controls for displaying images. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a camera application icon can include a view for displaying text and a view for displaying images.

[0142] The resource manager provides various resources for applications, such as pictures, video files, localized strings, icons, layout files, and so on.

[0143] The hardware abstraction layer may include a decision module, which may be used to determine the type of photographing scene and the corresponding frame acquisition duration.

[0144] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, and sensor driver.

[0145] The following describes the workflow of the electronic device software and hardware during the execution of the photographing method provided in the embodiment of the present application.

[0146] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into raw input events (including touch coordinates, timestamp of the touch operation, etc.). The raw input events are stored in the kernel layer. Fig.11 As shown, the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. For example, the content provider of the application framework layer obtains the original input event from the sensor driver of the kernel layer. The touch operation is, for example, a touch single-click operation, and the control corresponding to the single-click operation is the control of the camera application icon. The camera application calls the interface of the application framework layer to start the camera application.

[0147] After the camera application is started, the scene information related to the photo shooting scene is sent to the decision module located in the hardware abstraction layer. Fig.12 As shown, the camera application sends the information of the camera mode to the decision module; and the camera module calls the kernel layer to start the sensor driver, detects the ambient light brightness through the ambient light sensor 180L, and sends the ambient light brightness to the decision module; and the camera application calls the kernel layer camera driver, obtains the information of the currently called camera, and sends the information of the currently called camera to the decision module.

[0148] The decision module of the hardware abstraction layer can determine the frame acquisition duration that matches the current scene based on the above-obtained scene information. The specific implementation method can refer to the above-mentioned embodiment and will not be described in detail.

[0149] Furthermore, the decision module of the hardware abstraction layer may send information about the frame acquisition duration to the camera application.

[0150] After the camera application is launched, you can also control the display of the current preview video in the preview area.

[0151] Specifically, Fig.13 As shown, after the camera application is started, the camera driver located in the kernel layer can be controlled to collect the preview video corresponding to the current shooting object, and the preview video received from the camera driver is sent to the display driver located in the kernel layer, and the display driver displays the current preview video in the preview area of ​​the camera application in real time.

[0152] When displaying a preview image P1 in the preview video, if the touch sensor 180K receives a touch operation on the camera application interface's photo button, the corresponding hardware interrupt is sent to the kernel layer, and processed into a raw input event for storage at the kernel layer. The camera application obtains the raw input event from the kernel layer, identifies the input event, and determines that a photo request has been received.

[0153] After detecting a photo request, Fig.13As shown, the camera application starts the camera driver by calling the kernel layer, and collects one or more image frames through the camera 193. The collected image frames can be used to generate the target image corresponding to this photo request, and the number of target images corresponding to one photo request is one. During the process of the camera 193 collecting image frames, the preview area will experience preview freeze, that is, the display content of the camera application preview interface will no longer change according to the change of the photographed object, and the display driver will always control the preview interface to display the preview image P1 displayed when the photo request is received.

[0154] While controlling the camera driver to capture image frames, the camera application can also send the above-obtained frame capture duration information to the display driver, and the display driver controls the preview area of ​​the camera application to display the photo animation according to the frame capture duration. Specifically, the display driver can display a black image in the preview area above the layer where the preview video is located, and then, according to the received frame capture duration, determine the corresponding transparency control function, and use the transparency control function to control the transparency of the black image at each moment within the frame capture duration. Alternatively, the display driver can determine the corresponding blur control function according to the received frame capture duration, and use the blur control function to control the blur of the preview video at each moment within the frame capture duration.

[0155] Then, the shooting animation displayed in the preview area during the frame acquisition process can be synchronized with the preview freeze as much as possible, which effectively blocks the preview freeze and improves the smoothness of the shooting process, while improving the shooting performance.

[0156] Furthermore, after the image frame acquisition is completed, the camera application can re-control the camera driver to acquire the preview video corresponding to the current object, and send the preview video received from the camera driver to the display driver at the kernel layer for preview display. At this point, the preview freeze ends and the preview is restored.

[0157] Through the above implementation scheme, the frame acquisition duration can be matched with the photo animation duration in various types of photo shooting scenes of electronic devices, thereby improving the smoothness of the photo shooting process.

[0158] It should be understood that the electronic device here is embodied in the form of a functional unit. The terms "unit" and "module" here can be implemented in the form of software and / or hardware, and are not specifically limited to this. For example, a "unit" or "module" can be a software program, a hardware circuit, or a combination of the two to implement the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a proprietary processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit, and / or other suitable components that support the described functions. Whether a function is executed in hardware or in a computer software-driven hardware manner 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.

[0159] The division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware.

[0160] An embodiment of the present application also provides an electronic device, which includes a storage medium and a central processing unit. The storage medium may be a non-volatile storage medium, in which a computer executable program is stored. The central processing unit is connected to the non-volatile storage medium and executes the computer executable program to implement the above-mentioned photographing method.

[0161] The embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes each step of the photographing method of the embodiment of the present application.

[0162] The embodiment of the present application also provides a computer program product containing instructions. When the computer program product is run on a computer or any at least one processor, the computer executes each step of the photographing method of the embodiment of the present application.

[0163] An embodiment of the present application also provides a chip, including a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute corresponding operations and / or processes performed by the photographing method provided in the present application.

[0164] Optionally, the chip also includes a memory, which is connected to the processor via a circuit or wire, and the processor is used to read and execute the computer program in the memory. Further optionally, the chip also includes a communication interface, and the processor is connected to the communication interface. The communication interface is used to receive data and / or information to be processed, and the processor obtains the data and / or information from the communication interface and processes the data and / or information. The communication interface can be an input and output interface.

[0165] The memory may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.

[0166] In the embodiments of the present application, "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent the situation where A exists alone, A and B exist at the same time, or B exists alone. A and B may be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent: a, b, c, ab, ac, bc, or abc, where a, b, c may be single or multiple.

[0167] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0168] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0169] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0170] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A photographing method, characterized in that: include: Display a preview interface for taking photos, wherein the preview interface includes a preview area, and the preview area is used to display a preview video; A photo triggering operation is detected, a frame acquisition operation is triggered, and while the frame acquisition operation is being performed, a first animation is displayed in the preview area according to a first duration, wherein the first duration is a predicted value of the frame acquisition duration of the frame acquisition operation triggered by the photo triggering operation.

2. The method according to claim 1, characterized in that The method further comprises: Get scene information; The frame acquisition time required for the photo-taking operation is predicted based on the scene information.

3. The method according to claim 2, characterized in that The scene information includes environment information and / or device information; the environment information includes environment brightness, and the device information includes camera mode information and / or currently called camera information.

4. The method according to claim 3, characterized in that: Predicting the frame acquisition time required for the photo-taking operation according to the scene information includes: Determining a frame acquisition strategy corresponding to a photo-taking operation according to the scene information; According to the mapping relationship between each preset frame acquisition strategy and the frame acquisition duration, the frame acquisition duration corresponding to the frame acquisition strategy is determined.

5. The method according to claim 4, characterized in that The method further comprises: According to each preset frame acquisition strategy, respectively calculate the frame acquisition duration corresponding to each preset frame acquisition strategy; A mapping relationship between each of the preset frame acquisition strategies and the frame acquisition duration is generated.

6. The method according to claim 5, characterized in that According to each preset frame acquisition strategy, the frame acquisition duration corresponding to each preset frame acquisition strategy is calculated respectively, including: According to each preset frame acquisition strategy, respectively calculate the estimated frame acquisition duration corresponding to each preset frame acquisition strategy; The estimated frame acquisition duration is corrected using the correction parameter to obtain the frame acquisition duration corresponding to each preset frame acquisition strategy; The correction parameter is determined according to the time error of the actual frame acquisition process.

7. The method according to any one of claims 4 to 6, characterized in that: The frame acquisition strategy includes at least one of the number of frames to be acquired, the exposure time of each frame, and the exposure interval of each frame.

8. The method according to claim 1, characterized in that Displaying a first animation in the preview area according to a first duration includes: A prompt animation is displayed in the preview area according to the first duration, wherein the prompt animation includes prompt information, and the prompt information is used to prompt the remaining duration until the end of frame acquisition.

9. The method according to claim 1, characterized in that: Displaying a first animation in the preview area according to a first duration includes: A photo-taking animation is displayed in the preview area according to a first duration, where the photo-taking animation is used to prompt that photo-taking is currently being performed.

10. The method according to claim 9, characterized in that Displaying the photo-taking animation in the preview area according to the first duration includes: In the preview area, a black image is displayed on the layer above the layer where the preview video is located; The transparency of the black image is controlled according to a first preset function, where the first preset function is used to describe the transparency of the black image at different moments in the first time period.

11. The method according to claim 9, characterized in that Displaying the photo-taking animation in the preview area according to the first duration includes: The blurriness of the preview video in the preview area is controlled according to a second preset function, where the second preset function is used to describe the blurriness of the preview video at different moments within the first duration.

12. The method according to claim 1, characterized in that After the photo-taking trigger operation is detected, the method further includes: playing a photo-taking sound effect according to the first duration.

13. An electronic device, characterized in that: include: one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, and when the instructions are executed by the device, the device performs the method according to any one of claims 1 to 12.

14. A chip, characterized in that: The chip includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface to execute the method as described in any one of claims 1 to 12.

15. A storage medium, characterized in that: The storage medium stores program instructions, which, when executed on an electronic device, enable the electronic device to execute the method as claimed in any one of claims 1 to 12.