Image preview method and device, electronic equipment and computer program product

By using the second shooting module in the electronic device to obtain the second preview image, the brightness of the closer object is compensated, and the problem of the surrounding objects being imaged too dark when shooting objects with higher brightness in the distance is solved, and the consistency of the shooting effect and user experience are improved.

CN120128795APending Publication Date: 2025-06-10GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510390942.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

In electronic devices, when shooting objects with high brightness in the distance, the surrounding objects are prone to image too dark, resulting in large brightness gaps and inconsistent shooting effects.

Method used

By obtaining the first preview image captured by the first shooting module and displaying it in the shooting preview interface, and at the same time, when the zoom magnification of the first shooting module is greater than a certain threshold and is in the target shooting scene, the second preview image is obtained using the second shooting module and displaying it simultaneously in the shooting preview interface. The field angle of the second shooting module is greater than that of the first shooting module, and is used to compensate for the brightness of the closer object.

Benefits of technology

It reduces the brightness gap between objects with higher brightness in the distance and surrounding objects by electronic devices, improves the consistency of shooting effects, and enhances the user's shooting experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128795A_ABST
    Figure CN120128795A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image preview method and device, electronic equipment and a computer program product. Relates to the technical field of image processing. The method is applied to the electronic equipment, and comprises the following steps: acquiring a first preview image acquired by a first shooting module, and displaying the first preview image in a shooting preview interface; and when the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold value and in the target shooting scene, a second preview image is acquired through the second shooting module, the second preview image is displayed in the shooting preview interface at the same time, and the field angle of the second shooting module is greater than the field angle of the first shooting module. According to the invention, the brightness difference between the distant object and the near object shot by the electronic equipment is smaller, the contrast between the two objects is smaller, and the consistency of the shooting effect of the electronic equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of image processing technology, and particularly to an image preview method, apparatus, electronic device, and computer program product. Background Art

[0002] With the development of science and technology, various electronic devices have emerged in people's daily lives, and people can use electronic devices for entertainment, learning, etc.

[0003] Currently, in various electronic devices, most have a shooting function. Users start the corresponding camera application program in the electronic device and take pictures of the surrounding environment or people by triggering the corresponding shooting control. In some scenes of shooting long-distance views, in order to better capture objects with higher brightness in the distance and achieve better imaging, the electronic device needs to increase the zoom ratio significantly while reducing the exposure value of automatic exposure (AE) to avoid overexposure of objects with higher brightness in the distance and losing details and textures. In this solution, although the imaging of objects with higher brightness is better due to the reduction of the AE value, the surrounding objects that are closer in the camera's field of view are imaged too dark, resulting in a large contrast between the two and inconsistent shooting effects. Summary of the Invention

[0004] In order to solve the problems of related technologies, reduce the abruptness between an electronic device shooting an object with higher brightness in the distance and surrounding objects, reduce the brightness difference between the two, and improve the consistency of shooting effects. Embodiments of the present application provide an image preview method, apparatus, electronic device, and computer program product. The technical solutions are as follows:

[0005] On the one hand, an embodiment of the present application provides an image preview method applied to an electronic device. The method includes:

[0006] Obtain a first preview image collected by a first shooting module and display the first preview image in a shooting preview interface;

[0007] When the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and in a target shooting scene, obtain a second preview image through a second shooting module and simultaneously display the second preview image in the shooting preview interface, where the field of view angle of the second shooting module is greater than that of the first shooting module.

[0008] On the other hand, an embodiment of the present application provides an image preview apparatus applied to an electronic device. The apparatus includes:

[0009] The first display module is configured to obtain a first preview image collected by the first shooting module and display the first preview image in the shooting preview interface;

[0010] The second display module is configured to, when the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and in a target shooting scene, obtain a second preview image through a second shooting module and simultaneously display the second preview image in the shooting preview interface, wherein the field of view angle of the second shooting module is greater than that of the first shooting module.

[0011] On the other hand, the present application provides an electronic device, which includes a processor and a memory. The memory stores a computer program that can run on the processor. When the processor executes the computer program, the image preview method described in the above aspect is implemented.

[0012] On the other hand, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the image preview method described in the above aspect is implemented.

[0013] On the other hand, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the image preview method described in the above aspect is implemented.

[0014] On the other hand, an embodiment of the present application provides an application publishing platform, which is used to publish a computer program product. When the computer program product runs on a computer, the computer is caused to execute to implement the image preview method described in the above aspect.

[0015] The beneficial effects brought by the technical solutions provided by the embodiments of the present application at least include:

[0016] Obtain a first preview image captured by a first shooting module in an electronic device and display the first preview image in a shooting preview interface; when the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and in a target shooting scene, obtain a second preview image through a second shooting module and simultaneously display the second preview image in the shooting preview interface, where the field of view angle of the second shooting module is greater than that of the first shooting module. In this solution, after the electronic device captures the first preview image through the first shooting module and displays it in the shooting preview interface, it judges the current zoom ratio and shooting scene corresponding to the first shooting module. If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and in a target shooting scene, obtain a second preview image through the second shooting module with a larger field of view angle and simultaneously display it in the shooting preview interface, so that a closer object can still be captured by the second shooting module, and the second shooting module can compensate a certain amount of brightness for the closer object, making the brightness difference between the first preview image captured by the first shooting module and the second preview image captured by the second shooting module smaller when the zoom ratio is greater than the first zoom threshold and in a target shooting scene, the contrast between the two is smaller, and the displayed effects in the electronic device are more similar, improving the consistency of the shooting effect of the electronic device and enhancing the user's shooting experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the following described drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0018] Figure 1 Schematic structural diagram of an electronic device provided in an exemplary embodiment of the present application;

[0019] Figure 2 Interface schematic diagram of a shooting preview interface involved in an exemplary embodiment of the present application;

[0020] Figure 3 Interface schematic diagram of a preview interface including the moon involved in an exemplary embodiment of the present application;

[0021] Figure 4 Method flowchart of an image preview method provided in an exemplary embodiment of the present application;

[0022] Figure 5 Data flow schematic diagram of a shooting module generating a first preview image in an electronic device involved in an exemplary embodiment of the present application;

[0023] Figure 6The method flowchart of an image preview method provided by an exemplary embodiment of the present application;

[0024] Figure 7 The data flow diagram of generating a preview image by a shooting module in an electronic device involved in an exemplary embodiment of the present application;

[0025] Figure 8 The flowchart of determining whether a shooting scene is a target shooting scene in an electronic device involved in an exemplary embodiment of the present application;

[0026] Figure 9 The structural diagram of the maximum brightness ratio of an electronic device involved in an exemplary embodiment of the present application;

[0027] Figure 10 The method flowchart of detecting whether the shooting scene where the first shooting module is located is a target shooting scene based on the brightness ratio value in an electronic device involved in an exemplary embodiment of the present application;

[0028] Figure 11 The method flowchart of an image preview method provided by an exemplary embodiment of the present application;

[0029] Figure 12 The comparison diagram when cropping 1X FOV to 3X FOV involved in an exemplary embodiment of the present application;

[0030] Figure 13 The interface diagram of a shooting preview interface involved in an exemplary embodiment of the present application;

[0031] Figure 14 The interface diagram of a composition setting interface involved in an exemplary embodiment of the present application;

[0032] Figure 15 The method flowchart of an image preview method provided by an exemplary embodiment of the present application;

[0033] Figure 16 The data flow diagram of generating a preview image by a shooting module in an electronic device involved in an exemplary embodiment of the present application;

[0034] Figure 17 The method flowchart of an image preview method provided by an exemplary embodiment of the present application;

[0035] Figure 18 The interface diagram of a shooting preview interface involved in an exemplary embodiment of the present application;

[0036] Figure 19Schematic diagram of an interface for triggering a shooting control to generate a target shooting image in a shooting preview interface according to an exemplary embodiment of the present application;

[0037] Figure 20 Block diagram of an image preview device provided by an exemplary embodiment of the present application;

[0038] Figure 21 Schematic diagram of another example of an image preview device provided by an embodiment of the present application. Detailed implementation manners

[0039] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0040] As used herein, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0041] It should be noted that the terms "first", "second", and "third" involved in the embodiments of the present application are used to distinguish similar or different objects and do not represent a specific order for the objects. It can be understood that, where permitted, "first", "second", and "third" can be interchanged in a specific order or sequence so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0042] The solution provided by the present application can be used in the real-life scenario where people use an electronic device with a shooting function to take pictures in daily life. For the convenience of understanding, some terms and application scenarios involved in the embodiments of the present application will be briefly introduced below.

[0043] Zoom ratio: In this solution, it refers to the change multiple that can occur in the imaging of a zoom lens within each focus range. Generally, the larger the zoom ratio, the larger the range of the focus area of the camera, the farther the shooting distance, and the clearer the distant object can be seen.

[0044] Scene brightness index: In this solution, it refers to the index value calculated through a series of brightness parameters to represent the high or low scene brightness of the shooting scene. For example, the index value calculated by combining the brightness Bv value of the object being photographed, the ambient light brightness Luma value, etc., with the calculation method set by developers.

[0045] Shooting mode: In this solution, it can refer to some shooting modes provided by existing camera applications. For example, it is a general term for various modes such as beauty mode, background blur mode, creative mode, and special effects mode that require using corresponding models / algorithms to process images. The names may be different in different electronic devices.

[0046] Preview image: The image displayed on the display screen before shooting in an electronic device.

[0047] Image gallery: It can also be called photo gallery, album, etc. It is a naming for the storage area of each image / video in an electronic device.

[0048] Live Photo: It refers to a type of photo that captures the moments and audio before and after the photo is taken.

[0049] High-resolution sensor: Many flagship mobile phones are equipped with high-resolution camera sensors, such as the main camera with 48 million, 64 million or even 100 million pixels, which can capture more details.

[0050] Night mode: Many smartphones now have night mode, which can obtain clear pictures in low-light environments through long exposure and multi-frame synthesis technology. This is a very useful function for shooting night sky scenes such as the moon.

[0051] Ultra-long zoom: Some mobile phones are equipped with periscope zoom lenses, enabling 5x, 10x or even higher optical zoom. Combined with digital zoom, the moon can be photographed larger and clearer.

[0052] Artificial Intelligence (AI) and image processing: Advanced AI and image processing algorithms can automatically adjust parameters such as exposure, contrast, and color, improving the quality of the final photo. Some mobile phones can even recognize the shooting object as the moon and automatically apply specific optimization settings.

[0053] Stability technology: Optical Image Stabilization (OIS) and Electric Image Stabilization (EIS) technologies help reduce jitter during long exposure and provide clearer images.

[0054] With the development of science and technology, various electronic devices have emerged in people's daily lives, and people can use electronic devices for entertainment, learning, etc. Among them, the shooting function has been applied in most electronic devices, and users can start the camera application in the electronic device to enable the electronic device to take pictures of the surrounding environment.

[0055] Please refer to Figure 1 , which shows a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application. As Figure 1 shown, the electronic device includes components such as a processor 110, a memory 120, a transceiver 130, a display unit 140, an input unit 150, a sensor 160, an audio circuit 170, and a power module 180.

[0056] The processor 110 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 120, and by calling the data stored in the memory 120, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 110 may include one or more processing units; optionally, the processor 110 may integrate an application processor, and the application processor mainly processes operating systems, user interfaces, and application programs, etc. Of course, other processors may also be included, which will not be listed one by one here.

[0057] The memory 120 can be used to store software programs and modules, and the processor 110 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area. Among them, the program storage area may store operating systems, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area may store data created according to the use of the electronic device (such as audio data, phone books, etc.). In addition, the memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0058] The transceiver 130 can provide wireless communication solutions applied to electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The transceiver 130 can be one or more devices integrating at least one communication processing module. For example, integrating an antenna and a baseband processor into the transceiver 130, or integrating an antenna and a modem processor into the transceiver 130, etc., which is not limited herein.

[0059] The display unit 140 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device. The display unit 140 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc., which is not limited herein.

[0060] The input unit 150 can be used to receive input digital or character information, and generate key signal inputs related to user settings and function controls of the electronic device. Specifically, the input unit 150 can collect operations of the user on or near it, and drive corresponding connection devices according to a preset program. In addition, the input unit 150 can include a touch panel, which can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel, the input unit 150 can also include other input devices. Specifically, the other input devices can include, but are not limited to, one or more of function keys (such as volume control buttons, switch buttons, etc.), trackballs, joysticks, etc.

[0061] The electronic device may further include at least one sensor 160, such as a gyroscope sensor, a motion sensor, and other sensors. The motion sensor can include an acceleration sensor, which is used to detect the magnitude of acceleration in all directions. When stationary, it can detect the magnitude and direction of gravity, and can be used in applications for identifying the posture of the electronic device, such as landscape / portrait screen switching, related games, magnetometer attitude calibration, etc. As for other sensors that the electronic device can also be configured with, such as a pressure gauge, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be elaborated herein.

[0062] The audio circuit 170 may include a speaker and a microphone, and can provide an audio interface between the user and the electronic device. The audio circuit 170 can transmit the electrical signal converted from the received audio data to the speaker, which converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 170 and then converted into audio data. After the audio data is output to the processor 110 for processing, it is sent to another electronic device, for example, through the video circuit, or the audio data is output to the memory 120 for further processing.

[0063] The electronic device further includes a power module 180 that powers each component. Optionally, the power module 180 can be logically connected to the processor 110 through a power management device, so as to implement functions such as management of charging, discharging, and power consumption management through the power management device.

[0064] The electronic device further includes one or more camera modules 190. Among them, each camera module 190 may include a camera and a corresponding high-resolution sensor, etc. The positions of these cameras on the electronic device can be front-facing or rear-facing, and the embodiments of the present application do not limit this. For example, most camera modules can be divided based on the types of cameras included. For example, a camera module including a telephoto camera can be regarded as a telephoto camera module, and a camera module including a wide-angle camera can be regarded as a wide-angle camera module. Of course, in practical applications, other division methods can also be used, and examples are not given one by one here.

[0065] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0066] Optionally, the above-mentioned electronic device may include, but is not limited to, wearable devices (such as smart bracelets, smart watches, smart glasses, etc.), mobile phones, tablet computers, laptop computers, smart glasses, smart watches, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, desktop computers, laptop portable computers, etc.

[0067] Under normal circumstances, the above Figure 1The electronic device shown needs to be equipped with a corresponding operating system and run based on the operating system. For example, the operating system of the electronic device can be the Android system, the iOS system, the Linux system, etc.

[0068] Optionally, for the above Figure 1 shown electronic device with a shooting function, during the shooting process, the user can first display a corresponding shooting interface on the display screen of the electronic device, and then trigger the corresponding shooting control, so as to realize taking pictures of the surrounding environment or people. Please refer to Figure 2 , which shows a schematic diagram of an interface of a shooting preview interface according to an exemplary embodiment of the present application. As Figure 2 shown, the user can trigger the camera application 201 in the electronic device, and then display the shooting preview interface 202 on the display screen. The shooting preview interface 202 includes a preview area 203, a shooting control 204, various zoom ratios 205, and various modes 206. Among them, the preview area 203 can display in real time the preview image generated by the electronic device based on the image data collected by the shooting module. The user can manually adjust (such as using a switching bar or pulling up a slider to zoom) the zoom ratio 205 and select the current appropriate zoom ratio. Of course, the user can also select any one of the various modes 206 and trigger the shooting control 204, so that the electronic device can generate corresponding pictures.

[0069] Generally, the user can also change the current zoom ratio 205 in the above shooting interface to achieve zooming in and out of distant objects or nearby objects. For example, if the user wants to take a larger picture of a distant object, the user can increase the zoom ratio and shoot the corresponding object through a telephoto lens. For example, in some regions and cultures, the moon has great significance. During specific festivals or at night, users will take pictures of the moon, and the technology for taking pictures of the moon is also developing rapidly. In order to make the moon clearer, after adjusting the zoom ratio to a certain multiple, the AE value will be actively reduced to avoid overexposure of the moon and resulting in too high brightness.

[0070] For example, in some electronic devices, the selected mode can be the moon scene shooting mode, which is specifically used to shoot the moon. Among them, the user can use the camera to aim at the direction where the moon is located and adjust the magnification of the camera. Generally speaking, it is necessary to use a medium telephoto lens of 10X or more to shoot, and there will be a better composition and effect, so that the moon will not be too small and the composition effect of the moon and the surrounding scenery can be obtained. Please refer to Figure 3 , which shows a schematic diagram of an interface of a preview interface including the moon and the finally captured image according to an exemplary embodiment of the present application. As Figure 3 shown, in Figure 3In (a), to better capture the moon, the user will increase the zoom ratio. At this time, the moon 302 can be seen in the preview image 301. Since the moon has a certain brightness, to see the detailed features on the moon's surface on the electronic device, the AE needs to be adjusted downward to a certain extent. If the AE exposure is too high, the moon's surface will be overexposed, losing details and textures and reducing the beauty of the moon. However, reducing the preview AE exposure will cause the surrounding scenery to be too dark, affecting the photographer's composition. The direct impact is that when the user triggers Figure 3 the shooting control 303 in (a), the image shown in Figure 3 (b) will be displayed.

[0071] In Figure 3 the image shown in (b), in addition to the moon 302 that can be seen in the preview image 301, the user also sees the foreground leaves 304 captured by the camera. That is to say, in the generation process of the above Figure 3 (b), some electronic devices will enhance the algorithm effect to display the foreground leaves. Through the above process, it can be seen that when the user is shooting the moon, after adjusting the zoom ratio, the preview image such as Figure 3 (a) will be displayed in the preview interface. Although there are closer objects (such as leaves, houses, etc.) captured within the field of view of the current camera, at this time, due to the high brightness of the moon at night, the electronic device reduces its own AE to improve the details of the moon, resulting in a lower brightness of these foreground contents. Sometimes, the user cannot clearly see them before shooting, but after triggering the shooting control, the electronic device combines functions such as AI to display the foreground contents again, causing a "false sense" and "uncertainty" in the user's vision.

[0072] Moreover, in some electronic devices, after adjusting the zoom ratio to a certain ratio (such as 15X), the corresponding composition will be displayed in the form of a floating window according to the "picture-in-picture" method. However, the image displayed in the floating window is still the image captured by the zoomed camera, that is, the image data captured by the same source camera as in the preview image. Its brightness is still insufficient. Even if it is displayed in the floating window, the user cannot refer to it. In the floating window, usually only a brighter moon can be seen, and it is even more difficult to see the foreground contents captured by the camera. Therefore, in these solutions, although the imaging of objects with higher brightness is better, the surrounding objects closer in the camera's field of view are imaged too dark, resulting in a large contrast between the two and inconsistent shooting effects.

[0073] To solve the above problems existing in the related art and reduce the abruptness between the electronic device and surrounding objects when photographing a distant and bright object, an image preview method is provided in an embodiment of the present application. Based on actual requirements, after obtaining and displaying a first preview image collected by a first shooting module, another shooting module with a larger field of view angle can be timely turned on, and a second preview image is obtained and displayed through the shooting module with a larger field of view angle, so that in the target shooting scenario, the brightness difference between the electronic device and surrounding objects when photographing a distant and bright object is reduced, and the consistency of the shooting effect is improved.

[0074] Please refer to Figure 4 , which shows a flowchart of an image preview method provided by an exemplary embodiment of the present application. The image preview method can be applied to an electronic device. As Figure 4 shown, the image preview method may include the following steps:

[0075] Step 401, obtain a first preview image collected by a first shooting module, and display the first preview image in a shooting preview interface.

[0076] Optionally, in the present application, the electronic device has a function of photographing the external environment. Among them, the shooting module of the electronic device may at least include a camera. The electronic device processes the original image data collected by the camera to generate a corresponding preview image and displays it in the shooting preview interface. For example, the first shooting module includes a telephoto lens. During the process of the user using the first shooting module for shooting, as the electronic device controls the orientation of the telephoto lens, different frames of original image data can be collected and the preview image of the current frame can be displayed in real time in the shooting preview interface.

[0077] Exemplarily, the original image data is equivalent to the unprocessed image data directly collected by the first shooting module. For example, taking the electronic device as a mobile phone, the original image data is the original RAW data collected by the shooting module of the mobile phone. For example, the RAW data includes RAW format files collected in the electronic device. The first preview image is generated after processing the original image data collected by the first shooting module.

[0078] Please refer to Figure 5 , which shows a data flow diagram of a shooting module in an electronic device generating a first preview image according to an exemplary embodiment of the present application. Among them, Figure 5 it is based on the example that the electronic device is an Android system and a Qualcomm chip. As Figure 5As shown in the figure, after the camera module (sensor) captures the original image data, it can transmit the original image data to the Hardware Abstraction Layer (HAL). After the real-time default module (RealtimeDefault) and the offline reprocessing module (OfflineReprocess) in the HAL layer process the original image data, the corresponding preview image is finally generated and sent to the application (Application, APP) for preview display.

[0079] Optionally, the above is the underlying processing logic for displaying the preview image. In actual applications, it may also include more processing modules to achieve the effect of finally displaying the preview image. The specific method for displaying the first preview image in this solution is not limited.

[0080] Step 402, when the zoom ratio corresponding to the first camera module is greater than the first zoom threshold and in the target shooting scene, obtain a second preview image through the second camera module, and simultaneously display the second preview image in the shooting preview interface. The field of view angle of the second camera module is greater than that of the first camera module.

[0081] Optionally, the electronic device needs to include at least two camera modules, where the field of view angle of one camera module is greater than that of the other camera module, which can be used as the first camera module and the second camera module in this solution. For example, in common electronic devices, there are usually a telephoto lens and a wide-angle lens. The field of view angle of the telephoto lens is small, and the shooting range is also small, while the field of view angle of the wide-angle lens is large, and the shooting range is also large. The first camera module can be a telephoto shooting module including a telephoto lens, and the second camera module can be a wide-angle shooting module including a wide-angle lens.

[0082] In this solution, when the electronic device detects that the zoom ratio corresponding to the first camera module is greater than the first zoom threshold and in the target shooting scene, it can start the second camera module to obtain a second preview image, and display both the first preview image and the second preview image in the shooting preview interface. The user can view the preview images captured simultaneously by the two camera modules. Among them, the first zoom threshold can be set by the developer in the electronic device in advance. For example, the first zoom threshold can be 10 times, that is, when the zoom ratio corresponding to the first camera module is greater than 10 and in the target shooting scene, the second camera module can be started to obtain a second preview image.

[0083] In this solution, in addition to detecting the zoom ratio corresponding to the first shooting module, the electronic device also needs to detect the current shooting scene where the first shooting module is located. If the scene brightness of the current shooting scene is lower than the first brightness threshold, it indicates that the shooting scene where the first shooting module is located is the target shooting scene, and the subsequent logic is executed. If the scene brightness of the current shooting scene is not lower than the first brightness threshold, it indicates that the shooting scene where the first shooting module is located is not the target shooting scene. Optionally, the first brightness threshold can be set independently by developers or users.

[0084] Optionally, the target shooting scene with a brightness lower than the first brightness threshold is also called a low-light scene. In this solution, in a low-light scene, if the electronic device needs to adjust the zoom ratio of the first shooting module to shoot a distant object, through the above detection, in addition to displaying the first preview image obtained by the first shooting module in the shooting preview interface, the electronic device can also be triggered to obtain a second preview image through the second shooting module, and the first preview image and the second preview image are simultaneously displayed in the shooting preview interface, so that a closer object can also be captured by the second shooting module. A certain brightness compensation can be provided for the closer object through the second shooting module, and a brighter object at a closer distance is displayed in the shooting preview interface, improving the preview effect before shooting.

[0085] To sum up, the first preview image collected by the first shooting module is obtained in the electronic device and displayed in the shooting preview interface; when the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and it is in the target shooting scene, the second preview image is obtained through the second shooting module and the second preview image is simultaneously displayed in the shooting preview interface, and the field of view angle of the second shooting module is greater than that of the first shooting module. In this solution, after the electronic device captures the first preview image through the first shooting module and displays it in the shooting preview interface, it judges the current zoom ratio and shooting scene corresponding to the first shooting module. If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and it is in the target shooting scene, the second preview image is obtained through the second shooting module with a larger field of view angle and simultaneously displayed in the shooting preview interface, so that a closer object can also be captured by the second shooting module. A certain brightness can be compensated for the closer object through the second shooting module, making the brightness difference between the first preview image captured by the first shooting module and the second preview image captured by the second shooting module smaller, the contrast between the two smaller, and the displayed effects in the electronic device more similar, improving the consistency of the shooting effect of the electronic device and enhancing the shooting experience of users.

[0086] In a possible implementation manner, in the electronic device, the working state of the second shooting module can be flexibly controlled by detecting the zoom ratio and whether it is in the target shooting scene as described above. If it is necessary to control the working state of the second shooting module to be the on state, the subsequent steps are continued. If it is necessary to control the working state of the second shooting module to be the off state, the second shooting module does not need to be turned on, so as to avoid the extra power consumption caused by the second shooting module being always on, achieving the effect of flexibly controlling the second shooting module.

[0087] Please refer to Figure 6 , which shows a flowchart of a method for image preview provided by an exemplary embodiment of the present application. This method for image preview can be applied to an electronic device. As Figure 6 shown, the method for image preview may include the following steps:

[0088] Step 601, obtain a first preview image collected by the first shooting module, and display the first preview image in the shooting preview interface.

[0089] Optionally, the way of displaying the first preview image in this step may be the same as that in step 401 above, and will not be elaborated here.

[0090] Step 602, when the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and it is in the target shooting scene, control the working state of the second shooting module to be in the on state, and obtain a second preview image collected by the second shooting module.

[0091] Optionally, in this solution, the working state of the second shooting module can be controlled based on the detection results of the zoom ratio corresponding to the first shooting module and whether it is in the target shooting scene. If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and it is in the target shooting scene, then control the working state of the second shooting module to be in the on state, and obtain a second preview image collected by the second shooting module.

[0092] Step 603, when the zoom ratio corresponding to the first shooting module is not greater than the first zoom threshold, or it is not in the target shooting scene, control the working state of the second shooting module to be in the off state.

[0093] Optionally, if the above detection results indicate that the zoom ratio corresponding to the first shooting module is not greater than the first zoom threshold, or it is not in the target shooting scene, then control the working state of the second shooting module to be in the off state.

[0094] That is to say, for the control of the working state of the second shooting module, first detect whether the zoom ratio corresponding to the current first shooting module is greater than the first zoom threshold. If the zoom ratio corresponding to the current first shooting module is greater than the first zoom threshold, further detect whether the current shooting scene is the target shooting scene. If it is also in the target shooting scene, the working state of the second shooting module can be controlled to be in the on state. If the zoom ratio corresponding to the current first shooting module is not greater than the first zoom threshold, or it is subsequently detected that the first shooting module is not in the target shooting scene, the working state of the second shooting module can be directly controlled to be in the off state.

[0095] Step 604, when the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold, identify the first preview image. If a target object is identified, determine whether the shooting scene where the first shooting module is located is the target shooting scene.

[0096] In a possible implementation manner, when the zoom ratio corresponding to the first shooting module of the electronic device is greater than the first zoom threshold, first identify the first preview image. If a target object is identified, continue to determine whether the shooting scene where the first shooting module is located is the target shooting scene. If no target object is identified, the step of determining whether the shooting scene where the first shooting module is located is the target shooting scene may not be executed, and the working state of the second shooting module can be directly controlled to be in the off state.

[0097] Optionally, the target object is an object among the objects collected by the first shooting module whose object brightness is greater than the second brightness threshold. For example, the recognition algorithm of the electronic device can identify the objects in the first preview image whose object brightness is higher than the second brightness threshold. If the object exceeding the second brightness threshold is included, it can be determined that a target object is identified. If there is no object exceeding the second brightness threshold, it is determined that there is no target object. Or, the target object is an object whose object brightness difference from other objects among the objects collected by the first shooting module is greater than the first preset difference. For example, the recognition algorithm of the electronic device identifies the object brightness of each object included in the first preview image and calculates the difference between the object brightness of the highest object and the object brightness of other objects. If it is found that there is an object exceeding the first preset difference, it means that there is a target object. If there is no object exceeding the first preset difference, there is no target object.

[0098] In a possible implementation, the target object can also be set by developers or users independently. For example, the target object is an object with a certain brightness such as the moon, a street lamp, a Ferris wheel, a lighthouse on a high building, etc. In addition to identifying through the object brightness of the object, the electronic device can also identify through the shape or contour of the object. The electronic device can identify the first preview image through a pre-set machine learning model to determine whether it contains a target object such as the moon.

[0099] Optionally, the electronic device can design the recognition process of the first preview image based on actual needs. This solution does not limit the algorithms or machine learning models used to specifically recognize the target object.

[0100] Step 605, if the target object is not recognized or not in the target shooting scene, control the working state of the second shooting module to be the off state.

[0101] Optionally, if the result of the above-mentioned recognition of the target object indicates that the target object is not in the current first preview image, the working state of the second shooting module can be directly controlled to be the off state. Or, if the result of the above-mentioned recognition of the target object indicates that although the current first preview image contains the target object, but the shooting scene where the first shooting module is located is not in the target shooting scene, the working state of the second shooting module will also be controlled to be the off state.

[0102] Step 606, display the second preview image in the shooting preview interface at the same time.

[0103] Optionally, when the electronic device controls the working state of the second shooting module to be the on state, the electronic device will obtain the second preview image collected by the second shooting module and display the second preview image in the shooting preview interface at the same time.

[0104] Optionally, the process for the electronic device to obtain the second preview image collected by the second shooting module can be similar to the process for obtaining the first preview image collected by the first shooting module. For example, the original image data collected by the second shooting module is transmitted to the HAL layer in the above-mentioned Figure 5 way and finally output to the corresponding APP layer for display.

[0105] Optionally, in this solution, in the electronic device, the data processing engine for processing the original image collected by the first shooting module is different from the data processing engine for processing the original image collected by the second shooting module. Please refer to Figure 7 which shows a schematic data flow diagram of generating a preview image through a shooting module in an electronic device according to an exemplary embodiment of the present application. As Figure 7As shown, it includes the data stream schematic 701 of the first preview image and the data stream schematic 702 of the second preview image. Among them, the data stream schematic 701 of the first preview image includes the process in which the electronic device performs a series of processes on the original image data collected by the first shooting module to obtain the first preview image, and the data stream schematic 702 of the second preview image includes the process in which the electronic device performs a series of processes on the original image data collected by the second shooting module to obtain the second preview image.

[0106] In the above Figure 7 , the original image data collected by the first shooting module is input into RealtimeDefault1 in the HAL layer, and the original image data collected by the second shooting module is input into RealtimeDefault2 in the HAL layer. They are respectively processed through their respective Camera Serial Interface-D (CSID) and Top Frame Engine (TFE), input into the Spatial Alignment Transformation (SAT) module, and then input into their respective OfflineReprocess. Through the Graphics Module Engine (GME) and Output Frame Engine (OFE), the first preview image is output by OFE1, the second preview image is output by OFE2, and they are further processed through their respective Image Processing Engines (IPE) and output to the application layer for display.

[0107] Optionally, the processing flow of the data stream in the above Figure 7 is exemplary. In actual applications, there may also be more data processing processes, and finally the corresponding first preview image and second preview image are generated. This application does not limit the detailed process of specifically generating the first preview image and the second preview image.

[0108] Optionally, in the electronic device shown in the above Figure 7 , an Auto SceneDetect (ASD) module is also included, and the algorithm / model for recognizing the first preview image can be executed by the ASD. Optionally, the ASD can be deployed in the Algo Process System (APS) in the APP layer or in the HAL layer, and the specific location can be flexibly set by developers.

[0109] In summary, in this solution, after the electronic device acquires the first preview image captured by the first shooting module and displays it in the shooting preview interface, it determines the zoom ratio and shooting scene corresponding to the current first shooting module, and then controls the working state of the second shooting module. When the working state of the second shooting module is the on state, the second preview image can be acquired through the second shooting module with a larger field of view, and the first preview image and the second preview image are simultaneously displayed in the shooting preview interface. In addition, it is also possible to combine the recognition of the target object in the first preview image to determine whether to further determine whether the first shooting module is in the target shooting scene, better control the opening and closing of the second shooting module, so that the brightness difference between the first preview image captured by the first shooting module and the second preview image captured by the second shooting module is smaller, while reducing the unnecessary activation of the second shooting module and saving the power consumption of the electronic device.

[0110] In a possible implementation manner, the electronic device detecting whether the shooting scene where the first shooting module is located is the target shooting scene can be detected by combining the target brightness information, where the target brightness information includes the image brightness information corresponding to the first preview image and / or the ambient light brightness corresponding to the electronic device. Please refer to Figure 8 , which shows a schematic flowchart of determining whether the shooting scene is the target shooting scene in an electronic device according to an exemplary embodiment of the present application. As Figure 8 shown, the detection process may include the following steps:

[0111] Step 801, acquire the target brightness information, where the target brightness information includes the image brightness information corresponding to the first preview image and / or the ambient light brightness corresponding to the electronic device.

[0112] Optionally, the electronic device acquires the target brightness information before acquiring the second preview image captured by the second shooting module. Among them, the image brightness information corresponding to the first preview image includes at least one of the darkness value corresponding to the first preview image, the brightness (Brightness Value, BV) value corresponding to the first preview image, and the brightness value corresponding to the first preview image. The ambient light brightness corresponding to the electronic device may refer to the background brightness of the environment where the current electronic device is located.

[0113] Optionally, the darkness value corresponding to the first preview image can be represented by LvIndex. The smaller the value of LvIndex, the higher the brightness of the first preview image. Conversely, the larger the value of LvIndex, the lower the brightness of the first preview image. Usually, in the night scene mode, the darkness value of the first preview image captured by the first shooting module of the electronic device is 300+ (i.e., 300 or above). If the electronic device is indoors, the darkness value of the first preview image captured by the first shooting module is between 200 and 300. If in the daytime outdoors, the darkness value of the first preview image captured by the first shooting module of the electronic device is often below 100.

[0114] For the BV value corresponding to the first preview image, physically it is opposite to LvIndex. The smaller the value of BV, the lower the brightness of the first preview image. Conversely, the larger the value of BV, the higher the brightness of the first preview image. For the brightness value corresponding to the first preview image, it can be represented by Luma. Luma includes the overall image brightness of the first preview image and the background brightness of the environment where the electronic device is located, and is a comprehensive data. And the ambient light brightness corresponding to the electronic device can be represented by Light, which specifically refers to the background brightness of the current environment where the electronic device is located. For example, when using the electronic device to take pictures indoors, the brightness of the indoor environment where the electronic device is located.

[0115] Optionally, the electronic device can use any one or a combination of the above three parameters to measure the brightness of the first preview image. For example, using only the LvIndex value as the target brightness information, or using LvIndex and Luma as the brightness information, etc.

[0116] Optionally, how to specifically select the above several brightness parameters as the target brightness information can be freely set by the developer, and the process of calculating each brightness parameter is not limited in this solution.

[0117] Step 802, determine the shooting scene where the first shooting module is located according to the target brightness information.

[0118] Optionally, the target brightness information obtained by the electronic device may be the image brightness information corresponding to the first preview image of the current frame. Based on this target brightness information, the shooting scene where the first shooting module is located is determined. For example, taking only the target brightness information including the LvIndex value as an example, corresponding preset thresholds may be set in advance in the electronic device. If the obtained target brightness information is greater than the preset threshold, it indicates that the brightness of the first preview image is low, and the scene brightness of the shooting scene where the current first shooting module is located is also lower than the first brightness threshold, that is, it is in the target shooting scene. If the obtained target brightness information is less than the preset threshold, it indicates that the brightness of the first preview image is high, and the scene brightness of the shooting scene where the current first shooting module is located is not lower than the first brightness threshold, that is, it is not in the target shooting scene. A similar method can also be used for the above cases where BV or Luma is used as the target brightness information, which will not be elaborated here.

[0119] Of course, if the target brightness information includes several of the above examples, in this solution, corresponding weights can be set in advance for the types included in the target brightness information. In the way of weighted summation, an index representing the scene brightness of the target shooting scene is calculated and compared with a preset index threshold to determine the shooting scene where the current first shooting module is located. No more examples will be given here.

[0120] In this solution, in order to improve the accuracy of determining that the shooting scene where the first shooting module is located is the target shooting scene, the electronic device can determine it in combination with the situation of M target brightness information recorded within a preset duration. M is an integer greater than 1, and the preset duration can be set in advance by developers in the electronic device. For example, the preset duration is 10 ms. During the shooting process of the electronic device, determining the shooting scene where the first shooting module is located according to the target brightness information can be as follows: Obtain M target brightness information recorded within 10 ms, and determine the shooting scene where the first shooting module is located according to the M target brightness information.

[0121] For example, for the original image data or the first preview image collected by the first shooting module of the electronic device, the electronic device will calculate the corresponding LvIndex value and store it. In this process, the image brightness information calculated for the original image data or the first preview image of the current frame and the ambient light brightness corresponding to the electronic device at the current frame moment can be obtained in real time. According to the above preset duration, obtain the target brightness information recorded each time within the preset duration before, obtain M target brightness information, and determine the shooting scene where the first shooting module is located according to the M target brightness information.

[0122] In a possible implementation, taking the M target brightness information obtained as the image brightness information corresponding to the first preview images of M frames as an example, the specific process for the electronic device to determine the shooting scene where the first shooting module is located based on the M target brightness information is as follows: Based on the image brightness information corresponding to each of the M first preview images, determine the shooting scene where the first shooting module is located. The M first preview images include the current frame first preview image and the M - 1 first preview images before the current frame first preview image.

[0123] Optionally, the way for the electronic device to determine the shooting scene where the first shooting module is located based on the image brightness information corresponding to each of the M first preview images can be as follows: The electronic device can calculate any one of the average value, the mode value, and the maximum value of the image brightness information corresponding to each of the M first preview images, and then based on the threshold corresponding to the image brightness information, determine whether the shooting scene where the first shooting module is located is the target shooting scene. Similar to the above detection process of the image brightness information and the corresponding preset threshold, still taking the LvIndex value as an example, if the average value of the LvIndex values corresponding to each of the M first preview images is higher than the preset threshold, it means that the brightness of the first preview image is lower, and the scene brightness of the current shooting scene where the first shooting module is located is also lower than the first brightness threshold, that is, it is in the target shooting scene. If the average value of the LvIndex values corresponding to each of the M first preview images is lower than the preset threshold, it means that the brightness of the first preview image is higher, and the scene brightness of the current shooting scene where the first shooting module is located is not lower than the first brightness threshold, that is, it is not in the target shooting scene. The same method can be used for other types of image brightness information, which will not be elaborated here.

[0124] In a possible implementation, there is also a target brightness condition set in the electronic device. The process for the electronic device to determine the shooting scene where the first shooting module is located based on the M target brightness information can be as follows: According to the M target brightness information and the target brightness condition, obtain the first frame number corresponding to the target brightness information that meets the target brightness condition among the M target brightness information; Determine the shooting scene where the first shooting module is located according to the ratio of the first frame number to M. Among them, the target brightness condition can be set by the developer in advance. That is to say, for the M target brightness information, the electronic device filters based on the preset target brightness condition, obtains each frame that meets the target brightness condition among them, and counts the total number of these frames (i.e., the first frame number). By calculating the ratio between the first frame number and M, the ratio of the first frame number to M is obtained, and then it is determined whether the shooting scene where the first shooting module is located is the target shooting scene.

[0125] In a possible implementation manner, the way for the electronic device to determine the shooting scene where the first shooting module is located according to the proportion of the first number of frames to M can be as follows: Determine the brightness proportion value according to the proportion of the first number of frames to M and the maximum brightness proportion. The maximum brightness proportion is the maximum brightness proportion value corresponding to the case where the first number of frames is equal to M; if the brightness proportion value is greater than the first brightness ratio threshold, it is determined that the shooting scene where the first shooting module is located is the target shooting scene; if the brightness proportion value is less than the second brightness ratio threshold, it is determined that the shooting scene where the first shooting module is located is not the target shooting scene; the first brightness ratio threshold is greater than the second brightness ratio threshold.

[0126] Please refer to Figure 9 , which shows a schematic structural diagram of the maximum brightness proportion of an electronic device according to an exemplary embodiment of the present application. As Figure 9 shown, it includes a loop detection window 901 and a preset brightness proportion range 902. The electronic device can obtain the target brightness information of the first M frames according to the size of the loop detection window 901, screen each first preview image that meets the target brightness condition in the M frames and count the corresponding first number of frames, calculate the proportion of the first number of frames to M, combine the pre-designed maximum brightness proportion, calculate the current brightness proportion value, and determine the shooting scene where the first shooting module is located by comparing the current brightness proportion value with the preset brightness proportion threshold.

[0127] In the above Figure 9 , use β to represent the currently calculated brightness proportion value, and the preset brightness proportion range is 0 to 100. Then, the maximum brightness proportion is 100, and the electronic device can calculate the current brightness proportion value according to the formula β = N / M * 100. Where N is the first number of frames.

[0128] Still taking the LvIndex value of each first preview image as the target brightness information as an example, after the electronic device obtains the LvIndex values corresponding to the M frames, it can screen out each first preview image with a value less than the preset darkness threshold (for example, 300), and the first number of frames counted is N. Then, the proportion of the first number of frames to the M frames calculated is N / M. In the example shown in the above Figure 9 , the first brightness ratio threshold is βH = 80, and the second brightness ratio threshold is βL = 20. If the currently calculated brightness proportion value is greater than 80, it means that the brightness is very dark and it is in the target shooting scene. If the currently calculated brightness proportion value is less than 20, it means that the brightness is very bright and it is not in the target shooting scene.

[0129] Optionally, in the electronic device, if the calculated brightness proportion value is not less than the second brightness ratio threshold and not greater than the first brightness ratio threshold, the working state of the second shooting module is controlled to remain unchanged. That is, the current working state of the second shooting module is maintained.

[0130] For example, when the shooting scene where the first shooting module is located changes from bright to dark, the LvIndex value of each frame will gradually increase. The above N represents the number of elements whose LvIndex value is below the preset darkness threshold, and N will also gradually increase. Figure 9 The brightness ratio value β in will increase from low to high until it reaches 100. In this solution, it is set that if the electronic device wants to control the working state of the second shooting module to be the on state, the brightness ratio value β needs to be greater than 80, that is, the "on threshold" is set as βH = 80. When it is detected that β exceeds βH, it means that the shooting scene where the first shooting module is located is dark enough, and the second shooting module can be turned on for assistance. When the shooting scene where the first shooting module is located changes from dark to bright, the LvIndex value of each frame will gradually decrease, and the above N will also gradually decrease, and β will gradually decrease. Figure 9 The brightness ratio value β in will decrease from high to low until it reaches 0. In this solution, it is set that if the electronic device wants to control the working state of the second shooting module to be the on state, the brightness ratio value β needs to be lower than 20. The "off threshold" is set as βL = 20. When it is detected that β is lower than βL, it means that the shooting scene where the first shooting module is located is bright enough, and the second shooting module can be turned off (that is, the second shooting module is not needed for assistance). Of course, if the calculated β is within the range of (βL, βH), the working state of the second shooting module is controlled to remain the same as the previous state without change.

[0131] Please refer to Figure 10 , which shows a schematic flowchart of a method for an electronic device to detect whether the shooting scene where the first shooting module is located is the target shooting scene based on the brightness ratio value in an exemplary embodiment of the present application. As Figure 10 shown, the method may include the following steps:

[0132] Step 1001, cumulatively obtain the first preview images.

[0133] Step 1002, detect whether there are more than M first preview images.

[0134] If so, execute step 1003; if not, return to step 1001.

[0135] Step 1003, obtain the LvIndex value of each of the first M preview images including the current frame, count N that meets the conditions, and calculate the current brightness ratio value β = N / M * 100.

[0136] Step 1004, detect β >= βH.

[0137] If so, execute step 1006; otherwise, execute step 1005.

[0138] Step 1005, detect β <= βL.

[0139] If so, execute step 1007; otherwise, execute step 1008.

[0140] Step 1006: Control the working state of the second shooting module to be the on state.

[0141] Step 1007: Control the working state of the second shooting module to be the off state.

[0142] Step 1008: Maintain the working state of the second shooting module.

[0143] That is, maintain the current working state of the second shooting module. In step 1008, if the current working state of the second shooting module is the on state, then it is the on state; if the current working state of the second shooting module is the off state, then it is the off state.

[0144] Optionally, in the electronic device, if the initial working state of the second shooting module is the off state, then through the above detection process, if the LvIndex fluctuates due to the change of the surrounding environment, it will cause the change of β. Based on the process from step 1004 to step 1008, the change of the working state of the second shooting module can be flexibly controlled.

[0145] Optionally, in the above Figure 10 It is also an example where the image brightness information is the darkness value corresponding to the first preview image, and the target brightness condition is less than the preset darkness threshold. In practical applications, different target brightness conditions need to be set for different image brightness information; therefore, in the electronic device, the target brightness conditions corresponding to different image brightness information can be stored in advance, and the target brightness conditions corresponding to different image brightness information are different. For example, the target brightness condition for the darkness value corresponding to the first preview image is less than the preset darkness threshold; the target brightness condition for the BV value corresponding to the first preview image is greater than the preset BV threshold; the target brightness condition for the brightness value corresponding to the first preview image is greater than the preset brightness threshold. The actual values of different thresholds in this solution are not limited.

[0146] In a possible implementation manner, the electronic device can also determine the shooting scene where the first shooting module is located according to the following method based on M target brightness information: The electronic device determines a brightness index value according to the M target brightness information, and the brightness index value includes any one of the average value, the mode value, and the maximum value of the M target brightness information; and determines the shooting scene where the first shooting module is located according to the target index range to which the brightness index value belongs.

[0147] Optionally, in addition to detecting according to the above brightness ratio value, corresponding brightness index values can also be calculated for the obtained M target brightness information. That is, the electronic device can obtain the corresponding average value according to the M target brightness information and use the average value as the brightness index value of the scene brightness where the first shooting module is located; or, according to the M target brightness information, obtain the mode value corresponding to the M target brightness information and use the mode value as the brightness index value of the scene brightness where the first shooting module is located; or, according to the first M target brightness information, obtain the maximum value corresponding to the M target brightness information and use the maximum value as the brightness index value of the scene brightness where the first shooting module is located.

[0148] According to the calculated brightness index value and the target index range, it is determined whether it is in the target shooting scene. Among them, different target brightness information is also set with different target index ranges. For example, the target index range is a range corresponding to being greater than the preset index value. That is, if the obtained brightness index value is within this target index range, it is determined that the scene brightness where the first shooting module is located is the target shooting scene. If the obtained brightness index value is not within this target index range, it is determined that the scene brightness where the first shooting module is located is not the target shooting scene. Optionally, the specific detection process can be based on threshold detection or detection based on the index range into which it falls. This solution does not limit this.

[0149] In summary, in this solution, the electronic device can detect the shooting scene where the first shooting module is located based on the above various methods. In the calculation method of the brightness ratio value, the first brightness ratio threshold and the second brightness ratio threshold are set in advance, and the working state of the second shooting module is switched only when it exceeds the brightness ratio range composed of the first brightness ratio threshold to the second brightness ratio threshold, rather than simply controlling in the way of a fixed threshold like other methods. This can avoid repeatedly controlling the opening and closing of the second shooting module in the case of brightness fluctuations in the external environment, reduce the power consumption increment caused by unnecessary opening, reduce the unnecessary opening of the second shooting module, save the power consumption of the electronic device, and improve the judgment accuracy.

[0150] In a possible implementation manner, in this solution, the shooting preview interface displayed by the electronic device further includes a floating window, and when the second preview image is displayed, it is displayed in this floating window, so as to achieve the effect of simultaneously displaying the first preview image and the second preview image.

[0151] Next, in combination with the judgment logic of whether the floating window is turned on, the above embodiments will be illustrated by examples. Please refer to Figure 11 , which shows a flowchart of a method for image preview provided by an exemplary embodiment of the present application. This method for image preview can be applied to an electronic device. As Figure 11As shown, the image preview method may include the following steps:

[0152] Step 1101: Obtain a first preview image captured by a first shooting module, and display the first preview image in a shooting preview interface.

[0153] Optionally, the manner of displaying the first preview image in this step may be the same as that in step 401 above, and will not be elaborated here.

[0154] Step 1102: If the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and less than a second zoom threshold, then identify the first preview image.

[0155] In this embodiment, when the electronic device detects that the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and less than the second zoom threshold, it may first identify the first preview image. The identification process may refer to the content in the above Figure 6 embodiment on how to identify the target object specifically, and will not be elaborated here.

[0156] Optionally, taking the first zoom threshold as 10 and the second zoom threshold as 15 as an example, in this solution, when it is determined that the zoom ratio corresponding to the first shooting module is between 10 and 15, the step of identifying the first preview image may be executed.

[0157] Step 1103: If a target object is identified in the first preview image, then display a floating frame in the shooting preview interface.

[0158] Step 1104: If the zoom ratio corresponding to the first shooting module is not greater than the first zoom threshold, or no target object is identified in the first preview image, then do not display the floating frame in the shooting preview interface, and control the working state of the second shooting module to be the off state.

[0159] Optionally, based on the recognition result of identifying the target object in the first preview image, if a target object is identified in the first preview image, the electronic device controls the floating frame to be displayed in the shooting preview interface; if there is no target object, the floating frame may not be displayed.

[0160] For example, taking the target object as the moon and the target shooting scene as a low-light scene where the scene brightness is lower than a preset brightness threshold, that is, usually, at night, the target shooting scene is satisfied. When the electronic device shoots the moon, it usually needs to adjust the zoom ratio to 20 or even higher. Through the process of this solution, it is possible to combine the size of the zoom ratio and the recognition of whether there is a target object to determine the enabling of the floating frame and whether to display the floating frame in the shooting preview interface.

[0161] Step 1105, when the first shooting module is in the target shooting scene, control the working state of the second shooting module to be on, and obtain a second preview image collected by the second shooting module.

[0162] Optionally, this embodiment is equivalent to a process of further determining whether the first shooting module is in the target shooting scene on the premise that it is determined that the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and less than the second zoom threshold, and the target object is recognized. When the first shooting module is in the target shooting scene, the second shooting module can be turned on so that the second shooting module can work, obtain the second preview image, and display the second preview image in the floating window.

[0163] Step 1106, display the second preview image in the floating window.

[0164] Optionally, the electronic device can generate the second preview image based on the original image data collected by the second shooting module as follows: crop the original image collected by the second shooting module to obtain the second preview image corresponding to the target focal length. The target focal length can be set in the electronic device by the developer or the user, and the target focal length is greater than the original focal length of the original image data collected by the second shooting module.

[0165] For example, for an electronic device, the original focal length of the original image data collected by the second shooting module is 1X, and the target focal length can be set to values such as 3X, 6X, 10X, etc. Taking 3X as an example, the electronic device can crop the original image data collected by the second shooting module from 1X to 3X. Please refer to Figure 12 , which shows a comparison diagram when cropping the 1X FOV to 3X FOV according to an exemplary embodiment of the present application. Among them, Figure 12 (a) shows the sizes corresponding to the field of view (FOV) at various focal lengths. If cropping from 1X to 3X, an image range of size 12(b) is obtained, and the cropped second preview image is displayed in the floating window.

[0166] Please refer to Figure 13 , which shows a schematic diagram of a shooting preview interface according to an exemplary embodiment of the present application. As Figure 13 shown, it includes the displayed first preview image 1301, second preview image 1302, floating window 1303, foreground content 1304, and target object 1305. In Figure 13 , the zoom ratio of the first shooting module of the electronic device is greater than the first zoom threshold and less than the second zoom threshold, and the first preview image 1301 contains the target object 1305 and is in the target shooting scene, then it is displayed as Figure 13Each content included in the displayed shooting preview interface. A first preview image 1301 is displayed in the preview area, a floating frame 1303 is also displayed on the preview area, and a second preview image 1302 is displayed in the floating frame. Combining Figure 13 Looking at the magnified content of the second preview image 1302 displayed in the floating frame 1303 in [reference], in the second preview image 1302, in addition to including the target object 1305, it also includes foreground content (leaves) 1304. Optionally, the position of the second preview image on the screen can be dragged arbitrarily, which is not limited here.

[0167] That is to say, in the shooting preview interface of this solution, when the zoom ratio of the first shooting module of the electronic device is greater than the first zoom threshold and less than the second zoom threshold and is in the target shooting scene, in addition to the first preview image obtained by the first shooting module after reducing AE, a second preview image obtained by the second shooting module with a larger field of view angle can also be displayed in the floating frame. The foreground content that cannot be displayed due to insufficient brightness in the first preview image after reducing AE can be obtained by the second shooting module and displayed in the floating frame, allowing the user to clearly see the foreground content, facilitating the user's composition and improving the user's shooting experience.

[0168] In a possible implementation manner, the above target focal length can also be set by the user independently. For example, the electronic device can respond to a trigger operation on the floating frame of the shooting preview interface to display a composition setting interface. The composition setting interface includes setting controls for setting the focal length of the image displayed in the floating frame; in response to a setting operation on the setting controls in the composition setting interface, the selected target focal length is determined. For example, the user can perform trigger operations such as clicking or long-pressing in the area of the floating frame, causing the electronic device to display the composition setting interface and select the focal length that the user wants to set. Finally, the electronic device can use the focal length selected by the user as the target focal length and use the target focal length selected by the user during the above cropping process.

[0169] Please refer to Figure 14 , which shows an interface schematic diagram of a composition setting interface related to an exemplary embodiment of the present application. As Figure 14 shown, it includes a composition setting interface 1401, setting controls 1402, a target focal length 1403, and a confirmation control 1404. The user can click on the Figure 13 shown floating frame, causing the electronic device to display the Figure 14 shown interface. The user further clicks on the Figure 14Trigger the setting control corresponding to the target focal length 1403, select the corresponding focal length (for example, 6X), and trigger the confirmation control 1404. The electronic device will use the focal length 6X selected by the user as the target focal length. During the above-mentioned cropping process, the 1X FOV collected by the second shooting module is cropped to 6X FOV and displayed in the floating window.

[0170] In summary, in the electronic device, obtain the first preview image collected by the first shooting module and display the first preview image in the shooting preview interface; when the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and in the target shooting scene, obtain the second preview image through the second shooting module and simultaneously display the second preview image in the shooting preview interface. The field of view angle of the second shooting module is greater than that of the first shooting module. In this solution, after the electronic device captures the first preview image through the first shooting module and displays it in the shooting preview interface, it judges the current zoom ratio and shooting scene corresponding to the first shooting module. If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and in the target shooting scene, obtain the second preview image through the second shooting module with a larger field of view angle and simultaneously display it in the shooting preview interface, so that a closer object can also be captured by the second shooting module, and a certain brightness can be compensated for the closer object through the second shooting module, so that the brightness difference between the first preview image captured by the first shooting module and the second preview image captured by the second shooting module is smaller when the zoom ratio is greater than the first zoom threshold and in the target shooting scene, the contrast between the two is smaller, and the displayed effects in the electronic device are more similar, improving the consistency of the shooting effect of the electronic device and enhancing the shooting experience of the user.

[0171] Optionally, in the content of the floating window displayed in the above shooting preview interface, when the electronic device is performing the above series of judgment processes and the floating window needs to be displayed but the processes of identifying the target shooting scene, target object, etc. have not been completed, the first preview image can be defaultly displayed in the floating window first. When it is determined that the second shooting module needs to be turned on and the second preview image needs to be displayed, the first preview image is replaced with the second preview image to improve the coherence of the preview image display in the floating window.

[0172] Please refer to Figure 15 , which shows the flowchart of a method for image preview provided by an exemplary embodiment of the present application. This method for image preview can be applied to an electronic device. As Figure 15 shown, this method for image preview may include the following steps:

[0173] Step 1501, obtain the first preview image collected by the first shooting module and display the first preview image in the shooting preview interface.

[0174] Optionally, the manner of displaying the first preview image in this step may be the same as that in step 401 above, and will not be elaborated here.

[0175] Step 1502: If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold, identify the first preview image.

[0176] In this embodiment, when the electronic device detects that the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold, it can first identify the first preview image. The identification process can refer to the above Figure 6 embodiment for the specific content of how to identify the target object, which will not be elaborated here.

[0177] Optionally, taking the first zoom threshold as 10 as an example, in this solution, when it is determined that the zoom ratio corresponding to the first shooting module is greater than 10, the step of identifying the first preview image can be executed. Combining the above 14 embodiments, the identification of the first preview image can be triggered when the zoom ratio corresponding to the first shooting module is greater than 10, or can be triggered when it is determined that the zoom ratio corresponding to the first shooting module is between 10 and 15.

[0178] Optionally, the electronic device further includes a target storage area; after obtaining the first preview image collected by the first shooting module, the electronic device can also copy the first preview image and store the copied first preview image in the target storage area; when performing the identification of the first preview image, it is the first preview image stored in the target storage area that is identified.

[0179] Please refer to Figure 16 which shows a data flow diagram of generating a preview image by a shooting module in an electronic device according to an exemplary embodiment of the present application. As Figure 16 shown, it includes a data flow diagram 1601 of the first preview image, a data flow diagram 1602 of the second preview image, a target storage area 1603, and an ASD module 1604. Among them, the data flow diagram 1601 of the first preview image includes the process of the electronic device performing a series of processes on the original image data collected by the first shooting module to obtain the first preview image, and the data flow diagram 1602 of the second preview image includes the process of the electronic device performing a series of processes on the original image data collected by the second shooting module to obtain the second preview image.

[0180] Optionally, in this solution, the first preview image obtained by the first shooting module through a series of processes is represented as a Master image, and the second preview image obtained by the second shooting module through a series of processes is represented as a Salve image. During the data stream schematic 1601 process of the above first preview image, in addition to being given to the APP layer for display (corresponding to the display of the first preview image in the shooting preview interface), the electronic device can also let OFE1 output another copy of the Master image (duplicate) and store it in the target storage area 1603. During the data stream schematic 1602 process of the above second preview image, the Salve image output by OFE2 can also be stored in the target storage area 1603 first.

[0181] Optionally, if the ASD module 1604 is deployed in the APS, first identify based on the Master image in the target storage area 1603, and the electronic device selects the execution of subsequent steps based on the recognition result. Of course, if the ASD module 1604 is deployed in the HAL layer, the process of data flowing from the HAL to the APS can be reduced. The ASD module 1604 can obtain the Master image output by the IPE2 in the HAL layer for recognition and output the corresponding recognition result to the electronic device.

[0182] Optionally, before recognizing the first preview image, the electronic device can also obtain the attitude parameter of the electronic device, and the attitude parameter is used to indicate the movement direction of the electronic device; if the attitude parameter meets the preset attitude range, recognize the first preview image. Optionally, the attitude parameter can be obtained based on one or more of the acceleration sensor, gravity sensor, etc. of the electronic device. For example, in this solution, the electronic device can also combine the GSensor gravity sensor to judge the pitch attitude of the electronic device. If the attitude parameter corresponding to the pitch attitude is within the preset attitude range, then execute the process of recognizing the target object in the first preview image.

[0183] For example, taking the target object as the moon, when the user takes a picture of the moon, usually the electronic device needs to be oriented towards the moon, so the orientation of the first shooting module of the electronic device needs to be adjusted to the range where the moon can be photographed. During this change process, the attitude parameter of the electronic device can be obtained by detecting the gravity sensor or the acceleration sensor. Recognizing that it is within the preset attitude range indicates that the user raises the hand to take a picture of the moon, and then controls the activation of the ASD process for recognizing the target object.

[0184] Step 1503, if the target object is not recognized, control the working state of the second shooting module to be in the off state.

[0185] Step 1504, display the first preview image in the floating window of the shooting preview interface.

[0186] Optionally, in combination with the above Figure 16 As shown in the data stream, the electronic device can first default to display the first preview image stored in the target storage area in the floating window of the shooting preview interface. After the ASD recognition is completed, if the second preview image needs to be displayed in the floating window, the first preview image displayed in the floating window can be replaced with the second preview image stored in the target storage area.

[0187] Step 1505, if the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and not in the target shooting scene, display the first preview image in the floating window of the shooting preview interface.

[0188] Optionally, if it is detected that the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold, but subsequently it is detected that the first shooting module is not in the target shooting scene, then the second shooting module still does not need to be activated, and the first preview image is still temporarily displayed in the floating window of the shooting preview interface.

[0189] Step 1506, if the target object is recognized, replace the first preview image displayed in the floating window with the second preview image stored in the target storage area.

[0190] It should be noted that the various embodiments shown in this solution can be combined with each other or replaced to achieve the effect of displaying the shooting preview interface in the electronic device.

[0191] In addition, for the shooting controls displayed in the shooting preview interface involved in the above various embodiments, the electronic device can also respond to the trigger operation on the shooting control, generate a target shooting image according to the first preview image and the second preview image. The foreground content in the target shooting image is generated based on the second preview image, and the background content in the target shooting image is generated based on the first preview image. That is, in this solution, the first preview image can be used for the composition of the foreground content, and the second preview image can be used for the composition of the background content.

[0192] In summary, in an electronic device, a first preview image collected by a first shooting module is obtained and displayed in a shooting preview interface; when the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and in a target shooting scene, a second preview image is obtained by a second shooting module and the second preview image is simultaneously displayed in the shooting preview interface, and the field of view angle of the second shooting module is greater than that of the first shooting module. In this solution, after the electronic device captures the first preview image through the first shooting module and displays it in the shooting preview interface, it judges the current zoom ratio and shooting scene corresponding to the first shooting module. If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and in a target shooting scene, a second preview image is obtained by the second shooting module with a larger field of view angle and is simultaneously displayed in the shooting preview interface, so that a closer object can also be captured by the second shooting module, and a certain brightness can be compensated for the closer object by the second shooting module, making the brightness difference between the first preview image captured by the first shooting module and the second preview image captured by the second shooting module smaller, the contrast between the two smaller, and the displayed effects in the electronic device more similar, improving the consistency of the shooting effect of the electronic device and enhancing the shooting experience of the user.

[0193] Next, taking the electronic device as a mobile phone, the target object as the moon, the first shooting module as the telephoto lens module of the mobile phone, and the second shooting module as the wide-angle lens module of the mobile phone as an example, an example introduction of the combined solution of the above embodiments will be given.

[0194] Please refer to Figure 17 , which shows a flowchart of an image preview method provided by an exemplary embodiment of the present application. The image preview method can be applied to an electronic device. As Figure 17 shown, the image preview method may include the following steps:

[0195] Step 1701, enter the shooting interface.

[0196] Optionally, the user can enter the corresponding shooting interface by clicking on the camera application. The specific shooting interface can refer to the schematic diagrams of the above shooting interfaces and will not be elaborated here.

[0197] Step 1702, obtain a first preview image through the telephoto lens module and display the first preview image in the shooting preview interface.

[0198] Step 1703, obtain the zoom ratio of the telephoto lens module.

[0199] Step 1704, detect whether the zoom ratio of the telephoto lens module is less than 10.

[0200] If so, perform step 1705; otherwise, do not display the floating window.

[0201] Step 1705: Detect whether the zoom ratio of the telephoto lens module is less than 15.

[0202] If so, perform step 1706; otherwise, perform step 1707.

[0203] Step 1706: Identify the first preview image and detect whether the moon is identified in the first preview image.

[0204] If there is a moon in the first preview image, perform step 1707; otherwise, perform step 1707.

[0205] Step 1707: Display the floating window and also display the first preview image in the floating window.

[0206] Optionally, in this embodiment, the focal length corresponding to the zoom ratio within 10 to 15 is the medium telephoto focal length range. When shooting the night moon in this focal length range, there is a difficulty that the foreground in the floating window is too dark to compose a picture. Therefore, the action of identifying the first preview image can be performed within this focal length range. If it is in the telephoto focal length range above 15, the action of identifying the first preview image can be directly skipped, and step 1707 and subsequent steps can be directly performed.

[0207] Step 1708: Detect whether the shooting scene where the telephoto lens module is located is a low-light scene.

[0208] Among them, the low-light scene is equivalent to the target shooting scene in the above embodiment. If so, perform step 1709; otherwise, control the wide-angle lens module to remain closed and continue to perform step 1707. Optionally, the control to close the wide-angle lens module can also be performed in parallel when the respective conditions in the above steps 1704, 1705, and 1706 are not met. This solution does not limit this.

[0209] When it is detected that the shooting scene is not a low-light scene, that is, the mobile phone faces a scene with sufficient foreground brightness, such as in the morning or evening. At this time, although the user is shooting the moon and the previous conditions are all met, since the foreground brightness is sufficient, there is no need to activate the wide-angle lens module as an auxiliary. That is, at this time, the brightness of the first preview image in the shooting preview interface is relatively high. If a new wide-angle lens module is added, without bringing any beneficial effects, it will instead cause a significant temperature increase and power consumption waste.

[0210] Please refer to Figure 18 which shows a schematic diagram of an interface of a shooting preview interface according to an exemplary embodiment of the present application. As Figure 18As shown, it includes the first preview image 1801, the floating frame 1802, and the second preview image 1803. Among them, both the first preview image 1801 and the second preview image 1803 are obtained based on the original image data collected by the telephoto lens module. For example, in the above Figure 16 , the generated Master image can be scaled by IPE1 and output to the preview area as the first preview image 1801 to be displayed. The copied Master image stored in the target storage area can be scaled by IPE2 and output to the floating frame for display in the floating frame 1802. In this case where other conditions are met but it is not a low-light scene, although the floating frame can continue to be displayed, the content displayed is the first preview image.

[0211] Step 1709, turn on the wide-angle lens module.

[0212] Optionally, the above specific detection process and the determination of the low-light scene can be combined with the content in the above various embodiments, which will not be elaborated here.

[0213] Please refer to Figure 19 , which shows a schematic interface diagram of an interface for triggering a shooting control to generate a target shooting image in a shooting preview interface according to an exemplary embodiment of the present application. In Figure 19 , after a series of judgment detections by the mobile phone, it is determined that the shooting preview interface 1900 to be displayed in the shooting preview interface and with the wide-angle lens module turned on includes the first preview image 1901, the second preview image 1902, the target object 1903, and the foreground content 1904. After the user triggers the shooting control 1905, the target shooting image 1906 can be obtained, and the target object 1903 and the foreground content 1904 are also included in the target shooting image 1906. Through the process of this solution, when the user uses the mobile phone to shoot the moon, the second preview image collected by the wide-angle lens module can be displayed in the floating frame and composition can be carried out in the floating frame (clear foreground content can be seen in the floating frame). Combining that the user can independently adjust the target focal length, the user can freely compose the picture, zoom in or out, achieving the effect that the user can see the moon main body with light and dark details and the foreground content in the shooting preview interface 1900, that is, not only seeing the moon with light and dark details and texture features, but also the surrounding foreground content (leaves) can be seen clearly in the floating frame. Compared with the shooting process in the above Figure 3 , it avoids the abrupt feeling brought by the foreground leaves not being displayed in the preview image but appearing in the final photo. That is, in this solution, when the user triggers the shooting control 1905 to take a photo, the same content also exists in the target shooting image 1906 after shooting. Because these contents have been displayed in the shooting preview interface before taking the photo, the user will not have a visual "false feeling".

[0214] In summary, for different focal lengths, a comprehensive method is formulated through the brightness information of the moon scene picture, scene detection, etc. to decide whether to trigger the floating frame and whether to activate the wide-angle lens module for auxiliary composition. It can limit the trigger enable to specific moon scene shooting occasions, effectively improve the experience of moon scene shooting interaction, and reduce the power consumption increment caused by the opening of unnecessary scenes.

[0215] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the method embodiment of the present application.

[0216] Please refer to Figure 20 , which shows a structural block diagram of an image preview device provided by an exemplary embodiment of the present application. The image preview device 2000 can be used in an electronic device to execute all or part of the steps executed by the electronic device in the methods provided by the above various illustrated embodiments. The image preview device 2000 includes:

[0217] A first display module 2001, configured to obtain a first preview image through a first shooting module and display the first preview image in a shooting preview interface;

[0218] A second display module 2002, configured to obtain a second preview image through a second shooting module and simultaneously display the second preview image in the shooting preview interface when the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and in a target shooting scene, and a field of view angle of the second shooting module is greater than a field of view angle of the first shooting module.

[0219] In summary, in an electronic device, a first preview image collected by a first shooting module is obtained and displayed in a shooting preview interface; when the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and the device is in a target shooting scene, a second preview image is obtained by a second shooting module and simultaneously displayed in the shooting preview interface, and the field of view angle of the second shooting module is greater than that of the first shooting module. In this solution, after the electronic device captures the first preview image through the first shooting module and displays it in the shooting preview interface, it judges the current zoom ratio and shooting scene corresponding to the first shooting module. If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and the device is in a target shooting scene, a second preview image is obtained by the second shooting module with a larger field of view angle and simultaneously displayed in the shooting preview interface, so that a closer object can still be captured by the second shooting module, and the second shooting module can compensate a certain amount of brightness for the closer object, making the brightness difference between the first preview image captured by the first shooting module and the second preview image captured by the second shooting module smaller when the zoom ratio is greater than the first zoom threshold and the device is in a target shooting scene, the contrast between the two is smaller, and the displayed effects in the electronic device are more similar, improving the consistency of the shooting effect of the electronic device and enhancing the shooting experience of the user.

[0220] Optionally, the second display module 2002 is further configured to:

[0221] When the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and the device is in a target shooting scene, control the working state of the second shooting module to be in an on state, and obtain the second preview image collected by the second shooting module.

[0222] Optionally, the device further includes:

[0223] A first control module, configured to control the working state of the second shooting module to be in an off state when the zoom ratio corresponding to the first shooting module is not greater than the first zoom threshold or the device is not in a target shooting scene.

[0224] Optionally, the device further includes:

[0225] A first determination module, configured to, before obtaining the second preview image through the second shooting module, when the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold, identify the first preview image, and if a target object is identified, determine whether the shooting scene where the first shooting module is located is the target shooting scene;

[0226] The second control module is used to control the working state of the second shooting module to be in a closed state if the target object is not recognized or the device is not in the target shooting scene.

[0227] Optionally, the device further includes:

[0228] The first acquisition module is used to acquire target brightness information before acquiring the second preview image through the second shooting module, where the target brightness information includes the image brightness information corresponding to the first preview image and / or the ambient light brightness corresponding to the electronic device.

[0229] The second determination module is used to determine the shooting scene where the first shooting module is located according to the target brightness information.

[0230] Optionally, the second determination module includes: a first determination unit;

[0231] The first determination unit is used to determine the shooting scene where the first shooting module is located according to M pieces of target brightness information, where the M pieces of target brightness information are recorded within a preset time period, and M is an integer greater than 1.

[0232] Optionally, the M pieces of target brightness information are the image brightness information corresponding to M frames of the first preview image, and the first determination unit is further used to:

[0233] Determine the shooting scene where the first shooting module is located according to the image brightness information corresponding to each of the M frames of the first preview image, where the M frames of the first preview image include the current frame of the first preview image and M-1 frames of the first preview image before the current frame of the first preview image.

[0234] Optionally, the first determination unit is further used to:

[0235] According to the M pieces of target brightness information and the target brightness condition, obtain the first number of frames corresponding to the target brightness information that meets the target brightness condition among the M pieces of target brightness information;

[0236] Determine the shooting scene where the first shooting module is located according to the ratio of the first number of frames to M.

[0237] Optionally, the determining the shooting scene where the first shooting module is located according to the ratio of the first number of frames to M includes:

[0238] Determine a brightness ratio value according to the ratio of the first number of frames to M and the maximum brightness ratio, where the maximum brightness ratio is the maximum value corresponding to the case where the first number of frames is equal to M;

[0239] If the brightness ratio value is greater than the first brightness ratio threshold, it is determined that the shooting scene where the first shooting module is located is the target shooting scene;

[0240] If the brightness ratio value is less than the second brightness ratio threshold, it is determined that the shooting scene where the first shooting module is located is not the target shooting scene; the first brightness ratio threshold is greater than the second brightness ratio threshold.

[0241] Optionally, the device further includes:

[0242] A third control module, configured to control the working state of the second shooting module to remain unchanged if the brightness ratio value is not less than the second brightness ratio threshold and not greater than the first brightness ratio threshold.

[0243] Optionally, the image brightness information corresponding to the first preview image includes at least one of the darkness value corresponding to the first preview image, the BV value corresponding to the first preview image, and the brightness value corresponding to the first preview image.

[0244] Optionally, different target brightness conditions correspond to different image brightness information;

[0245] Among them, the target brightness condition for the darkness value corresponding to the first preview image is less than a preset darkness threshold; the target brightness condition for the BV value corresponding to the first preview image is greater than a preset BV threshold; the target brightness condition for the brightness value corresponding to the first preview image is greater than a preset brightness threshold.

[0246] Reliably, the first determination unit is further configured to:

[0247] Determine a brightness index value according to the M target brightness information, where the brightness index value includes any one of the average value, the mode value, and the maximum value of the M target brightness information;

[0248] Determine the shooting scene where the first shooting module is located according to the target index range to which the brightness index value belongs.

[0249] Optionally, the second display module is further configured to:

[0250] Display a floating frame in the shooting preview interface and display the second preview image in the floating frame.

[0251] Optionally, the device further includes:

[0252] A first recognition module, configured to recognize the first preview image if the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and less than the second zoom threshold before displaying a floating frame in the shooting preview interface;

[0253] Displaying a floating frame in the shooting preview interface includes:

[0254] If a target object is recognized in the first preview image, the floating frame is displayed in the shooting preview interface.

[0255] Optionally, the device further includes:

[0256] A fourth control module, configured to, if the zoom ratio corresponding to the first shooting module is not greater than the first zoom threshold, or the target object is not recognized in the first preview image, not display the floating frame in the shooting preview interface, and control the working state of the second shooting module to be the off state.

[0257] Optionally, the device further includes:

[0258] A third display module, configured to, if the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and not in the target shooting scene, display the first preview image in the floating frame of the shooting preview interface.

[0259] Optionally, the device further includes:

[0260] A second recognition module, configured to, if the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold, recognize the first preview image;

[0261] A fifth control module, configured to, if the target object is not recognized, control the working state of the second shooting module to be in the off state;

[0262] A fourth display module, configured to display the first preview image in the floating frame of the shooting preview interface.

[0263] Optionally, the electronic device further includes a target storage area;

[0264] The device further includes:

[0265] A first storage module, configured to, after acquiring the first preview image collected by the first shooting module, copy the first preview image and store the copied first preview image in the target storage area;

[0266] A fifth display module, configured to display the first preview image stored in the target storage area in the floating frame of the shooting preview interface;

[0267] The recognizing the first preview image includes:

[0268] Identify the first preview image stored in the target storage area.

[0269] Optionally, the second display module is further configured to:

[0270] If the target object is identified, replace the first preview image displayed in the floating frame with the second preview image stored in the target storage area.

[0271] Optionally, the device further includes:

[0272] A second acquisition module, configured to acquire the attitude parameter of the electronic device before identifying the first preview image, where the attitude parameter is used to indicate the movement direction of the electronic device;

[0273] The identifying the first preview image includes:

[0274] If the attitude parameter meets the preset attitude range, identify the first preview image.

[0275] Optionally, the device further includes:

[0276] A sixth display module, configured to display a composition setting interface in response to a trigger operation on the floating frame of the shooting preview interface, where the composition setting interface includes setting controls for setting the focal length of the image displayed in the floating frame;

[0277] A third determination module, configured to determine the selected target focal length in response to a setting operation on the setting control in the composition setting interface;

[0278] The obtaining the second preview image by the second shooting module includes:

[0279] Crop the raw image collected by the second shooting module to obtain the second preview image corresponding to the target focal length.

[0280] Optionally, in the electronic device, the data processing engine for processing the raw image collected by the first shooting module is different from the data processing engine for processing the raw image collected by the second shooting module.

[0281] Optionally, the shooting preview interface includes shooting controls, and the device further includes:

[0282] A first generation module, configured to generate a target shooting image based on the first preview image and the second preview image in response to a trigger operation on the shooting control, where the foreground content in the target shooting image is generated based on the second preview image, and the background content in the target shooting image is generated based on the first preview image.

[0283] Please refer to Figure 21 , which is a schematic structural diagram of another example of the image preview device provided in the embodiments of the present application. Among them, the image preview device 2100 may be an electronic device, and the electronic device can implement the functions in the method provided in the embodiments of the present application. Among them, the image preview device 2100 may be a chip system. In the embodiments of the present application, the chip system may be composed of chips, or may include chips and other discrete devices.

[0284] In terms of hardware implementation, the above communication module may be a transceiver, and the transceiver is integrated in the image preview device 2100 to form a communication interface 2103.

[0285] The image preview device 2100 includes at least one processor 2101, which is used to implement or support the image preview device 2100 to implement the functions of the electronic device in the method provided in the embodiments of the present application. Exemplarily, the processor 2101 may execute to obtain the first preview image collected by the first shooting module and display the first preview image in the shooting preview interface; when the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and in the case of the target shooting scene, obtain the second preview image through the second shooting module and simultaneously display the second preview image in the shooting preview interface, etc. For specific details, please refer to the detailed description in the method example, which will not be elaborated here.

[0286] The image preview device 2100 may further include at least one memory 2102, which is used to store program instructions and / or data. The memory 2102 is coupled to the processor 2101. The coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, which may be electrical, mechanical or other forms, and is used for information interaction between devices, units or modules. The processor 2101 may cooperate with the memory 2102. The processor 2101 may execute the program instructions stored in the memory 2102. At least one of the at least one memories may be included in the processor.

[0287] The image preview device 2100 may further include a communication interface 2103, which is used to communicate with other devices through a transmission medium, so that the devices in the image preview device 2100 can communicate with other devices. Exemplarily, the other device may be a network-side device. The processor 2101 may use the communication interface 2103 to send and receive data. The communication interface 2103 may specifically be a transceiver.

[0288] In the embodiments of the present application, the specific connection medium between the above communication interface 2103, processor 2101, and memory 2102 is not limited. The embodiments of the present application are in Figure 21In the Zhongyi device, a memory 2102, a processor 2101, and a communication interface 2103 are connected through a bus 2104. The bus is represented by a thick line in Figure 21 the figure. The connection manners between other components are only for illustrative purposes and are not limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 21 only one thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.

[0289] In the embodiments of the present application, the processor 2101 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.

[0290] In the embodiments of the present application, the memory 2102 can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or can also be a volatile memory, such as a random-access memory (RAM). The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiments of the present application can also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.

[0291] Optionally, the embodiments of the present application further provide an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, all or part of the steps performed by the electronic device in the image preview methods of the above various embodiments are implemented.

[0292] Optionally, the embodiments of the present application further provide a computer-readable medium, on which a computer program is stored. When the computer program is executed by a processor, all or part of the steps performed by the electronic device in the image preview methods of the above various embodiments are implemented.

[0293] Optionally, an embodiment of the present application further provides a chip, on which a computer program that can run is included. When the chip executes the computer program, all or part of the steps performed by the electronic device in the image preview method of each of the above embodiments are implemented.

[0294] Optionally, an embodiment of the present application further provides a computer program product, including a computer program, which implements the image preview method of each of the above embodiments when the computer program is processed and executed.

[0295] Optionally, an embodiment of the present application further provides an application publishing platform, which is used to publish a computer program product. When the computer program product runs on a computer, the computer is caused to execute all or part of the steps performed by the electronic device in the image preview method of each of the above embodiments.

[0296] It should be noted that: when the device provided in the above embodiment executes the control of the electronic device, only the division of the above function modules is used for illustration. In actual application, the above functions can be allocated to different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the method embodiment belong to the same concept, and the specific implementation process can be seen in the method embodiment, which will not be elaborated here.

[0297] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages and disadvantages of the embodiments.

[0298] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disc, etc.

[0299] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An image preview method, characterized in that: Applied to electronic equipment, the method comprises: Acquire a first preview image captured by the first shooting module, and display the first preview image in the shooting preview interface; When the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and is in the target shooting scene, a second preview image is obtained through the second shooting module, and the second preview image is simultaneously displayed in the shooting preview interface, and the field of view of the second shooting module is greater than the field of view of the first shooting module.

2. The method according to claim 1, characterized in that The method of acquiring a second preview image through a second shooting module when the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and the scene is in a target shooting scene includes: When the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold and the scene is in a target shooting scene, controlling the working state of the second shooting module to be in an on state; Acquire the second preview image captured by the second shooting module.

3. The method according to claim 1, characterized in that The method further comprises: When the zoom ratio corresponding to the first shooting module is not greater than a first zoom threshold, or is not in a target shooting scene, the working state of the second shooting module is controlled to be in a closed state.

4. The method according to claim 3, characterized in that Before acquiring the second preview image by the second shooting module, the method further includes: When the zoom ratio corresponding to the first shooting module is greater than a first zoom threshold, identifying the first preview image, and if a target object is identified, determining whether the shooting scene where the first shooting module is located is the target shooting scene; If the target object is not identified or is not in the target shooting scene, the working state of the second shooting module is controlled to be a closed state.

5. The method according to claim 1, characterized in that: Before acquiring the second preview image by the second shooting module, the method further includes: Acquiring target brightness information, where the target brightness information includes image brightness information corresponding to the first preview image and / or ambient light brightness corresponding to the electronic device; The shooting scene where the first shooting module is located is determined according to the target brightness information.

6. The method according to claim 5, characterized in that The determining, according to the target brightness information, the shooting scene in which the first shooting module is located includes: The shooting scene in which the first shooting module is located is determined according to M target brightness information, the M target brightness information is recorded within a preset time length, and M is an integer greater than 1.

7. The method according to claim 6, characterized in that The M target brightness information is image brightness information corresponding to the M frames of first preview images, and determining the shooting scene where the first shooting module is located according to the M target brightness information includes: The shooting scene of the first shooting module is determined according to the image brightness information corresponding to each of the M frames of first preview images, wherein the M frames of first preview images include the current frame of first preview image and the M-1 frames of first preview image before the current frame of first preview image.

8. The method according to claim 6, characterized in that The determining, according to the M target brightness information, the shooting scene where the first shooting module is located includes: According to the M target brightness information and the target brightness condition, obtaining a first frame number corresponding to the target brightness information that meets the target brightness condition in the M target brightness information; According to the ratio of the first number of frames to M, the shooting scene in which the first shooting module is located is determined.

9. The method according to claim 8, characterized in that The determining, according to the ratio of the first number of frames to M, the shooting scene in which the first shooting module is located includes: Determine a brightness ratio value according to a ratio of the first number of frames to M and a maximum brightness ratio, wherein the maximum brightness ratio is a maximum value corresponding to a case where the first number of frames is equal to M; If the brightness ratio value is greater than a first brightness ratio threshold, determining that the shooting scene where the first shooting module is located is the target shooting scene; If the brightness ratio value is less than a second brightness ratio threshold, it is determined that the shooting scene where the first shooting module is located is not the target shooting scene; and the first brightness ratio threshold is greater than the second brightness ratio threshold.

10. The method according to claim 9, characterized in that The method further comprises: If the brightness ratio value is not less than the second brightness ratio threshold and not greater than the first brightness ratio threshold, the working state of the second shooting module is controlled to remain unchanged.

11. The method according to claim 8, characterized in that The image brightness information corresponding to the first preview image includes at least one of a darkness value corresponding to the first preview image, a BV value corresponding to the first preview image, and a brightness value corresponding to the first preview image.

12. The method according to claim 11, characterized in that Different image brightness information corresponds to different target brightness conditions; Among them, the target brightness condition for the darkness value corresponding to the first preview image is less than the preset darkness threshold; the target brightness condition for the BV value corresponding to the first preview image is greater than the preset BV threshold; the target brightness condition for the brightness value corresponding to the first preview image is greater than the preset brightness threshold.

13. The method according to claim 6, characterized in that The determining, according to the M target brightness information, the shooting scene where the first shooting module is located includes: Determine a brightness index value according to the M target brightness information, wherein the brightness index value includes any one of an average value, a mode value, and a maximum value of the M target brightness information; The shooting scene in which the first shooting module is located is determined according to the target index range to which the brightness index value belongs.

14. The method according to any one of claims 1 to 13, characterized in that: Simultaneously displaying the second preview image in the shooting preview interface includes: A floating frame is displayed in the shooting preview interface, and the second preview image is displayed in the floating frame.

15. The method according to claim 14, characterized in that Before displaying the floating frame in the shooting preview interface, the method further includes: If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold, and the zoom ratio is less than the second zoom threshold, identifying the first preview image; The displaying of a floating frame in the shooting preview interface includes: If a target object is identified in the first preview image, the floating frame is displayed in the shooting preview interface.

16. The method according to claim 15, characterized in that The method further comprises: If the zoom ratio corresponding to the first shooting module is not greater than the first zoom threshold, or the target object is not recognized in the first preview image, the floating frame is not displayed in the shooting preview interface, and the working state of the second shooting module is controlled to be the closed state.

17. The method according to claim 1, characterized in that The method further comprises: If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and is not in the target shooting scene, the first preview image is displayed in a floating frame on the shooting preview interface.

18. The method according to claim 1, characterized in that The method further comprises: If the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold, identifying the first preview image; If the target object is not identified, controlling the working state of the second shooting module to be in a closed state; The first preview image is displayed in a floating frame of the shooting preview interface.

19. The method according to claim 18, characterized in that The electronic device also includes a target storage area; After acquiring the first preview image captured by the first shooting module, the method further includes: Copying the first preview image, and storing the copied first preview image in the target storage area; Displaying the first preview image stored in the target storage area in a floating frame of the shooting preview interface; The identifying the first preview image includes: The first preview image stored in the target storage area is identified.

20. The method according to claim 19, characterized in that The target storage area is also used to store the second preview image; and the step of simultaneously displaying the second preview image in the shooting preview interface includes: If the target object is identified, the first preview image displayed in the floating frame is replaced by the second preview image stored in the target storage area.

21. The method according to claim 4 or 17, characterized in that: Before identifying the first preview image, the method further includes: Acquiring a posture parameter of the electronic device, where the posture parameter is used to indicate a movement direction of the electronic device; The identifying the first preview image includes: If the posture parameter meets the preset posture range, the first preview image is recognized.

22. The method according to any one of claims 1 to 13, characterized in that: The method further comprises: In response to a triggering operation on the floating frame of the shooting preview interface, displaying a composition setting interface, wherein the composition setting interface includes a setting control, and the setting control is used to set the focal length of the image displayed in the floating frame; In response to a setting operation on the setting control in the composition setting interface, determining a selected target focal length; The acquiring the second preview image by the second shooting module includes: The original image captured by the second shooting module is cropped to obtain a second preview image corresponding to the target focal length.

23. The method according to any one of claims 1 to 13, characterized in that: In the electronic device, a data processing engine for processing the original image captured by the first shooting module is different from a data processing engine for processing the original image captured by the second shooting module.

24. The method according to any one of claims 1 to 13, characterized in that: The shooting preview interface includes a shooting control, and the method further includes: In response to a triggering operation on the shooting control, a target shooting image is generated according to the first preview image and the second preview image, wherein the foreground content in the target shooting image is generated based on the second preview image, and the background content in the target shooting image is generated based on the first preview image.

25. An image preview device, characterized in that: Applied to electronic equipment, the device comprises: A first display module, used to obtain a first preview image captured by the first shooting module, and display the first preview image in a shooting preview interface; The second display module is used to obtain a second preview image through the second shooting module and simultaneously display the second preview image in the shooting preview interface when the zoom ratio corresponding to the first shooting module is greater than the first zoom threshold and is in the target shooting scene. The field of view of the second shooting module is greater than the field of view of the first shooting module.

26. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program that can be run on the processor, and the processor implements the image preview method according to any one of claims 1 to 24 when executing the computer program.

27. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the image preview method according to any one of claims 1 to 24.