Shooting method, electronic equipment, readable storage medium and program product

By capturing the preview image of the second camera in advance before switching the zoom ratio, the problem of lag when switching cameras is solved, and a smoother preview image display is achieved.

CN120751241APending Publication Date: 2025-10-03HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410890770.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

During the zoom ratio switching process of the camera of an electronic device, the preview image may be displayed jittery, especially when the camera switches from one zoom ratio range to another. The existing technology needs to wait for the new camera to prepare to capture the image, resulting in delay.

Method used

Before the zoom ratio is switched to the second camera, a preview image is captured in advance through the second camera, and the captured image is displayed after switching to the second zoom ratio, avoiding waiting for the capture preparation stage.

Benefits of technology

Improves the display smoothness of preview images and avoids lag when switching zoom ratios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120751241A_ABST
    Figure CN120751241A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of shooting, and discloses a shooting method, electronic equipment, a readable storage medium and a program product. The method is applied to the electronic equipment comprising a first camera and a second camera. In the method, under the condition that the electronic equipment displays a first preview image collected by a first camera at a first zoom ratio, when the electronic equipment detects a switching operation that a user adjusts the zoom ratio from the first zoom ratio corresponding to the first camera to a second zoom ratio corresponding to a second camera, the zoom ratio of the first camera is adjusted to be close to the second zoom ratio corresponding to the second camera; a second preview image is captured by the second camera before switching to the second zoom magnification. According to the method, the display lag of the preview image caused by the fact that the second preview image is collected through the second camera only when the second zoom ratio is switched to can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of photographing technology, and in particular to a photographing method, electronic equipment, readable storage medium, and program product. Background Art

[0002] When an electronic device (such as a mobile phone or tablet) is shooting through a camera application (such as a camera application), a shooting preview screen will be displayed. In addition, the user can also zoom in and out of the preview image by adjusting the zoom ratio in the shooting preview screen to meet the user's different shooting needs.

[0003] Electronic devices typically include multiple cameras, with different cameras corresponding to different zoom magnification ranges. For example, when the zoom magnification range is 1x-2.5x, the main camera performs image capture and displays the captured image on the display screen. Because there is a time interval between a camera receiving an instruction to capture an image and starting to capture the first frame of image corresponding to that camera, when a user zooms in or out of a preview image, causing the zoom magnification range corresponding to one camera to switch to the zoom magnification range corresponding to another camera, the electronic device will continue to display the image captured by the first camera from the time the other camera receives the instruction to capture an image to the time it starts capturing the first frame of image corresponding to the other camera. This can cause the preview image to freeze during the switch, reducing the smoothness of the preview image display. Summary of the Invention

[0004] Embodiments of the present application provide a shooting method, electronic device, readable storage medium, and program product. The method can begin capturing a second preview image through a second camera before switching to a second zoom ratio, thereby avoiding preview image display lag caused by starting to capture the second preview image through the second camera only when switching to the second zoom ratio.

[0005] In a first aspect, the present application provides a shooting method, which is applied to an electronic device, wherein the electronic device includes a first camera and a second camera, and the method includes: displaying a first preview image captured by the first camera at a first zoom ratio; detecting a user's zoom operation; in a process of switching the zoom ratio in response to the zoom operation: capturing a second preview image through the second camera before switching to a second zoom ratio corresponding to the second camera, and displaying the second preview image when the switching to the second zoom ratio is detected.

[0006] Among them, the zoom operation includes a zoom-in operation and a zoom-out operation. Regardless of whether it is a zoom-in operation or a zoom-out operation, as long as the electronic device detects the switching operation of the zoom ratio from the first zoom ratio corresponding to the first camera to the second zoom ratio corresponding to the second camera, it can capture a second preview image through the second camera before switching to the second zoom ratio. Therefore, in the solution provided by the present application, after the zoom ratio is switched to the second zoom ratio, the electronic device can display the image captured by the second camera without waiting for the second camera to perform the relevant work in the acquisition preparation stage. This method can avoid display freezes of the preview image and improve display smoothness.

[0007] In a possible implementation of the first aspect, the user's zoom operation includes: a sliding operation or a long press operation of a zoom control in an interface displaying a first preview image on a display screen of an electronic device; or a zoom operation of the user on the first preview image using two fingers; or a long press operation of the user on a first button on the electronic device.

[0008] The first preview image interface can be found in Figure 1 In the shooting preview interface 100, the first preview image may be preview image 103, and the zoom control may be Figure 1 The user can slide the zoom bar 102 in the preview screen 100 of the electronic device to perform a zoom operation. In addition, the zoom control can also be Figure 6B For example, the user can zoom in on the preview image 103 by clicking or long pressing the control 104, and zoom out on the preview image 103 by clicking or long pressing the control 105. Figure 6B For example, the user can long press the control 106 to zoom in or out on the preview image 103.

[0009] In a possible implementation of the first aspect, the first camera corresponds to a first zoom magnification range, the second camera corresponds to a second zoom magnification range, the upper limit value of the first zoom magnification range and the lower limit value of the second zoom magnification range are the second zoom magnification; and, in a process of switching the zoom magnification in response to a zoom operation: before switching to the second zoom magnification corresponding to the second camera, a second preview image is captured through the second camera, including: detecting that the zoom magnification increases from the first zoom magnification to the second zoom magnification, and capturing the second preview image through the second camera before switching to the second zoom magnification.

[0010] It is understood that if the upper limit of the first zoom ratio range and the lower limit of the second zoom ratio range are the second zoom ratio, it means that the zoom ratio in the first zoom ratio range is smaller than the zoom ratio in the second zoom ratio range. Therefore, when the electronic device detects that the zoom ratio increases from the first zoom ratio to the second zoom ratio, it can capture the second preview image through the second camera before switching to the second zoom ratio.

[0011] For example, if an electronic device includes a wide-angle camera, a main camera, and a telephoto camera, if the camera corresponding to the first zoom magnification range is the wide-angle camera, then the camera corresponding to the second zoom magnification range can be the main camera. If the camera corresponding to the first zoom magnification range is the main camera, then the camera corresponding to the second zoom magnification range can be the telephoto camera.

[0012] In a possible implementation of the first aspect, the first camera corresponds to a first zoom magnification range, the second camera corresponds to a second zoom magnification range, the lower limit value of the first zoom magnification range and the upper limit value of the second zoom magnification range are the second zoom magnification; and, in a process of switching the zoom magnification in response to a zoom operation: before switching to the second zoom magnification corresponding to the second camera, a second preview image is captured through the second camera, including: detecting that the zoom magnification decreases from the first zoom magnification to the second zoom magnification, and capturing the second preview image through the second camera before switching to the second zoom magnification.

[0013] It is understood that if the lower limit of the first zoom ratio range and the upper limit of the second zoom ratio range are the second zoom ratio, it means that the zoom ratio in the first zoom ratio range is greater than the zoom ratio in the second zoom ratio range. Therefore, when the electronic device detects that the zoom ratio is reduced from the first zoom ratio to the second zoom ratio, it can capture the second preview image through the second camera before switching to the second zoom ratio.

[0014] In this case, if the camera corresponding to the first zoom magnification range is the main camera, the camera corresponding to the second zoom magnification range can be the wide-angle camera. If the camera corresponding to the first zoom magnification range is the telephoto camera, the camera corresponding to the second zoom magnification range can be the main camera.

[0015] In a possible implementation of the first aspect, the electronic device further includes a third camera; and capturing a second preview image through the second camera before switching to a second zoom ratio corresponding to the second camera includes: corresponding to a zoom ratio switching speed being less than a speed threshold, capturing the second preview image through the second camera before switching to the second zoom ratio; corresponding to a switching speed being greater than or equal to the speed threshold, capturing the second preview image through the second camera before switching to the second zoom ratio, and capturing a third preview image through the third camera.

[0016] It can be understood that if the switching speed of the zoom ratio is fast, for example, greater than the speed threshold, it can be determined that the current zoom operation is in a fast zoom state. At this time, the switching speed is too fast, which may cause the zoom ratio to switch within the zoom ratio range corresponding to all cameras included in the electronic device in a short period of time, and then cause the zoom ratio to switch to a certain zoom ratio range. The camera corresponding to the range has not yet had time to capture the image, resulting in a freeze. Therefore, in this method, the electronic device can capture the preview image based on the third camera included in the electronic device in addition to the second camera before switching to the second zoom ratio. This can ensure the smoothness of the display of the preview image.

[0017] In a possible implementation of the first aspect, the switching speed of the zoom ratio can be determined by any one of the following methods: determining the switching speed based on the ratio of the change value of the zoom ratio before and after the switching to the switching time; determining the switching speed based on the ratio of the change value of the zoom ratio corresponding to the first number of preview images to the first number; determining the switching speed based on the ratio of the change value of the distance between the electronic device and the photographed object to the change time.

[0018] In a possible implementation of the first aspect, the method further includes: detecting that the zoom operation ends at a third zoom ratio, controlling cameras other than the second camera to stop capturing images, wherein the third zoom ratio is within the second zoom ratio range.

[0019] It can be understood that after the zoom ratio is switched to the second zoom ratio, if the zoom operation ends at a third zoom ratio greater than the second zoom ratio, the electronic device can stop cameras other than the second camera from capturing images.

[0020] In a possible implementation of the first aspect, detecting that the zoom operation ends at the third zoom ratio includes: detecting that the user's finger leaves the display screen when the zoom ratio is the third zoom ratio; or detecting that the user releases the first button on the electronic device when the zoom ratio is the third zoom ratio; or detecting a change in the number of the user's fingers touching the display screen when the zoom ratio is the third zoom ratio.

[0021] The change in the number of fingers a user is touching on the display screen can occur, for example, when a user is performing a two-finger zoom and one of the fingers no longer touches the display screen. At this point, the electronic device can determine that the zoom operation has ended. For another example, when a user is performing a one-finger zoom and changes from sliding the zoom bar with one finger to touching the zoom bar with two fingers, the electronic device can also determine that the zoom operation has ended.

[0022] In a second aspect, the present application provides an electronic device comprising: one or more processors; one or more memories; one or more memories storing one or more programs, which, when one or more programs are executed by one or more processors, enables the electronic device to execute the shooting method of the first aspect and any possible implementation of the first aspect.

[0023] In a third aspect, the present application provides a computer-readable storage medium having instructions stored thereon. When the instructions are executed on a computer, the computer executes the shooting method of the first aspect and any possible implementation of the first aspect.

[0024] In a fourth aspect, the present application provides a computer program product, which includes: computer instructions, which, when executed on an electronic device, enable the electronic device to execute the shooting method of the first aspect and any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 According to some embodiments of the present application, a schematic diagram of an interface for shooting a preview screen is shown;

[0026] Figure 2 According to some embodiments of the present application, a schematic diagram showing a correspondence between a current zoom ratio and a streaming camera during a zoom operation is shown;

[0027] Figure 3 According to some embodiments of the present application, a schematic diagram illustrating a correspondence between a current zoom ratio and a streaming camera in another zoom operation is shown;

[0028] Figure 4 According to some embodiments of the present application, a schematic diagram of a process for camera flow decision-making is shown;

[0029] Figure 5 According to some embodiments of the present application, another schematic diagram of a flow chart of camera flow decision making is shown;

[0030] Figure 6A According to some embodiments of the present application, a schematic flow chart of a shooting method is shown;

[0031] Figure 6B According to some embodiments of the present application, another schematic diagram of an interface for shooting a preview screen is shown;

[0032] Figure 7 According to some embodiments of the present application, a schematic diagram of a framework of a multi-camera strategy decision engine is shown;

[0033] Figure 8According to some embodiments of the present application, a schematic flow chart of a second shooting method is shown;

[0034] Figure 9 According to some embodiments of the present application, a schematic diagram of an interface of a shooting preview screen including a zoom bar in an expanded state is shown;

[0035] Figure 10 According to some embodiments of the present application, a schematic flow chart of a third shooting method is shown;

[0036] Figure 11 According to some embodiments of the present application, a schematic diagram of the hardware structure of a mobile phone 10 is shown;

[0037] Figure 12 According to some embodiments of the present application, a schematic diagram of the software structure of a mobile phone 10 is shown. DETAILED DESCRIPTION

[0038] Illustrative embodiments of the present application include, but are not limited to, a photographing method, an electronic device, a readable storage medium, and a program product.

[0039] It can be understood that the shooting method provided in the embodiments of the present application is applicable to electronic devices including multiple cameras. For example, the electronic devices may include but are not limited to mobile phones, smart TVs, wearable devices, tablet computers, computers with wireless transceiver functions, virtual reality (VR) devices, augmented reality (AR) devices, wireless devices in industrial control, wireless devices in self-driving, wireless devices in remote medical surgery, wireless devices in smart grids, wireless devices in transportation safety, wireless devices in smart cities, wireless devices in smart homes, etc.

[0040] In addition, this application does not limit the number and type of cameras. For the convenience of description, the embodiments of this application are described later using an electronic device including three cameras, namely a main camera, a wide-angle camera, and a telephoto camera, as an example.

[0041] The following is an explanation of the specific terms involved in the embodiments of this application.

[0042] The main camera is the core of the electronic device's camera, responsible for capturing images in most scenarios. The main camera has the highest pixel count, resulting in higher-definition images.

[0043] Telephoto camera: used to capture images from a long distance.

[0044] Wide-angle camera: used to capture close-range images.

[0045] Streaming: In this application, the streaming process of the camera includes the acquisition preparation phase and the acquisition phase. After receiving the streaming instruction, the camera enters the acquisition preparation phase, which may include, for example, the camera power-on and initialization process. After the preparation phase, the camera enters the acquisition phase to acquire images for display by the electronic device. For details, see Figure 2 When the zoom ratio is between 1x and 2.5x, the main camera starts streaming at time t2 and ends streaming at time t3. During the time period t2-t21, the main camera is in the acquisition preparation phase; during the time period t21-t3, the main camera is in the acquisition phase, i.e., it can capture images.

[0046] Display: The image captured by the streaming camera can be sent to the display module and displayed on the display screen of the electronic device, which is called display. During the shooting process of the electronic device, the electronic device can make streaming decisions and display decisions. For example, at a certain shooting moment, it determines which / which camera starts streaming and which camera is displayed. For example, if only the main camera is streaming at a certain moment, the image taken by the main camera is displayed; if both the main camera and the wide-angle camera are streaming at a certain moment, the image taken by the main camera can be displayed, and the image taken by the wide-angle camera can also be displayed. When multiple cameras are streaming, the camera for display can be determined based on pre-set settings, for example, different zoom ratio ranges correspond to different display cameras, etc.

[0047] The following is a brief description of the relevant background involved in the embodiments of the present application.

[0048] Electronic devices such as mobile phones and tablets can include multiple cameras (or simply multi-cameras), each with different functions and applicable scenarios. This can meet the image quality requirements of the electronic device in different shooting scenarios. For example, an electronic device may include three cameras: a main camera, a wide-angle camera, and a telephoto camera.

[0049] In this application, different zoom magnification ranges correspond to different streaming cameras. For example, the wide-angle camera corresponds to a zoom magnification range of 0.5x-1x; the main camera corresponds to a zoom magnification range of 1x-2.5x; and the telephoto camera corresponds to a zoom magnification range of 2.5x-100x. For ease of description, the following description of this application will be based on the above correspondence between streaming cameras and zoom magnification ranges.

[0050] It should be noted that in other embodiments, the specific correspondence between the zoom ratio range and the streaming camera may also be set in a different manner from the above correspondence. For example, the zoom ratio range corresponding to the main camera may be 1x-2x, and the zoom ratio range corresponding to the telephoto camera may be 2x-100x, etc. This application does not limit this.

[0051] In some embodiments, after a camera application (e.g., a camera application, etc.) in an electronic device is started, a shooting preview screen may be displayed on the display screen of the electronic device. The shooting preview screen may display a preview image captured by a preset camera (e.g., a main camera corresponding to a 1x zoom ratio) for the user to preview.

[0052] Taking mobile phones as an example, Figure 1 A schematic diagram of an interface for a shooting preview screen is shown.

[0053] refer to Figure 1 The shooting preview screen 100 displayed by the mobile phone includes a preview area 101, a zoom bar 102, and a preview image 103. Among them, the preview image 103 is displayed in the preview area 101 for the user to preview. Figure 1 The zoom bar 102 in the image is in a non-expanded state and includes four zoom ratios, namely 0.5x, 1x, 2.5x, and 5x. The zoom ratio corresponding to the preview image 103 in the shooting preview screen 100 is 1x, that is, the preview image 103 is an image captured by the main camera.

[0054] After detecting the user's zooming operation on the preview image, the electronic device can use the corresponding camera to start streaming according to the current zoom ratio of the user, and display the image captured by the camera as the preview image. Figure 2 A schematic diagram showing the corresponding relationship between the current zoom ratio and the camera that starts streaming during a zoom operation is shown. Figure 2As shown, during the user's zoom operation, the zoom magnification corresponding to time t1 is 0.5x, the zoom magnification corresponding to time t2 is 1x, the zoom magnification corresponding to time t3 is 2.5x, and the zoom magnification corresponding to time t4 is 100x. When the zoom magnification is 0.5x to 1x, the wide-angle camera starts streaming, when the zoom magnification is 1x to 2.5x, the main camera starts streaming, and when the zoom magnification is 2.5x to 100x, the telephoto camera starts streaming. Specifically:

[0055] At time t1, the wide-angle camera enters the acquisition preparation phase and enters the acquisition phase at time t11. The electronic device displays a preview of the image acquired by the wide-angle camera from time t11 to time t2.

[0056] At time t2, the electronic device detects that the zoom ratio has switched to the 1x zoom ratio corresponding to the main camera, that is, it detects the zoom ratio switching operation and can control the main camera to enter the acquisition preparation phase. The main camera enters the acquisition phase at time t21. From time t2 to time t21, the electronic device can only continue to display the image captured by the wide-angle camera because the main camera cannot capture images, causing lag. Furthermore, from time t21 to time t3, the electronic device displays a preview of the image captured by the main camera.

[0057] At time t3, the electronic device detects that the zoom ratio has switched to the 2.5x zoom ratio corresponding to the telephoto camera, i.e., it detects the zoom ratio switching operation and can control the telephoto camera to enter the acquisition preparation phase. The telephoto camera enters the acquisition phase at time t31. From time t3 to time t31, the electronic device can only continue to display the image captured by the main camera because the telephoto camera cannot capture images, causing lag. In addition, from time t3 to time t31, the electronic device displays a preview of the image captured by the main camera.

[0058] Therefore, based on the foregoing, the electronic device controls the second camera to start streaming only when it detects that the zoom ratio has changed from the zoom ratio corresponding to the first camera (such as the main camera) to the zoom ratio corresponding to the second camera (such as the telephoto camera), which will cause the preview image to freeze.

[0059] Therefore, to solve the above technical problems, the present application provides a shooting method. In this method, when the electronic device detects that the user has switched the zoom magnification from a first zoom magnification range corresponding to the first camera to a second zoom magnification range close to the second camera, the electronic device can control the second camera to start capturing images before the zoom magnification is adjusted to the second zoom magnification range. Furthermore, after the zoom magnification is switched to the second zoom magnification range, the electronic device can preview the image captured by the second camera on a shooting preview screen.

[0060] Figure 3 A schematic diagram showing the corresponding relationship between the zoom ratio currently zoomed to and the camera starting the stream in the zoom operation of this application is shown. Figure 3 As shown, during the user's zoom operation, the electronic device determines at time t12 that the zoom ratio will switch from the zoom ratio range corresponding to the wide-angle camera to the zoom ratio range corresponding to the main camera. In other words, the electronic device predicts the zoom ratio switching operation at time t12. In this case, the electronic device can control the main camera to enter the acquisition preparation phase at time t12. In this way, at time t2, the main camera is already in the acquisition phase, and the shooting preview screen can directly display the image captured by the main camera.

[0061] Similarly, Figure 3 In this case, the electronic device can predict the zoom ratio switching operation at time t22. In this case, the electronic device can control the telephoto camera to enter the acquisition preparation phase at time t22. In this way, at time t3, the telephoto camera is already in the acquisition phase, and the image captured by the telephoto camera can be directly displayed in the shooting preview screen.

[0062] It will be appreciated that the aforementioned timing at which the electronic device predicts a zoom magnification switching operation is merely an example. For example, if the zoom magnification increases from 0.5x to 1x at time t1, the electronic device may also predict and detect a zoom magnification switching operation at time t1 and control the main camera to enter the acquisition preparation phase.

[0063] Based on the above method, since the second camera has started capturing images before the zoom magnification is adjusted to the second zoom magnification range (for example, the capture preparation stage has ended), after the zoom magnification is switched to the second zoom magnification range, the electronic device can display the image captured by the second camera without waiting for the second camera to perform related work in the capture preparation stage, thereby avoiding display freezes in the preview image and improving display smoothness.

[0064] In some embodiments, if the zoom magnification corresponding to the second zoom magnification interval is greater than the zoom magnification corresponding to the first zoom magnification interval, the zoom operation performed by the user is an operation of increasing the zoom magnification; if the zoom magnification corresponding to the second zoom magnification interval is less than the zoom magnification corresponding to the first zoom magnification interval, the zoom operation performed by the user is an operation of reducing the zoom magnification.

[0065] In some embodiments, the zoom ratio switching operation includes: the user performs a zoom operation (such as single-finger zoom) by sliding or long pressing the zoom control in the shooting preview screen, wherein the zoom control can be Figure 1The zoom bar 102 shown, or the user directly zooms in and out of the preview image in the shooting preview screen with two fingers (for example, two-finger zoom), or the user operates a button on the electronic device that can adjust the zoom ratio (as an example of a first button), etc.

[0066] In some embodiments, if the user switches the zoom ratio quickly, that is, the zoom ratio switches quickly (e.g., fast zooming), for example, if the switching speed is greater than a certain speed threshold, the electronic device can control all cameras included in the electronic device to start streaming. For example, if the electronic device includes a first camera, a second camera, and a third camera in addition to the first camera, the first camera, the second camera, and the third camera will all start streaming.

[0067] In some embodiments, after the zoom ratio is adjusted to the second zoom ratio range, the first camera corresponding to the first zoom ratio range can continue to be in the streaming state. In other words, when the zoom ratio is adjusted in the second zoom ratio range, both the first camera and the second camera are in the streaming state.

[0068] In some other embodiments, if the user's zoom operation is to switch the zoom magnification from the first zoom magnification range corresponding to the first camera to a zoom magnification in the second zoom magnification range corresponding to the second camera (hereinafter referred to as the pause magnification), and continue the zoom operation after staying at the pause magnification for a period of time, then, after the electronic device detects that the zoom magnification stays at the pause magnification (for example, the pause magnification stays within a preset time length), it will turn off other cameras except the second camera, that is, it will only capture images based on the second camera corresponding to the current zoom magnification, and control other cameras again, such as the first camera to capture images, after detecting that the user continues to zoom.

[0069] Figure 4 Figure 1 shows a flow chart of a camera flow decision process. Figure 4 As shown, after the camera application is opened / started (401), the camera 1x interface is entered (step 1 in 402), that is, the display screen of the electronic device is displayed as shown below. Figure 1 The shooting preview screen 100 is shown. When the electronic device detects that the current zoom magnification is 1x, it makes a multi-camera stream decision (403). Specifically, the electronic device can match the conditions based on scene information such as distance, zoom magnification, and zoom status, as well as a related configuration file (404), to obtain a multi-camera stream decision result (405).

[0070] Corresponding to step 1, when the shooting zoom ratio is 1x, among the three cameras, the wide-angle camera, the telephoto camera, and the main camera, only the main camera starts streaming.

[0071] The user can then adjust the zoom ratio. For example, when the zoom ratio switches from 1x to 0.5x, that is, when the main camera slides to the wide-angle camera (step 2 in 402), the electronic device again makes a multi-camera streaming decision (403) and obtains a multi-camera streaming decision result (405). Corresponding to step 2, when the zoom ratio slides from 1x to 0.5x, both the main camera and the wide-angle camera start streaming.

[0072] If after switching the zoom ratio, the user briefly stays at the zoom ratio of 0.5x (for example, the stay time exceeds a certain time threshold), that is, briefly stays at the wide-angle camera (step 3 in 402), then only the wide-angle camera corresponding to 0.5x will start streaming, and the main camera will no longer start streaming.

[0073] After staying at the zoom ratio of 0.5x, when the user switches the zoom ratio from 0.5x to 1x, that is, sliding from the wide-angle camera to the main camera (step 4 in 402), the main camera will start streaming again, that is, both the main camera and the wide-angle camera will start streaming.

[0074] In the above process, since there is a certain time interval between the main camera receiving the streaming instruction and starting to capture images, during this time interval, the image captured by the wide-angle camera will be displayed in the shooting preview screen, which will also cause the preview image to be displayed in a stuck state.

[0075] Based on this, in some embodiments, such as Figure 5 As shown in the figure, even if the zoom ratio stays at 0.5x, the electronic device will still control the main camera and wide-angle camera to keep streaming. It is understandable that Figure 5 Steps 501 to 504 in the embodiment are the same as steps 401 to 404 above. Figure 5 The scene restriction decision (505) in the example includes making decisions on zooming scenes such as single-finger zooming, double-finger zooming, and fast zooming. This decision will be described in detail later and will not be repeated here.

[0076] Therefore, during the process of switching the zoom magnification from the first zoom magnification range to the second zoom magnification range, even if the electronic device detects that the zoom magnification is paused at a certain pause magnification, if the user's zoom operation has not ended (for example, the user's finger has not left the display screen, or the user has not released the first button (or control) for adjusting the zoom magnification, or the number of fingers the user is touching the display screen has not changed), the electronic device will keep the camera corresponding to the pause magnification and at least one camera corresponding to the zoom magnification range adjacent to the zoom magnification range where the pause magnification is located streaming. In other words, as long as the zoom magnification switches between the first zoom magnification range and the second zoom magnification range, the electronic device will control both the first camera and the second camera to start streaming, thus avoiding lag.

[0077] The following is a detailed introduction to the shooting method provided by this application.

[0078] Figure 6A A flow chart of a shooting method is shown. The method can be executed by an electronic device, and the electronic device includes at least a first camera and a second camera. Figure 6A As shown, the method may include the following steps:

[0079] 600: Display a first preview image captured by a first camera at a first zoom ratio.

[0080] In this application, the first preview image captured by the first camera can be as follows: Figure 1 The preview image 103 in FIG. Figure 1 , the first camera is the main camera.

[0081] 601: A user zoom operation is detected.

[0082] It is understood that the embodiments of the present application do not limit the specific method of zooming operation. For example, the user can perform a zoom operation by sliding or long pressing the zoom control in the shooting preview screen (i.e., the interface displaying the first preview image). This zoom operation can be called a one-finger zoom operation, and the corresponding zoom state is a one-finger zoom state. For example, the user can slide the zoom bar (such as Figure 1 For example, the zoom bar 102 in the Figure 6B As shown, the shooting preview screen 100 includes a control 104 and a control 105. The user can zoom in on the preview image 103 by clicking or long pressing the control 104, and zoom out on the preview image 103 by clicking or long pressing the control 105.

[0083] For example, the user can also use two fingers to directly click on the first preview image (such as Figure 1The preview image 103 in the image is zoomed in and out. This zooming operation can be called a two-finger zooming operation, and the corresponding zooming state is a two-finger zooming state.

[0084] In addition, the user can also long press the first button on the electronic device that can adjust the zoom ratio to zoom in and out of the first preview image. Figure 6B , the first button can be Figure 6B For example, the user can long press the control 106 to zoom in or out on the preview image 103.

[0085] 602: Determine whether the zoom ratio switching speed is greater than a speed threshold.

[0086] In some embodiments, the single-finger zoom state and / or the two-finger zoom state also have corresponding fast zoom states. For example, if the user's single-finger zoom operation speed is relatively fast, resulting in a relatively fast switching speed of the zoom ratio, such as if the switching speed is greater than a speed threshold, it can be determined that the user is in the single-finger fast zoom state. Similarly, if the user's two-finger zoom operation speed is relatively fast, resulting in a relatively fast switching speed of the zoom ratio, such as if the switching speed is greater than a speed threshold, it can be determined that the user is in the two-finger fast zoom state.

[0087] It is understood that if the zoom ratio switching speed is not greater than the speed threshold, step 603 is executed; if the zoom ratio switching speed is greater than the speed threshold, step 606 is executed. The method for determining the switching speed will be described in detail later and will not be repeated here.

[0088] 603: In the process of switching the zoom ratio in response to the zoom operation: before switching to the second zoom ratio corresponding to the second camera, capturing a second preview image through the second camera.

[0089] As mentioned above, the electronic device can initiate a stream instruction to the second camera. After receiving the stream instruction, the second camera can enter the acquisition preparation stage, that is, it is in the stream preparation state. After the acquisition preparation stage ends, it enters the acquisition stage, at which time the second camera can acquire images.

[0090] It is understood that in the embodiment of the present application, the first camera may correspond to a first zoom magnification range, the second camera may correspond to a second zoom magnification range, and the upper limit value of the first zoom magnification range and the lower limit value of the second zoom magnification range may be the second zoom magnification. Based on this, capturing the second preview image through the second camera before switching to the second zoom magnification corresponding to the second camera may include: upon detecting that the zoom magnification increases from the first zoom magnification to the second zoom magnification, the electronic device captures the second preview image through the second camera before switching to the second zoom magnification.

[0091] For example, if an electronic device includes three cameras: a wide-angle camera, a main camera, and a telephoto camera, if the camera corresponding to the first zoom magnification range is the wide-angle camera, then the camera corresponding to the second zoom magnification range can be the main camera. If the camera corresponding to the first zoom magnification range is the main camera, then the camera corresponding to the second zoom magnification range can be the telephoto camera. For example, the second zoom magnification in this case can be 2.5x.

[0092] In some other embodiments, the lower limit of the first zoom ratio range is the upper limit of the second zoom ratio range. Based on this, capturing the second preview image through the second camera before switching to the second zoom ratio corresponding to the second camera can include: upon detecting that the zoom ratio decreases from the first zoom ratio to the second zoom ratio, the electronic device capturing the second preview image through the second camera before switching to the second zoom ratio.

[0093] For example, if an electronic device includes three cameras: a wide-angle camera, a main camera, and a telephoto camera, if the camera corresponding to the first zoom magnification range is the main camera, then the camera corresponding to the second zoom magnification range can be the wide-angle camera. If the camera corresponding to the first zoom magnification range is the telephoto camera, then the camera corresponding to the second zoom magnification range can be the main camera. For example, the second zoom magnification in this case can be 1x.

[0094] In some embodiments, at a first moment before the electronic device is zoomed to a second zoom ratio, the second camera is controlled to start capturing images. Then, starting from the first moment, both the first camera and the second camera can start streaming.

[0095] In some other embodiments, when the zoom ratio is switched within the second zoom ratio range, both the first camera and the second camera may maintain the streaming state.

[0096] 604: Detecting that the zoom ratio has been switched to the second zoom ratio, and displaying the second preview image.

[0097] It can be understood that if the zoom ratio has been switched to the second zoom ratio, no matter both the first camera and the second camera are streaming, or only the second camera is streaming, only the second preview image captured by the second camera corresponding to the second zoom ratio will be displayed.

[0098] Taking the zoom operation as an example, when the zoom ratio switches from 1x to 2.5x, the first camera is the main camera, the second camera is the telephoto camera, and the first preview image can be the preview image corresponding to the zoom ratio of 1x, and the second preview image can be the preview image corresponding to the zoom focal length of 2.5x.

[0099] This allows the second camera to pre-capture a second preview image. When the second zoom ratio corresponding to the second camera is switched, the second preview image captured by the second camera can be directly displayed for preview without waiting for the second camera's capture preparation phase. This method can avoid preview image freezes when switching between zoom ratios.

[0100] 605 : Detecting that the zoom operation ends at the third zoom magnification, controlling cameras other than the second camera to stop capturing images.

[0101] The third zoom ratio is within the second zoom ratio range.

[0102] It will be understood that after the zoom ratio is switched to the second zoom ratio, it is within the second zoom ratio range. If the zoom operation ends at a third zoom ratio greater than the second zoom ratio, the electronic device can stop the cameras other than the second camera from capturing images, i.e., stop streaming. In other words, from the time the user starts the zoom operation to the time the zoom operation ends, the cameras that were already streaming do not stop streaming. However, when the zoom operation ends, the cameras other than the second camera corresponding to the third zoom ratio at the time the zoom operation ended are stopped.

[0103] In an embodiment of the present application, the sign of the end of the zoom operation includes but is not limited to the following when the electronic device detects that the zoom magnification is the third zoom magnification: the user's finger leaves the display screen, the user releases the first button (or control) on the electronic device for adjusting the zoom magnification, the number of fingers the user touches the display screen changes, etc.

[0104] The change in the number of fingers a user is touching on the display screen can occur, for example, when a user is performing a two-finger zoom and one of the fingers no longer touches the display screen. At this point, the electronic device can determine that the zoom operation has ended. For another example, when a user is performing a one-finger zoom and changes from sliding the zoom bar with one finger to touching the zoom bar with two fingers, the electronic device can also determine that the zoom operation has ended.

[0105] In this approach, even if the zoom magnification stops at a certain pause magnification during a zoom operation, as long as the zoom operation is not completed, the electronic device will continue to stream the camera that has already started streaming, rather than ending the streaming state of the camera other than the camera corresponding to the pause magnification. This approach can also avoid lag when previewing the image.

[0106] 606 : In the process of switching the zoom ratio in response to the zoom operation: before switching to the second zoom ratio, capturing a second preview image through the second camera, and capturing a third preview image through the third camera.

[0107] It is understandable that switching the zoom ratio too quickly may cause the zoom ratio to switch within the zoom ratio range corresponding to all cameras included in the electronic device in a short period of time, which in turn causes the zoom ratio to switch to a certain zoom ratio range before the camera corresponding to the range has time to capture the image, resulting in a freeze. Therefore, in this method, the electronic device can capture the preview image based on the third camera included in the electronic device in addition to capturing the preview image based on the second camera before switching to the second zoom ratio. This ensures that all cameras of the electronic device capture images, thereby improving the display smoothness of the preview image.

[0108] In some embodiments, if the electronic device includes a third camera in addition to the first camera and the second camera, then when the electronic device is in a fast zoom state corresponding to single-finger zoom or double-finger zoom, before switching to the second zoom ratio, the electronic device can control both the second camera and the third camera to capture images.

[0109] Based on the above method, since the second camera has started capturing images before the zoom ratio is adjusted to the second zoom ratio (for example, the capture preparation stage has ended), after the zoom ratio is switched to the second zoom ratio, the electronic device can display the image captured by the second camera without waiting for the second camera to perform related work in the capture preparation stage, thereby avoiding display freezes in the preview image and improving display smoothness.

[0110] In some examples, the above Figure 6A The steps shown in are implemented based on a multi-camera strategy decision engine in an electronic device. Figure 7 A schematic diagram of a multi-camera strategy decision engine framework is shown. Figure 7 The multi-camera strategy decision engine in [1] mainly consists of two parts: one is the relevant scene information carried by the load request when it is issued, and the other is the multi-camera strategy decision engine that determines and outputs the multi-camera decision solution (i.e., the multi-camera strategy) based on the scene information. Among them, the load request can be a request issued periodically at fixed intervals. The scene information can include scene mode (scene), zoom ratio (zoom ratio), distance (distance), high-dynamic range imaging (HDR), etc.

[0111] The scene mode may be a shooting mode selected by the user in the preview state, such as night scene, portrait, photo, video, etc. Figure 1 The scene mode in the image is the photo mode. The zoom ratio can be, for example, 1x, 2.5x, etc. Figure 1The current zoom ratio in the image is 1x. The distance can be the distance between the electronic device and the subject being photographed. High dynamic range imaging is a technology used to achieve a greater exposure dynamic range (i.e., greater differences between light and dark) than conventional digital imaging technologies. The scene information can include information indicating whether the high dynamic range imaging function is on or off. Figure 1 The HDR function in is turned on.

[0112] For each received load request, the multi-camera strategy decision engine will initialize the multi-camera strategy, for example, deleting the multi-camera decision solution determined based on the previous load request. Exemplarily, the multi-camera strategy decision engine can initialize the multi-camera strategy based on the DefaultStateConfig.xml configuration file.

[0113] Then, the multi-camera strategy decision engine can select a multi-camera strategy, for example, it can select a multi-camera strategy based on the StrategyConfig.xml configuration file. Specifically, the multi-camera strategy decision engine can select a multi-camera strategy based on the Rule.xml configuration file included in the StrategyConfig.xml configuration file by performing multi-camera strategy calculation. For example, the Rule.xml configuration file can be configured with a correspondence between scene information and multi-camera strategy. In this way, the multi-camera strategy decision engine can determine the selected multi-camera strategy based on the scene information and the corresponding Rule.xml configuration file. This process can also be described in the previous text. Figure 4 The process of conditional matching based on scene information and configuration files. The multi-camera strategy obtained based on the Rule.xml configuration file is the flow decision.

[0114] Then, the multi-camera strategy decision engine can output the multi-camera strategy (out parameters), wherein the multi-camera strategy can include a preview strategy, outputting the camera for preview, and can also include a streaming strategy, outputting the camera for streaming. Exemplarily, the camera for streaming can be output based on the IdMapConfig.xml configuration file. The IdMapConfig.xml configuration file includes a mapping relationship between the logical identification number (identity document, ID) and the physical ID of the camera. The multi-camera strategy decision engine can convert the logical ID of the camera to be streamed into a physical ID based on the configuration file and output it. In addition, the StageMapConfig.xml configuration file is used to determine the camera for preview based on the camera for streaming.

[0115] Based on the foregoing, the shooting method provided in this application can be applied to the multi-camera strategy decision engine of an electronic device. Based on the method provided in this application, the multi-camera strategy decision engine determines the camera that starts streaming, that is, the camera that captures the image, under different switching trends of the zoom ratio through multi-camera strategy calculation and other methods.

[0116] The following further describes the shooting method provided in this application by taking an electronic device including a wide-angle camera, a telephoto camera and a main camera as an example. Figure 8 Detailed flow chart of a shooting method is shown in FIG. Figure 8 As shown, the method may include the following steps:

[0117] 801: Start.

[0118] In an exemplary embodiment, this step may represent the start of scene restriction decision making, and the triggering condition for scene restriction decision making may be receiving Figure 7 For example, after receiving the loading request, the multi-camera strategy decision engine in the electronic device may start making a scene restriction decision. The purpose of making the scene restriction decision is to determine the current zoom state of the preview image. The zoom states include: a single-finger zoom state, a two-finger zoom state, and a fast sliding state. The fast sliding state may include at least one of a fast state corresponding to a single-finger zoom and a fast state corresponding to a two-finger zoom.

[0119] It can be understood that this embodiment will be described in the following by taking the example that the fast sliding state only includes the fast state corresponding to the single-finger zoom state.

[0120] 802: Determine whether the zoom bar is expanded.

[0121] It is understood that the electronic device can determine the zoom state corresponding to the current zoom operation by determining whether the zoom bar is expanded. If the zoom bar is in the expanded state, it means that the user is currently performing a zoom operation by sliding the zoom bar with one finger, and then step 803 is executed to determine that the current zoom state is the one-finger zoom state.

[0122] refer to Figure 9 , Figure 9 The zoom bar 102 in the zoom bar is in the expanded state. This application does not limit the triggering conditions for the zoom bar 102 to change from the non-expanded state to the expanded state. For example, the user presses the Figure 1 The zoom bar 102 in the non-expanded state can be obtained Figure 9 The zoom bar 102 is in the expanded state. Then, the user can zoom in and out of the preview image by sliding the zoom bar left and right. In addition, the user can also directly Figure 1 The zoom bar 102 in the embodiment is slid to make the zoom bar Figure 1The non-expanded state in Figure 9 in the expanded state.

[0123] If the zoom bar is not in the expanded state, it means that the current zoom state is not the one-finger zoom state, and step 806 may be executed to further determine whether the current zoom state is the two-finger zoom state.

[0124] 803: Determine that the current zoom state is a single-finger zoom state.

[0125] It can be understood that if the zoom bar is in the expanded state and a switch of the zoom ratio or a sliding of the zoom bar is detected, it can be determined that the current zoom state is the single-finger zoom state.

[0126] 804: Determine whether it is a fast sliding state.

[0127] It is understood that if the electronic device determines that the current zoom state is the one-finger zoom state, the electronic device may further determine whether it is the fast sliding state corresponding to the one-finger zoom state. If so, step 805 is executed, and the main camera, wide-angle camera, and telephoto camera are all started; if not, step 808 is executed.

[0128] In an exemplary embodiment, the electronic device may determine whether the electronic device is in a fast sliding state based on at least the following three methods.

[0129] Method 1: The sliding rate per unit time is calculated based on the position before and after sliding / sliding time.

[0130] The position before and after the slide can be represented by the zoom factor before and after the slide. For example, the zoom factor at time p1 is a1, and the zoom factor at time p2 is a2. The sliding rate per unit time can be determined using the formula (a2-a1) / (p2-p1).

[0131] After determining the sliding speed, the sliding speed is compared with a preset first speed threshold. If the sliding speed is greater than the first speed threshold, it can be determined that the electronic device is currently in a fast sliding state; if the sliding speed is less than or equal to the first speed threshold, it can be determined that the electronic device is currently not in a fast sliding state.

[0132] Among them, the preset first rate threshold can be determined based on experience, or can be flexibly set based on actual application scenarios, and this application does not impose any restrictions on this.

[0133] Method 2: Determine the rate of change of the zoom ratio corresponding to each frame based on the change of the zoom ratio corresponding to every fixed number of image frames.

[0134] The present embodiment is not limited to a fixed number, and may be, for example, 10 frames, 20 frames, etc. Taking 10 frames as an example, the electronic device may determine that the zoom ratio corresponding to the first frame of the 10 frames is a1, and the zoom ratio corresponding to the tenth frame is a2. Then, the rate of change of the zoom ratio corresponding to each frame is determined based on the formula (a2-a1) / 10.

[0135] Similarly, after determining the rate of change of the zoom factor corresponding to each frame, the electronic device may also compare the rate of change with a preset second rate threshold. If the rate of change is greater than the second rate threshold, it can be determined that the electronic device is currently in a fast sliding state; if the rate of change is less than or equal to the second rate threshold, it can be determined that the electronic device is not currently in a fast sliding state.

[0136] The preset second rate threshold may be determined based on experience or may be flexibly set based on actual application scenarios, and this application does not impose any restrictions on this.

[0137] Method 3: Determine the distance change rate based on the change situation / time of the distance between the electronic device and the photographed object.

[0138] It is understood that, at a fixed zoom ratio, the user can change the camera that is being streamed by changing the distance between the electronic device and the subject being photographed. Therefore, the electronic device can determine whether the electronic device is currently in a fast sliding state based on the ratio of the change in distance to the subject and time.

[0139] For example, if the distance between the electronic device and the subject at time p1 is l1 and the distance between the electronic device and the subject at time p2 is l2, the rate of change of the distance per unit time can be determined based on the formula (l2-l1) / (p2-p1).

[0140] After determining the rate of change of the distance per unit time, the electronic device may also compare the rate of change with a preset third rate threshold. If the rate of change is greater than the third rate threshold, the electronic device may determine that the device is currently in a fast sliding state; if the rate of change is less than or equal to the third rate threshold, the electronic device may determine that the device is not currently in a fast sliding state.

[0141] The preset third rate threshold may be determined based on experience or may be flexibly set based on actual application scenarios, and this application does not impose any restrictions on this.

[0142] 805: Determine whether the main camera, wide-angle camera, and telephoto camera are streaming.

[0143] It's understandable that if the current zoom state is the fast sliding state corresponding to the single-finger zoom state, it means that the user is zooming in and out quickly by sliding the zoom bar. In this case, the main camera, wide-angle camera, and telephoto camera can all start streaming. This method does not require the camera to repeatedly start and stop streaming, thus improving the smoothness of the preview image display.

[0144] 806: Determine whether the user touches the display screen with two fingers.

[0145] It is understood that if the zoom bar is not expanded, the electronic device can determine whether the user is currently touching the display screen with two fingers. If so, step 807 is executed. If not, it means that the current zoom state is neither a single-finger zoom state nor a two-finger zoom state, and step 813 can be executed directly according to the above description. Figure 2 The flow decision method shown can output the decision result.

[0146] 807: Determine that the current zoom state is the two-finger zoom state.

[0147] It can be understood that if the user touches the display screen with two fingers and a switching of the zoom ratio or a sliding operation of two fingers on the display screen is detected, it can be determined that the current zoom state is the two-finger zoom state.

[0148] 808: Determine a zoom scenario based on the current zoom ratio and sliding trend.

[0149] It can be understood that the sliding trend is the switching trend of the zoom ratio mentioned above. When the electronic device determines that the current zoom state is the two-finger zoom state, or determines that the current zoom state does not belong to the fast sliding state corresponding to the single-finger zoom state, it can perform this step to determine the zoom scene based on the current zoom ratio and the sliding trend.

[0150] Among them, the zoom scenes include but are not limited to: zoom in scene of the main camera, zoom out scene of the telephoto camera, zoom out scene of the main camera, and zoom in scene of the wide-angle camera.

[0151] Among them, the zoom scenario of the main camera is that the current zoom ratio is in the zoom ratio range corresponding to the main camera, and the zoom ratio switching trend is the trend of switching from the current zoom ratio range to the zoom ratio range corresponding to the telephoto camera.

[0152] The zoom-out scenario of the main camera is that the current zoom ratio is within the zoom ratio range corresponding to the main camera, and the zoom ratio switching trend is a trend of switching from the current zoom ratio range to the zoom ratio range corresponding to the wide-angle camera.

[0153] The zoom-out scenario of the telephoto camera is that the current zoom ratio is within the zoom ratio range corresponding to the telephoto camera, and the zoom ratio switching trend is a trend of switching from the current zoom ratio range to the zoom ratio range corresponding to the main camera.

[0154] The wide-angle zoom scenario is that the current zoom ratio is within the zoom ratio range corresponding to the wide-angle camera, and the zoom ratio switching trend is a trend of switching from the current zoom ratio range to the zoom ratio range corresponding to the main camera.

[0155] 809: Determine whether the current scene is a zoomed-in scene of the main camera or a zoomed-out scene of the telephoto camera.

[0156] It can be understood that if the current scene is a zoomed-in scene of the main camera or a zoomed-out scene of the telephoto camera, the electronic device can execute step 810 to determine whether the main camera and the telephoto camera are streaming; if not, step 811 is executed, and the electronic device further determines whether it is a zoomed-out scene of the main camera or a zoomed-in scene of the wide-angle camera.

[0157] It can be understood that if the current scene is a zoomed-in scene of the primary camera, the zoom trend can be determined to be a trend of switching from the zoom magnification range corresponding to the primary camera to the zoom magnification range corresponding to the telephoto camera. The electronic device can control the telephoto camera to start streaming before zooming to the zoom magnification range corresponding to the telephoto camera. In other words, during this process, both the primary camera and the telephoto camera start streaming.

[0158] It can be understood that if the current scene is a telephoto zoomed out scene, it can be determined that the zoom trend is switching from the zoom magnification range corresponding to the telephoto camera to the zoom magnification range corresponding to the main camera. The electronic device can control the main camera to start streaming before zooming to the zoom magnification range corresponding to the main camera. In other words, during this process, both the main camera and the telephoto camera start streaming.

[0159] 810: Confirm that the main camera and telephoto camera are streaming.

[0160] It can be understood that the main camera and the telephoto camera start streaming, which means that both the main camera and the telephoto camera capture images.

[0161] 811: Determine whether the current scene is a zoomed-out scene of the main camera or a zoomed-in scene of the wide-angle camera.

[0162] It can be understood that if the current scene is a zoomed-out scene of the main camera or an enlarged scene of the wide-angle camera, the electronic device can execute step 812 to determine whether the main camera and the wide-angle camera are streaming; if not, execute step 813 and follow the above steps. Figure 2 The flow decision method shown can output the decision result.

[0163] It can be understood that if the current scene is a zoomed-out scene of the primary camera, the zoom trend can be determined to be a trend of switching from the zoom magnification range corresponding to the primary camera to the zoom magnification range corresponding to the wide-angle camera. The electronic device can control the wide-angle camera to start streaming before zooming to the zoom magnification range corresponding to the wide-angle camera. In other words, during this process, both the primary camera and the wide-angle camera start streaming.

[0164] It can be understood that if the current scene is a wide-angle zoom scene, the zoom trend can be determined to be a trend of switching from the zoom magnification range corresponding to the wide-angle camera to the zoom magnification range corresponding to the main camera. The electronic device can control the main camera to start streaming before zooming to the zoom magnification range corresponding to the main camera. In other words, during this process, both the main camera and the wide-angle camera start streaming.

[0165] 812: Confirm that the main camera and wide-angle camera start streaming.

[0166] It can be understood that the main camera and the wide-angle camera start streaming, which means that both the main camera and the wide-angle camera capture images.

[0167] 813: Output the decision result.

[0168] It is understood that the multi-camera strategy decision engine of the electronic device can output the decision results to the control module that manages camera streaming in the electronic device, so that the corresponding cameras can start streaming. The streaming results include the main camera, wide-angle camera and telephoto camera streaming, the main camera and wide-angle camera streaming, and the main camera and telephoto camera streaming.

[0169] 814: End.

[0170] Based on the previous content, Figure 8 Only the shooting method in the case of the fast sliding state corresponding to the single-finger zoom is described. It can be understood that the fast sliding state can also include the fast sliding state corresponding to the single-finger zoom and the fast sliding state corresponding to the double-finger zoom. The shooting method in this case can be found in Figure 10 .

[0171] like Figure 10 As shown, the method includes the following steps:

[0172] 1001: Start.

[0173] 1002: Determine whether the zoom bar is expanded.

[0174] 1003: Determine that the current zoom state is a single-finger zoom state.

[0175] 1004: Determine whether it is a fast sliding state corresponding to the single-finger zoom state.

[0176] 1005: Confirm that the main camera, wide-angle camera, and telephoto camera are streaming.

[0177] 1006: Determine whether the user touches the display screen with two fingers.

[0178] 1007: Determine that the current zoom state is a two-finger zoom state.

[0179] It can be understood that the principles of steps 1001-1007 are the same as those of steps 801-807 above, and will not be repeated here.

[0180] 1008: Determine whether it is a fast sliding state corresponding to the two-finger zoom state.

[0181] It is understood that if the electronic device determines that the current zoom state is the two-finger zoom state, the electronic device may further determine whether it is the fast sliding state corresponding to the two-finger zoom state. If so, step 1005 is executed, and the main camera, wide-angle camera, and telephoto camera are all started; if not, step 1009 is executed.

[0182] In an exemplary embodiment, the method for determining the fast sliding state corresponding to the double-finger zoom state is the same as that described above. Figure 8 The principle of determining the fast sliding state corresponding to the single-finger zoom state is the same as that shown, and will not be repeated here.

[0183] 1009: Determine the zoom scene based on the current zoom ratio and sliding trend.

[0184] 1010: Determine whether the current scene is a zoomed-in scene of the main camera or a zoomed-out scene of the telephoto camera.

[0185] 1011: Confirm that the main camera and telephoto camera are streaming.

[0186] 1012: Determine whether the current scene is a zoomed-out scene of the main camera or a zoomed-in scene of the wide-angle camera.

[0187] 1013: Confirm that the main camera and wide-angle camera are streaming.

[0188] 1014: Output the decision result.

[0189] 1015: End.

[0190] It can be understood that the principles of steps 1009-1015 are the same as those of steps 808-814 above, and will not be repeated here.

[0191] An embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; and one or more programs stored in the one or more memories. When the one or more programs are executed by the one or more processors, the electronic device performs the photographing method described in the above embodiment. Furthermore, the relevant content of the electronic device applicable to the method provided by this application has been described in detail above and will not be repeated here.

[0192] An embodiment of the present application further provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the shooting method involved in the above embodiment.

[0193] An embodiment of the present application also provides a computer program product, including: execution instructions, the execution instructions are stored in a readable storage medium, at least one processor of the electronic device can read the execution instructions from the readable storage medium, and at least one processor executes the execution instructions so that the electronic device implements the shooting method involved in the above embodiment.

[0194] Figure 11 The following is a schematic diagram of the structure of an electronic device (taking a mobile phone 10 as an example) provided in an embodiment of the present application. It is understood that the electronic device can be any electronic device having at least two cameras, including but not limited to mobile phones, wearable devices (such as smart watches, smart bracelets, etc.), tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, netbooks, etc., and the present embodiment of the application does not limit this.

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

[0196] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the mobile phone 10. In other embodiments of the present application, the mobile phone 10 may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0197] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

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

[0199] The processor 110 may also be provided with 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 have just been used or are being recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves system efficiency. The processor can be used to execute the shooting method described in this application.

[0200] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0201] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0202] The SIM card interface 195 is used to connect a SIM card.

[0203] Figure 12 The software structure block diagram of the mobile phone 10 involved in the embodiment of the present application is shown.

[0204] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, The system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime layer ( runtime), the hardware abstraction layer (HAL), and the kernel layer.

[0205] The application layer may include a series of application packages. In this application, the application layer may include an application package for a camera application.

[0206] like Figure 12 As shown, the application package can include applications such as camera, gallery, bank, communication, etc. In addition, the application package can also include system applications such as the home screen (i.e., desktop), negative one screen, control center, notification center, etc. The camera application involved in this application is located in this application layer.

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

[0208] The application framework layer may include a camera service. When the camera application in the application layer detects a user operation on the preview image (such as a user zoom operation), the camera application may send relevant operation information of the camera application to the HAL layer through the camera service in the application framework layer.

[0209] The system library can include multiple functional modules, such as a surface manager, a 2D graphics engine (e.g. SGL), etc.

[0210] The Hardware Abstraction Layer (HAL) is the interface layer between operating system software and hardware components, providing an interface for interaction between upper-level software and lower-level hardware. The HAL abstracts the underlying hardware into software containing the corresponding hardware interfaces. By accessing the HAL, you can configure the underlying hardware devices, for example, enabling or disabling related hardware components at the HAL layer. In some embodiments, the core architecture of the HAL layer is composed of at least one of C++ or C.

[0211] The multi-camera strategy decision engine involved in the embodiment of this application is located in Figure 11 After the multi-camera strategy decision engine receives user operation information related to the camera application, it can execute the shooting method provided by this application.

[0212] The kernel layer is the layer between hardware and software. Figure 12 In the kernel layer, there are display drivers, camera drivers, audio drivers, sensor drivers, etc.

[0213] It will be understood that, as used herein, the term "module" may refer to or include, or be part of, an application specific integrated circuit (ASIC), an electronic circuit, a processor (shared, dedicated, or group) and / or memory that executes one or more software or firmware programs, a combinational logic circuit, and / or other appropriate hardware components that provide the described functionality.

[0214] It is understood that in each embodiment of the present application, the processor can be a microprocessor, a digital signal processor, a microcontroller, etc., and / or any combination thereof. According to another aspect, the processor can be a single-core processor, a multi-core processor, etc., and / or any combination thereof.

[0215] The various embodiments disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0216] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0217] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.

[0218] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer-readable media. Therefore, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to floppy disks, optical disks, optical discs, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Therefore, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).

[0219] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.

[0220] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.

[0221] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0222] While the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the present application.

Claims

1. A shooting method, characterized in that: Applied to an electronic device, the electronic device includes a first camera and a second camera, and the method includes: displaying a first preview image captured by the first camera at a first zoom ratio; Detecting the user's zoom operation; In the process of switching the zoom ratio in response to the zoom operation: before switching to the second zoom ratio corresponding to the second camera, a second preview image is captured by the second camera, and Switching to the second zoom ratio is detected, and the second preview image is displayed.

2. The method according to claim 1, characterized in that The first camera corresponds to a first zoom magnification range, the second camera corresponds to a second zoom magnification range, and the upper limit value of the first zoom magnification range and the lower limit value of the second zoom magnification range are the second zoom magnification; Furthermore, in the process of switching the zoom ratio in response to the zoom operation: capturing a second preview image through the second camera before switching to the second zoom ratio corresponding to the second camera, including: It is detected that the zoom ratio increases from the first zoom ratio to the second zoom ratio, and the second preview image is captured by the second camera before switching to the second zoom ratio.

3. The method according to claim 1, characterized in that The first camera corresponds to a first zoom magnification range, the second camera corresponds to a second zoom magnification range, and a lower limit value of the first zoom magnification range and an upper limit value of the second zoom magnification range are the second zoom magnification; Furthermore, in the process of switching the zoom ratio in response to the zoom operation: capturing a second preview image through the second camera before switching to the second zoom ratio corresponding to the second camera, including: It is detected that the zoom ratio decreases from the first zoom ratio to the second zoom ratio, and the second preview image is captured by the second camera before switching to the second zoom ratio.

4. The method according to claim 1, wherein The electronic device further includes a third camera; and capturing a second preview image through the second camera before switching to a second zoom ratio corresponding to the second camera includes: The switching speed corresponding to the zoom ratio is less than a speed threshold, and the second preview image is captured by the second camera before switching to the second zoom ratio; Corresponding to the switching speed being greater than or equal to the speed threshold, before switching to the second zoom ratio, the second preview image is captured by the second camera, and the third preview image is captured by the third camera.

5. The method according to claim 2 or 3, characterized in that The user's zooming operation includes: A user performs a sliding operation or a long pressing operation on a zoom control in an interface where the first preview image is displayed on the display screen of the electronic device; or The user zooms in and out of the first preview image using two fingers; or A user performs a long press operation on a first button on the electronic device.

6. The method according to claim 5, characterized in that The method further comprises: It is detected that the zoom operation ends at a third zoom ratio, and cameras other than the second camera are controlled to stop capturing images, wherein the third zoom ratio is within the second zoom ratio range.

7. The method according to claim 6, characterized in that Detecting that the zoom operation ends at a third zoom factor includes: detecting that the user's finger leaves the display screen when the zoom magnification is the third zoom magnification; or, detecting that, when the zoom magnification is the third zoom magnification, the user releases the first button on the electronic device; or A change in the number of fingers of a user touching the display screen is detected when the zoom magnification is the third zoom magnification.

8. An electronic device, characterized in that: include: one or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the shooting method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the photographing method according to any one of claims 1 to 7.

10. A computer program product, characterized in that include: Computer instructions, when the computer instructions are executed on an electronic device, enable the electronic device to execute the shooting method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Camera control method and device, storage medium and electronic equipment

    CN110505389A

  • Shooting method and electronic equipment

    CN111010506A

  • Shooting method and electronic equipment

    CN115802145A

  • Shooting method and electronic equipment

    CN117278850A