Shooting mode switching method and related device

CN120239971APending Publication Date: 2025-07-01HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380078515.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-11-22
Filing Date
2023-08-23
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

When the smartphone switches the shooting mode, the preview data flow is interrupted, resulting in no screen display on the shooting interface, affecting the user experience.

Method used

By calling the graphics processing unit GPU, the preview data of the first shooting mode is obtained from the memory, downsampled and blurred, and a blurred image is generated and overlaid and displayed on the preview frame until the preview image in the second shooting mode is obtained.

Benefits of technology

Quickly solve the problem of preview data flow interruption, prevent no picture display in the shooting interface, and improve the picture preview effect when switching shooting modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120239971A_ABST
    Figure CN120239971A_ABST
Patent Text Reader

Abstract

The invention provides a shooting mode switching method and a related device, when an electronic device detects an operation of switching from a first shooting mode to a second shooting mode, preview data in the first shooting mode can be obtained from a memory by calling a GPU, and downsampling is carried out to a specified image size to obtain a downsampling image of a specified data type. And performing blurring processing on the downsampling image of the specified data type returned by the GPU to obtain a blurred image, and displaying the blurred image on the preview frame in a covering manner. Therefore, downsampling is carried out while the preview data is acquired through the GPU, the acquisition process of the downsampled image can be accelerated, the blurred image can be quickly displayed on the preview frame, and no-picture display of a shooting interface caused by cutoff of the preview data stream of the first shooting mode is prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Shooting mode switching method and related device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 22, 2022, with application number 202211468025.5 and application name “Shooting Mode Switching Method and Related Devices”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer vision technology, and in particular to a shooting mode switching method and related devices. Background Art

[0003] As smartphones have evolved, photography and video recording have become one of their most important features. As the capabilities of smartphones and other electronic devices become increasingly powerful, more and more people are using them instead of professional cameras, and the number of shooting modes available on smartphones and other electronic devices is increasing.

[0004] When users preview shots on electronic devices like smartphones, they can switch between different shooting modes to preview the effects of each mode. Because different shooting modes correspond to different shooting parameters and image processing algorithms, it takes time for an electronic device to switch from one shooting mode to another. This can cause the electronic device to be unable to obtain the preview data stream for a period of time when switching shooting modes, resulting in the preview box not displaying the image for a period of time, and a poor user viewing experience.

[0005] Summary of the Invention

[0006] The present application provides a shooting mode switching method and related devices, which can quickly obtain the original image from the preview data, process it into a blurred image, and overlay it on the preview frame when switching from a first shooting mode to a second shooting mode, thereby preventing the shooting interface from being displayed without a picture due to the interruption of the preview data stream of the first shooting mode.

[0007] In a first aspect, the present application provides a method for switching shooting modes, applied to an electronic device equipped with a camera. The method comprises: displaying a first preview interface, the first preview interface including a first preview frame, wherein the first preview frame displays a preview image captured by the camera of the electronic device in a first shooting mode. The preview image captured by the camera of the electronic device in the first shooting mode has a first resolution. A first operation is received to switch from the first shooting mode to a second shooting mode, the first shooting mode being different from the second shooting mode. In response to the first operation, a graphics processing unit (GPU) is invoked to retrieve an original image from preview data for the first shooting mode stored in a memory, the preview data for the first shooting mode being used to display the preview image captured in the first shooting mode in the first preview frame. The GPU downsamples the original image to a specified resolution to obtain a downsampled image of a specified type, wherein the specified resolution is smaller than the first resolution. Blurring the downsampled image of the specified type to obtain a blurred image. The blurred image is displayed as an overlay on the preview frame. When a preview image captured by the camera of the electronic device in the second shooting mode is retrieved, the blurred image is removed from the preview frame and the preview image captured by the camera of the electronic device in the second shooting mode is displayed in the preview frame.

[0008] The shooting mode switching method provided by the present application enables the electronic device to call the GPU from the memory to obtain the preview data in the first shooting mode when detecting the operation of switching from the first shooting mode to the second shooting mode, and downsample it to the specified image size to obtain a downsampled image of the specified data type. The downsampled image of the specified data type returned by the GPU is blurred to obtain a blurred image, and the blurred image is overlaid and displayed on the preview frame. In this way, by obtaining the preview data through the GPU while downsampling, the acquisition process of the downsampled image can be accelerated, and the blurred image can be quickly displayed on the preview frame, preventing the shooting interface from being displayed without a picture due to the interruption of the preview data stream of the first shooting mode.

[0009] In one possible implementation, before receiving a first operation to switch from the first shooting mode to the second shooting mode, the method further includes: identifying a shooting scene, and determining the second shooting mode based on the shooting scene. Displaying a first control corresponding to the second shooting mode on the preview interface, wherein the first operation is an operation on the first control.

[0010] In this way, it is possible to automatically recommend user-related shooting modes based on the shooting scene, thereby improving the user's shooting experience.

[0011] In one possible implementation, the first preview interface further includes an AI scene recognition control. Before identifying the shooting scene and determining the second shooting mode based on the shooting scene, the method further includes: receiving a second operation on the AI ​​scene recognition control. Identifying the shooting scene and determining the second shooting mode specifically includes: identifying the shooting scene in response to the second operation, and determining the second shooting mode based on the shooting scene.

[0012] In this method, based on the user manually turning on the AI ​​scene recognition function, it can automatically recommend user-related shooting modes based on the shooting scene, thereby improving the user's shooting experience.

[0013] In one possible implementation, the preview frame displays a preview image captured by the electronic device's camera in a first shooting mode, specifically including: after the electronic device's camera hardware abstraction layer obtains preview data of the first shooting mode through the camera, the preview data of the second shooting mode is passed through the electronic device's camera service framework layer. The camera service framework layer stores the preview data of the first shooting mode in a memory area of ​​a display control module in an application framework layer on the electronic device. Based on the preview data of the first shooting mode in the memory area of ​​the display control module, the display control module displays the preview image captured by the electronic device's camera in the first shooting mode in the preview frame.

[0014] In this manner, the preview frame displays the preview image of the first shooting mode through the functional module.

[0015] In one possible implementation, receiving a first operation to switch from the first shooting mode to the second shooting mode specifically includes: detecting the second operation to switch from the first shooting mode to the second shooting mode via a mode switching module in a camera application on the electronic device. The method further includes: the mode switching module sending a mode switching instruction to a fuzzy frame capture module in the camera application, and sending an instruction to switch to the second shooting mode to a camera hardware abstraction layer on the electronic device. The fuzzy frame capture module obtains a memory address of a display control module in an application framework layer on the electronic device, wherein the memory area corresponding to the memory address of the display control module stores preview data for the first shooting mode. The fuzzy frame capture module sends the memory address of the display control module to a GPU hardware rendering layer in the application framework layer. Calling a graphics processing unit (GPU) to obtain an original image from the preview data for the first shooting mode stored in memory specifically includes: after obtaining the memory address of the display control module, the GPU hardware rendering layer controls the GPU to obtain the original image from the memory area corresponding to the memory address of the display control module.

[0016] In one possible implementation, the fuzzy frame capture module sends the memory address of the display control module to the GPU hardware rendering layer in the application framework layer, specifically including: the fuzzy frame capture module sends the memory address of the display control module to the GPU hardware rendering layer in the application framework layer through the pixel copy interface.

[0017] In one possible implementation, downsampling the original image to a specified resolution by the GPU to obtain a downsampled image of a specified type specifically includes: after the GPU obtains the original image of a first data type from a memory area corresponding to a memory address of the display control module, downsampling the original image of the first data type to a specified resolution, and converting the downsampled image into the specified data type to obtain the downsampled image, wherein the data type of the downsampled image is a specified type that is different from the first data type. The GPU returns the downsampled image to the fuzzy frame capture module via the GPU hardware rendering layer.

[0018] In one possible implementation, blurring the downsampled image of the specified type to obtain a blurred image specifically includes: after acquiring the downsampled image, the blurred frame capture module blurring the downsampled image to obtain an analog-to-digital image. Overlaying and displaying the blurred image on the first preview frame specifically includes: controlling the blurred frame capture module to display the blurred image over the first preview frame.

[0019] In one possible implementation, when a preview image captured by the camera of the electronic device in a second shooting mode is obtained, the blurred image is canceled from being displayed on the first preview frame. Specifically, the camera hardware abstraction layer sends a mode switching completion instruction to the blurred frame capture module when obtaining preview data captured in the second shooting mode, wherein the preview data of the second shooting mode is used by the display control module to display the preview image captured in the second shooting mode in the preview frame. In response to the mode switching instruction, the blurred frame capture module cancels the overlay display of the blurred image on the preview frame.

[0020] In a possible implementation, the data type of the original image is a YUV type, and the data type of the downsampled image is a bitmap type.

[0021] In one possible implementation, the first shooting mode is any one of the following: normal video mode, macro video mode, night scene video mode, portrait video mode, high dynamic range video mode, main character video mode, and multi-lens video mode. The second shooting mode is any one of the following: normal video mode, macro video mode, night scene video mode, portrait video mode, high dynamic range video mode, main character video mode, and multi-lens video mode.

[0022] In a second aspect, the present application provides an electronic device comprising: a camera, one or more processors, and one or more memories. The camera and the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code comprising computer instructions, which, when executed by the one or more processors, cause the camera mode switching method in any possible implementation of any of the above aspects to be performed.

[0023] In a third aspect, the present application provides an electronic device, comprising one or more functional modules, which are used to execute the shooting mode switching method in any possible implementation of any of the above aspects.

[0024] In a fourth aspect, the present application provides a chip system, including a chip system applied to an electronic device, the chip system including one or more processors, characterized in that the processor is used to call computer instructions to execute a camera mode switching method in any possible implementation of any of the above aspects.

[0025] In a fifth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables execution of a camera mode switching method as in any possible implementation of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] FIG1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0027] FIG2 is a schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;

[0028] 3A-3L are a set of user interface schematic diagrams provided in an embodiment of the present application;

[0029] 4A-4C are another set of user interface schematic diagrams provided in an embodiment of the present application;

[0030] FIG5 is a schematic diagram of software module interaction of a shooting mode switching method provided in an embodiment of the present application;

[0031] FIG6 is a schematic diagram of software module interaction of another shooting mode switching method provided by an embodiment of the present application;

[0032] FIG7 is a flow chart of a method for switching shooting modes provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following is a clear and detailed description of the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0034] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0035] FIG1 is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application.

[0036] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a camera 193, a display screen 194, etc. The sensor module 180 may include a pressure sensor 180A, a distance sensor 180F, a proximity light sensor 180G, a touch sensor 180K, an ambient light sensor 180L, etc.

[0037] It should be understood that the structure illustrated in the embodiments 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, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0038] 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 processing unit (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). The different processing units may be independent devices or integrated into one or more processors. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0039] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

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

[0041] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be made of 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), a miniLED, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device can include one or N display screens 194, where N is a positive integer greater than one.

[0042] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0043] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise and illumination. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0044] 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.

[0045] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform a Fourier transform on the frequency point energy. The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in a variety of encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0046] In an embodiment of the present application, the electronic device 100 can record videos and / or take photos through the shooting functions provided by the ISP, camera 193, video codec, GPU, display 194 and application processor.

[0047] The internal memory 121 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). The RAM can be directly read and written by the processor 110 and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data. The NVM can also store executable programs and user and application data, and can be pre-loaded into the RAM for direct reading and writing by the processor 110.

[0048] The program code corresponding to the shooting mode recommendation method provided in the embodiment of the present application can be stored in a non-volatile memory. When the camera application is running, the electronic device 100 can load the program code stored in the non-volatile memory into the random access memory and then send it to the processor 110 for execution, thereby implementing the shooting mode switching method.

[0049] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as captured videos can be saved in the external non-volatile memory.

[0050] The electronic device 100 may implement audio functions through the audio module 170 and an application processor, etc.

[0051] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0052] Specifically, the audio module 170 may include a speaker 170A, a receiver 170B, a microphone 170C, and an earphone jack 170D. The speaker 170A, also known as a "speaker", is used to convert an audio electrical signal into a sound signal. The receiver 170B, also known as a "handset", is used to convert an audio electrical signal into a sound signal. In an embodiment of the present application, after starting to record a video, the electronic device 100 may encode the audio electrical signal of the microphone 170C and then obtain a video sound track. The microphone 170C, also known as a "microphone" or "microphone", is used to convert a sound signal into an electrical signal. The earphone jack 170D is used to connect wired headphones.

[0053] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A may be located on display screen 194. When a touch operation is performed on display screen 194, electronic device 100 detects the intensity of the touch operation using pressure sensor 180A. Electronic device 100 may also calculate the location of the touch based on the detection signal from pressure sensor 180A.

[0054] Distance sensor 180F is used to measure distance. Electronic device 100 can measure distance using infrared or laser. In some embodiments, when photographing a scene, electronic device 100 can use distance sensor 180F to measure distance for rapid focus. In embodiments of the present application, electronic device 100 can use distance sensor 180F to determine the distance of an object in an image.

[0055] The ambient light sensor 180L is used to sense the ambient light illumination. In the embodiment of the present application, the electronic device 100 can use the ambient light sensor 180L to determine the illumination of the image.

[0056] The touch sensor 180K is also called a "touch-sensitive device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.

[0057] In the embodiment of the present application, the electronic device 100 can detect user operations such as clicking and sliding on the screen through the touch detection capability provided by the touch sensor 180K, thereby controlling the activation and deactivation of applications and controls.

[0058] The electronic device 100 may be a mobile phone with a camera, a digital camera, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, and / or a smart city device. The embodiments of the present application do not impose any special restrictions on the specific type of the electronic device 100.

[0059] FIG2 exemplarily shows a schematic diagram of the software and hardware architecture of an electronic device according to an embodiment of the present application.

[0060] As shown in Figure 2, a layered architecture divides the system into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the system is divided into five layers: application layer, application framework layer, hardware abstraction layer, driver layer, and hardware layer, from top to bottom.

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

[0062] The application package may include a camera application, etc.

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

[0064] In some embodiments, the application framework layer may include a camera access interface, wherein the camera access interface may include camera management and camera devices. The camera access interface is used to provide an application programming interface and a programming framework for camera applications.

[0065] The hardware abstraction layer is an interface layer located between the application framework layer and the driver layer, providing a virtual hardware platform for the operating system.

[0066] In the embodiment of the present application, the hardware abstraction layer may include a camera hardware abstraction layer and a camera algorithm library.

[0067] The camera hardware abstraction layer may provide one or more camera call interfaces. These interfaces may include camera interface 1 (e.g., a main camera) and camera interface 2 (e.g., a wide-angle camera). The electronic device 100 may use camera interfaces such as camera interface 1 and camera interface 2 to call various cameras.

[0068] The camera algorithm library may include one or more algorithm modules of image processing / image recognition algorithms, for example, an algorithm module for scene recognition, an algorithm module for subject tracking, an algorithm module for digital zoom, and the like.

[0069] The driver layer is the layer between hardware and software. It includes drivers for various hardware components. These drivers can include camera device drivers, digital signal processor drivers, and image processor drivers. The camera device driver drives the image sensors (e.g., image sensor 1, image sensor 2, etc.) of one or more cameras in the camera module to capture images and drives the image signal processor to pre-process the images. The digital signal processor driver drives the digital signal processor to process images. The image processor driver drives the graphics processor to process images.

[0070] The hardware layer may include a camera module, an image signal processor, a digital signal processor, and an image processor. The camera module may include one or more camera image sensors (e.g., image sensor 1, image sensor 2, etc.). Optionally, the camera module may also include a time of flight (TOF) sensor, a multispectral sensor, and the like.

[0071] The following describes the method in the embodiment of the present application in detail in combination with the above hardware structure and system structure:

[0072] 1. The electronic device 100 turns on the camera and obtains the image reported by the camera.

[0073] In response to a user operation on the camera application icon (e.g., a click), the camera application calls the camera access interface of the application framework layer to start the camera application, and then sends an instruction to start the camera application by calling camera interface 1 (the default, generally the main camera) in the camera hardware abstraction layer. The camera hardware abstraction layer sends this instruction to the camera device driver of the driver layer. The camera device driver can start the image sensor corresponding to camera interface 1 (e.g., image sensor 1), collect image light signals through image sensor 1, and transmit the image light signals to the image signal processor for preprocessing to obtain an image. The image is then transmitted to the camera hardware abstraction layer through the camera device driver. The continuously generated images constitute an image stream.

[0074] 2. The electronic device 100 determines the current shooting scene based on the image and determines a shooting mode that matches the scene.

[0075] On the one hand, the camera hardware abstraction layer can pass the image directly back to the camera application for display.

[0076] The camera hardware abstraction layer, on the other hand, sends the image to the camera algorithm library. Leveraging the support of the digital signal processor and image processor, the camera algorithm library extracts image feature information. This library can determine the object distance using a preset object distance detection algorithm; the image illumination using a preset illumination detection algorithm; and the image exposure using a preset exposure detection algorithm. Furthermore, it can identify specific objects such as people, cats, and dogs in the image, as well as the number and area ratio of these objects, using preset face detection and animal recognition algorithms.

[0077] The camera algorithm library then determines the current shooting scene based on the image's feature information and identifies a suitable shooting mode. The library then sets the matching shooting mode as the recommended mode and transmits the recommended mode information back to the camera application at the application layer.

[0078] The camera algorithm library also includes image processing algorithms for various shooting modes. After selecting one or more shooting modes, the camera algorithm library can call the corresponding image processing algorithm to process the image reported by the camera, and then upload the processed image back to the application layer for display.

[0079] 3. The electronic device 100 updates the content displayed on the screen and recommends a shooting mode that matches the current shooting scene to the user.

[0080] On the one hand, the camera application displays the image reported by the camera in a designated area of ​​the screen (such as a preview box).

[0081] On the other hand, the camera application can manage the various windows in the user interface through the window manager and update the content displayed in the window, for example, displaying / exiting the display mode recommendation control, etc. In this way, the electronic device 100 can recommend a shooting mode that matches the current shooting scene to the user in real time through the above-mentioned mode recommendation control.

[0082] The following describes the shooting mode switching method provided in this embodiment in conjunction with application scenarios.

[0083] In some application scenarios, users can use multiple shooting modes in the camera application of the electronic device 100 to take photos or videos. Before taking photos or videos, users can switch between different shooting modes in the camera application to view the effects of the preview screen in different shooting modes. In the process of the electronic device 100 switching from the first shooting mode to the second shooting mode, the electronic device 100 can extract the original image from the preview screen stream obtained in the first shooting mode, blur it into a blurred image, and overlay it on the preview box in the shooting interface. In this way, the electronic device 100 can prevent the display of the preview screen from being interrupted when the shooting mode is switched, thereby improving the screen preview effect when the shooting mode is switched.

[0084] Exemplarily, as shown in Figure 3A, the electronic device 100 can display a desktop 310, in which a page with application icons is displayed, and the page includes multiple application icons (for example, a settings application icon, an application market application icon, a gallery application icon, a browser application icon, etc.). A page indicator 313 is also displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. A tray area 311 is displayed below the page indicator 313. Among them, the tray area 311 includes multiple tray icons, for example, a camera application icon 312, an address book application icon, a phone application icon, and a message application icon. The tray area 311 remains displayed when the page is switched. In some embodiments, the above-mentioned page may also include multiple application icons and a page indicator 313. The page indicator 313 may not be part of the page and may exist independently. The above-mentioned tray icon is also optional, and the embodiments of the present application are not limited to this.

[0085] The electronic device 100 may receive user input (eg, a single click) on the camera application icon 312 . In response to the input operation, the electronic device 100 may display a shooting interface 320 as shown in FIG. 3B .

[0086] As shown in Figure 3B, the shooting interface 320 may include a display control 325A, a shooting control 325B, a camera switching control 325C, a preview box 322, and a zoom ratio control 323A. As shown in Figure 3B, the control 324D for normal shooting mode is selected, and the electronic device 100 is in normal shooting mode. The preview box 322 displays a preview screen 326 captured by the camera of the electronic device 100 in normal shooting mode. The display control 325A can be used to trigger the display of a captured image or video. The shooting control 325B can be used to trigger the saving of images captured by the camera. The camera switching control 325C can be used to switch the camera used by the electronic device 100 to capture images (for example, switching from the front camera to the rear camera, or vice versa). The zoom ratio control 323A can be used to set the zoom factor for the photos or videos captured by the electronic device 100. The shooting mode controls can be used to trigger the start of the image processing process corresponding to the shooting mode. For example, the control 324A for large aperture shooting mode can be used to trigger the camera to capture images using large aperture parameters. The control 324B for the night scene photography mode can be used to trigger increasing the brightness and color richness in the captured image, etc. The control 324C for the portrait photography mode can be used to trigger the electronic device 100 to beautify the portrait in the captured image. The control 324D for the normal photography mode can be used to trigger the electronic device 100 to capture an image using default parameters and process the image captured by the camera using the default image processing flow. The control 324E for the normal video recording mode can be used to trigger the electronic device 100 to record a video through a single camera. The control 324F for the multi-lens video recording mode can be used to trigger the electronic device 100 to record a video through multiple cameras simultaneously. The more controls 324G can be used to trigger the electronic device 100 to display controls for more shooting modes.

[0087] The electronic device 100 can receive input (e.g., a single click) from the user selecting the control 324E for normal recording mode. In response to the input, the electronic device 100 can switch from the normal photo mode to the normal recording mode, and generate a blurred image 327 based on the image captured by the camera in the normal photo mode.

[0088] As shown in Figure 3C, when the electronic device 100 switches from normal photo mode to normal video mode, the electronic device 100 can overlay the blurred image 327 on the preview frame 322. The electronic device 100 can switch from normal photo mode to normal video mode and replace the above-mentioned shooting control 325B with the recording start control 325D. After switching to normal video mode, the electronic device 100 can display one or more function controls (e.g., the protagonist video mode control 321A, the AI ​​scene recognition control 321B, the flash control 321C, the color mode control 321D, the setting control 321E, etc.) on the shooting interface 320. The protagonist video mode control 321A can be used to trigger the electronic device 100 to identify the protagonist among multiple people in the preview screen when it is turned on. The AI ​​scene recognition control 321B can be used to trigger the electronic device 100 to identify the shooting scene in the preview screen when it is turned on. The AI ​​scene recognition control 321B is currently in the turned-on state. The flash control 321C can be used to trigger the electronic device 100 to turn the flash on or off. The color mode control 321D can be used to trigger the electronic device 100 to use a color filter to process the image captured by the camera. The setting control 321E can be used to set the shooting parameters of the electronic device 100 (for example, image size, image storage format, etc.). The control 321A of the protagonist recording mode can be used to trigger the electronic device 100 to identify the protagonist among multiple characters in the preview screen when it is turned on. The AI ​​scene recognition control 321B can be used to trigger the electronic device 100 to identify the shooting scene in the preview screen when it is turned on. The current AI scene recognition control 321B is in the turned-on state. The flash control 321C can be used to trigger the electronic device 100 to turn on or off the flash. The color mode control 321D can be used to trigger the electronic device 100 to use a color filter to process the image captured by the camera. The setting control 321E can be used to set the shooting parameters of the electronic device 100 (for example, image size, image storage format, etc.).

[0089] As shown in Figure 3D, after the electronic device 100 switches to the normal recording mode, the electronic device 100 can cancel the display of the blurred image 327 and display the preview screen 328 captured by the camera in real time in the normal recording mode in the preview box 322. Optionally, after the electronic device 100 switches to the normal recording mode, one or more function controls related to recording can be displayed, such as a background blur control 323B, a beauty control 323C, and so on. Among them, the background blur control 323B can be used to set the degree of background blur in the preview screen and the captured screen. The beauty control 323C can be used to set the degree of beautification of the face color in the preview screen and the captured screen.

[0090] As shown in Figure 3E, since the electronic device 100 has turned on the AI ​​scene recognition function, the electronic device 100 can recognize that the preview screen 328 includes a portrait. Therefore, the electronic device 100 can display a control 329 for the portrait recording mode. After turning on the control 329, if the electronic device 100 starts recording, the electronic device 100 can record the video using the shooting parameters and image processing flow in the portrait recording mode. For example, the background area outside the portrait in the recording screen is blurred to highlight the portrait features. Among them, the AI ​​scene recognition function can be turned on by default when entering the normal recording mode.

[0091] In one possible implementation, the AI ​​scene recognition function can be turned off by default when entering the normal recording mode. The electronic device 100 can receive and respond to the user's input to the AI ​​scene recognition control 321B in the off state, switch the AI ​​scene recognition control 321B to the on state, and turn on the AI ​​scene recognition function.

[0092] The electronic device 100 can receive and respond to the user's input on the control 329 of the portrait recording mode, generate a blurred image 332 based on the image captured by the camera in the normal recording mode, switch from the normal recording mode to the portrait recording mode, and display the portrait recording interface 330 as shown in Figure 3F.

[0093] As shown in Figure 3F, the portrait video recording interface 330 may include a preview box 331, a close control 333, a replay control 334A, and a start recording control 334B, among others. When the electronic device 100 switches from normal recording mode to portrait recording mode, the electronic device 100 may display the blurred image 332 on the preview box 322. The replay control 334A may be used to trigger the display of the captured image or video. The start recording control 334B may be used to trigger the electronic device 100 to start recording in portrait recording mode. The close control 333 may be used to trigger the electronic device 100 to exit portrait recording mode. Optionally, after the electronic device 100 switches to portrait recording mode, the electronic device 100 may display one or more recording-related function controls on the portrait video recording interface 330, such as a zoom ratio control 335A, a background blur control 335B, a beauty control 335C, and so on. The zoom ratio control 335A may be used to set the zoom factor of the electronic device 100 in portrait recording mode. The background blur control 335B can be used to set the degree of background blur in the preview image and the video image. The face beautification control 335C can be used to set the degree of face color beautification in the preview image and the video image.

[0094] As shown in FIG3G , after the electronic device 100 switches from the normal recording mode to the portrait recording mode, the electronic device 100 can capture images in real time using the shooting parameters in the portrait recording mode and process the captured images using the image processing flow in the portrait recording mode to obtain a real-time preview image 336. After the electronic device 100 obtains the real-time preview image 336, the electronic device 100 can cancel the display of the blurred image 332 and display the real-time preview image 336 in the preview frame 331.

[0095] The electronic device 100 can receive user input (for example, a single click) on the close control 333. In response to the input, the electronic device 100 can generate a blurred image 337 based on the image captured by the camera in the portrait recording mode, switch from the normal recording mode to the portrait recording mode, and display the shooting interface 320 as shown in Figure 3H.

[0096] As shown in FIG3H , when the electronic device 100 switches from the portrait recording mode to the normal recording mode, the electronic device 100 may display the blurred image 337 in the preview box 322 of the shooting interface 320. For the textual descriptions of other controls in the shooting interface 320, please refer to the textual descriptions of the embodiments shown in FIG3C and FIG3D , and will not be repeated here.

[0097] As shown in FIG3I , after the electronic device 100 switches to the normal recording mode, the electronic device 100 can capture images in real time using the shooting parameters in the normal recording mode and process the real-time captured images using the image processing flow in the normal recording mode to obtain a real-time preview screen 338. After the electronic device 100 obtains the real-time preview screen 338, the electronic device 100 can cancel the display of the blurred image 337 and display the real-time preview screen 338 in the preview box 322. Among them, after the electronic device 100 switches to the normal recording mode, since the electronic device 100 recognizes that the real-time preview screen 338 includes a portrait, the electronic device 100 can display the above-mentioned portrait recording mode control 329. For the textual description of the control 329, please refer to the embodiment shown in FIG3E above, which will not be repeated here.

[0098] As shown in Figure 3J, the electronic device 100 can display a preview screen 341 captured by the camera in real time in the preview box 322 of the shooting interface 320. Since the electronic device 100 has turned on the AI ​​scene recognition function, the electronic device 100 can recognize that the preview screen 341 meets the conditions for high-dynamic recording (for example, the exposure ratio is greater than a preset value). Therefore, the electronic device 100 can display a control 342 for the high-dynamic recording mode. After turning on the control 342, if the electronic device 100 starts recording, the electronic device 100 can record the video using the shooting parameters and image processing process in the high-dynamic recording mode.

[0099] The electronic device 100 can receive and respond to the user's input on the control 342 of the high dynamic recording mode, generate a blurred image 352 based on the image captured by the camera in the normal recording mode, switch from the normal recording mode to the high dynamic recording mode, and display the high dynamic recording interface 350 as shown in Figure 3K.

[0100] As shown in Figure 3K, the high-dynamic-motion video recording interface 350 may include a preview box 351, a close control 353, an echo control 354A, and a start recording control 354B, among others. When the electronic device 100 switches from normal recording mode to high-dynamic-motion video recording mode, the electronic device 100 may display the blurred image 352 in the preview box 351. The echo control 354A may be used to trigger the display of the captured image or video. The start recording control 354B may be used to trigger the electronic device 100 to start recording in high-dynamic-motion video recording mode. The close control 353 may be used to trigger the electronic device 100 to exit high-dynamic-motion video recording mode. Optionally, after the electronic device 100 switches to high-dynamic-motion video recording mode, the electronic device 100 may display one or more function controls related to recording on the high-dynamic-motion video recording interface 350, such as a zoom ratio control 355. The zoom ratio control 355 may be used to set the zoom ratio of the electronic device 100 in high-dynamic-motion video recording mode.

[0101] As shown in FIG3L , after the electronic device 100 switches from the normal recording mode to the high-dynamic recording mode, the electronic device 100 can capture images in real time using the shooting parameters in the high-dynamic recording mode and process the captured images using the image processing flow in the high-dynamic recording mode to obtain a real-time preview image 356. After the electronic device 100 obtains the real-time preview image 356, the electronic device 100 can cancel the display of the blurred image 352 and display the real-time preview image 356 in the preview frame 351.

[0102] In some embodiments, the user can switch between different cameras on the electronic device 100 to take photos or videos. Before taking photos or videos, the user can switch between different cameras in the camera application to view the effects of the preview screen under different cameras. In the process of the electronic device 100 switching from the first camera to the second camera, the electronic device 100 can extract the original image from the preview screen stream obtained under the first camera, blur it into a blurred image, and display it in the preview box in the shooting interface. In this way, the electronic device 100 can prevent the display of the preview screen from being interrupted when the camera is switched, thereby improving the screen preview effect when the shooting mode is switched.

[0103] For example, as shown in FIG4A , the electronic device 100 may display a shooting interface 320. The shooting interface 320 may include an echo control 325A, a recording start control 325D, a camera conversion control 325C, a preview box 322, a zoom ratio control 323A, one or more shooting mode controls (e.g., a large aperture shooting mode control 324A, a night scene shooting mode control 324B, a portrait shooting mode control 324C, a normal shooting mode control 324D, a normal video recording mode control 324E, a multi-lens video recording mode control 324F, and a more mode control 324G), and one or more function controls (e.g., a protagonist video recording mode control 321A, an AI scene recognition control 321B, a flash control 321C, a color mode control 321D, a setting control 321E, etc.). As shown in FIG4A , the normal video recording mode control 324E is selected, and the electronic device 100 is in normal video recording mode. The preview frame 322 displays a preview image 328 captured in real time by the first camera in the normal video recording mode.

[0104] The electronic device 100 can receive input from the user on the camera conversion control 325C (for example, a single click). In response to the input, the electronic device 100 can generate a blurred image 411 based on the image captured by the first camera in normal recording mode, and capture images in real time through the second camera in normal recording mode.

[0105] As shown in FIG. 4B , when the camera for real-time image acquisition of the electronic device 100 in the normal video recording mode switches from the first camera to the second camera, the electronic device 100 may display the blurred image 411 in the preview frame 322 .

[0106] As shown in FIG4C , the electronic device 100 can process the image captured in real time by the second camera through the image processing process of the normal recording mode to obtain a real-time preview image 412. After obtaining the real-time preview image 412, the electronic device 100 can cancel the display of the blurred image 411 in the preview frame 322 and instead display the real-time preview image 412 in the preview frame 322.

[0107] The following describes a shooting mode switching method provided in an embodiment of the present application in conjunction with a software module.

[0108] FIG5 shows a schematic diagram of software module interaction of a shooting mode switching method in an embodiment of the present application.

[0109] As shown in Figure 5, the software framework of the electronic device 100 may include a camera application, an application framework layer (framework, FWK), and a hardware abstraction layer (HAL). Among them, the camera application may include a camera scene recommendation module 510, a mode switching module 520, and a blur capture module 530. The application framework layer may include a display control module 540, an image reader module 550, and a camera service framework layer 560. The hardware abstraction layer may include a camera hardware abstraction layer 570.

[0110] The interaction process between the software modules of the electronic device 100 may include the following steps:

[0111] S501 . The mode switching module 520 detects an operation of previewing in the first shooting mode.

[0112] The operation of previewing in the first shooting mode may be the user opening the camera application, and thus the first shooting mode may be the normal photo mode. The operation of previewing in the first shooting mode may also be the user opening the camera application and selecting the normal video recording mode after displaying the shooting interface, and thus the first shooting mode may be the normal video recording mode. Without limitation, the first shooting mode may also be another shooting mode, such as a large aperture photo mode, a night scene photo mode, a night scene video recording mode, and the like, which are not limited herein.

[0113] S502 . The mode switching module 520 sends the preview resolution A to the fuzzy frame capture module 530 .

[0114] The preview resolution A may be a preset preview resolution in the camera application, for example, the preview resolution may be "1920*1080".

[0115] In one possible implementation, the preview resolution A may correspond to the device type of the electronic device 100. For example, when the device type of the electronic device 100 is a mobile phone, the preview resolution A may be "1920*1080", and when the device type of the electronic device 100 is a tablet, the preview resolution A may be "1280*720", and so on. The above examples are merely for explaining the present application and should not be construed as limiting.

[0116] In one possible implementation, the preview resolution A may correspond to the shooting mode currently used by the electronic device 100. For example, when the electronic device 100 is currently using a shooting mode (normal shooting mode, portrait shooting mode, etc.), the preview resolution A may be "2560*1440"; when the electronic device 100 is currently using a video recording mode (for example, normal video recording mode, portrait video recording mode, etc.), the preview resolution A may be "1920*1080"; the preview resolution A may be "1280*720"; and so on. The above examples are merely used to explain the present application and should not be construed as limiting.

[0117] S503. The mode switching module 520 sends a preview request to the camera hardware abstraction layer 570 through the inter-layer interface, wherein the preview request carries the preview resolution A. The preview request is used to request the camera hardware abstraction layer 570 to obtain the preview data stream of the first shooting mode.

[0118] Among them, after receiving the preview request, the camera hardware abstraction layer 570 can control the camera to collect the image stream in real time based on the preview resolution A carried in the preview request, and then obtain the preview data stream of preview resolution A from the real-time collected image stream.

[0119] S504 . The camera hardware abstraction layer 570 transmits the preview data stream of the first shooting mode to the camera service framework layer 560 .

[0120] S505 . The camera service framework layer 560 stores the preview data stream of the first shooting mode in the memory area of ​​the display control module 540 .

[0121] S506 . The display control module 540 may display the preview image of the first shooting mode in the preview frame based on the preview data stream of the first shooting mode.

[0122] After the display control module 540 obtains the preview data stream of the preview resolution transmitted by the camera service framework layer 560 from the memory area of ​​the display control module 540, it can continuously draw and display the preview image of the first shooting mode in the preview frame based on the preview data stream through a surface view. The surface view can define the size and position of the preview frame.

[0123] S507. The camera scene recommendation module 510 may identify the shooting scene and determine a recommended shooting mode.

[0124] Among them, the recommended shooting modes may include any one or more combinations of macro video mode, night scene video mode, portrait video mode, high dynamic video mode, protagonist video mode, multi-lens video mode, etc.

[0125] For example, the matching conditions of the recommended shooting modes are shown in Table 1 below:

[0126] Table 1

[0127] Among them, it can be seen from the above Table 1 that when the camera scene recommendation module 510 recognizes that the distance (object distance) between the shooting object and the electronic device 100 is less than D1 and the illumination is less than L1 and the zoom ratio = 1x, the camera scene recommendation module 510 can determine that the recommended shooting mode is the macro recording mode. When the camera scene recommendation module 510 recognizes that the illumination is greater than L2 and the zoom ratio is within 1x~2x, the camera scene recommendation module 510 can determine that the recommended shooting mode is the night scene recording mode. When the camera scene recommendation module 510 recognizes that the maximum face area ratio in the preview screen is greater than P1 and the illumination is less than L3 and the zoom ratio is within 1x~2x, the camera scene recommendation module 510 can determine that the recommended shooting mode is the portrait recording mode. When the camera scene recommendation module 510 identifies that the number of faces in the preview image is ≥ 2, P2 is less than the maximum face area ratio in the preview image and less than P1, the illumination is less than L4, and the zoom factor is between 0.5x and 2x, the camera scene recommendation module 510 can determine that the recommended shooting mode is the main character recording mode. When the camera scene recommendation module 501 identifies that the preview image includes a preset object such as a cat or dog and the zoom factor is between 1x and 6x, the camera scene recommendation module 501 can determine that the recommended shooting mode is the multi-lens recording mode.

[0128] Among them, the object distance threshold D1, the illumination thresholds L1, L2, L3, L4, and the ratio thresholds P1 and P2 are preset. The embodiments of this application do not limit their specific values. It is understandable that developers can set them based on experience. For example, D1 = 12cm; L1 = 450F, L2 = 440F, L3 = 450F, L4 = 350F; P1 = 15%, P2 = 7%. The above examples are only used to explain this application and should not constitute a limitation.

[0129] S508 . The camera scene recommendation module 510 may send the recommended shooting mode to the mode switching module 520 .

[0130] After receiving the recommended shooting mode, the mode switching module 520 may control a control to display the recommended shooting mode.

[0131] S509 . The mode switching module 520 may detect an operation of switching to the recommended shooting mode.

[0132] For example, after the electronic device 100 displays the controls for a recommended shooting mode (e.g., portrait video mode), the mode switching module 520 can detect the user's operation on the controls for the recommended shooting mode. In response to the operation, the mode switching module 520 can determine that it is necessary to switch to the recommended shooting mode.

[0133] S510. The mode switching module 520 may send a mode switching instruction to the fuzzy frame capture module 530 in response to the operation of switching to the recommended shooting mode.

[0134] S511 . The mode switching module 520 may send an instruction to switch to the recommended shooting mode to the camera hardware abstraction layer 570 in response to the operation of switching to the recommended shooting mode.

[0135] After receiving the instruction to switch to the recommended shooting mode, the camera hardware abstraction layer 570 stops acquiring the preview data stream of the first shooting mode and reissues the shooting parameters of the recommended shooting mode to the camera, instructing the camera to capture the image stream in real time using the shooting parameters of the recommended shooting mode. The camera hardware abstraction layer 570 can activate the image processing module corresponding to the recommended shooting mode to process the image stream captured by the camera in real time to obtain the preview data stream of the recommended shooting mode.

[0136] S512. After receiving the mode switching instruction, the fuzzy frame capture module 530 may send a frame capture request to the image reading module 550, wherein the frame capture request carries an image storage area of ​​an image size corresponding to the preview resolution A.

[0137] For example, the preview resolution A is 1920*1080, and the image storage area corresponding to the image size of the preview resolution A can be used to store data with an image size of 1920*1080 pixels.

[0138] S513 . After receiving the frame capture request, the image reading module 550 may capture the original image from the preview data stream obtained by the camera service framework layer 560 .

[0139] S514. The image reading module 550 can return the original image to the fuzzy frame capture module 530 in the image storage area.

[0140] S515. The fuzzy frame capture module 530 obtains the original image from the image storage area.

[0141] Among them, the image reading module 550 can capture the original image based on the preview data stream obtained from the camera service framework layer 560, store the data of the original image (for example, YUV data) in the above-mentioned image storage area, and return the image class corresponding to the data of the original image to the fuzzy frame capture module 530.

[0142] After obtaining the image class of the original image returned by the image reading module 550, the fuzzy frame capture module 530 can find the above-mentioned image storage area from the memory based on the image class of the original image and obtain the data of the original image from the above-mentioned image storage area.

[0143] S516. The fuzzy frame capture module 530 downsamples the original image to obtain a downsampled image.

[0144] The fuzzy frame capture module 530 downsamples the original image based on the original image data, i.e., reduces the resolution of the original image. The resolution of the downsampled image is smaller than the resolution of the original image. For example, if the resolution of the original image is "1920*1080", after 100 times downsampling, the resolution of the downsampled image is "192*108".

[0145] S517. The fuzzy frame capture module 530 performs fuzzy processing on the downsampled image to obtain a blurred image.

[0146] Since the blurring algorithm can only blur image data of a specified data type (e.g., a bitmap), and the original image data obtained by the blurred frame capture module 530 is YUV data, the blurred frame capture module 530 needs to convert the image data from YUV to a specified data type (e.g., a bitmap) before blurring the image. After obtaining the YUV downsampled image, the blurred frame capture module 530 can first convert the downsampled image data from YUV to a bitmap, and then perform the blurring process to obtain a blurred bitmap image.

[0147] The blurred frame capture module 530 may use a blur processing algorithm to blur the downsampled image to obtain a blurred image. The blur processing algorithm may include, but is not limited to, one or more of a Gaussian blur algorithm, a box blur, a dual blur, a bokeh blur, a tilt shift blur, an iris blur, a grainy blur, a radial blur, a directional blur, and the like.

[0148] S518. After acquiring the blurred image, the blurred frame capture module 530 overlays and displays the blurred image in the preview frame.

[0149] Among them, after obtaining the blurred image, the blurred frame capture module 530 can overlay the blurred image on the preview frame to prevent the shooting interface from being displayed without a picture due to the interruption of the preview data stream when the mode is switched.

[0150] Specifically, the fuzzy frame capture module 530 can control to set a fuzzy control of the same size as the preview box on the upper layer of the preview box, and the fuzzy frame capture module 530 can display the fuzzy image in the fuzzy control, thereby achieving the coverage of the preview box by the fuzzy image.

[0151] S519 . After receiving the instruction to switch to the recommended shooting mode, the camera hardware abstraction layer 570 may obtain a preview data stream of the recommended shooting mode and transmit the preview data stream of the recommended shooting mode to the camera service framework layer 560 .

[0152] Among them, after receiving the instruction to switch to the recommended shooting mode, the camera hardware abstraction layer 570 can call the camera to collect images in real time using the shooting parameters under the recommended shooting mode, and use the image processing process corresponding to the recommended shooting mode to process the images collected by the camera in real time to obtain a preview data stream of the recommended shooting mode.

[0153] S520. When the camera hardware abstraction layer 570 obtains the preview data stream of the recommended shooting mode, it sends a mode switching completion instruction to the fuzzy frame capture module 530.

[0154] Among them, when the camera hardware abstraction layer 570 obtains the first frame of image data in the preview data stream that detects the recommended shooting mode, the camera hardware abstraction layer 570 can send a mode switching completion instruction to the fuzzy frame capture module 530 through the inter-layer interface.

[0155] S521 . After acquiring the preview data stream of the recommended shooting mode, the camera service framework layer 560 stores the preview data stream of the recommended shooting mode in the memory area of ​​the display control module 540 .

[0156] S522 . After acquiring the preview data stream of the recommended shooting mode from the memory area of ​​the display control module 540 , the display control module 540 displays the preview image of the recommended shooting mode in the preview frame.

[0157] S523. After receiving the mode switching completion instruction sent by the camera hardware abstraction layer 570, the blurred frame capture module 530 can cancel the overlay display of the blurred image on the preview frame.

[0158] Through the shooting mode switching method shown in Figure 5 above, when the electronic device 100 switches from the first shooting mode to the second shooting mode, the image reading module 550 can capture the YUV data of the original image from the camera service framework layer 560, encapsulate the image class and return it to the fuzzy frame capture module 530. Then, the fuzzy frame capture module 530 obtains the original image from the image storage area based on the image class, downsamples and blurs it, and finally obtains a blurred image. The electronic device 100 then overlays the blurred image on the preview frame until the preview image stream of the second shooting mode is obtained. In this way, it can prevent the shooting interface from being displayed without an image due to the interruption of the preview data stream of the first shooting mode.

[0159] However, the preview data stream obtained by the image reading module 550 from the camera service framework layer 560 is in the YUV format, and the blur processing algorithm can only process data of a specified data type (e.g., bitmap) other than the YUV type. Therefore, the blurred frame capture module 530 needs to convert the YUV image data into image data of a specified data type (e.g., bitmap) before blurring the image. Furthermore, the blurred frame capture module 530 needs to downsample the original image before blurring it to reduce the subsequent blur processing time. The blurred frame capture module 530 runs on a central processing unit (CPU) (or application processor (AP)), which has many processing tasks. This results in a long downsampling and format conversion time for the blurred frame capture module 530. For example, experimental data shows that using the method of the embodiment shown in FIG. 5 , it takes 100ms to 150ms for the electronic device 100 to detect the operation of switching the shooting mode and display the blurred image in the preview frame.

[0160] Therefore, an embodiment of the present application provides another method for switching shooting modes. When the electronic device 100 detects an operation to switch from a first shooting mode to a second shooting mode, it can call the GPU through a pixel copy interface to obtain a frame of preview data in the first shooting mode from the memory area of ​​the display control module, downsample it to a specified image size, and obtain a downsampled image of the specified data type. The downsampled image of the specified data type returned by the GPU is blurred to obtain a blurred image, and the blurred image is overlaid on the preview frame. In this way, by downsampling while the GPU obtains the preview data from the memory, the acquisition process of the downsampled image can be accelerated. Moreover, after the GPU directly obtains a frame of YUV-type preview data from the memory, it can quickly convert it into a bitmap-type preview data. The GPU can directly return the bitmap-type downsampled image to the blur frame capture module in the CPU for blur processing. This eliminates the need for image format conversion and saves time in acquiring the blurred image. For example, experimental data shows that it only takes 5ms to 20ms for the electronic device 100 to detect the operation of switching shooting modes and display the blurred image on the preview frame.

[0161] Another shooting mode switching method provided by an embodiment of the present application is described in detail below.

[0162] FIG6 shows a schematic diagram of software module interaction of another shooting mode switching method in an embodiment of the present application.

[0163] As shown in Figure 6, the software framework of the electronic device 100 may include a camera application, an application framework layer (FWK), and a hardware abstraction layer (HAL). The camera application may include a camera scene recommendation module 610, a mode switching module 620, and a fuzzy frame capture module 630. The application framework layer may include a display control module 640, a GPU hardware rendering layer 650, and a camera service framework layer 660. The hardware abstraction layer may include a camera hardware abstraction layer 670.

[0164] The interaction process between the software modules of the electronic device 100 may include the following steps:

[0165] S601. The mode switching module 620 detects an operation of starting camera preview.

[0166] The operation of previewing in the first shooting mode may be the user opening the camera application, and thus the first shooting mode may be the normal photo mode. The operation of previewing in the first shooting mode may also be the user opening the camera application and selecting the normal video recording mode after displaying the shooting interface, and thus the first shooting mode may be the normal video recording mode. Without limitation, the first shooting mode may also be another shooting mode, such as a large aperture photo mode, a night scene photo mode, a night scene video recording mode, and the like, which are not limited herein.

[0167] S602 . The mode switching module 620 sends the preview resolution A to the fuzzy frame capture module 630 .

[0168] The preview resolution A may be a preset preview resolution in the camera application, for example, the preview resolution may be "1920*1080".

[0169] In one possible implementation, the preview resolution A may correspond to the device type of the electronic device 100. For example, when the device type of the electronic device 100 is a mobile phone, the preview resolution A may be "1920*1080", and when the device type of the electronic device 100 is a tablet, the preview resolution A may be "1280*720", and so on. The above examples are merely for explaining the present application and should not be construed as limiting.

[0170] In one possible implementation, the preview resolution A may correspond to the shooting mode currently used by the electronic device 100. For example, when the electronic device 100 is currently using a shooting mode (normal shooting mode, portrait shooting mode, etc.), the preview resolution A may be "2560*1440"; when the electronic device 100 is currently using a video recording mode (for example, normal video recording mode, portrait video recording mode, etc.), the preview resolution A may be "1920*1080"; the preview resolution A may be "1280*720"; and so on. The above examples are merely used to explain the present application and should not be construed as limiting.

[0171] S603. The mode switching module 620 sends a preview request to the camera hardware abstraction layer 670 through the inter-layer interface, wherein the preview request carries the preview resolution A. The preview request is used to request the camera hardware abstraction layer 670 to obtain the preview data stream of the first shooting mode.

[0172] Among them, after receiving the preview request, the camera hardware abstraction layer 670 can control the camera to capture the image stream in real time based on the preview resolution A carried in the preview request, and then obtain the preview data stream of the preview resolution A from the real-time captured image stream.

[0173] S604 . The camera hardware abstraction layer 670 transmits the preview data stream of the first shooting mode to the camera service framework layer 660 .

[0174] S605 . The camera service framework layer 660 stores the preview data stream of the first shooting mode in the memory area of ​​the display control module 640 .

[0175] S606 . The display control module 640 may display the preview image of the first shooting mode in the preview frame based on the preview data stream of the first shooting mode.

[0176] After obtaining the preview data stream of the preview resolution transmitted by the camera service framework layer 660 from the memory address of the display control module 640, the display control module 640 can continuously draw and display the preview image of the first shooting mode in the preview frame based on the preview data stream through a surface view. The surface view can define the size and position of the preview frame.

[0177] S607. The camera scene recommendation module 610 can identify the shooting scene and determine a recommended shooting mode.

[0178] The recommended shooting modes may include any one or more combinations of macro recording mode, night scene recording mode, portrait recording mode, high dynamic range recording mode, main character recording mode, multi-lens recording mode, etc. The matching conditions for the recommended shooting modes can be referred to step S507 in the embodiment shown in FIG. 5 above, and will not be further described here.

[0179] S608 . The camera scene recommendation module 610 may send the recommended shooting mode to the mode switching module 620 .

[0180] S609 . The mode switching module 620 may detect an operation of switching to the recommended shooting mode.

[0181] S610. The mode switching module 620 may send a mode switching instruction to the fuzzy frame capture module 630 in response to the operation of switching to the recommended shooting mode.

[0182] S611 . The mode switching module 620 may send an instruction to switch to the recommended shooting mode to the camera hardware abstraction layer 670 in response to the operation of switching to the recommended shooting mode.

[0183] After receiving the instruction to switch to the recommended shooting mode, the camera hardware abstraction layer 670 stops acquiring the preview data stream of the first shooting mode and reissues the shooting parameters of the recommended shooting mode to the camera, instructing the camera to capture the image stream in real time using the shooting parameters of the recommended shooting mode. The camera hardware abstraction layer 670 can activate the image processing module corresponding to the recommended shooting mode to process the image stream captured by the camera in real time to obtain the preview data stream of the recommended shooting mode.

[0184] S612. The fuzzy frame capture module 630 can obtain the memory address of the display control module 640 in response to the mode switching instruction.

[0185] The memory address of the display control module 640 stores a preview data stream of the first shooting mode.

[0186] S613. The fuzzy frame capture module 630 determines the specified resolution based on the preview resolution A.

[0187] The specified resolution is smaller than the preview resolution A. For example, the preview resolution A can be 1920*1080, and the specified resolution can be 192*108.

[0188] S614. The fuzzy frame capture module 630 sends the memory address and the specified resolution of the display control module 640 to the GPU hardware rendering layer 650 through a pixel copy interface.

[0189] S615. The GPU hardware rendering layer 650 obtains the original image from the memory area of ​​the display control module 640 according to the memory address of the display control module 640 through the GPU, and downsamples it to the specified resolution to obtain a downsampled image.

[0190] The resolution of the downsampled image is smaller than the resolution of the original image. For example, if the resolution of the original image is "1920*1080", after being downsampled by 100 times, the resolution of the downsampled image is "192*108".

[0191] S616. The GPU hardware rendering layer 650 returns the downsampled image to the fuzzy frame capture module 630 through the pixel copy interface.

[0192] Among them, since the data of the original image obtained by the GPU is of YUV type, the GPU can downsample the YUV data of the original image to obtain YUV data of the downsampled image, and then convert the YUV data of the downsampled image into bitmap data of the downsampled image.

[0193] After converting the bitmap data into the downsampled image, the GPU can store the bitmap data of the downsampled image in a designated area of ​​memory and return the address of the designated area in memory to the fuzzy frame capture module 630 via the pixel copy interface through the GPU hardware rendering layer 650. The fuzzy frame capture module 630 can obtain the bitmap data of the downsampled image from the designated area of ​​memory based on the address of the designated area.

[0194] S617. The fuzzy frame capture module 630 performs fuzzy processing on the downsampled image to obtain a blurred image.

[0195] The blurred frame capture module 630 may blur the downsampled image based on the bitmap data of the downsampled image using a blur processing algorithm to obtain a blurred image. The blur processing algorithm may include, but is not limited to, one or more of a Gaussian blur algorithm, box blur, dual blur, bokeh blur, tilt shift blur, iris blur, grainy blur, radial blur, directional blur, and the like.

[0196] S618. After acquiring the blurred image, the blurred frame capture module 630 overlays and displays the blurred image in the preview frame.

[0197] Among them, after obtaining the blurred image, the blurred frame capture module 630 can overlay the blurred image on the preview frame to prevent the shooting interface from being displayed without a picture due to the interruption of the preview data stream when the mode is switched.

[0198] Specifically, the fuzzy frame capture module 630 can control to set a fuzzy control of the same size as the preview box on the upper layer of the preview box, and the fuzzy frame capture module 630 can display the fuzzy image in the fuzzy control, thereby achieving the coverage of the preview box by the fuzzy image.

[0199] S619 . After receiving the instruction to switch to the recommended shooting mode, the camera hardware abstraction layer 670 may obtain a preview data stream of the recommended shooting mode and transmit the preview data stream of the recommended shooting mode to the camera service framework layer 660 .

[0200] Among them, after receiving the instruction to switch to the recommended shooting mode, the camera hardware abstraction layer 670 can call the camera to collect images in real time using the shooting parameters under the recommended shooting mode, and use the image processing process corresponding to the recommended shooting mode to process the images collected by the camera in real time to obtain a preview data stream of the recommended shooting mode.

[0201] S620. When the camera hardware abstraction layer 670 obtains the preview data stream of the recommended shooting mode, it sends a mode switching completion instruction to the fuzzy frame capture module 630.

[0202] Among them, when the camera hardware abstraction layer 670 obtains the first frame of image data in the preview data stream that detects the recommended shooting mode, the camera hardware abstraction layer 670 can send a mode switching completion instruction to the fuzzy frame capture module 530 through the inter-layer interface.

[0203] S621 . After acquiring the preview data stream of the recommended shooting mode, the camera service framework layer 660 stores the preview data stream of the recommended shooting mode in the memory area of ​​the display control module 540 .

[0204] S622. After acquiring the preview data stream of the recommended shooting mode from the memory area of ​​the display control module 640, the display control module 640 displays the preview screen of the recommended shooting mode in the preview frame.

[0205] S623. After receiving the mode switching completion instruction sent by the camera hardware abstraction layer 670, the blurred frame capture module 630 can cancel the overlay display of the blurred image on the preview frame.

[0206] The embodiment of the present application provides a shooting mode switching method. When the electronic device 100 detects an operation of switching from a first shooting mode to a second shooting mode, it can call the GPU through a pixel copy interface to obtain a frame of preview data in the first shooting mode from the memory area of ​​the display control module, and downsample it to a specified image size to obtain a downsampled image of a specified data type. The downsampled image of the specified data type returned by the GPU is blurred to obtain a blurred image, and the blurred image is overlaid and displayed on the preview frame. In this way, by obtaining the preview data through the GPU while downsampling, the acquisition process of the downsampled image can be accelerated, and the blurred image can be quickly obtained and displayed on the preview frame, thereby preventing the shooting interface from having no screen display due to the interruption of the preview data stream of the first shooting mode.

[0207] FIG7 shows a flow chart of a shooting mode switching method provided in an embodiment of the present application.

[0208] As shown in FIG7 , the method includes:

[0209] S701. The electronic device 100 displays a first preview interface, wherein the first preview interface includes a first preview frame, and the first preview frame displays a preview image captured by the camera of the electronic device in a first shooting mode.

[0210] For example, the first shooting mode can be a normal photo mode. The operation of previewing in the first shooting mode can also be an operation in which the user opens the camera application to display the shooting interface and selects the normal video recording mode. Therefore, the first shooting mode can be a normal video recording mode. Without limitation, the first shooting mode can also be other shooting modes, such as a large aperture photo mode, a night scene photo mode, a night scene video recording mode, etc., which are not limited here.

[0211] For example, the first shooting mode may be a normal shooting mode, the first preview interface may be the shooting interface 320 shown in the embodiment shown in FIG3B , and the preview box may be the preview box 322 shown in the embodiment shown in FIG3B . For details, please refer to the embodiment shown in FIG3B , and no further details will be given here.

[0212] For another example, the first shooting mode may be a normal video recording mode, the first preview interface may be the shooting interface 320 shown in the embodiment shown in FIG3E , and the preview frame may be the preview frame 341 shown in the embodiment shown in FIG3E . For details, please refer to the embodiment shown in FIG3E , and no further details will be given here.

[0213] The resolution of the preview image captured by the camera of the electronic device 100 in the first shooting mode is the first resolution.

[0214] For example, the first resolution may be 1920*1080 pixels.

[0215] S702: Receive a first operation to switch from a first shooting mode to a second shooting mode, wherein the first shooting mode is different from the second shooting mode.

[0216] The second shooting mode can be any one of the following: normal recording mode, macro recording mode, night scene recording mode, portrait recording mode, high dynamic range recording mode, main character recording mode and multi-lens recording mode.

[0217] In one possible implementation, the electronic device 100 may identify a shooting scene, determine the second shooting mode, and display a first control corresponding to the second shooting mode on the first preview interface of the electronic device 100. The first operation may be an operation on the first control.

[0218] For example, the first shooting mode may be a normal video recording mode, and the second shooting mode may be a portrait video recording mode. The first control may be control 329 for the portrait video recording mode in the embodiment described in FIG. 3E . The first operation may be an operation of control 329 for the portrait video recording mode. For details, please refer to the embodiment described in FIG. 3E , and will not be further described here.

[0219] For another example, the first shooting mode may be a portrait video mode, and the second shooting mode may be a high-dynamic range video mode. The first control may be control 329 for the portrait video mode in the embodiment described in FIG. 3E . The first operation may be an operation on control 329 for the portrait video mode. For details, please refer to the embodiment described in FIG. 3E , and will not be further described here.

[0220] In one example, the first shooting mode may be a portrait video mode, and the second shooting mode may be a normal video mode. The first operation may be an operation for closing control 333 in the portrait video interface 330 shown in FIG. 3G . For details, please refer to the embodiment shown in FIG. 3G , and no further description is given here.

[0221] S703. In response to the first operation, call the graphics processing unit GPU to obtain an original image from the preview data of the first shooting mode stored in the memory, where the preview data of the first shooting mode is used to display a preview picture shot in the first shooting mode in a first preview frame.

[0222] For the specific content, please refer to the embodiment shown in FIG6 , which will not be described in detail here.

[0223] S704. Downsampling the original image to a specified resolution through the GPU to obtain a downsampled image of a specified type, wherein the specified resolution is smaller than the first resolution;

[0224] For the specific content, please refer to the embodiment shown in FIG6 , which will not be described in detail here.

[0225] S705. Blurring the downsampled image of the specified type to obtain a blurred image;

[0226] The fuzzy processing process may refer to the embodiment shown in FIG6 , which will not be described in detail here.

[0227] S706. The electronic device 100 overlays the blurred image on the preview frame;

[0228] S707. When the electronic device 100 obtains a preview picture shot by the camera of the electronic device in the second shooting mode, cancel displaying the blurred image on the preview frame and display the preview picture shot by the camera of the electronic device 100 in the second shooting mode in the preview frame.

[0229] Among them, for the parts not described in detail in the embodiments of the present application, reference can be made to the aforementioned embodiments and will not be repeated here.

[0230] The embodiment of the present application provides a shooting mode switching method. When the electronic device 100 detects an operation of switching from a first shooting mode to a second shooting mode, it can call the GPU through a pixel copy interface to obtain a frame of preview data in the first shooting mode from the memory area of ​​the display control module, and downsample it to a specified image size to obtain a downsampled image of a specified data type. The downsampled image of the specified data type returned by the GPU is blurred to obtain a blurred image, and the blurred image is overlaid and displayed on the preview frame. In this way, by obtaining the preview data through the GPU while downsampling, the acquisition process of the downsampled image can be accelerated, and the blurred image can be quickly obtained and displayed on the preview frame, thereby preventing the shooting interface from having no screen display due to the interruption of the preview data stream of the first shooting mode.

[0231] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0232] An embodiment of the present application further provides a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the above-mentioned various method embodiments.

[0233] The present application also provides a chip system, comprising a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip system can be a single chip or a chip module composed of multiple chips.

[0234] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the media interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is a source code written in a specific computer language such as Java and Extensible Markup Language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as <head> and <body>. A node corresponds to a control or attribute in the interface, and the node is presented as user-visible content after parsing and rendering. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is a source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code, such as HTML through <body>. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0235] A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations that uses graphics. It can be an icon, window, control, or other interface element displayed on the display of an electronic device. Controls can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and other visual interface elements.

[0236] As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items. As used in the above embodiments, the term "when..." can be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...". Similarly, the phrase "when determining..." or "if (stated condition or event) is detected" can be interpreted to mean "if determining..." or "in response to determining..." or "when (stated condition or event) is detected" or "in response to detecting (stated condition or event)", depending on the context.

[0237] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).

[0238] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0239] 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 above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above 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.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A shooting mode switching method, applied to an electronic device with a camera, characterized in that: The method comprises: displaying a first preview interface, the first preview interface including a first preview frame, wherein a preview image captured by the camera of the electronic device in the first shooting mode is displayed in the first preview frame; the resolution of the preview image captured by the camera of the electronic device in the first shooting mode is a first resolution; receiving a first operation to switch from the first shooting mode to a second shooting mode, the first shooting mode being different from the second shooting mode; In response to the first operation, calling a graphics processing unit (GPU) to obtain an original image from preview data of a first shooting mode stored in a memory, where the preview data of the first shooting mode is used to display a preview image shot in the first shooting mode in the first preview frame; downsampling the original image to a specified resolution by the GPU to obtain a downsampled image of a specified type, wherein the specified resolution is smaller than the first resolution; Performing blur processing on the downsampled image of the specified type to obtain a blurred image; Overlaying and displaying the blurred image on the preview frame; When a preview picture shot by the camera of the electronic device in the second shooting mode is obtained, the blurred image is not displayed on the preview frame, and the preview picture shot by the camera of the electronic device in the second shooting mode is displayed in the preview frame.

2. The method according to claim 1, characterized in that Before receiving a first operation to switch from the first shooting mode to the second shooting mode, the method further includes: identifying a shooting scene, and determining the second shooting mode based on the shooting scene; A first control corresponding to the second shooting mode is displayed on the preview interface; wherein the first operation is an operation on the first control.

3. The method according to claim 1 or 2, characterized in that The first preview interface further includes an AI scene recognition control; before identifying the shooting scene and determining the second shooting mode based on the shooting scene, the method further includes: receiving a second operation on the AI ​​scene recognition control; The identifying the shooting scene and determining the second shooting mode specifically includes: In response to the second operation, a shooting scene is identified, and the second shooting mode is determined based on the shooting scene.

4. The method according to any one of claims 1 to 3, characterized in that The preview frame displays a preview image captured by the camera of the electronic device in the first shooting mode, specifically including: After the camera hardware abstraction layer of the electronic device obtains the preview data of the first shooting mode through the camera, the preview data of the second shooting mode is passed to the camera service framework layer of the electronic device; The camera service framework layer stores the preview data of the first shooting mode to the application framework on the electronic device In the memory area of ​​the display control module in the layer; The display control module displays a preview image captured by the camera of the electronic device in the first shooting mode in the preview frame based on the preview data of the first shooting mode in the memory area of ​​the display control module.

5. The method according to any one of claims 1 to 4, characterized in that The receiving a first operation of switching from the first shooting mode to the second shooting mode specifically includes: detecting, by a mode switching module in a camera application on the electronic device, the second operation of switching from the first shooting mode to the second shooting mode; The method further comprises: The mode switching module sends a mode switching instruction to the blur frame capture module in the camera application, and sends an instruction to switch to the second shooting mode to the camera hardware abstraction layer on the electronic device; The fuzzy frame capture module obtains a memory address of a display control module in an application framework layer on the electronic device, wherein a memory area corresponding to the memory address of the display control module stores preview data of the first shooting mode; The fuzzy frame capture module sends the memory address of the display control module to the GPU hardware rendering layer in the application framework layer; The calling of the graphics processing unit (GPU) to obtain the original image from the preview data of the first shooting mode stored in the memory specifically includes: After obtaining the memory address of the display control module, the GPU hardware rendering layer controls the GPU to obtain the original image from the memory area corresponding to the memory address of the display control module.

6. The method according to claim 5, characterized in that The fuzzy frame capture module sends the memory address of the display control module to the GPU hardware rendering layer in the application framework layer, specifically including: The fuzzy frame capture module sends the memory address of the display control module to the GPU hardware rendering layer in the application framework layer through a pixel copy interface.

7. The method according to claim 5 or 6, characterized in that The downsampling of the original image to a specified resolution by the GPU to obtain a downsampled image of a specified type specifically includes: After obtaining the original image of the first data type from the memory area corresponding to the memory address of the display control module, the GPU downsamples the original image of the first data type to a specified resolution, and converts the downsampled image into the specified data type to obtain the downsampled image, wherein the data type of the downsampled image is a specified type, and the specified type is different from the first data type; The GPU returns the downsampled image to the fuzzy frame capture module through the GPU hardware rendering layer.

8. The method according to claim 7, characterized in that The blurring of the downsampled image of the specified type to obtain a blurred image specifically includes: After acquiring the downsampled image, the fuzzy frame capture module performs fuzzy processing on the downsampled image to obtain an analog-to-digital image; The overlaying and displaying the blurred image on the first preview frame specifically includes: The fuzzy frame capture module controls the blurred image to be displayed overlaid on the first preview frame.

9. The method according to claim 8, characterized in that When a preview image captured by the camera of the electronic device in the second shooting mode is acquired, canceling the display of the blurred image on the first preview frame specifically includes: When the camera hardware abstraction layer obtains the preview data in the second shooting mode, it sends a mode switching completion instruction to the fuzzy frame capture module, wherein the preview data in the second shooting mode is used by the display control module to display the preview image captured in the second shooting mode in the preview frame; The blurred frame capture module cancels the overlay display of the blurred image on the preview frame in response to the mode switching instruction.

10. The method according to any one of claims 1 to 9, characterized in that The data type of the original image is a YUV type, and the data type of the downsampled image is a bitmap type.

11. The method according to any one of claims 1 to 10, characterized in that The first shooting mode is any one of the following: normal video mode, macro video mode, night scene video mode, portrait video mode, high dynamic range video mode, protagonist video mode, and multi-lens video mode; The second shooting mode is any one of the following: normal video mode, macro video mode, night scene video mode, portrait video mode, high dynamic video mode, protagonist video mode and multi-lens video mode.

12. An electronic device, characterized in that: The method comprises a camera, one or more processors and one or more memories; wherein the camera and the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the method as described in any one of claims 1 to 11 is executed.

13. An electronic device, characterized in that: The method comprises one or more functional modules, wherein the one or more functional modules are configured to execute the method according to any one of claims 1 to 11.

14. A chip system, applied to electronic equipment, comprising one or more processors, characterized in that: The processor is configured to call computer instructions so as to execute the method according to any one of claims 1 to 11.

15. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the method according to any one of claims 1 to 11 is executed.