Shooting mode switching method and related device

CN120188490APending Publication Date: 2025-06-20HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380078516.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-11-22
Filing Date
2023-08-26
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

In electronic devices such as smartphones, the field of view of the preview image is prone to jump too much when switching shooting modes, which affects the user experience.

Method used

By determining whether the zoom magnification range supported by the second shooting mode includes the first zoom magnification, and setting it as the initial zoom magnification when supported, the jump amplitude of the field of view angle is reduced.

Benefits of technology

Improved the display effect of the preview screen during shooting mode switching, preventing excessive field of view jumps and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120188490A_ABST
    Figure CN120188490A_ABST
Patent Text Reader

Abstract

The invention provides a shooting mode switching method and a related device, and when electronic equipment is switched from a first shooting mode to a second shooting mode, the electronic equipment can judge whether a zoom ratio range supported by the second shooting mode comprises a first zoom ratio or not. And if the zoom magnification range supported by the second shooting mode comprises the first zoom magnification, the electronic equipment can set the initial zoom magnification in the second shooting mode as the first zoom magnification. Thus, overlarge jump of the field angle of the preview image in the shooting mode switching process can be prevented, and the display effect of the preview image in the shooting mode switching process is improved.
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 202211468023.6 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 use electronic devices such as smartphones to preview their shots, they can switch between different shooting modes to preview the shooting effects of different shooting modes. Improving the visual quality of the preview screen during the switching process has become a pressing issue for those skilled in the art.

[0005] Summary of the Invention

[0006] This application provides a shooting mode switching method and related apparatus, which implements a method for switching from a first shooting mode to a second shooting mode, wherein if the zoom ratio range supported by the second shooting mode includes the first zoom ratio, the initial zoom ratio in the second shooting mode is set to the first zoom ratio. This prevents excessive jumps in the field of view of the preview image during the shooting mode switching process, thereby improving the display quality of the preview image during the shooting mode switching process.

[0007] In a first aspect, the present application provides a shooting mode switching method, which is applied to an electronic device with a camera, including: displaying a first preview interface, the first preview interface displaying a first preview screen, and the zoom ratio corresponding to the first preview screen is a first zoom ratio; 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; when the first zoom ratio is within the zoom ratio range supported by the second shooting mode, in response to the first operation, displaying a second preview interface, the second preview interface displaying a second preview screen, and the zoom ratio corresponding to the second preview screen is the first zoom ratio.

[0008] In this way, when the electronic device switches from the first shooting mode to the second shooting mode, the electronic device can determine whether the zoom ratio range supported by the second shooting mode includes the first zoom ratio. If the zoom ratio range supported by the second shooting mode includes the first zoom ratio, the electronic device can set the initial zoom ratio in the second shooting mode to the first zoom ratio. This can prevent the field of view of the preview image from jumping too much during the shooting mode switching process, thereby improving the display effect of the preview image during the shooting mode switching process.

[0009] In combination with the first aspect, in some possible implementations, the first preview interface also displays a first zoom ratio control, and the zoom ratio selected on the first zoom ratio control is the first zoom ratio; the second preview interface also displays a second zoom ratio control, and the zoom ratio selected on the second zoom ratio control is the first zoom ratio.

[0010] In combination with the first aspect, in some possible implementations, the first zoom ratio is within the zoom ratio range supported by the second shooting mode, including: the first zoom ratio is greater than or equal to a first value and the first zoom ratio is less than or equal to a second value, and the first value is less than the second value.

[0011] In combination with the first aspect, in some possible implementations, the zoom ratio range supported by the second shooting mode is between a first value and a second value, and the method further includes: when the first zoom ratio is not within the zoom ratio range supported by the second shooting mode, in response to the first operation, displaying a third preview interface, and displaying a third preview screen on the third preview interface, wherein the zoom ratio corresponding to the third preview screen is the first value or the second value.

[0012] In this way, when the shooting mode is switched and the zoom ratio last used in the previous shooting mode is not within the zoom ratio range supported by the next shooting mode, the jump amplitude of the field of view angle of the preview screen can be minimized, thereby improving the display effect of the preview screen during the shooting mode switching process.

[0013] In combination with the first aspect, in some possible implementations, when the first zoom ratio is greater than the second value, the zoom ratio corresponding to the third preview screen is the second value; when the first zoom ratio is less than the first value, the zoom ratio corresponding to the third preview screen is the first value.

[0014] In combination with the first aspect, in some possible implementations, the method further includes: in response to the first operation, displaying a fourth preview interface, the fourth preview interface displaying a fourth preview screen, wherein the zoom ratio corresponding to the fourth preview screen is a default zoom ratio.

[0015] In this manner, when the shooting mode is switched and the zoom magnification last used in the previous shooting mode is not within the zoom magnification range supported by the next shooting mode, the zoom magnification can be restored to the default zoom magnification.

[0016] In combination with the first aspect, in some possible implementations, 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 first preview interface; wherein the first operation is an operation corresponding to the first control.

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

[0018] In combination with the first aspect, in some possible implementations, the first preview interface also includes an AI scene recognition control; before identifying the shooting scene and determining the second shooting mode based on the shooting scene, the method also includes: receiving a second operation on the AI ​​scene recognition control; identifying the shooting scene and determining the second shooting mode specifically includes: in response to the second operation, identifying the shooting scene, and determining the second shooting mode based on the shooting scene.

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

[0020] In combination with the first aspect, in some possible implementations, receiving the first operation of switching from the first shooting mode to the second shooting mode specifically includes: detecting the first operation of switching from the first shooting mode to the second shooting mode through a mode management module in a camera application on the electronic device; the method also includes: the mode management module sending an instruction to switch to the second shooting mode to a zoom ratio management module in the camera application in response to the first operation, and sending a preview request of the first shooting mode to a camera hardware abstraction layer; after receiving the instruction to switch to the second shooting mode, the zoom ratio management module determines whether the first zoom ratio is within the zoom ratio range supported by the second shooting mode; when the first zoom ratio is within the zoom ratio range supported by the second shooting mode, the zoom ratio management module sends the first zoom ratio to the camera hardware abstraction layer on the electronic device; after receiving the instruction to switch to the second shooting mode and the first zoom ratio, the camera hardware abstraction layer obtains preview data shot by the camera of the electronic device at the first zoom ratio in the second shooting mode.

[0021] In this approach, the functional module enables the electronic device to determine whether the zoom ratio range supported by the second shooting mode includes the first zoom ratio when switching from the first shooting mode to the second shooting mode. If the zoom ratio range supported by the second shooting mode includes the first zoom ratio, the electronic device can set the initial zoom ratio in the second shooting mode to the first zoom ratio. This prevents excessive jumps in the preview image's field of view during the shooting mode switch, improving the preview image's display quality during the shooting mode switch.

[0022] In combination with the first aspect, in some possible implementations, the method includes: the camera hardware abstraction layer sends the preview data captured by the camera of the electronic device in the second shooting mode to the display control module in the application framework layer on the electronic device; the display control module displays the second preview screen on the second preview interface based on the preview data captured by the camera of the electronic device in the second shooting mode with the first zoom ratio.

[0023] In combination with the first aspect, in some possible implementations, the zoom ratio range supported by the second shooting mode is between a first value and a second value, and the method further includes: when the first zoom ratio is not within the zoom ratio range supported by the second shooting mode, the zoom ratio management module sends the first value or the second value to the camera hardware abstraction layer on the electronic device; after receiving the instruction to switch to the second shooting mode and the first value or the second value, the camera hardware abstraction layer obtains preview data shot by the camera of the electronic device in the second shooting mode with the zoom ratio of the first value or the second value; the camera hardware abstraction layer sends the preview data shot by the camera of the electronic device in the second shooting mode with the zoom ratio of the first value or the second value to the display control module; the display control module displays the third preview screen in the third preview interface based on the preview data shot by the camera of the electronic device in the second shooting mode with the zoom ratio of the first value or the second value.

[0024] In combination with the first aspect, in some possible implementations, the camera hardware abstraction layer stores zoom ratio ranges of multiple shooting modes, and the multiple shooting modes include the first shooting mode and the second shooting mode; before the first operation of switching from the first shooting mode to the second shooting mode is detected by the mode management module in the camera application, the method also includes: the camera startup module in the camera application detects the operation of starting the camera application; in response to the operation of starting the camera application, the camera startup module sends a camera startup instruction to the zoom ratio management module; the zoom ratio module sends a zoom ratio range acquisition request to the camera hardware abstraction layer; the camera hardware abstraction layer returns the zoom ratio range supported by each of the multiple shooting modes to the zoom ratio management module.

[0025] In combination with the first aspect, in some possible implementations, when displaying the first preview interface, the method also includes: if the first zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device, controlling the optical zoom of the camera to capture the image stream of the first zoom ratio; processing the image stream of the first zoom ratio through the image processing flow corresponding to the first shooting mode to obtain the first preview screen.

[0026] In combination with the first aspect, in some possible implementations, when displaying the first preview interface, the method also includes: if the first zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device, controlling the optical zoom of the camera to capture the image stream of the maximum optical zoom ratio; obtaining the image stream of the first zoom ratio by digitally zooming the image stream of the maximum optical zoom ratio; processing the image stream of the first zoom ratio through the image processing process corresponding to the first shooting mode to obtain the first preview screen.

[0027] In combination with the first aspect, in some possible implementations, when displaying the second preview interface, the method also includes: if the first zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device, controlling the optical zoom of the camera to capture the image stream of the first zoom ratio; processing the image stream of the first zoom ratio through the image processing process corresponding to the second shooting mode to obtain the second preview screen.

[0028] In combination with the first aspect, in some possible implementations, when displaying the second preview interface, the method also includes: if the first zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device, controlling the optical zoom of the camera to capture the image stream of the maximum optical zoom ratio; obtaining the image stream of the first zoom ratio by digitally zooming the image stream of the maximum optical zoom ratio; processing the image stream of the first zoom ratio through the image processing process corresponding to the second shooting mode to obtain the second preview screen.

[0029] In combination with the first aspect, in some possible implementations, the first shooting mode is any one of the following: normal recording mode, macro recording mode, night scene recording mode, portrait recording mode, high dynamic recording mode, protagonist recording mode and multi-lens recording mode; the second shooting mode is any one of the following: normal recording mode, macro recording mode, night scene recording mode, portrait recording mode, high dynamic recording mode, protagonist recording mode and multi-lens recording mode.

[0030] In a second aspect, the present application provides an electronic device comprising a camera, one or more processors and one or more memories; wherein the camera, the one or more memories are coupled to the one or more processors, the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the shooting mode switching method in any possible implementation of the above-mentioned first aspect is executed.

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

[0032] In a fourth aspect, the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to execute the shooting mode switching method in any possible implementation of the first aspect above.

[0033] 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 the shooting mode switching method in any possible implementation of the first aspect described above.

[0034] In a sixth aspect, the present application provides a communication device comprising one or more processors and one or more memories. 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, wherein the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the communication device executes the shooting mode switching method in any possible implementation of any of the above aspects.

[0035] In a seventh aspect, an embodiment of the present application provides a computer storage medium comprising computer instructions, which, when executed on an electronic device, enables a communication device to execute a shooting mode switching method in any possible implementation of any of the above aspects.

[0036] In an eighth aspect, an embodiment of the present application provides a computer program product, which, when running on a computer, enables the computer to execute the shooting mode switching method in any possible implementation of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0076] The camera hardware abstraction layer can provide one or more camera call interfaces. The one or more camera call interfaces include camera interface 1 (e.g., main camera) and camera interface 2 (e.g., wide-angle camera), etc. The electronic device 100 can call each camera through camera interfaces such as camera interface 1 and camera interface 2.

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

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

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

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

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

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

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

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

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

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

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

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

[0089] On the one hand, a designated area (eg, a preview window) of the camera application screen displays the image reported by the camera.

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

[0091] The following describes the shooting mode switching method provided in the embodiment of the present application in combination with application scenarios.

[0092] In some application scenarios, a user can use multiple shooting modes in the camera application of the electronic device 100 to take photos or videos. Before taking a photo or recording a video, the user can switch between different shooting modes in the camera application to view the preview screen effects in different shooting modes. The user can also adjust the zoom ratio (zoom radio) in each shooting mode to view the preview screen effects at different zoom ratios. The electronic device 100 can receive user input and set the zoom ratio to the first zoom ratio in the first shooting mode. When the electronic device 100 switches from the first shooting mode to the second shooting mode, the electronic device 100 can determine whether the zoom ratio range supported by the second shooting mode includes the first zoom ratio. If the zoom ratio range supported by the second shooting mode includes the first zoom ratio, the electronic device 100 can set the initial zoom ratio in the second shooting mode to the first zoom ratio. In this way, the field of view (FOV) of the preview screen can be prevented from jumping too much during the shooting mode switching process, thereby improving the display effect of the preview screen during the shooting mode switching process.

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

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

[0095] As shown in Figure 3B, the shooting interface 320 may include an echo control 325A, a shooting control 325B, a camera conversion control 325C, a preview box 322, a zoom ratio control 323, and controls for one or more shooting modes (for example, controls 324A for large aperture shooting mode, controls 324B for night scene shooting mode, controls 324C for portrait shooting mode, controls 324D for normal shooting mode, controls 324E for normal video recording mode, controls 324F for multi-lens video recording mode, and controls 324G for more modes).

[0096] As shown in FIG3B , the control 324D for the normal photo mode is selected, and the electronic device 100 is in normal photo mode. The preview box 322 displays a preview screen 326 captured by the electronic device 100 through the camera in normal photo mode. The echo control 325A can be used to trigger the display of the captured image or video. The capture control 325B is used to trigger the saving of the image captured by the camera. The camera conversion control 325C can be used to switch the camera used by the electronic device 100 to capture images (for example, the front camera is switched to the rear camera, or the rear camera is switched to the front camera). The zoom ratio control 323 can be used to set the zoom factor for the electronic device 100 to capture photos or videos. The zoom ratio control 323 can display the currently used zoom factor (for example, 1x), a first commonly used zoom factor that is smaller than the currently used zoom factor (for example, 0.5x), and a second commonly used zoom factor that is larger than the currently used zoom factor (for example, 2x).

[0097] The controls for the shooting mode can be used to trigger the image processing process corresponding to the shooting mode. For example, the control 324A for the large aperture shooting mode can be used to trigger the camera to shoot images using large aperture parameters. The control 324B for the night scene shooting mode can be used to trigger increasing the brightness and color richness in the captured image, etc. The control 324C for the portrait shooting mode can be used to trigger the electronic device 100 to beautify the portrait in the captured image. The control 324D for the normal shooting mode can be used to trigger the electronic device 100 to shoot images using default parameters and use the default image processing process to process the images captured by the camera. The control 324E for the normal recording mode can be used to trigger the electronic device 100 to record video through a single camera. The control 324F for the multi-lens recording mode can be used to trigger the electronic device 100 to record video simultaneously through multiple cameras. The more controls 324G can be used to trigger the electronic device 100 to display controls for more shooting modes.

[0098] The electronic device 100 may receive an input (eg, a single click) from the user selecting the control 324E for the normal video recording mode. In response to the input, the electronic device 100 may switch from the normal photographing mode to the normal video recording mode.

[0099] As shown in Figure 3C, after the electronic device 100 switches to normal recording mode, the electronic device 100 may display a preview image 329 captured in real time by the camera in normal recording mode in the preview box 322, and replace the aforementioned shooting control 325B with a recording start control 325D. After switching to normal recording mode, the electronic device 100 may display one or more functional controls (e.g., a control 321A for the protagonist recording mode, an AI scene recognition control 321B, a flash control 321C, a color mode control 321D, a settings control 321E, etc.) on the shooting interface 320. The protagonist recording mode control 321A, when enabled, can be used to trigger the electronic device 100 to identify the protagonist among multiple people in the preview image. The AI ​​scene recognition control 321B, when enabled, can be used to trigger the electronic device 100 to identify the shooting scene in the preview image. The AI ​​scene recognition control 321B is currently disabled. 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 process the image captured by the camera using a color filter. The setting control 321E may be used to set shooting parameters of the electronic device 100 (eg, image size, image storage format, etc.).

[0100] The electronic device 100 may receive a user input (eg, a single click) on the zoom ratio control 323 . In response to the input, the electronic device 100 may display a zoom ratio setting control 331 and a current zoom ratio control 332 as shown in FIG. 3D .

[0101] As shown in FIG3D , the electronic device 100 can replace the zoom ratio control 323 with a zoom ratio setting control 331 and a current zoom ratio control 332. The zoom ratio setting control 331 can display the zoom ratio range supported by the normal recording mode (e.g., 0.5x to 6x). The electronic device 100 can determine the zoom ratio set by the user based on the user's input (e.g., sliding) to the zoom ratio setting control 331. The current zoom ratio control 332 can be used to display the zoom ratio currently selected by the user on the zoom ratio setting control 331.

[0102] As shown in Figure 3E, the electronic device 100 can receive and respond to the user's input (e.g., sliding) on ​​the zoom ratio setting control 331, adjust the zoom ratio of the normal recording mode (e.g., adjusting the zoom ratio from 1x to 1.5x), and obtain a real-time preview screen 333 based on the zoom ratio set by the user (e.g., 1.5x). The electronic device 100 can display the preview screen 333 in the preview frame 322. Comparing the preview screen 333 with the preview screen 329, since the zoom ratio of the preview screen 333 (e.g., 1.5x) is greater than the zoom ratio of the preview screen 329 (e.g., 1x), the screen ratio of the subject in the preview screen 333 is greater than the screen ratio of the same subject in the preview screen 329.

[0103] After the electronic device 100 sets the zoom ratio of the normal recording mode based on the user's input to the zoom ratio setting control 331, the electronic device 100 can receive and respond to the user's input (for example, a single click) on the blank area (i.e., the area without touchable controls) on the shooting interface 320, as shown in Figure 3F, and replace the zoom ratio setting control 331 and the current zoom ratio control 332 with the zoom ratio control 323.

[0104] As shown in Figure 3F, after the electronic device 100 replaces the zoom ratio setting control 331 and the current zoom ratio control 332 with the zoom ratio control 323, the current zoom ratio (for example, 1.5x), a first commonly used zoom ratio (for example, 0.5x) that is smaller than the currently used zoom ratio, and a second commonly used zoom ratio (for example, 2x) that is larger than the currently used zoom ratio can be displayed on the zoom ratio control 323.

[0105] The electronic device 100 can receive input from the user on the AI ​​scene recognition control 321B (for example, a single click). In response to the input, the electronic device 100 can turn on the AI ​​scene recognition function, identify the shooting scene, and determine a recommended shooting mode based on the shooting scene.

[0106] As shown in FIG3G , after determining that the recommended shooting mode is the high-dynamic range recording mode, the electronic device 100 may display a high-dynamic range recording mode control 334. After turning on the control 334, if the electronic device 100 starts recording, the electronic device 100 may record the video using the shooting parameters and image processing flow in the high-dynamic range recording mode.

[0107] The electronic device 100 can receive and respond to a user input (e.g., a single click) on the control 334 for the high dynamic range recording mode, switch from the normal recording mode to the high dynamic range recording mode, and determine whether the zoom magnification last used in the normal recording mode before the switch is within the zoom magnification range supported by the high dynamic range recording mode. If the zoom magnification last used in the normal recording mode is within the zoom magnification range supported by the high dynamic range recording mode, the electronic device 100 can set the initial zoom magnification after switching to the high dynamic range recording mode to the zoom magnification last used in the normal recording mode.

[0108] As shown in Figure 3H, for example, the zoom magnification last used in normal recording mode is 1.5x. High dynamic range recording mode supports zoom magnifications ranging from 1x to 4x. The zoom magnification last used in normal recording mode is within the zoom magnification range supported by high dynamic range recording mode. After switching to high dynamic range recording mode, electronic device 100 may display high dynamic range recording interface 340. This high dynamic range recording interface 340 may include a preview box 341, a close control 343, a replay control 344A, a recording start control 344B, and a zoom magnification control 345. Zoom magnification control 345 may display the current zoom magnification of 1.5x. Electronic device 100 may capture images in real time using the shooting parameters in high dynamic range recording mode and process the captured images using the image processing process in high dynamic range recording mode to generate a real-time preview screen 342. The zoom magnification of this real-time preview screen 342 is 1.5x. Electronic device 100 may display this real-time preview screen 342 in preview box 341. The recording start control 344B is used to trigger the electronic device 100 to start recording in the high-dynamic recording mode. The closing control 343 can be used to trigger the electronic device 100 to exit the high-dynamic recording mode.

[0109] The electronic device 100 may receive a user input (eg, a single click) on the zoom ratio control 345 , and in response to the input, the electronic device 100 may display a zoom ratio setting control 346 and a current zoom ratio control 347 as shown in FIG. 3I .

[0110] As shown in FIG3I , the electronic device 100 can replace the zoom ratio control 345 and the off control 343 with a zoom ratio setting control 346 and a current zoom ratio control 347. The zoom ratio setting control 346 can display the zoom ratio range supported by the high dynamic range recording mode (e.g., 1x to 4x). The electronic device 100 can determine the zoom ratio set by the user based on the user's input (e.g., sliding) to the zoom ratio setting control 346. The current zoom ratio control 347 can be used to display the zoom ratio currently selected by the user on the zoom ratio setting control 346.

[0111] As shown in FIG3J , the electronic device 100 can receive and respond to the user's input (e.g., sliding) on ​​the zoom ratio setting control 346, adjust the zoom ratio of the high dynamic range recording mode (e.g., adjusting the zoom ratio from 1.5x to 2.3x), and obtain a real-time preview screen 348 based on the zoom ratio set by the user (e.g., 1.5x). The electronic device 100 can display the preview screen 348 in the preview frame 341. Comparing the preview screen 333 with the preview screen 329, since the zoom ratio of the preview screen 348 (e.g., 2.3x) is greater than the zoom ratio of the preview screen 342 (e.g., 1.5x), the screen ratio of the subject in the preview screen 348 is greater than the screen ratio of the same subject in the preview screen 342.

[0112] After the electronic device 100 sets the zoom ratio of the high-dynamic recording mode based on the user's input to the zoom ratio setting control 346, the electronic device 100 can receive and respond to the user's input (e.g., a single click) on a blank area (i.e., an area without touchable controls) on the shooting interface 350, and replace the above-mentioned zoom ratio setting control 346 and the current zoom ratio control 347 with the zoom ratio control 345 and the close control 343.

[0113] As shown in Figure 3K, after the electronic device 100 replaces the zoom ratio setting control 346 and the current zoom ratio control 347 with the zoom ratio control 345 and the close control 343, the current zoom ratio (for example, 2.3x), the first commonly used zoom ratio (for example, 2x) that is smaller than the currently used zoom ratio, and the second commonly used zoom ratio (for example, 3x) that is larger than the currently used zoom ratio can be displayed on the zoom ratio control 345.

[0114] The electronic device 100 may receive and respond to a user input (e.g., a single click) on the close control 343 to switch from the high-dynamic-motion recording mode to the normal recording mode, and determine whether the zoom magnification last used in the high-dynamic-motion recording mode before the switch is within the zoom magnification range supported by the normal recording mode. If the zoom magnification last used in the high-dynamic-motion recording mode is within the zoom magnification range supported by the normal recording mode, the electronic device 100 may set the initial zoom magnification after switching to the normal recording mode to the zoom magnification last used in the high-dynamic-motion recording mode.

[0115] As shown in Figure 3L, for example, the zoom magnification last used in the high-dynamic recording mode is 2.3x. The zoom magnification range supported by the normal recording mode is 0.5x to 6x. The zoom magnification last used in the high-dynamic recording mode is within the zoom magnification range supported by the normal recording mode. After switching to the normal recording mode, the electronic device 100 can display the above-mentioned shooting interface 320 and display the current zoom magnification as the zoom magnification last used in the high-dynamic recording mode (for example, 2.3x) on the zoom magnification control 323 in the shooting interface 320. The electronic device 100 can capture images in real time using the shooting parameters in the normal recording mode and use the image processing process in the high-dynamic recording mode to process the real-time captured images to obtain a real-time preview screen 349. The zoom magnification of the real-time preview screen 349 is 2.3x. The electronic device 100 can display the real-time preview screen 349 in the preview box 322.

[0116] In some embodiments, when the zoom magnification of the first shooting mode is the first zoom magnification, when the electronic device 100 switches from the first shooting mode to the second shooting mode, the electronic device 100 may determine whether the zoom magnification range supported by the second shooting mode includes the first zoom magnification. If the zoom magnification range supported by the second shooting mode does not include the first zoom magnification, the electronic device 100 may determine the zoom magnification closest to the first zoom magnification in the zoom magnification range supported by the second shooting mode as the target zoom magnification, and set the target zoom magnification as the initial zoom magnification when entering the second shooting mode.

[0117] For example, as shown in FIG4A , the electronic device 100 is in high-dynamic-motion recording mode and displays a high-dynamic-motion recording interface 340. The zoom magnification control 345 in the high-dynamic-motion recording interface 340 displays a current zoom magnification of 2.3x, and the electronic device 100 displays a preview image 348 with a zoom magnification of 2.3x in the preview box 341 of the high-dynamic-motion recording interface 340. For a detailed description of the high-dynamic-motion recording interface 340, please refer to the embodiment shown in FIG3K above and will not be repeated here.

[0118] As shown in FIG4B , the electronic device 100 can switch the subject to a portrait. The electronic device 100 can recognize that the preview screen 351 includes a portrait. Therefore, the electronic device 100 can display a control 352 for the portrait recording mode. After turning on this control 352 and starting 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 can be blurred to highlight the features of the portrait.

[0119] The electronic device 100 can receive and respond to user input (such as a single click) on the portrait recording mode control 352, switch from high-dynamic recording mode to portrait recording mode, and determine whether the zoom ratio last used in the high-dynamic recording mode before switching is within the zoom ratio range supported by the portrait recording mode. If the zoom ratio last used in the high-dynamic recording mode is not within the zoom ratio range supported by the portrait recording mode, the electronic device 100 can determine the zoom ratio closest to the zoom ratio last used in the high-dynamic recording mode in the zoom ratio range supported by the portrait recording mode as the target zoom ratio, and set the target zoom ratio to the initial zoom ratio when entering the portrait recording mode.

[0120] As shown in Figure 4C, for example, the zoom magnification last used in high-dynamic recording mode is 2.3x. The zoom magnification range supported by portrait recording mode is 1x to 2x. The zoom magnification last used in high-dynamic recording mode is not within the zoom magnification range supported by portrait recording mode. The electronic device 100 can determine that the zoom magnification closest to the zoom magnification last used in high-dynamic recording mode in the zoom magnification range supported by portrait recording mode is 2x. Therefore, the target zoom magnification is 2x. After switching to portrait recording mode, the electronic device 100 can display a portrait recording interface 360. The portrait recording interface 360 ​​may include a preview box 361, a close control 363, an echo control 364A, a recording start control 364B, and a zoom magnification control 365A. The zoom magnification control 365A can display the current zoom magnification of 2x. The electronic device 100 can capture images in real time using the shooting parameters in the high-dynamic recording mode and process the real-time captured images using the image processing process in the high-dynamic recording mode to obtain a real-time preview screen 362. The zoom magnification of the real-time preview screen 362 is 2x. The electronic device 100 can display the real-time preview screen 362 in the preview box 361. The echo control 364A can be used to trigger the display of the captured image or video. The recording start control 364B is used to trigger the electronic device 100 to start recording in the high-dynamic recording mode. The close control 363 can be used to trigger the electronic device 100 to exit the high-dynamic recording mode.

[0121] Optionally, after the electronic device 100 switches to normal recording mode, it may display one or more function controls related to portrait recording, such as a background blur control 365B, a beautification control 365C, etc. The background blur control 365B may be used to set the degree of background blur in the preview image and the captured image. The beautification control 365C may be used to set the degree of beautification of the face color in the preview image and the captured image.

[0122] The electronic device 100 may receive user input (eg, a single click) for the zoom ratio control 365A. In response to the input, the electronic device 100 may display a zoom ratio setting control 366 and a current zoom ratio control 367 as shown in FIG. 4D .

[0123] As shown in Figure 4D, the electronic device 100 can replace the above-mentioned zoom ratio control 365A, the off control 363, the background blur control 365B, the beauty control 365C, etc. with a zoom ratio setting control 366 and a current zoom ratio control 367. The zoom ratio setting control 366 can display the zoom ratio range supported by the portrait recording mode (for example, 1x to 2x). The electronic device 100 can determine the zoom ratio set by the user based on the user's input to the zoom ratio setting control 366 (for example, sliding). The current zoom ratio control 367 can be used to display the zoom ratio currently selected by the user on the zoom ratio setting control 366.

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

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

[0126] 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 (hardware abstraction layer, HAL). Among them, the camera application may include a camera scene recommendation module 510, a camera startup module 520, a mode management module 530, and a zoom ratio (zoom radio) management module 540. The application framework layer may include a display control module 550 and a camera service framework layer (camera framework, Camera FWK) 560. The hardware abstraction layer may include a camera hardware abstraction layer (camera hardware abstraction layer, Camera HAL) 570.

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

[0128] S501 . The camera hardware abstraction layer 570 stores the zoom ratio ranges supported by all shooting modes on the electronic device 100 .

[0129] For example, all shooting modes of the camera application of the electronic device 100 may include multiple items of a normal shooting mode, a portrait shooting mode, a large aperture shooting mode, a high dynamic shooting mode, a macro shooting mode, a normal video recording mode, a macro video recording mode, a portrait video recording mode, a high dynamic video recording mode, a main character video recording mode, a multi-lens video recording mode, etc. The above examples are only used to explain the present application and should not be construed as limiting. In the embodiments of the present application, there may be more or fewer shooting modes.

[0130] For example, the zoom magnification range supported by the normal photo mode may be 0.5x to 20x. The zoom magnification range supported by the portrait photo mode may be 1x to 2x. The zoom magnification range supported by the large aperture photo mode may be 1x to 3x. The zoom magnification range supported by the high dynamic photo mode may be 1x to 4x. The zoom magnification range supported by the macro photo mode may be 0.5x to 2x. The zoom magnification range supported by the normal photo mode may be 0.5x to 6x. The zoom magnification range supported by the macro video mode may be 0.5x to 2x. The zoom magnification range supported by the portrait video mode may be 1x to 2x. The zoom magnification range supported by the high dynamic video mode may be 1x to 4x. The zoom magnification range supported by the protagonist video mode may be 0.5x to 2x. The zoom magnification range supported by the multi-lens video mode may be 1x to 6x. The above examples are only used to explain the present application and should not constitute a limitation.

[0131] S502 . The camera activation module 520 detects an operation of activating the camera.

[0132] For example, the operation of starting the camera may be the operation on the camera application icon 312 in the embodiment shown in FIG. 3A .

[0133] S503 . The camera activation module 520 may send a camera activation instruction to the zoom ratio management module 540 in response to the camera activation operation.

[0134] S504: The zoom ratio management module 540 sends a zoom ratio range acquisition request to the camera hardware abstraction layer 570. The zoom ratio range acquisition request is used to acquire the zoom ratio ranges corresponding to all shooting modes.

[0135] S505 . The camera hardware abstraction layer 570 responds to the zoom ratio range acquisition request and returns the zoom ratio ranges supported by all shooting modes to the zoom ratio management module 540 .

[0136] After the camera hardware abstraction layer 570 receives the zoom ratio range acquisition request, the camera hardware abstraction layer 570 may return the zoom ratio ranges supported by all shooting modes to the zoom ratio management module 540 .

[0137] S506 : The mode management module 530 detects an operation of switching to the first shooting mode.

[0138] The first shooting mode may be a normal video recording mode. The operation of switching to the first shooting mode may be the input of the control 324E for the normal video recording mode as shown in FIG3B above. For details, please refer to the embodiment shown in FIG3B above and will not be repeated here.

[0139] In a possible implementation, the first shooting mode may also be other recording modes recommended based on the shooting scene, for example, any one of macro recording mode, portrait recording mode, high dynamic recording mode, protagonist recording mode, and multi-lens recording mode.

[0140] S507 . After detecting the operation of switching to the first shooting mode, the mode management module 530 may send an instruction of the first shooting mode to the zoom ratio management module 540 .

[0141] S508 . The zoom ratio management module 540 sends the default zoom ratio of the first shooting mode to the camera hardware abstraction layer 570 in response to the instruction of the first shooting mode.

[0142] For example, the default zoom ratio may be 1x. In specific implementations, the default zoom ratio may also be other values, which are not limited here.

[0143] S509: After detecting that the camera is in the first shooting mode, the mode management module 530 may send a preview request A of the first shooting mode to the camera hardware abstraction layer 570. The preview request A is used to request the camera hardware abstraction layer 570 to obtain a preview data stream of the first shooting mode.

[0144] S510. After the camera hardware abstraction layer 570 obtains the preview request A and the default zoom ratio, it can obtain a preview data stream of the default zoom ratio in the first shooting mode through the camera.

[0145] After receiving the preview request A and the default zoom ratio, the camera hardware abstraction layer 570 may determine whether the zoom ratio A is greater than the maximum optical zoom ratio value supported by the electronic device 100 .

[0146] If the default zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device 100 (e.g., 3.5x), the camera hardware abstraction layer 570 may control the camera to perform optical zoom using the shooting parameters corresponding to the first shooting mode to capture an image stream at the default zoom ratio. After acquiring the image stream at the default zoom ratio, the camera hardware abstraction layer 570 may process the image at the default zoom ratio using the image processing flow corresponding to the first shooting mode to obtain a preview data stream of the default zoom ratio under the first shooting mode.

[0147] If the default zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device 100 (for example, 3.5x), the camera hardware abstraction layer 570 can control the camera to perform optical zoom with the shooting parameters corresponding to the first shooting mode, and collect the image stream of the maximum optical zoom ratio in real time. After obtaining the image stream of the maximum optical zoom ratio, the camera hardware abstraction layer 570 can crop and enlarge the image stream of the maximum optical zoom ratio through the digital zoom processing flow to obtain the image stream of the default zoom ratio. The camera hardware abstraction layer 570 can process the image stream of the default zoom ratio through the image processing flow corresponding to the first shooting mode to obtain a preview data stream of the default zoom ratio under the first shooting mode.

[0148] S511 . After acquiring the preview data stream of the default zoom factor in the first shooting mode, the camera hardware abstraction layer 570 returns the preview data stream of the default zoom factor in the first shooting mode to the camera service framework layer 560 .

[0149] S512 . The camera service framework layer 560 may return a preview data stream of the default zoom ratio in the first shooting mode to the display control module 550 .

[0150] S513. The display control module 550 may display a preview image of the default zoom ratio in the first shooting mode in the preview frame.

[0151] S514 . The zoom magnification management module 540 detects an operation of setting the zoom magnification to zoom magnification A.

[0152] For example, the first shooting mode may be a normal video recording mode, and the operation of setting the zoom magnification to zoom magnification A may be an input to zoom magnification setting control 331 in the embodiment described in FIG. 3D , where zoom magnification A may be 1.5x. For another example, the first shooting mode may be a high-dynamic range video recording mode, and the operation of setting the zoom magnification to zoom magnification A may be an input to zoom magnification control 346 in the embodiment described in FIG. 3I . The above examples are merely for illustrative purposes and should not be construed as limiting the present application.

[0153] S515 . In response to the operation of setting the zoom magnification to zoom magnification A, the zoom magnification management module 540 sends the zoom magnification A to the camera hardware abstraction layer 570 .

[0154] S516. After receiving the zoom magnification A, the camera hardware abstraction layer 570 may obtain a preview data stream of the zoom magnification A in the first shooting mode through the camera.

[0155] After receiving the zoom magnification A, the camera hardware abstraction layer 570 may determine whether the zoom magnification A is greater than the maximum optical zoom magnification value supported by the electronic device 100 .

[0156] If the zoom magnification A is less than or equal to the maximum optical zoom magnification supported by the electronic device 100 (for example, 3.5x), the camera hardware abstraction layer 570 can control the camera to perform optical zoom using the shooting parameters corresponding to the first shooting mode to capture an image stream at the zoom magnification A. After obtaining the image stream at the zoom magnification A, the camera hardware abstraction layer 570 can process the image at the zoom magnification A using the image processing flow corresponding to the first shooting mode to obtain a preview data stream of the zoom magnification A in the first shooting mode.

[0157] If the zoom magnification A is greater than the maximum optical zoom magnification supported by the electronic device 100 (for example, 3.5x), the camera hardware abstraction layer 570 can control the camera to perform optical zoom using the shooting parameters corresponding to the first shooting mode, and collect the image stream of the maximum optical zoom magnification in real time. After obtaining the image stream of the maximum optical zoom magnification, the camera hardware abstraction layer 570 can crop and enlarge the image stream of the maximum optical zoom magnification through the digital zoom processing flow, thereby obtaining an image stream of the zoom magnification A. The camera hardware abstraction layer 570 can process the image stream of the zoom magnification A through the image processing flow corresponding to the first shooting mode, and obtain a preview data stream of the zoom magnification A under the first shooting mode.

[0158] S517 . After acquiring the preview data stream of the zoom magnification A in the first shooting mode, the camera hardware abstraction layer 570 returns the preview data stream of the zoom magnification A in the first shooting mode to the camera service framework layer 560 .

[0159] S518 . The camera service framework layer 560 may send the preview data stream of the zoom magnification A in the first shooting mode to the display control module 550 .

[0160] S519. The display control module 550 may display a preview image of the zoom ratio A in the first shooting mode in the preview frame.

[0161] S520. The camera scene recommendation module 510 can detect an operation of turning on AI scene recognition.

[0162] For example, the operation of detecting the activation of AI scene recognition may be the input of the AI ​​scene recognition control 321B in the closed state in the embodiment shown in FIG. 3F above. For the specific content, please refer to the embodiment shown in FIG. 3F above and will not be repeated here.

[0163] S521 . The camera scene recommendation module 510 identifies the shooting scene and determines a recommended shooting mode in response to the operation of starting AI scene recognition.

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

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

[0166] Table 1

[0167] 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, 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, 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, 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 recognizes that the number of faces in the preview screen is ≥2 and P2 is less than the maximum face area ratio in the preview screen < P1 and the illumination is less than L4, the camera scene recommendation module 510 can determine that the recommended shooting mode is the protagonist recording mode. When the camera scene recommendation module 501 recognizes that the preview image includes preset objects such as cats and dogs and the zoom ratio is within 1x to 6x, the camera scene recommendation module 501 can determine that the recommended shooting mode is the multi-lens recording mode.

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

[0169] In one possible implementation, when the mode management module 530 detects switching to the normal recording mode, it can notify the camera scene recommendation module 510 to turn on AI scene recognition, identify the shooting scene of the electronic device 100, and determine the recommended shooting mode.

[0170] S522 . The camera scene recommendation module 510 sends the recommended shooting mode to the mode management module 530 .

[0171] The recommended shooting mode is different from the first shooting mode. For example, the first shooting mode may be a normal video recording mode, and the recommended shooting mode may be a high-dynamic range video recording mode.

[0172] S523. The mode management module 530 may control a control to display a recommended shooting mode on the display screen.

[0173] S524 . The mode management module 530 may detect an operation of a control for the recommended shooting mode.

[0174] For example, the recommended shooting mode may be a high-dynamic recording mode, and the control for the recommended shooting mode may be the control 334 shown in FIG3G above. The operation of the control for the recommended shooting mode may be the input for the control 334 in the embodiment shown in FIG3G above. For specific content, please refer to the embodiment shown in FIG3G above and will not be repeated here.

[0175] S525 . In response to the operation of the control for the recommended shooting mode, the mode management module 530 sends an instruction to switch to the recommended shooting mode to the zoom ratio management module 540 .

[0176] S526: In response to the operation of the control for the recommended shooting mode, the mode management module 530 may send a preview request B of the recommended shooting mode to the camera hardware abstraction layer 570. The preview request B is used to request the camera hardware abstraction layer 570 to obtain a preview data stream of the recommended shooting mode.

[0177] S527. The zoom ratio management module 540 may determine whether the zoom ratio A is within the zoom ratio range of the recommended shooting mode in response to the instruction of the recommended shooting mode.

[0178] S528 . If the zoom ratio A is within the zoom ratio range of the recommended shooting mode, the zoom ratio management module 540 may send the zoom ratio A to the camera hardware abstraction layer 570 .

[0179] For example, the first shooting mode may be normal recording mode, and the recommended shooting mode is high-dynamic-motion recording mode. Zoom factor A is 1.5x. High-dynamic-motion recording mode supports zoom factors ranging from 1x to 4x. The zoom factor A last used in normal recording mode is within the zoom factor range supported by high-dynamic-motion recording mode. Therefore, zoom factor management module 540 can send a zoom factor of 1.5x to camera hardware abstraction layer 570.

[0180] S529. After receiving the preview request B of the recommended shooting mode and the zoom magnification A, the camera hardware abstraction layer 570 may obtain a preview data stream of the zoom magnification A in the recommended shooting mode through the camera.

[0181] Among them, after receiving the preview request B of the recommended shooting mode and the zoom ratio A, the camera hardware abstraction layer 570 can determine whether the zoom ratio A is greater than the maximum optical zoom ratio value supported by the electronic device 100.

[0182] If zoom magnification A is less than or equal to the maximum optical zoom magnification supported by electronic device 100 (e.g., 3.5x), the camera hardware abstraction layer 570 may control the camera to perform optical zoom using the shooting parameters corresponding to the recommended shooting mode, and collect an image stream at zoom magnification A. After obtaining the image stream at zoom magnification A, the camera hardware abstraction layer 570 may process the image at zoom magnification A using the image processing flow corresponding to the recommended shooting mode, and obtain a preview data stream of zoom magnification A under the recommended shooting mode.

[0183] If the zoom magnification A is greater than the maximum optical zoom magnification supported by the electronic device 100 (for example, 3.5x), the camera hardware abstraction layer 570 can control the camera to perform optical zoom to recommend shooting parameters corresponding to the shooting, and collect the image stream of the maximum optical zoom magnification in real time. After obtaining the image stream of the maximum optical zoom magnification, the camera hardware abstraction layer 570 can crop and enlarge the image stream of the maximum optical zoom magnification through the digital zoom processing flow to obtain the image stream of the zoom magnification A. The camera hardware abstraction layer 570 can process the image stream of the zoom magnification A through the image processing flow corresponding to the recommended shooting mode to obtain a preview data stream of the zoom magnification A under the recommended shooting mode.

[0184] S530 . After acquiring the preview data stream of the zoom magnification A in the recommended shooting mode, the camera hardware abstraction layer 570 may return the preview data stream of the zoom magnification A in the recommended shooting mode to the camera service framework layer 560 .

[0185] S531 . The camera service framework layer 560 may send a preview data stream of the zoom magnification A in the recommended shooting mode to the display control module 550 .

[0186] S532. The display control module 550 may display a preview image of the zoom ratio A in the recommended shooting mode in the preview frame.

[0187] Through the embodiment of the present application, when the electronic device 100 switches from the first shooting mode to the second shooting mode, the electronic device 100 can determine whether the zoom ratio range supported by the second shooting mode includes the first zoom ratio. If the zoom ratio range supported by the second shooting mode includes the first zoom ratio, the electronic device 100 can set the initial zoom ratio in the second shooting mode to the first zoom ratio. In this way, the field of view (FOV) of the preview screen can be prevented from jumping too much during the shooting mode switching process, thereby improving the display effect of the preview screen during the shooting mode switching process.

[0188] In one possible implementation, if zoom magnification A is not within the zoom magnification range of the recommended shooting mode, the zoom magnification management module 540 may determine the zoom magnification (e.g., the first value or the second value) closest to zoom magnification A within the zoom magnification range supported by the recommended shooting mode (e.g., the zoom magnification range supported by the recommended shooting mode is between a first value and a second value) as the target zoom magnification, and send the target zoom magnification to the camera hardware abstraction layer 570. After receiving the preview request B and the target zoom magnification, the camera hardware abstraction layer 570 may obtain a preview data stream for zoom magnification B in the recommended shooting mode and transmit it to the camera service framework layer 560. The camera service framework layer 560 may send the preview data stream for zoom magnification B in the recommended shooting mode to the display control module 550. The display control module 550 may display a preview image of the target zoom magnification in the recommended shooting mode in the preview box.

[0189] For example, the value of the zoom magnification A last used in the high-dynamic recording mode is 2.3x. The zoom magnification range supported by the portrait recording mode is 1x to 2x. The zoom magnification A last used in the high-dynamic recording mode is not within the zoom magnification range supported by the portrait recording mode. Therefore, the zoom magnification management module 540 can send the zoom magnification B with a value of 2x to the camera hardware abstraction layer 570. The camera hardware abstraction layer 570 can obtain the preview data stream with a zoom magnification value of 2x in the portrait shooting mode and transmit it to the camera service framework layer 560. The camera service framework layer 560 can send the preview data stream with a zoom magnification value of 2x in the portrait recording mode to the display control module 550. The display control module 550 can display the preview screen with a zoom magnification value of 2x in the portrait recording mode in the preview box.

[0190] In this way, when switching between shooting modes and the zoom ratio last used in the previous shooting mode is not within the zoom ratio range supported by the next shooting mode, the jump amplitude of the field of view (FOV) of the preview screen can be minimized, thereby improving the display effect of the preview screen during the switching of shooting modes.

[0191] In one possible implementation, if zoom magnification A is not within the zoom magnification range of the recommended shooting mode, the zoom magnification management module 540 may send the default zoom magnification of the recommended shooting mode (e.g., 1x) to the camera hardware abstraction layer 570. After receiving the preview request B and the default zoom magnification, the camera hardware abstraction layer 570 may obtain a preview data stream of the default zoom magnification in the recommended shooting mode and transmit it to the camera service framework layer 560. The camera service framework layer 560 may send the preview data stream of the default zoom magnification in the recommended shooting mode to the display control module 550. The display control module 550 may display a preview image of the default zoom magnification in the recommended shooting mode in the preview box.

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

[0193] As shown in FIG6 , the method includes:

[0194] S601. The electronic device 100 displays a first preview interface, where the first preview interface displays a first preview picture, and the zoom ratio corresponding to the first preview picture is a first zoom ratio.

[0195] The first preview interface includes a first preview frame, in which a first preview picture is displayed. The first preview picture is captured in the first shooting mode.

[0196] A first zoom ratio control may also be displayed on the first preview interface, and the zoom ratio selected on the first zoom ratio control is the first zoom ratio.

[0197] Among them, the selected zoom ratio can be a zoom ratio value displayed in a specified style on the zoom ratio control, and the selected zoom ratio can be used to indicate the zoom ratio corresponding to the preview image currently displayed on the display screen. For example, the selected zoom ratio is the zoom ratio value highlighted on the zoom ratio control. For another example, the selected zoom ratio can be the zoom ratio value enclosed by a circle or rectangle on the zoom ratio control. For another example, the selected zoom ratio can be the zoom ratio value marked with a special color (for example, yellow) on the zoom ratio control. For example, in the embodiment shown in Figure 3F, the zoom ratio selected on the zoom ratio control 323 is 1.5x. The word "1.5x" is circled by a circular graphic.

[0198] The first zoom ratio control may be used to trigger a user to set a zoom ratio in a first shooting mode.

[0199] The first shooting mode may be a normal photo mode. The first shooting mode may also be a normal video mode. The first shooting mode may also be another video mode recommended based on the shooting scenario, such as a macro video mode, a portrait video mode, a high dynamic range video mode, a main character video mode, a multi-lens video mode, and the like.

[0200] For example, the first shooting mode may be a normal video recording mode, the first preview interface may be shooting interface 320 shown in the embodiment shown in FIG. 3G , and the first preview frame may be preview frame 322 shown in the embodiment shown in FIG. The first zoom control may be zoom control 323 shown in the embodiment shown in FIG. For details, please refer to the embodiment shown in FIG. 3G , and will not be further described here.

[0201] For another example, the first shooting mode may be a high-dynamic-rate video recording mode, the first preview interface may be the high-dynamic-rate video recording interface 340 shown in the embodiment shown in FIG. 3K or FIG. 4B , and the first preview frame may be the preview frame 341 shown in the embodiment shown in FIG. 3K or FIG. 4B . The first zoom ratio control may be the zoom ratio control 345 shown in the embodiment shown in FIG. 3K or FIG. 4B For details, please refer to the embodiment shown in FIG. 3K or FIG. 4B , and will not be further described here.

[0202] If the first zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device (for example, 3.5x), the electronic device 100 can control the optical zoom of the camera to collect the image stream of the first zoom ratio; through the image processing process corresponding to the first shooting mode, the image stream of the first zoom ratio is processed to obtain a preview picture of the first zoom ratio under the first shooting mode.

[0203] If the first zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device (for example, 3.5x), control the camera optical zoom to capture the image stream of the maximum optical zoom ratio; obtain the image stream of the first zoom ratio by digitally zooming the image stream of the maximum optical zoom ratio; process the image stream of the first zoom ratio through the image processing flow corresponding to the first shooting mode to obtain a preview picture of the first zoom ratio under the first shooting mode.

[0204] S602: The electronic device 100 receives a first operation of switching from a first shooting mode to a second shooting mode.

[0205] The first shooting mode is different from the second shooting mode. 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.

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

[0207] For example, the first shooting mode may be a normal recording mode, and the second shooting mode may be a high-dynamic recording mode. The first control may be control 334 for the high-dynamic recording mode in the embodiment described in FIG. 3G . The first operation may be an operation on control 334 for the high-dynamic recording mode. For details, please refer to the embodiment described in FIG. 3G , and will not be further described here.

[0208] For another example, the first shooting mode may be a high-dynamic range recording mode, and the second shooting mode may be a portrait recording mode. The first control may be control 352 for the portrait recording mode in the embodiment described in FIG. 4B . The first operation may be an operation on control 352 for the portrait recording mode. For details, please refer to the embodiment described in FIG. 4B , and will not be further described here.

[0209] In one example, the first shooting mode may be a high-dynamic range recording mode, and the second shooting mode may be a normal recording mode. The first operation may be an operation for closing control 343 in the high-dynamic range recording interface 340 shown in FIG. 3K . For details, please refer to the embodiment shown in FIG. 3K , and will not be repeated here.

[0210] S603. In response to the first operation, the electronic device 100 determines whether the first zoom ratio is within a zoom ratio range supported by the second shooting mode. The zoom ratio range supported by the second shooting mode may be from a first value to a second value.

[0211] The electronic device 100 may store the zoom ratio ranges supported by all shooting modes of the electronic device 100. For example, all shooting modes applied by the camera of the electronic device 100 may include multiple items of normal shooting mode, portrait shooting mode, large aperture shooting mode, high dynamic shooting mode, macro shooting mode, normal video recording mode, macro video recording mode, portrait video recording mode, high dynamic recording mode, main character video recording mode, multi-lens video recording mode, etc. The above examples are only used to explain the present application and should not be construed as limiting. In the embodiments of the present application, there may be more or fewer shooting modes.

[0212] For example, the zoom magnification range supported by the normal photo mode may be 0.5x to 20x. The zoom magnification range supported by the portrait photo mode may be 1x to 2x. The zoom magnification range supported by the large aperture photo mode may be 1x to 3x. The zoom magnification range supported by the high dynamic photo mode may be 1x to 4x. The zoom magnification range supported by the macro photo mode may be 0.5x to 2x. The zoom magnification range supported by the normal photo mode may be 0.5x to 6x. The zoom magnification range supported by the macro video mode may be 0.5x to 2x. The zoom magnification range supported by the portrait video mode may be 1x to 2x. The zoom magnification range supported by the high dynamic video mode may be 1x to 4x. The zoom magnification range supported by the protagonist video mode may be 0.5x to 2x. The zoom magnification range supported by the multi-lens video mode may be 1x to 6x. The zoom magnification ranges supported by the multiple shooting modes in the above examples are only used to explain this application and should not be construed as limiting.

[0213] Specifically, the process of obtaining the zoom ratio range supported by all shooting modes of the electronic device 100 can refer to steps S501 to S504 in the embodiment shown in FIG5 , which will not be described in detail here.

[0214] S604. If the first zoom ratio is within the zoom ratio range supported by the second shooting mode, the electronic device 100 displays a second preview interface, which displays a second preview picture. The zoom ratio corresponding to the second preview picture is the first zoom ratio.

[0215] The second preview interface may include a second preview frame, and the electronic device 100 may display the second preview picture in the second shooting mode in the second preview frame.

[0216] The second preview interface may also display a second zoom ratio control, where the zoom ratio selected in the second zoom ratio control is the first zoom ratio. This second zoom ratio control can be used to trigger the user to set the zoom ratio for the second shooting mode. The zoom ratio selected in the second zoom ratio control can be explained in the same manner as described above for the first zoom ratio, and will not be further elaborated here.

[0217] For example, the first shooting mode is the normal video recording mode, the first zoom ratio is 1.5x, and the second shooting mode is the high dynamic video recording mode, and the zoom ratio range corresponding to the high dynamic video recording mode is 1x to 4x. The first zoom ratio is within the zoom ratio range corresponding to the high dynamic video recording mode. Therefore, after switching to the high dynamic video recording mode, the electronic device 100 can display a second preview interface and display a preview screen with a zoom ratio of 1.5x in the high dynamic video recording mode in the second preview frame. Among them, the second preview interface can be the high dynamic video recording interface 340 in the embodiment shown in Figure 3H above, and the second preview frame can be the preview frame 341 in the embodiment shown in Figure 3H above. For specific content, please refer to the embodiments shown in Figures 3G to 3I above, and no further details will be given here.

[0218] For another example, the first shooting mode is the high-dynamic recording mode, the first zoom ratio is 2.3x, and the second shooting mode is the normal mode, and the zoom ratio range corresponding to the normal recording mode is 1x to 6x. The first zoom ratio is within the zoom ratio range corresponding to the normal recording mode. Therefore, after switching to the high-dynamic recording mode, the electronic device 100 can display a second preview interface and display a preview screen with a zoom ratio of 1.5x in the high-dynamic recording mode in the second preview frame of the second preview frame interface. The second preview interface can be the shooting interface 320 in the embodiment shown in Figure 3L above, and the second preview frame can be the preview frame 322 in the embodiment shown in Figure 3L above. For specific details, please refer to the embodiments shown in Figures 3K to 3L above, and no further details will be given here.

[0219] If the first zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device 100, the electronic device 100 controls the camera optical zoom to capture an image stream at the first zoom ratio. The electronic device 100 processes the image stream at the first zoom ratio using the image processing flow corresponding to the second shooting mode to obtain a preview image at the first zoom ratio in the second shooting mode.

[0220] If the first zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device, the electronic device 100 controls the camera optical zoom to capture an image stream at the maximum optical zoom ratio. The electronic device 100 digitally zooms the image stream at the maximum optical zoom ratio to obtain an image stream at the first zoom ratio. The electronic device 100 processes the image stream at the first zoom ratio using the image processing flow corresponding to the second shooting mode to obtain a preview image of the first zoom ratio in the second shooting mode.

[0221] S605. If the first zoom ratio is not within the zoom ratio range supported by the second shooting mode, the electronic device 100 determines a target zoom ratio closest to the first zoom ratio from the zoom ratio range supported by the second shooting mode.

[0222] The second shooting mode supports a zoom ratio range between a first value and a second value. The target zoom ratio is the first value or the second value. When the first zoom ratio is greater than the second value, the target zoom ratio is the second value; when the first zoom ratio is less than the first value, the target zoom ratio is the first value.

[0223] S606. The electronic device 100 displays a third preview interface, which displays a third preview picture. The zoom ratio corresponding to the third preview picture is the target zoom ratio.

[0224] The third preview interface may include a third preview frame, and the electronic device 100 may display a third preview picture of the second shooting mode in the third preview frame.

[0225] The third preview interface may also display a third zoom factor control that displays the current zoom factor. This third zoom factor control can be used to trigger the user to set the zoom factor for the second shooting mode. If the first zoom factor is within the zoom factor range supported by the second shooting mode, the current zoom factor displayed on the third zoom factor control becomes the target zoom factor.

[0226] For example, the first shooting mode is high-dynamic range recording mode, with a first zoom magnification of 2.3x, and the second shooting mode is portrait recording mode, with a zoom magnification range of 1x to 2x. The first zoom magnification is not within the zoom magnification range corresponding to portrait recording mode. Therefore, the electronic device 100 can determine that the target zoom magnification closest to the first zoom magnification within the zoom magnification range corresponding to portrait recording mode is 2x. After switching to portrait recording mode, the electronic device 100 can display a third preview interface and display a preview of the high-dynamic range recording mode with a zoom magnification of 2x in the third preview frame of the third preview interface. The third preview interface can be the portrait recording interface 360 ​​in the embodiment shown in FIG. 4C , and the third preview frame can be the preview frame 361 in the embodiment shown in FIG. For details, please refer to the embodiments shown in FIG. 4A to FIG. 4D , which will not be described in detail here.

[0227] In this way, when switching between shooting modes and the zoom ratio last used in the previous shooting mode is not within the zoom ratio range supported by the next shooting mode, the jump amplitude of the field of view (FOV) of the preview screen can be minimized, thereby improving the display effect of the preview screen during the switching of shooting modes.

[0228] If the target zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device 100, the electronic device 100 controls the camera optical zoom to capture an image stream at the target zoom ratio. The electronic device 100 processes the image stream at the target zoom ratio through the image processing process corresponding to the second shooting mode to obtain a preview image of the target zoom ratio in the second shooting mode.

[0229] If the target zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device, the electronic device 100 controls the camera optical zoom to capture an image stream at the maximum optical zoom ratio. The electronic device 100 digitally zooms the image stream at the maximum optical zoom ratio to obtain an image stream at the target zoom ratio. The electronic device 100 processes the image stream at the target zoom ratio using the image processing flow corresponding to the second shooting mode to obtain a preview image at the target zoom ratio in the second shooting mode.

[0230] In one possible implementation, when the first zoom ratio is not within the zoom range supported by the second shooting mode, in response to the first operation, a fourth preview interface is displayed, and the fourth preview interface displays a fourth preview screen, wherein the zoom ratio corresponding to the fourth preview screen can be a default zoom ratio.

[0231] Through the embodiment of the present application, when the electronic device 100 switches from the first shooting mode to the second shooting mode, the electronic device 100 can determine whether the zoom ratio range supported by the second shooting mode includes the first zoom ratio. If the zoom ratio range supported by the second shooting mode includes the first zoom ratio, the electronic device 100 can set the initial zoom ratio in the second shooting mode to the first zoom ratio. In this way, the field of view (FOV) of the preview screen can be prevented from jumping too much during the shooting mode switching process, thereby improving the display effect of the preview screen during the shooting mode switching process.

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

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

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

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

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

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

[0238] 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).

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

[0240] 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, wherein the first preview interface displays a first preview picture, and the zoom ratio corresponding to the first preview picture is a first zoom ratio; 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; When the first zoom ratio is within the zoom ratio range supported by the second shooting mode, in response to the first operation, a second preview interface is displayed, the second preview interface displays a second preview picture, and the zoom ratio corresponding to the second preview picture is the first zoom ratio.

2. The method according to claim 1, characterized in that A first zoom ratio control is further displayed on the first preview interface, and the zoom ratio selected on the first zoom ratio control is the first zoom ratio; A second zoom ratio control is also displayed on the second preview interface, and the zoom ratio selected on the second zoom ratio control is the first zoom ratio.

3. The method according to claim 1 or 2, characterized in that The first zoom ratio is within a zoom ratio range supported by the second shooting mode, including: The first zoom ratio is greater than or equal to a first value and less than or equal to a second value, and the first value is less than the second value.

4. The method according to claim 3, characterized in that The method further comprises: When the first zoom ratio is not within the zoom ratio range supported by the second shooting mode, in response to the first operation, a third preview interface is displayed, and a third preview screen is displayed on the third preview interface, wherein the zoom ratio corresponding to the third preview screen is the first value or the second value.

5. The method according to claim 4, characterized in that When the first zoom ratio is greater than the second value, the zoom ratio corresponding to the third preview image is the second value; When the first zoom ratio is smaller than the first value, the zoom ratio corresponding to the third preview image is the first value.

6. The method according to claim 1, characterized in that The method further comprises: When the first zoom ratio is not within the zoom range supported by the second shooting mode, in response to the first operation, a fourth preview interface is displayed, the fourth preview interface displays a fourth preview screen, wherein the zoom ratio corresponding to the fourth preview screen is a default zoom ratio.

7. The method according to any one of claims 1 to 4, 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 first preview interface; wherein the first operation is an operation corresponding to the first control.

8. The method according to claim 7, 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.

9. The method according to any one of claims 1 to 8, 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 management module in a camera application on the electronic device, the first operation of switching from the first shooting mode to the second shooting mode; The method further comprises: In response to the first operation, the mode management module sends an instruction to switch to the second shooting mode to the zoom ratio management module in the camera application, and sends a preview request of the first shooting mode to the camera hardware abstraction layer; After receiving the instruction to switch to the second shooting mode, the zoom ratio management module determines whether the first zoom ratio is within the zoom ratio range supported by the second shooting mode; When the first zoom ratio is within a zoom ratio range supported by the second shooting mode, the zoom ratio management module sends the first zoom ratio to a camera hardware abstraction layer on the electronic device; After receiving the instruction to switch to the second shooting mode and the first zoom ratio, the camera hardware abstraction layer obtains preview data shot by the camera of the electronic device in the second shooting mode at the first zoom ratio.

10. The method according to claim 9, characterized in that The method comprises: The camera hardware abstraction layer sends the preview data captured by the camera of the electronic device in the second shooting mode to the display control module in the application framework layer on the electronic device; The display control module displays the second preview image on the second preview interface based on the preview data captured by the camera of the electronic device at the first zoom ratio in the second shooting mode.

11. The method according to claim 9 or 10, characterized in that The second shooting mode supports a zoom ratio range between a first value and a second value, and the method further includes: When the first zoom ratio is not within the zoom ratio range supported by the second shooting mode, the zoom ratio management module sends the first value or the second value to a camera hardware abstraction layer on the electronic device; The camera hardware abstraction layer receives the instruction to switch to the second shooting mode and the first value or the After the second value is obtained, preview data captured by the camera of the electronic device in the second shooting mode at the zoom ratio of the first value or the second value is obtained; The camera hardware abstraction layer sends preview data captured by the camera of the electronic device in the second shooting mode at the zoom ratio of the first value or the second value to the display control module; The display control module displays the third preview image in a third preview interface based on the preview data captured by the camera of the electronic device in the second shooting mode with the zoom ratio of the first value or the second value.

12. The method according to any one of claims 9 to 11, characterized in that The camera hardware abstraction layer stores zoom ratio ranges of a plurality of shooting modes, wherein the plurality of shooting modes include the first shooting mode and the second shooting mode; Before detecting, by a mode management module in a camera application, the first operation of switching from the first shooting mode to the second shooting mode, the method further includes: The camera startup module in the camera application detects an operation of starting the camera application; In response to the operation of starting the camera application, the camera starting module sends a camera starting instruction to the zoom ratio management module; The zoom ratio module sends a zoom ratio range acquisition request to the camera hardware abstraction layer; The camera hardware abstraction layer returns the zoom ratio ranges supported by each of the multiple shooting modes to the zoom ratio management module.

13. The method according to any one of claims 1 to 12, characterized in that When displaying the first preview interface, the method further includes: If the first zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device, controlling the camera to perform optical zoom and capture an image stream at the first zoom ratio; The image stream of the first zoom ratio is processed through the image processing flow corresponding to the first shooting mode to obtain the first preview image.

14. The method according to any one of claims 1 to 13, characterized in that When displaying the first preview interface, the method further includes: If the first zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device, controlling the camera to perform optical zoom and capturing an image stream at the maximum optical zoom ratio; Obtaining an image stream of the first zoom ratio by digitally zooming the image stream of the maximum optical zoom ratio; The image stream of the first zoom ratio is processed through the image processing flow corresponding to the first shooting mode to obtain the first preview image.

15. The method according to any one of claims 1 to 14, characterized in that When displaying the second preview interface, the method further includes: If the first zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device, controlling the camera to perform optical zoom and capture an image stream at the first zoom ratio; The image stream of the first zoom ratio is processed through the image processing flow corresponding to the second shooting mode to obtain the second preview image.

16. The method according to any one of claims 1 to 15, characterized in that When displaying the second preview interface, the method further includes: If the first zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device, controlling the camera to perform optical zoom and capturing an image stream at the maximum optical zoom ratio; Obtaining an image stream of the first zoom ratio by digitally zooming the image stream of the maximum optical zoom ratio; The image stream of the first zoom ratio is processed through the image processing flow corresponding to the second shooting mode to obtain the second preview image.

17. The method according to any one of claims 1 to 16, 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.

18. 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 17 is executed.

19. 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 17.

20. 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 17.

21. 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 17 is executed.