Shooting mode switching method and related apparatus
By adjusting the zoom ratio when switching shooting modes, the problem of the preview screen's field of view jumping was solved, improving the display effect and user experience during shooting mode switching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2022-11-22
- Publication Date
- 2026-05-19
AI Technical Summary
When an electronic device switches from one shooting mode to another, the field of view of the preview screen can change too drastically, affecting the user experience.
When switching shooting modes, it is determined whether the zoom range supported by the second shooting mode includes the first zoom ratio, and the initial zoom ratio of the second shooting mode is set to the first zoom ratio to prevent the field of view of the preview image from changing too much.
By adjusting the zoom ratio, the jump in the field of view of the preview screen during shooting mode switching is reduced, thereby improving the display effect of the preview screen and the user experience.
Smart Images

Figure CN118075606B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, and in particular to a shooting mode switching method and related apparatus. Background Technology
[0002] With the development of smartphones, photography and videography have become one of their most important features. As the photography and videography capabilities of smartphones and other electronic devices become increasingly powerful, more and more people are using smartphones and other electronic devices to replace professional camcorders, and the shooting modes on smartphones and other electronic devices are also becoming more and more diverse.
[0003] When users preview photos taken with smartphones or other electronic devices, they can switch between different shooting modes to see the effects of each mode. Improving the visual quality of the preview image during the switching process is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] This application provides a shooting mode switching method and related apparatus, which implements the following when switching from a first shooting mode to a second shooting mode: if the zoom range supported by the second shooting mode includes the first zoom range, the initial zoom range in the second shooting mode is set to the first zoom range. This prevents excessive jumps in the field of view of the preview image during shooting mode switching, thus improving the display effect of the preview image during the shooting mode switching process.
[0005] In a first aspect, this application provides a shooting mode switching method, applied to an electronic device equipped with a camera, comprising: displaying a first preview interface, the first preview interface displaying a first preview image, the zoom ratio corresponding to the first preview image being 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 image, the zoom ratio corresponding to the second preview image being the first zoom ratio.
[0006] In this way, when the electronic device switches from the first shooting mode to the second shooting mode, it can determine whether the zoom range supported by the second shooting mode includes the first zoom range. If the zoom range supported by the second shooting mode includes the first zoom range, the electronic device can set the initial zoom range of the second shooting mode to the first zoom range. This prevents excessive jumps in the field of view of the preview image during shooting mode switching, improving the display effect of the preview image during shooting mode switching.
[0007] In conjunction 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.
[0008] In conjunction 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, wherein the first value is less than the second value.
[0009] In conjunction with the first aspect, in some possible implementations, the zoom range supported by the second shooting mode is between a first value and a second value. The method further includes: when the first zoom range is not within the zoom range supported by the second shooting mode, in response to the first operation, displaying a third preview interface, wherein the third preview interface displays a third preview image, and the zoom range corresponding to the third preview image is the first value or the second value.
[0010] In this method, even when the zoom level used in the previous shooting mode is not within the zoom level supported by the next shooting mode, the jump in the field of view of the preview screen can be minimized during the shooting mode switching process, thus improving the display effect of the preview screen during the shooting mode switching process.
[0011] In conjunction 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.
[0012] In conjunction 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 level corresponding to the fourth preview screen is the default zoom level.
[0013] In this method, if the zoom ratio used in the previous shooting mode is not within the range of zoom ratios supported by the next shooting mode during the shooting mode switching process, the zoom ratio can be restored to the default zoom ratio.
[0014] In conjunction with the first aspect, in some possible implementations, before receiving the first operation to switch from the first shooting mode to the second shooting mode, the method further includes: identifying a shooting scene, determining the second shooting mode based on the shooting scene; displaying a first control corresponding to the second shooting mode on a first preview interface; wherein the first operation is an operation corresponding to the first control.
[0015] This method can automatically recommend relevant shooting modes to users based on the shooting scene, thereby improving the user's shooting experience.
[0016] In conjunction with the first aspect, in some possible implementations, the first preview interface also includes an AI scene recognition control; before recognizing 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 recognition of the shooting scene and determination of the second shooting mode specifically includes: in response to the second operation, recognizing the shooting scene and determining the second shooting mode based on the shooting scene.
[0017] In this method, the AI scene recognition function is manually enabled by the user, and the system automatically recommends relevant shooting modes based on the shooting scene, thereby improving the user's shooting experience.
[0018] In conjunction with the first aspect, in some possible implementations, receiving the first operation to switch from the first shooting mode to the second shooting mode specifically includes: detecting the first operation to switch from the first shooting mode to the second shooting mode through a mode management module in the camera application on the electronic device; the method further includes: in response to the first operation, the mode management module sends a command to switch to the second shooting mode to a 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 command 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 command to switch to the second shooting mode and the first zoom ratio, the camera hardware abstraction layer obtains the preview data captured by the camera of the electronic device in the second shooting mode at the first zoom ratio.
[0019] In this method, a functional module enables the electronic device to determine whether the zoom range supported by the second shooting mode includes the first zoom range when switching from the first shooting mode. If the zoom range supported by the second shooting mode includes the first zoom range, the electronic device can set the initial zoom range of the second shooting mode to the first zoom range. This prevents excessive jumps in the field of view of the preview image during shooting mode switching, improving the display effect of the preview image during shooting mode switching.
[0020] In conjunction with the first aspect, in some possible implementations, the method includes: the camera hardware abstraction layer sending preview data captured by the camera of the electronic device in the second shooting mode to a display control module in the application framework layer of the electronic device; the display control module displaying 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 at the first zoom level.
[0021] In conjunction with the first aspect, in some possible implementations, the zoom ratio supported by the second shooting mode is between a first value and a second value. 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 the 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; the camera hardware abstraction layer sends the 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 screen in the third preview interface based on the 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.
[0022] In conjunction with the first aspect, in some possible implementations, the camera hardware abstraction layer stores zoom ranges for multiple shooting modes, including the first shooting mode and the second shooting mode; before the mode management module in the camera application detects 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 detecting the operation of launching the camera application; in response to the operation of launching the camera application, the camera startup module sending a camera startup command to the zoom range management module; the zoom range module sending a zoom range acquisition request to the camera hardware abstraction layer; and the camera hardware abstraction layer returning the zoom ranges supported by each of the multiple shooting modes to the zoom range management module.
[0023] In conjunction with the first aspect, in some possible implementations, 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 optically zoom and acquiring an image stream of the first zoom ratio; and 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.
[0024] In conjunction with the first aspect, in some possible implementations, 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 optically zoom and acquiring an image stream of 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; and 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.
[0025] In conjunction with the first aspect, in some possible implementations, 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 optically zoom and acquiring an image stream of the first zoom ratio; and processing the image stream of the first zoom ratio through the image processing flow corresponding to the second shooting mode to obtain the second preview screen.
[0026] In conjunction with the first aspect, in some possible implementations, 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 optically zoom and acquiring an image stream of 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; and processing the image stream of the first zoom ratio through the image processing flow corresponding to the second shooting mode to obtain the second preview screen.
[0027] In conjunction with the first aspect, among some possible implementations, the first shooting mode is any one of the following: normal video recording mode, macro video recording mode, night scene video recording mode, portrait video recording mode, high dynamic range video recording mode, main character video recording mode, and multi-camera video recording mode; the second shooting mode is any one of the following: normal video recording mode, macro video recording mode, night scene video recording mode, portrait video recording mode, high dynamic range video recording mode, main character video recording mode, and multi-camera video recording mode.
[0028] In a second aspect, this application provides an electronic device including 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, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which, when the one or more processors execute the computer instructions, cause the shooting mode switching method in any possible implementation of the first aspect to be executed.
[0029] Thirdly, this application provides another electronic device, including one or more functional modules, which are used to perform the shooting mode switching method in any of the possible implementations of the first aspect above.
[0030] Fourthly, this application provides a chip system applied to an electronic device, the chip system including one or more processors, characterized in that the processor is configured to invoke computer instructions to execute the shooting mode switching method in any possible implementation of the first aspect above.
[0031] Fifthly, this application provides a computer-readable storage medium including instructions, characterized in that, when the instructions are executed on an electronic device, they cause the shooting mode switching method in any possible implementation of the first aspect described above to be performed.
[0032] Sixthly, this application provides a communication device including 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, including computer instructions. When the one or more processors execute the computer instructions, the communication device performs the shooting mode switching method in any possible implementation of any of the above aspects.
[0033] In a seventh aspect, embodiments of this application provide a computer storage medium including computer instructions, which, when executed on an electronic device, cause a communication device to perform the shooting mode switching method in any of the possible implementations of any of the above aspects.
[0034] Eighthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to execute the shooting mode switching method in any of the possible implementations of any of the above aspects. Attached Figure Description
[0035] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0036] Figure 2A schematic diagram of the hardware and software architecture of an electronic device provided in an embodiment of this application;
[0037] Figures 3A-3L A set of interface schematic diagrams provided for embodiments of this application;
[0038] Figures 4A-4D Another set of interface schematic diagrams provided for embodiments of this application;
[0039] Figure 5 A schematic diagram of software module interaction for a shooting mode switching method provided in an embodiment of this application;
[0040] Figure 6 This is a flowchart illustrating a shooting mode switching method provided in an embodiment of this application. Detailed Implementation
[0041] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0042] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0043] Figure 1 This is a schematic diagram of the hardware structure of the electronic device 100 provided in the embodiments of this application.
[0044] 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, a headphone jack 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.
[0045] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0046] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0047] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0048] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0049] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be manufactured using organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microled, micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc. In some embodiments, the electronic device may include one or N displays 194, where N is a positive integer greater than 1.
[0050] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0051] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, 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, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise and illuminance. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0052] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. 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, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0053] A digital signal processor (DSP) is used to process digital signals, including digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency point, the DSP performs Fourier transforms on the frequency energy. A video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. Thus, the electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, and MPEG 4.
[0054] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). 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 read and write operations by the processor 110.
[0055] The program code corresponding to the shooting mode recommendation method provided in this application embodiment can be stored in non-volatile memory. In the scenario of running a camera application, the electronic device 100 can load the program code stored in the non-volatile memory into random access memory, and then send it to the processor 110 for execution, thereby realizing the shooting mode switching method.
[0056] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, captured video files can be stored in the external non-volatile memory.
[0057] Electronic device 100 can implement audio functions through audio module 170 and application processor, etc.
[0058] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0059] Specifically, the audio module 170 may include a speaker 170A, a receiver 170B, a microphone 170C, and a headphone jack 170D. The speaker 170A, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. The receiver 170B, also called a "handpiece," is used to convert audio electrical signals into sound signals. In this embodiment, after video recording begins, the electronic device 100 can encode the audio electrical signals from the microphone 170C to obtain the video audio track. The microphone 170C, also called a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.
[0060] Pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, pressure sensor 180A may be disposed on display screen 194. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 may also calculate the touch position based on the detection signal from pressure sensor 180A.
[0061] A distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, during a shooting scene, the electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing. In this embodiment, the electronic device 100 can use the distance sensor 180F to determine the object distance of the image.
[0062] An ambient light sensor 180L is used to sense ambient light illuminance. In this embodiment, the electronic device 100 can use the ambient light sensor 180L to determine the illuminance of an image.
[0063] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0064] In this embodiment of the application, the electronic device 100 can detect user operations such as clicking and swiping on the screen through the touch detection capability provided by the touch sensor 180K, thereby controlling the activation and deactivation of applications and controls.
[0065] Electronic device 100 may be a mobile phone with a camera, digital camera, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, smart home device and / or smart city device. The embodiments of this application do not impose any special restrictions on the specific type of electronic device 100.
[0066] Figure 2 An exemplary schematic diagram of the hardware and software architecture of an electronic device according to an embodiment of this application is shown.
[0067] like Figure 2 As shown, the layered architecture divides the system into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the system is divided into five layers, from top to bottom: application layer, application framework layer, hardware abstraction layer, driver layer, and hardware layer.
[0068] The application layer can include a series of application packages.
[0069] Application packages can include camera apps, etc.
[0070] The application framework layer provides the application programming interface (API) and programming framework for the application packages in the application layer. The application framework layer includes some predefined functions.
[0071] In some embodiments, the application framework layer may include a camera access interface, which may include camera management and camera devices. The camera access interface is used to provide application programming interfaces and programming frameworks for camera applications.
[0072] 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.
[0073] In this embodiment of the application, the hardware abstraction layer may include a camera hardware abstraction layer and a camera algorithm library.
[0074] The camera hardware abstraction layer can provide interfaces for calling one or more cameras. These interfaces include Camera Interface 1 (e.g., main camera) and Camera Interface 2 (e.g., wide-angle camera), etc. Electronic device 100 can call each camera through Camera Interface 1, Camera Interface 2, etc.
[0075] The camera algorithm library may include one or more image processing / image recognition algorithm modules, such as scene recognition algorithm modules, main character tracking algorithm modules, digital zoom algorithm modules, and so on.
[0076] The driver layer is the layer between hardware and software. It includes drivers for various hardware components. The driver layer can include camera device drivers, digital signal processor (DSP) drivers, and image processor (IP) drivers, among others. Specifically, 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 acquire images and drives the image signal processor to preprocess the images. The DSP driver drives the digital signal processor to process images. The IIP driver drives the graphics processor to process images.
[0077] 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 image sensors from one or more cameras (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, etc.
[0078] The method in the embodiments of this application will be described in detail below with reference to the above hardware structure and system structure:
[0079] 1. Electronic device 100 turns on the camera and acquires the image reported by the camera.
[0080] In response to user actions on the camera application icon (e.g., a click), the camera application calls the camera access interface in the application framework layer to launch itself. It then sends a command to launch the camera application by calling camera interface 1 (the default, typically the main camera) in the camera hardware abstraction layer. The camera hardware abstraction layer forwards this command to the camera device driver in the driver layer. This driver then activates the image sensor (e.g., image sensor 1) corresponding to camera interface 1, acquires image light signals, and transmits these signals to an image signal processor for preprocessing to obtain an image. This image is then transmitted back to the camera hardware abstraction layer via the camera device driver. The continuously generated images constitute an image stream.
[0081] 2. The electronic device 100 determines the current shooting scene based on the image and determines the shooting mode that matches it.
[0082] On the one hand, the camera hardware abstraction layer can directly transmit images back to the camera application for display.
[0083] On the other hand, the camera hardware abstraction layer can send images to the camera algorithm library. Supported by digital signal processors and image processors, the camera algorithm library can extract feature information from the images. The library can determine the object distance of an image using a preset object distance detection algorithm; determine the illuminance of an image using a preset illuminance detection algorithm; determine the exposure of an image using a preset exposure detection algorithm; and identify whether the image contains specific objects such as people, cats, and dogs, as well as the number and area ratio of these objects, using preset face detection and animal recognition algorithms.
[0084] Then, the camera algorithm library can determine the current shooting scene based on the image's feature information and identify the matching shooting mode. The camera algorithm library can then set the matched shooting mode as the recommended mode. Finally, the camera algorithm library can send the recommended mode information back to the application layer camera application.
[0085] The camera algorithm library can also include image processing algorithms corresponding to 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.
[0086] 3. The electronic device 100 updates the content displayed on the screen and recommends shooting modes that match the current shooting scene to the user.
[0087] On the one hand, a designated area of the camera application screen (such as a preview window) displays the image reported by the camera.
[0088] 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 windows, such as showing / exiting the display mode recommendation control. In this way, the electronic device 100 can recommend shooting modes that match the current shooting scene to the user in real time through the aforementioned mode recommendation control.
[0089] The following describes the shooting mode switching method provided in the embodiments of this application, combined with application scenarios.
[0090] In some application scenarios, users can take photos or record videos using multiple shooting modes in the camera application of electronic device 100. Before taking a photo or recording video, users can switch between different shooting modes in the camera application to view the preview image effect under different shooting modes. Users can also adjust the zoom ratio in each shooting mode to view the preview image effect at different zoom ratios. Electronic device 100 can receive user input and set the zoom ratio as the first zoom ratio in the first shooting mode. When electronic device 100 switches from the first shooting mode to the second shooting mode, 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, electronic device 100 can set the initial zoom ratio of the second shooting mode to the first zoom ratio. This prevents excessive jumps in the field of view (FOV) of the preview image during shooting mode switching, improving the display effect of the preview image during shooting mode switching.
[0091] For example, such as Figure 3A As shown, the electronic device 100 can display a desktop 310, on which a page containing application icons is displayed. This page includes multiple application icons (e.g., settings application icon, app store application icon, gallery application icon, browser application icon, etc.). Below the multiple application icons, a page indicator 313 is also displayed to indicate the positional relationship between the currently displayed page and other pages. Below the page indicator 313, a tray area 311 is displayed. The tray area 311 includes multiple tray icons, such as a camera application icon 312, a contacts application icon, a phone application icon, and a messaging application icon. The tray area 311 remains displayed when switching pages. In some embodiments, the 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 tray icons are also optional, and this embodiment does not limit this.
[0092] Electronic device 100 can receive input from a user on camera application icon 312 (e.g., clicking), and in response to this input operation, electronic device 100 can display, for example... Figure 3B The shooting interface shown is 320.
[0093] like Figure 3BAs shown, the shooting interface 320 may include a display control 325A, a shooting control 325B, a camera switching control 325C, a preview frame 322, a zoom ratio control 323, and controls for one or more shooting modes (e.g., a large aperture shooting mode control 324A, a night scene shooting mode control 324B, a portrait shooting mode control 324C, a normal shooting mode control 324D, a normal video recording mode control 324E, a multi-lens video recording mode control 324F, and a more mode control 324G).
[0094] Among them, such as Figure 3B As shown, the control 324D for normal photo-taking mode is selected, and the electronic device 100 is in normal photo-taking mode. The preview box 322 displays a preview image 326 captured by the camera in normal photo-taking mode. The echo control 325A can be used to trigger the display of captured images or videos. The shooting control 325B is used to trigger the saving of images captured by the camera. The camera switching control 325C can be used to switch the camera used by the electronic device 100 to capture images (e.g., switching from a front camera to a rear camera, or vice versa). The zoom ratio control 323 can be used to set the zoom ratio for photos or videos taken by the electronic device 100. The zoom ratio control 323 can display the currently used zoom ratio (e.g., 1x), a first commonly used zoom ratio smaller than the currently used zoom ratio (e.g., 0.5x), and a second commonly used zoom ratio larger than the currently used zoom ratio (e.g., 2x).
[0095] The shooting mode controls can be used to trigger the image processing flow corresponding to that shooting mode. For example, control 324A for the large aperture shooting mode can be used to trigger the camera to use large aperture parameters to capture images. Control 324B for the night scene shooting mode can be used to trigger the increase of brightness and color richness in the captured image. Control 324C for the portrait shooting mode can be used to trigger the electronic device 100 to perform beautification processing on the portrait in the captured image. Control 324D for the normal shooting mode can be used to trigger the electronic device 100 to capture images using default parameters and process the images captured by the camera using the default image processing flow. Control 324E for the normal video recording mode can be used to trigger the electronic device 100 to record video using a single camera. Control 324F for the multi-lens video recording mode can be used to trigger the electronic device 100 to record video simultaneously using multiple cameras. The additional control 324G can be used to trigger the electronic device 100 to display controls for more shooting modes.
[0096] The electronic device 100 can receive input (e.g., a click) from the user's control 324E to select the normal recording mode. In response to this input, the electronic device 100 can switch from the normal photo mode to the normal recording mode.
[0097] like Figure 3C As shown, after switching to normal recording mode, the electronic device 100 can display the preview image 329 obtained by the camera in real time in the preview frame 322, and replace the aforementioned shooting control 325B with the recording start control 325D. After switching to normal recording mode, the electronic device 100 can display one or more functional controls on the shooting interface 320 (e.g., the main character recording mode control 321A, the AI scene recognition control 321B, the flash control 321C, the color mode control 321D, the settings control 321E, etc.). The main character recording mode control 321A can be used to trigger the electronic device 100 to identify the main character among multiple characters in the preview image when enabled. The AI scene recognition control 321B can be used to trigger the electronic device 100 to identify the shooting scene in the preview image when enabled; currently, the AI scene recognition control 321B is in a closed state. The flash control 321C can be used to trigger the electronic device 100 to turn the flash on or off. The color mode control 321D can be used to trigger the electronic device 100 to process the image captured by the camera using a color filter. The setting control 321E can be used to set the shooting parameters of the electronic device 100 (e.g., image size, image storage format, etc.).
[0098] Electronic device 100 can receive user input (e.g., a click) to zoom control 323, and in response to the input, electronic device 100 can display, as shown below. Figure 3D The zoom ratio setting control 331 and the current zoom ratio control 332 are shown.
[0099] like Figure 3D As shown, 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 a zoom ratio range supported by 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.
[0100] like Figure 3EAs shown, the electronic device 100 can receive and respond to user input (e.g., sliding) to the zoom ratio setting control 331, adjust the zoom ratio of the normal recording mode (e.g., adjust the zoom ratio from 1x to 1.5x), and acquire a real-time preview image 333 based on the user-set zoom ratio (e.g., 1.5x). The electronic device 100 can display the preview image 333 in the preview frame 322. Comparing the preview image 333 with the aforementioned preview image 329, since the zoom ratio of the preview image 333 (e.g., 1.5x) is greater than the zoom ratio of the aforementioned preview image 329 (e.g., 1x), the proportion of the subject in the preview image 333 is greater than the proportion of the same subject in the preview image 329.
[0101] After setting the zoom level for normal video recording mode based on user input to the zoom level setting control 331, electronic device 100 can receive and respond to user input (e.g., a click) on a blank area (i.e., an area without touch controls) on the shooting interface 320, such as... Figure 3F As shown, the zoom ratio setting control 331 and the current zoom ratio control 332 are replaced by the zoom ratio control 323.
[0102] like Figure 3F As shown, 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 zoom ratio control 323 can display the current zoom ratio (e.g., 1.5x), a first commonly used zoom ratio (e.g., 0.5x) which is smaller than the currently used zoom ratio, and a second commonly used zoom ratio (e.g., 2x) which is larger than the currently used zoom ratio.
[0103] Electronic device 100 can receive input from a user on AI scene recognition control 321B (e.g., click). In response to the input, electronic device 100 can activate AI scene recognition function, identify the shooting scene, and determine a recommended shooting mode based on the shooting scene.
[0104] like Figure 3G As shown, after determining that the recommended shooting mode is high dynamic range (HDR) recording mode, the electronic device 100 can display the HDR recording mode control 334. After enabling the control 334, if the electronic device 100 starts recording, it can use the shooting parameters and image processing flow of HDR recording mode to record video.
[0105] The electronic device 100 can receive and respond to user input (e.g., a click) to the control 334 applied to the high dynamic range recording mode, switching from normal recording mode to high dynamic range recording mode, and determining whether the zoom level last used in normal recording mode before the switch is within the zoom level range supported by high dynamic range recording mode. If the zoom level last used in normal recording mode is within the zoom level range supported by high dynamic range recording mode, the electronic device 100 can set the initial zoom level after switching to high dynamic range recording mode to the zoom level last used in normal recording mode.
[0106] like Figure 3H As shown, for example, the last zoom level used in normal recording mode is 1.5x. The high dynamic range (HDR) recording mode supports a zoom level range of 1x to 4x. The last zoom level used in normal recording mode falls within the zoom level range supported by HDR recording mode. After switching to HDR recording mode, the electronic device 100 can display an HDR recording interface 340. This HDR recording interface 340 may include a preview frame 341, a close control 343, a echo control 344A, a recording start control 344B, and a zoom level control 345. The zoom level control 345 can display the current zoom level as 1.5x. The electronic device 100 can acquire images in real-time using the shooting parameters in HDR recording mode and process the acquired images using the image processing flow of HDR recording mode to obtain a real-time preview screen 342. The zoom level of this real-time preview screen 342 is 1.5x. The electronic device 100 can display the real-time preview screen 342 in the preview frame 341. The recording start control 344B is used to trigger the electronic device 100 to start recording in high dynamic range recording mode. The close control 343 can be used to trigger the electronic device 100 to exit high dynamic range recording mode.
[0107] Electronic device 100 can receive user input (e.g., a click) to zoom control 345, and in response to the input, electronic device 100 can display, as shown below. Figure 3I The zoom ratio setting control 346 and the current zoom ratio control 347 are shown.
[0108] like Figure 3I As shown, the electronic device 100 can replace the zoom ratio control 345 and the close control 343 with a zoom ratio setting control 346 and a current zoom ratio control 347. The zoom ratio setting control 346 can display a zoom ratio range (e.g., 1x to 4x) supported by high dynamic range recording mode. 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.
[0109] like Figure 3J As shown, the electronic device 100 can receive and respond to user input (e.g., sliding) to the zoom ratio setting control 346, adjust the zoom ratio of the high dynamic range recording mode (e.g., adjust the zoom ratio from 1.5x to 2.3x), and acquire a real-time preview image 348 based on the user-set zoom ratio (e.g., 1.5x). The electronic device 100 can display the preview image 348 in the preview frame 351. Comparing this preview image 348 with the aforementioned preview image 329, since the zoom ratio of the preview image 348 (e.g., 2.3x) is greater than the zoom ratio of the aforementioned preview image 342 (e.g., 1.5x), the proportion of the subject in the preview image 348 is greater than the proportion of the same subject in the preview image 342.
[0110] After setting the zoom ratio of the high dynamic range 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 click) to a blank area (i.e., an area without touchable controls) on the shooting interface 350, and replace the aforementioned zoom ratio setting control 346 and current zoom ratio control 347 with the zoom ratio control 345 and the close control 343.
[0111] like Figure 3K As shown, after the electronic device 100 replaces the zoom setting control 346 and the current zoom control 347 with the zoom ratio control 345 and the close control 343, the zoom ratio control 345 may display the current zoom ratio (e.g., 2.3x), a first commonly used zoom ratio (e.g., 2x) which is smaller than the currently used zoom ratio, and a second commonly used zoom ratio (e.g., 3x) which is larger than the currently used zoom ratio.
[0112] The electronic device 100 can receive and respond to user input (e.g., a click) applied to the close control 343, switching from high dynamic range recording mode to normal recording mode, and determine whether the zoom level last used in high dynamic range recording mode before the switch is within the zoom level range supported by normal recording mode. If the zoom level last used in high dynamic range recording mode is within the zoom level range supported by normal recording mode, the electronic device 100 can set the initial zoom level after switching to normal recording mode as the zoom level last used in high dynamic range recording mode.
[0113] like Figure 3LAs shown, for example, the last zoom ratio used in High Dynamic Range (HDR) recording mode is 2.3x. The zoom ratio range supported by Normal Recording mode is 0.5x to 6x. The last zoom ratio used in HDR recording mode falls within the range supported by Normal Recording mode. After switching to Normal Recording mode, the electronic device 100 can display the aforementioned shooting interface 320, and the zoom ratio control 323 in the shooting interface 320 displays the current zoom ratio as the last zoom ratio used in HDR recording mode (e.g., 2.3x). The electronic device 100 can acquire images in real time using the shooting parameters in Normal Recording mode and process the acquired images using the image processing flow of HDR recording mode to obtain a real-time preview screen 349. The zoom ratio of this real-time preview screen 349 is 2.3x. The electronic device 100 can display the real-time preview screen 349 in the preview frame 322.
[0114] In some embodiments, when the zoom ratio of the first shooting mode is a first zoom ratio, 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 does not include the first zoom ratio, the electronic device 100 can determine the zoom ratio closest to the first zoom ratio in the zoom ratio range supported by the second shooting mode as the target zoom ratio, and set the target zoom ratio as the initial zoom ratio when entering the second shooting mode.
[0115] For example, such as Figure 4A As shown, the electronic device 100 is in high dynamic range (HDR) recording mode and displays an HDR recording interface 340. The zoom ratio control 345 in the HDR recording interface 340 displays a current zoom ratio of 2.3x, and the electronic device 100 displays a preview screen 348 with a zoom ratio of 2.3x in the preview frame 341 of the HDR recording interface 340. For a detailed textual description of the HDR recording interface 340, please refer to the above. Figure 3K The embodiments shown are not described in detail here.
[0116] like Figure 4B As shown, the electronic device 100 can switch the shooting subject to capture portraits. The electronic device 100 can recognize that a portrait is included in the preview screen 351. Therefore, the electronic device 100 can display the portrait recording mode control 352. After activating this control 329, if the electronic device 100 starts recording, it can record video using the shooting parameters and image processing flow of the portrait recording mode. For example, the background area outside the portrait in the recorded screen can be blurred to highlight the portrait features.
[0117] Electronic device 100 can receive and respond to user input (e.g., a click) applied to the portrait recording mode control 352, switch from high dynamic range recording mode to portrait recording mode, and determine whether the zoom ratio last used in high dynamic range recording mode before the switch is within the zoom ratio range supported by portrait recording mode. If the zoom ratio last used in high dynamic range recording mode is not within the zoom ratio range supported by portrait recording mode, electronic device 100 can determine the zoom ratio closest to the zoom ratio last used in high dynamic range recording mode within the zoom ratio range supported by portrait recording mode as the target zoom ratio, and set the target zoom ratio as the initial zoom ratio when entering portrait recording mode.
[0118] like Figure 4C As shown, for example, the last zoom ratio used in High Dynamic Range (HDR) recording mode is 2.3x. The zoom ratio range supported by Portrait Recording mode is 1x to 2x. The last zoom ratio used in HDR recording mode is not within the range supported by Portrait Recording mode. Electronic device 100 can determine that the zoom ratio closest to the last zoom ratio used in HDR recording mode within the range supported by Portrait Recording mode is 2x. Therefore, the target zoom ratio is 2x. After switching to Portrait Recording mode, electronic device 100 can display a Portrait Recording interface 360. This HDR recording interface 360 may include a preview box 361, a close control 363, a echo control 364A, a recording start control 364B, and a zoom ratio control 365A. The zoom ratio control 365A can display the current zoom ratio as 2x. Electronic device 100 can acquire images in real-time using the shooting parameters in HDR recording mode and process the acquired images using the image processing flow of HDR recording mode to obtain a real-time preview screen 362. The real-time preview screen 362 has a zoom ratio of 2x. The electronic device 100 can display the real-time preview screen 362 in the preview frame 361. The echo control 364A can be used to trigger the display of captured images or videos. The recording start control 364B is used to trigger the electronic device 100 to start recording in high dynamic range recording mode. The close control 363 can be used to trigger the electronic device 100 to exit high dynamic range recording mode.
[0119] Optionally, after the electronic device 100 switches to normal recording mode, it can display one or more functional controls related to portrait recording, such as background blur control 365B, beauty control 365C, etc. The background blur control 365B can be used to set the degree of background blur in the preview and shooting images. The beauty control 365C can be used to set the degree of facial color enhancement in the preview and shooting images.
[0120] Electronic device 100 can receive user input (e.g., a click) to the zoom control 365A, and in response to this input, electronic device 100 can display, for example... Figure 4D The zoom ratio setting control 366 and the current zoom ratio control 367 are shown.
[0121] like Figure 4D As shown, the electronic device 100 can replace the aforementioned zoom ratio control 365A, close control 363, background blur control 365B, beauty control 365C, etc., with the zoom ratio setting control 366 and the current zoom ratio control 367. The zoom ratio setting control 366 can display the zoom ratio range supported by the portrait recording mode (e.g., 1x to 2x). 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 366. 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.
[0122] The following describes a shooting mode switching method provided in the embodiments of this application, in conjunction with the software module.
[0123] Figure 5 The diagram illustrates the software module interaction of a shooting mode switching method according to an embodiment of this application.
[0124] like Figure 5 As shown, the software framework of the electronic device 100 may include a camera application, an application framework layer (FWK), and a hardware abstraction layer (HAL). The camera application may include a camera scene recommendation module 510, a camera launch module 520, a mode management module 530, and a zoom radio management module 540. The application framework layer may include a display control module 550 and a camera service framework layer (Camera FWK) 560. The hardware abstraction layer may include a camera hardware abstraction layer (Camera HAL) 570.
[0125] The interaction process between the software modules of the electronic device 100 may include the following steps:
[0126] S501. The camera hardware abstraction layer 570 stores the zoom range supported by each of the shooting modes on the electronic device 100.
[0127] For example, the camera application of electronic device 100 may include multiple shooting modes such as normal shooting mode, portrait shooting mode, large aperture shooting mode, high dynamic range shooting mode, macro shooting mode, normal video recording mode, macro video recording mode, portrait video recording mode, high dynamic range video recording mode, main subject video recording mode, multi-lens video recording mode, etc. The above examples are merely for explaining this application and should not be construed as limiting it; there may be more or fewer shooting modes in the embodiments of this application.
[0128] For example, the zoom range supported by the normal photo mode can be 0.5x to 20x. The zoom range supported by the portrait photo mode can be 1x to 2x. The zoom range supported by the large aperture photo mode can be 1x to 3x. The zoom range supported by the high dynamic range photo mode can be 1x to 4x. The zoom range supported by the macro photo mode can be 0.5x to 2x. The zoom range supported by the normal photo mode can be 0.5x to 6x. The zoom range supported by the macro video mode can be 0.5x to 2x. The zoom range supported by the portrait video mode can be 1x to 2x. The zoom range supported by the high dynamic range video mode can be 1x to 4x. The zoom range supported by the main subject video mode can be 0.5x to 2x. The zoom range supported by the multi-lens video mode can be 1x to 6x. The above examples are only for explaining this application and should not be construed as limiting it.
[0129] S502. The camera startup module 520 detected the operation to start the camera.
[0130] For example, the operation to start the camera can be described above. Figure 3A The operation of the camera application icon 312 in the illustrated embodiment.
[0131] S503. The camera startup module 520 can respond to the operation of starting the camera by sending a camera startup command to the zoom ratio management module 540.
[0132] S504. The zoom range management module 540 sends a zoom range acquisition request to the camera hardware abstraction layer 570. This zoom range acquisition request is used to obtain the zoom range corresponding to each shooting mode.
[0133] S505. The camera hardware abstraction layer 570 responds to the zoom range acquisition request and returns the zoom range supported by each shooting mode to the zoom management module 540.
[0134] After receiving a zoom range acquisition request, the camera hardware abstraction layer 570 can return the zoom range supported by each shooting mode to the zoom management module 540.
[0135] S506. The mode management module 530 detects the operation of switching to the first shooting mode.
[0136] The first shooting mode can be the normal video recording mode. Switching to the first shooting mode can be done as described above. Figure 3B The image shows the input for control 324E in normal recording mode. For details, please refer to the above. Figure 3B The embodiments shown are not described in detail here.
[0137] In one possible implementation, the first shooting mode can also be any of other video recording modes recommended based on the shooting scene, such as macro video recording mode, portrait video recording mode, high dynamic range video recording mode, main character video recording mode, or multi-camera video recording mode.
[0138] S507. After detecting the operation of switching to the first shooting mode, the mode management module 530 can send the first shooting mode command to the zoom ratio management module 540.
[0139] S508. The zoom ratio management module 540 responds to the command of the first shooting mode and sends the default zoom ratio of the first shooting mode to the camera hardware abstraction layer 570.
[0140] For example, the default zoom ratio can be 1x. In practice, this default zoom ratio can also be other values, which are not limited here.
[0141] S509. After detecting that it is in the first shooting mode, the mode management module 530 can send a preview request A for the first shooting mode to the camera hardware abstraction layer 570. This preview request A is used to request the camera hardware abstraction layer 570 to obtain the preview data stream of the first shooting mode.
[0142] After obtaining the preview request A and the default zoom ratio, the S510 camera hardware abstraction layer 570 can obtain the preview data stream of the default zoom ratio in the first shooting mode through the camera.
[0143] Among them, after receiving the preview request A and the default zoom ratio, 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.
[0144] 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 can control the camera to perform optical zoom using the shooting parameters corresponding to the first shooting mode, and acquire an image stream at the default zoom ratio. After acquiring the image stream at the default zoom ratio, the camera hardware abstraction layer 570 can process the image at the default zoom ratio through the image processing flow corresponding to the first shooting mode to obtain a preview data stream at the default zoom ratio in the first shooting mode.
[0145] If the default zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device (e.g., 3.5x), the camera hardware abstraction layer 570 can control the camera to perform optical zoom according to the shooting parameters corresponding to the first shooting mode, and acquire the image stream at the maximum optical zoom ratio in real time. After acquiring the image stream at the maximum optical zoom ratio, the camera hardware abstraction layer 570 can crop and enlarge the image stream at the maximum optical zoom ratio through a digital zoom processing flow to obtain the image stream at the default zoom ratio. The camera hardware abstraction layer 570 can process the image stream at the default zoom ratio through the image processing flow corresponding to the first shooting mode to obtain a preview data stream at the default zoom ratio in the first shooting mode.
[0146] S511. After obtaining the preview data stream of the default zoom ratio in the first shooting mode, the camera hardware abstraction layer 570 returns the preview data stream of the default zoom ratio in the first shooting mode to the camera service framework layer 560.
[0147] S512. The camera service framework layer 560 can return the preview data stream of the default zoom level in the first shooting mode to the display control module 550.
[0148] S513. The display control module 550 can display a preview of the default zoom level in the first shooting mode in the preview box.
[0149] S514. The zoom ratio management module 540 detected the operation of setting the zoom ratio to zoom ratio A.
[0150] For example, the first shooting mode can be normal video recording mode, and the operation of setting the zoom level to zoom level A can be as described above. Figure 3D In the embodiment described above, the zoom ratio setting control 331 can input a zoom ratio A of 1.5x. For example, the first shooting mode can be a high dynamic range recording mode, and setting the zoom ratio to zoom ratio A can be done as described above. Figure 3I The example described pertains to the input of the zoom ratio control 346. The above examples are merely illustrative and should not be construed as limiting the scope of this application.
[0151] S515. The zoom ratio management module 540 responds to the operation of setting the zoom ratio to zoom ratio A, and sends zoom ratio A to the camera hardware abstraction layer 570.
[0152] After receiving the zoom level A, the S516. Camera Hardware Abstraction Layer 570 can obtain a preview data stream of the zoom level A in the first shooting mode through the camera.
[0153] Upon receiving 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 supported by the electronic device 100.
[0154] If the zoom ratio A 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 can control the camera to perform optical zoom using the shooting parameters corresponding to the first shooting mode, and acquire an image stream at zoom ratio A. After acquiring the image stream at zoom ratio A, the camera hardware abstraction layer 570 can process the image at zoom ratio A through the image processing flow corresponding to the first shooting mode to obtain a preview data stream of zoom ratio A in the first shooting mode.
[0155] If the zoom ratio A is greater than the maximum optical zoom ratio supported by the electronic device 100 (e.g., 3.5x), the camera hardware abstraction layer 570 can control the camera to perform optical zoom according to the shooting parameters corresponding to the first shooting mode, and acquire the image stream at the maximum optical zoom ratio in real time. After acquiring the image stream at the maximum optical zoom ratio, the camera hardware abstraction layer 570 can crop and enlarge the image stream at the maximum optical zoom ratio through a digital zoom processing flow to obtain the image stream at zoom ratio A. The camera hardware abstraction layer 570 can process the image stream at zoom ratio A through the image processing flow corresponding to the first shooting mode to obtain a preview data stream at zoom ratio A in the first shooting mode.
[0156] S517. After obtaining the preview data stream of zoom level A in the first shooting mode, the camera hardware abstraction layer 570 returns the preview data stream of zoom level A in the first shooting mode to the camera service framework layer 560.
[0157] S518. The camera service framework layer 560 can send the preview data stream of zoom level A in the first shooting mode to the display control module 550.
[0158] S519. The display control module 550 can display a preview screen of zoom level A in the first shooting mode in the preview box.
[0159] The S520 camera scene recommendation module 510 can detect the operation of enabling AI scene recognition.
[0160] For example, the operation of detecting and enabling AI scene recognition can be as described above. Figure 3F For the input to the AI scene recognition control 321B in the illustrated embodiment, which is in a closed state, please refer to the above for details. Figure 3F The embodiments shown are not described in detail here.
[0161] S521. Camera scene recommendation module 510 responds to the operation of enabling AI scene recognition by identifying the shooting scene and determining the recommended shooting mode.
[0162] Recommended shooting modes may include any one or more combinations of macro video mode, night scene video mode, portrait video mode, high dynamic range video mode, main subject video mode, multi-lens video mode, etc.
[0163] For example, the matching criteria for the recommended shooting mode are shown in Table 1 below:
[0164] Table 1
[0165]
[0166] As shown in Table 1 above, when the camera scene recommendation module 510 detects that the distance (object distance) between the object being photographed and the electronic device 100 is less than D1 and the illuminance is less than L1, the camera scene recommendation module 510 can determine that the recommended shooting mode is macro video recording mode. When the camera scene recommendation module 510 detects that the illuminance is greater than L2, the camera scene recommendation module 510 can determine that the recommended shooting mode is night scene video recording mode. When the camera scene recommendation module 510 detects that the maximum face area ratio in the preview image is greater than P1 and the illuminance is less than L3, the camera scene recommendation module 510 can determine that the recommended shooting mode is portrait video recording mode. When the camera scene recommendation module 510 detects that the number of faces in the preview image is ≥2 and P2 < the maximum face area ratio in the preview image < P1 and the illuminance is less than L4, the camera scene recommendation module 510 can determine that the recommended shooting mode is main character video recording mode. When the camera scene recommendation module 501 recognizes that the preview screen 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 multi-lens video recording mode.
[0167] The object distance threshold D1, illuminance thresholds L1, L2, L3, L4, and proportional thresholds P1, P2 are preset. This application does not limit their specific values. It is understood 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 merely for explaining this application and should not be construed as limiting it.
[0168] In one possible implementation, when the mode management module 530 detects a switch to normal recording mode, it can notify the camera scene recommendation module 510 to enable AI scene recognition, identify the shooting scene of the electronic device 100, and determine the recommended shooting mode.
[0169] S522. The camera scene recommendation module 510 sends the recommended shooting mode to the mode management module 530.
[0170] The recommended shooting mode differs from the first shooting mode mentioned above. For example, the first shooting mode can be normal video recording mode, while the recommended shooting mode can be high dynamic range video recording mode.
[0171] The S523. Mode Management Module 530 can control the display of recommended shooting modes on the screen.
[0172] S524. The mode management module 530 can detect the operation of the controls for the recommended shooting mode.
[0173] For example, the recommended shooting mode could be high dynamic range recording mode, and the controls for the recommended shooting mode could be as described above. Figure 3G The control 334 shown can be operated in the manner described above for this recommended shooting mode. Figure 3G For details regarding the input to control 334 in the illustrated embodiment, please refer to the above. Figure 3G The embodiments shown are not described in detail here.
[0174] S525. In response to the operation of the control for the recommended shooting mode, the mode management module 530 sends a command to the zoom ratio management module 540 to switch to the recommended shooting mode.
[0175] S526. The mode management module 530 can respond to the operation of the control for the recommended shooting mode by sending a preview request B for recommended shooting to the camera hardware abstraction layer 570. The preview request B is used to request the camera hardware abstraction layer 570 to obtain the preview data stream of the recommended shooting mode.
[0176] S527. The zoom ratio management module 540 can respond to the instruction of the recommended shooting mode and determine whether the zoom ratio A is within the zoom ratio range of the recommended shooting mode.
[0177] S528. If the zoom ratio A is within the zoom ratio range of the recommended shooting mode, the zoom ratio management module 540 can send the zoom ratio A to the camera hardware abstraction layer 570.
[0178] For example, the first shooting mode can be normal video recording mode, while the recommended shooting mode is high dynamic range (HDR) video recording mode. The zoom ratio A is 1.5x. The zoom ratio range supported by HDR video recording mode can be 1x to 4x. The last zoom ratio A used in normal video recording mode is within the zoom ratio range supported by HDR video recording mode. Therefore, the zoom ratio management module 540 can issue a 1.5x zoom ratio to the camera hardware abstraction layer 570.
[0179] S529. After receiving the preview request B for the recommended shooting mode and the zoom ratio A, the camera hardware abstraction layer 570 can obtain the preview data stream of the zoom ratio A in the recommended shooting mode through the camera.
[0180] Upon receiving the preview request B for 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 supported by the electronic device 100.
[0181] If the zoom ratio A 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 can control the camera to perform optical zoom to obtain the shooting parameters corresponding to the recommended shooting mode and acquire an image stream at zoom ratio A. After acquiring the image stream at zoom ratio A, the camera hardware abstraction layer 570 can process the image at zoom ratio A through the image processing flow corresponding to the recommended shooting mode to obtain a preview data stream of zoom ratio A in the recommended shooting mode.
[0182] If the zoom ratio A is greater than the maximum optical zoom ratio supported by the electronic device 100 (e.g., 3.5x), the camera hardware abstraction layer 570 can control the camera to perform optical zoom to recommend shooting parameters and acquire the image stream at the maximum optical zoom ratio in real time. After acquiring the image stream at the maximum optical zoom ratio, the camera hardware abstraction layer 570 can crop and enlarge the image stream at the maximum optical zoom ratio through a digital zoom processing flow to obtain the image stream at zoom ratio A. The camera hardware abstraction layer 570 can process the image stream at zoom ratio A through the image processing flow corresponding to the recommended shooting mode to obtain a preview data stream of zoom ratio A in the recommended shooting mode.
[0183] S530. The camera hardware abstraction layer 570 can return the preview data stream of zoom level A in the recommended shooting mode to the camera service framework layer 560 after obtaining the preview data stream of zoom level A in the recommended shooting mode.
[0184] S531. The camera service framework layer 560 can send the preview data stream of zoom level A in the recommended shooting mode to the display control module 550.
[0185] S532. The display control module 550 can display a preview screen of the zoom level A in the recommended shooting mode in the preview box.
[0186] According to the embodiments of this application, when the electronic device 100 switches from a first shooting mode to a second shooting mode, the electronic device 100 can determine whether the zoom range supported by the second shooting mode includes the first zoom range. If the zoom range supported by the second shooting mode includes the first zoom range, the electronic device 100 can set the initial zoom range in the second shooting mode to the first zoom range. This prevents excessive jumps in the field of view (FOV) of the preview screen during shooting mode switching, improving the display effect of the preview screen during shooting mode switching.
[0187] In one possible implementation, if zoom ratio A is not within the zoom ratio range of the recommended shooting mode, the zoom ratio management module 540 can determine the zoom ratio (e.g., the first or second value) closest to zoom ratio A within the zoom ratio range supported by the recommended shooting mode (e.g., the zoom ratio range supported by the recommended shooting mode is between a first value and a second value) as the target zoom ratio, and send the target zoom ratio to the camera hardware abstraction layer 570. Upon receiving the preview request B and the target zoom ratio, the camera hardware abstraction layer 570 can obtain the preview data stream of zoom ratio B in the recommended shooting mode and transmit it to the camera service framework layer 560. The camera service framework layer 560 can send the preview data stream of zoom ratio B in the recommended shooting mode to the display control module 550. The display control module 550 can display a preview of the target zoom ratio in the recommended shooting mode in the preview window.
[0188] For example, the last zoom ratio A used in High Dynamic Range (HDR) recording mode is 2.3x. Portrait recording mode supports a zoom ratio range of 1x to 2x. The last zoom ratio A used in HDR recording mode is not within the range supported by portrait recording mode. Therefore, the zoom ratio management module 540 can send a zoom ratio B of 2x to the camera hardware abstraction layer 570. The camera hardware abstraction layer 570 can obtain the preview data stream with a zoom ratio of 2x in portrait recording 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 ratio of 2x in portrait recording mode to the display control module 550. The display control module 550 can display the preview screen with a zoom ratio of 2x in portrait recording mode in the preview window.
[0189] In this way, even when switching shooting modes and the zoom level used in the previous shooting mode is not within the zoom level supported by the next shooting mode, the jump in the field of view (FOV) of the preview screen can be minimized, thus improving the display effect of the preview screen during the shooting mode switching process.
[0190] In one possible implementation, if zoom ratio A is not within the zoom ratio range of the recommended shooting mode, the zoom ratio management module 540 can send the default zoom ratio of the recommended shooting mode (e.g., 1x) to the camera hardware abstraction layer 570. Upon receiving the preview request B and the default zoom ratio, the camera hardware abstraction layer 570 can obtain the preview data stream of the default zoom ratio in the recommended shooting mode and transmit it to the camera service framework layer 560. The camera service framework layer 560 can then send the preview data stream of the default zoom ratio in the recommended shooting mode to the display control module 550. The display control module 550 can then display the preview screen of the default zoom ratio in the recommended shooting mode in the preview window.
[0191] Figure 6 A flowchart illustrating a shooting mode switching method provided in an embodiment of this application is shown.
[0192] like Figure 6 As shown, the method includes:
[0193] S601. Electronic device 100 displays a first preview interface, which shows a first preview screen, and the zoom level corresponding to the first preview screen is the first zoom level.
[0194] The first preview interface includes a first preview frame, which displays a first preview image, which is captured in the first shooting mode.
[0195] The first preview interface can also display a first zoom level control, and the selected zoom level on the first zoom level control is the first zoom level.
[0196] The selected zoom level can be a zoom level value displayed in a specified style on the zoom level control. This selected zoom level can be used to indicate the zoom level corresponding to the currently displayed preview image. For example, the selected zoom level is the zoom level value highlighted on the zoom level control; another example is the zoom level value enclosed in a circle or rectangle on the zoom level control; yet another example is the zoom level value marked with a special color (e.g., yellow) on the zoom level control. For example, such as... Figure 3F In the illustrated embodiment, the zoom ratio selected on the zoom ratio control 323 is 1.5x. The word "1.5x" is circled in a circular graphic.
[0197] The first zoom level control can be used to trigger the user to set the zoom level in the first shooting mode.
[0198] The first shooting mode can be either a normal photo mode, a normal video mode, or any other video mode recommended based on the shooting scene, such as macro video mode, portrait video mode, high dynamic range video mode, subject video mode, multi-lens video mode, etc.
[0199] For example, the first shooting mode can be the normal video recording mode, and the first preview interface can be as described above. Figure 3G The shooting interface 320 shown in the embodiment can have the first preview frame as described above. Figure 3G The preview box 322 is shown in the embodiment. The first zoom control can be the one described above. Figure 3G The zoom control 323 shown in the illustrated embodiment. For details, please refer to the above. Figure 3G The embodiments shown will not be described in detail here.
[0200] For example, the first shooting mode could be high dynamic range recording mode, and the first preview interface could be as described above. Figure 3K or Figure 4B The shooting interface 340 shown in the embodiment can have the first preview frame as described above. Figure 3K or Figure 4B The preview box 341 shown in the embodiment is an example of a zoom control. The first zoom level control can be the one described above. Figure 3K or Figure 4B The zoom control 345 is shown in the embodiment. For details, please refer to the above. Figure 3K or Figure 4B The embodiments shown will not be described in detail here.
[0201] If the first zoom ratio is less than or equal to the maximum optical zoom ratio supported by the electronic device (e.g., 3.5x), the electronic device 100 can control the camera to optically zoom and acquire an image stream at the first zoom ratio; through the image processing flow corresponding to the first shooting mode, the image stream at the first zoom ratio is processed to obtain a preview image of the first zoom ratio in the first shooting mode.
[0202] If the first zoom ratio is greater than the maximum optical zoom ratio supported by the electronic device (e.g., 3.5x), the camera is controlled to optically zoom, and an image stream at the maximum optical zoom ratio is acquired; by digitally zooming the image stream at the maximum optical zoom ratio, an image stream at the first zoom ratio is obtained; by processing the image stream at the first zoom ratio through the image processing flow corresponding to the first shooting mode, a preview image of the first zoom ratio in the first shooting mode is obtained.
[0203] S602. Electronic device 100 receives a first operation to switch from the first shooting mode to the second shooting mode.
[0204] The first shooting mode differs from the second shooting mode. The second shooting mode can be any of the following: normal video recording mode, macro video recording mode, night scene video recording mode, portrait video recording mode, high dynamic range video recording mode, main subject video recording mode, and multi-lens video recording mode.
[0205] In one possible implementation, the electronic device 100 can identify the shooting scene and determine the second shooting mode. The electronic device 100 displays a first control corresponding to the second shooting mode on a first preview interface. The first operation can be an operation on the first control.
[0206] For example, the first shooting mode can be normal video recording mode, and the second shooting mode can be high dynamic range video recording mode. The first control can be as described above. Figure 3G The high dynamic range recording mode control 334 in the embodiment described above. The first operation can be an operation on the high dynamic range recording mode control 334. For details, please refer to the foregoing. Figure 3G The embodiments shown are not described in detail here.
[0207] For example, the first shooting mode could be a high dynamic range recording mode, and the second shooting mode could be a portrait recording mode. The first control could be as described above. Figure 4B The first operation can be an operation on the control 352 for the portrait recording mode in the embodiment. For details, please refer to the foregoing. Figure 4B The embodiments shown are not described in detail here.
[0208] In one example, the first shooting mode can be a high dynamic range recording mode, and the second shooting mode can be a normal recording mode. The first operation can be for the above... Figure 3K The operation of closing control 343 in the high dynamic range recording interface 340 shown is illustrated. For details, please refer to the previous section. Figure 3K The embodiments shown are not described in detail here.
[0209] S603. In response to the first operation, the electronic device 100 determines whether the first zoom ratio is within the zoom ratio range supported by the second shooting mode. The zoom ratio range supported by the second shooting mode can be from a first value to a second value.
[0210] The electronic device 100 may store the zoom range supported by each of its shooting modes. For example, the shooting modes of the camera application of the electronic device 100 may include multiple modes such as normal shooting mode, portrait shooting mode, large aperture shooting mode, high dynamic range shooting mode, macro shooting mode, normal video recording mode, macro video recording mode, portrait video recording mode, high dynamic range video recording mode, main subject video recording mode, multi-lens video recording mode, etc. The above examples are merely for explaining this application and should not be construed as limiting it. There may be more or fewer shooting modes in the embodiments of this application.
[0211] For example, the zoom range supported by the normal photo mode is 0.5x to 20x. The zoom range supported by the portrait photo mode is 1x to 2x. The zoom range supported by the large aperture photo mode is 1x to 3x. The zoom range supported by the high dynamic range photo mode is 1x to 4x. The zoom range supported by the macro photo mode is 0.5x to 2x. The zoom range supported by the normal photo mode is 0.5x to 6x. The zoom range supported by the macro video mode is 0.5x to 2x. The zoom range supported by the portrait video mode is 1x to 2x. The zoom range supported by the high dynamic range video mode is 1x to 4x. The zoom range supported by the main subject video mode is 0.5x to 2x. The zoom range supported by the multi-lens video mode is 1x to 6x. The zoom ranges supported by the various shooting modes in the above examples are only for explaining this application and should not be construed as limiting it.
[0212] For details regarding the process of obtaining the zoom range supported by each shooting mode of the electronic device 100, please refer to the above. Figure 5 Steps S501 to S504 in the illustrated embodiment will not be repeated here.
[0213] 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, on which a second preview screen is displayed, and the zoom ratio corresponding to the second preview screen is the first zoom ratio.
[0214] The second preview interface may include a second preview frame, in which the electronic device 100 can display a second preview screen under the second shooting mode.
[0215] The second preview interface can also display a second zoom level control, where the selected zoom level is the first zoom level. This second zoom level control can be used to trigger the user to set the zoom level in the second shooting mode. The zoom level selected on the second zoom level control can be referenced in the previous explanation of the first zoom level, and will not be repeated here.
[0216] For example, the first shooting mode is a normal video recording mode with a first zoom ratio of 1.5x, and the second shooting mode is a high dynamic range (HDR) video recording mode with a zoom ratio range of 1x to 4x. Since the first zoom ratio falls within the zoom ratio range corresponding to the HDR video recording mode, after switching to HDR video recording mode, the electronic device 100 can display a second preview interface, showing a preview of the 1.5x zoom ratio in HDR video recording mode within the second preview frame. The second preview interface can be as described above. Figure 3H The high dynamic range recording interface 340 in the illustrated embodiment may have a second preview frame as described above. Figure 3H The preview box 341 in the illustrated embodiment. For details, please refer to the above. Figures 3G to 3I The embodiments shown are not described in detail here.
[0217] For example, the first shooting mode is a high dynamic range (HDR) recording mode with a first zoom ratio of 2.3x, and the second shooting mode is a normal mode with a zoom ratio range of 1x to 6x. Since the first zoom ratio falls within the normal recording mode's zoom ratio range, after switching to HDR recording mode, the electronic device 100 can display a second preview interface, showing a preview of the HDR recording mode with a zoom ratio of 1.5x within the second preview frame of the second preview frame interface. The second preview interface can be as described above. Figure 3L In the illustrated embodiment, the shooting interface 320, the second preview frame can be as described above. Figure 3L The preview frame 322 in the illustrated embodiment. For details, please refer to the above. Figures 3K to 3L The embodiments shown are not described in detail here.
[0218] 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 to optically zoom and acquires an image stream at the first zoom ratio. The electronic device 100 processes the image stream at the first zoom ratio through 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.
[0219] 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 to optically zoom and acquires an image stream at the maximum optical zoom ratio. The electronic device 100 obtains the first zoom ratio image stream by digitally zooming the image stream at the maximum optical zoom ratio. The electronic device 100 processes the first zoom ratio image stream through 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.
[0220] S605. If the first zoom ratio is not within the zoom ratio range supported by the second shooting mode, the electronic device 100 determines the target zoom ratio that is closest to the first zoom ratio from the zoom ratio range supported by the second shooting mode.
[0221] The second shooting mode supports a zoom range between a first value and a second value. The target zoom ratio is either 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.
[0222] S606. Electronic device 100 displays a third preview interface, on which a third preview screen is displayed, and the zoom ratio corresponding to the third preview screen is the target zoom ratio.
[0223] The third preview interface may include a third preview frame, in which the electronic device 100 can display a third preview screen of the second shooting mode.
[0224] The third preview interface can also display a third zoom level control, which shows the current zoom level. This third zoom level control can be used to trigger the user to set the zoom level in the second shooting mode. If the first zoom level is within the zoom level range supported by the second shooting mode, the current zoom level displayed on the third zoom level control is the target zoom level.
[0225] For example, the first shooting mode is a high dynamic range (HDR) video recording mode with a first zoom ratio of 2.3x, and the second shooting mode is a portrait video recording mode with a zoom ratio range of 1x to 2x. The first zoom ratio is not within the zoom ratio range corresponding to the portrait video recording mode. Therefore, the electronic device 100 can determine that the target zoom ratio closest to the first zoom ratio within the zoom ratio range corresponding to the portrait video recording mode is 2x. After switching to the portrait video recording mode, the electronic device 100 can display a third preview interface, and display a preview image of the 2x zoom ratio in HDR video recording mode in the third preview frame of the third preview interface. The third preview interface can be as described above. Figure 4C In the illustrated embodiment, the shooting interface 360 and the third preview frame can be the one described above. Figure 4C The preview box 361 in the illustrated embodiment. For details, please refer to the above. Figures 4A to 4D The embodiments shown are not described in detail here.
[0226] In this way, even when switching shooting modes and the zoom level used in the previous shooting mode is not within the zoom level supported by the next shooting mode, the jump in the field of view (FOV) of the preview screen can be minimized, thus improving the display effect of the preview screen during the shooting mode switching process.
[0227] 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 to optically zoom and acquires 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 flow corresponding to the second shooting mode to obtain a preview image of the target zoom ratio in the second shooting mode.
[0228] 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 to optically zoom and acquires an image stream at the maximum optical zoom ratio. The electronic device 100 then 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 of the target zoom ratio in the second shooting mode.
[0229] 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. The fourth preview interface displays a fourth preview screen, wherein the zoom ratio corresponding to the fourth preview screen can be the default zoom ratio.
[0230] According to the embodiments of this application, when the electronic device 100 switches from a first shooting mode to a second shooting mode, the electronic device 100 can determine whether the zoom range supported by the second shooting mode includes the first zoom range. If the zoom range supported by the second shooting mode includes the first zoom range, the electronic device 100 can set the initial zoom range in the second shooting mode to the first zoom range. This prevents excessive jumps in the field of view (FOV) of the preview screen during shooting mode switching, improving the display effect of the preview screen during shooting mode switching.
[0231] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the above-described method embodiments.
[0232] This application also provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0233] This application also provides a chip system, which includes a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the steps of any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.
[0234] The term "user interface (UI)" used in the specification, claims, and drawings of this application refers to the medium through which an application or operating system interacts and exchanges information with the user. It converts information from its internal form to a form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java or Extensible Markup Language (XML). This source code is parsed and rendered on the terminal device, ultimately presenting user-recognizable content such as images, text, and buttons. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, images, and text. The attributes and content of controls in the interface are defined using tags or nodes, such as XML tags. <textview> 、 <imgview> 、
[0235] <videoview>Nodes define the controls contained in the interface. A node corresponds to a control or property in the interface, and after parsing and rendering, the node is presented as the content visible to the user. In addition, many applications, such as hybrid applications, often contain web pages within their interfaces. A web page, also known as a webpage, can be understood as a special control embedded in the application interface. Web pages are source code written in a specific computer language, such as Hypertext Markup Language (HTML), Cascading Style Sheets (CSS), JavaScript (JS), etc. Web page source code can be loaded and displayed as user-readable content by a browser or a web page display component with browser-like functionality. The specific content contained in a webpage is also defined through tags or nodes in the webpage source code; for example, HTML uses tags or nodes to define the content. 、 、 <video> 、 <canvas>To define the elements and attributes of a webpage.
[0236] The most common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be an icon, window, control, or other interface element displayed on the screen of an electronic device. Controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
[0237] As used in the specification and appended claims of this application, the singular expressions "a," "an," "the," "the," "the," and "this" are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the listed items. As used in the above embodiments, depending on the context, the term "when" can be interpreted as meaning "if..." or "after..." or "in response to determining..." or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining..." or "in response to determining..." or "when (the stated condition or event) is detected" or "in response to detecting (the stated condition or event)."
[0238] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of this application are generated. 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. 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 wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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 integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0239] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above 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] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.< / canvas> < / video> < / videoview> < / imgview> < / textview>
Claims
1. A shooting mode switching method, applied to an electronic device equipped with a camera, characterized in that, The method includes: The first preview interface is displayed, and the first preview interface displays a first preview screen. The zoom ratio corresponding to the first preview screen is the first zoom ratio. A first operation is received to switch from a first shooting mode to a second shooting mode, wherein the first shooting mode is 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 screen, and the zoom ratio corresponding to the second preview screen is the first zoom ratio. The zoom ratio range is between a first value and a second value, and the first value is less than the second value. 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, on which a third preview screen is displayed; wherein, when the first zoom ratio is less than the first value, the zoom ratio corresponding to the third preview screen is the first value; when the first zoom ratio is greater than the second value, the zoom ratio corresponding to the third preview screen is the second value.
2. The method according to claim 1, characterized in that, 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 level control, and the zoom level selected on the second zoom level control is the first zoom level.
3. The method according to claim 1 or 2, characterized in that, Before receiving a first operation to switch from the first shooting mode to the second shooting mode, the method further includes: Identify the shooting scene and determine the second shooting mode based on the shooting scene; The first control corresponding to the second shooting mode is displayed on the first preview interface; wherein, the first operation is the operation corresponding to the first control.
4. The method according to claim 3, characterized in that, The first preview interface also includes an AI scene recognition control; before recognizing the shooting scene and determining the second shooting mode based on the shooting scene, the method further includes: Receive a second operation on the AI scene recognition control; The process of identifying the shooting scene and determining the second shooting mode specifically includes: In response to the second operation, the shooting scene is identified, and the second shooting mode is determined based on the shooting scene.
5. The method according to claim 1 or 2, characterized in that, The first operation of receiving the switch from the first shooting mode to the second shooting mode specifically includes: 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 on the electronic device; The method further includes: 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 an 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. Upon receiving the instruction to switch to the second shooting mode and the first zoom level, the camera hardware abstraction layer obtains the preview data of the electronic device's camera shot in the second shooting mode at the first zoom level.
6. The method according to claim 5, characterized in that, 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 of 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 at the first zoom level.
7. The method according to claim 5, characterized in that, 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. Upon receiving the instruction to switch to the second shooting mode and the first value or the second value, the camera hardware abstraction layer obtains the preview data of the camera of the electronic device shooting at the zoom ratio of the first value or the second value in the second shooting mode; The camera hardware abstraction layer sends the preview data captured by the camera of the electronic device in the second shooting mode at the zoom magnification 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 captured by the camera of the electronic device in the second shooting mode at the zoom magnification of the first value or the second value.
8. The method according to claim 5, characterized in that, The camera hardware abstraction layer stores the zoom range of multiple shooting modes, including the first shooting mode and the second shooting mode; Before detecting the first operation of switching from the first shooting mode to the second shooting mode via the mode management module in the camera application, the method further includes: The camera startup module in the camera application detects the operation of launching the camera application. In response to the operation of launching the camera application, the camera launch module sends a camera launch command to the zoom ratio management module; The zoom ratio management module sends a zoom ratio range acquisition request to the camera hardware abstraction layer. The camera hardware abstraction layer returns the zoom range supported by each of the multiple shooting modes to the zoom ratio management module.
9. The method according to claim 1 or 2, 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, control the camera to optically zoom and acquire the image stream at the first zoom ratio. The first preview image is obtained by processing the image stream of the first zoom level through the image processing flow corresponding to the first shooting mode.
10. The method according to claim 1 or 2, 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, the camera is controlled to optically zoom, and an image stream at the maximum optical zoom ratio is acquired; By digitally zooming the image stream at the maximum optical zoom ratio, an image stream at the first zoom ratio is obtained; The first preview image is obtained by processing the image stream of the first zoom level through the image processing flow corresponding to the first shooting mode.
11. The method according to claim 1 or 2, 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, control the camera to optically zoom and acquire the image stream at the first zoom ratio. The second preview image is obtained by processing the image stream of the first zoom level through the image processing flow corresponding to the second shooting mode.
12. The method according to claim 1 or 2, 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, the camera is controlled to optically zoom, and an image stream at the maximum optical zoom ratio is acquired; By digitally zooming the image stream at the maximum optical zoom ratio, an image stream at the first zoom ratio is obtained; The second preview image is obtained by processing the image stream of the first zoom level through the image processing flow corresponding to the second shooting mode.
13. The method according to claim 1 or 2, characterized in that, The first shooting mode is any one of the following: normal video recording mode, macro video recording mode, night scene video recording mode, portrait video recording mode, high dynamic range video recording mode, main character video recording mode, and multi-lens video recording mode; The second shooting mode is any one of the following: normal video recording mode, macro video recording mode, night scene video recording mode, portrait video recording mode, high dynamic range video recording mode, main character video recording mode, and multi-lens video recording mode.
14. An electronic device, characterized in that, The device includes a camera, one or more processors, and one or more memories; wherein the camera, the one or more memories, and the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which, when executed by the one or more processors, cause the method as described in any one of claims 1-13 to be performed.
15. An electronic device, characterized in that, It includes one or more functional modules, which are used to perform the method as described in any one of claims 1-13.
16. A chip system applied to an electronic device, the chip system comprising one or more processors, characterized in that, The processor is used to invoke computer instructions to perform the method as described in any one of claims 1-13.
17. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, they cause the method as described in any one of claims 1-13 to be performed.