Image processing method, electronic equipment and computer readable storage medium

By supporting multiple physical cameras in electronic devices and switching dynamically, the problem of poor shooting results of the three-party applications when zoom magnification or object distance changes is solved, achieving more efficient photography performance and better preview effects.

CN119255067APending Publication Date: 2025-01-03HONOR DEVICE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The three-party applications on electronic devices have poor shooting results when zoom ratio or object distance changes, resulting in unclear photos or poor preview effects.

Method used

By supporting multiple physical cameras in electronic devices, such as wide-angle, ultra-wide-angle and telephoto cameras, and dynamically switching different cameras on the camera preview interface, adjusting the field of view and focal length according to zoom operation and the distance changes of the subject, To improve photography performance and shooting effect.

Benefits of technology

It effectively improves the photography performance and shooting effect of three-party applications and system camera applications, solves the problem of poor shooting results when zoom magnification or object distance changes, and provides a clearer picture and a better preview experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119255067A_ABST
    Figure CN119255067A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method, electronic equipment and a computer readable storage medium, relates to the technical field of intelligent terminals, and aims to solve the problem of poor shooting effect when a three-party application changes in zoom ratio or object distance. The image processing method comprises the following steps: starting a shooting function based on a three-party application, and displaying a first preview image on a camera preview interface of the three-party application; the first preview image is associated with the first physical camera, and the zoom ratio corresponding to the first preview image is the first zoom ratio. And displaying a second preview image on the camera preview interface in response to the zooming operation and / or the change of the distance between the electronic equipment and the shot object. The second preview image is associated with a second physical camera, the zoom ratio corresponding to the second preview image is a second zoom ratio, and the second physical camera is different from the first physical camera.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of intelligent terminal technology, and specifically to an image processing method, an electronic device, and a computer-readable storage medium. Background Art

[0002] Currently, many third-party applications on electronic devices have shooting functions. When using these third-party applications to take photos, the rear main camera is usually used. Since the rear main camera has a specific field of view (FOV) and focal length, when the zoom ratio or object distance changes, the photo may not be clear or the preview effect may be poor. Summary of the invention

[0003] The embodiments of the present application provide an image processing method, an electronic device, and a computer-readable storage medium, which are intended to solve the problem of poor shooting effects of three-party applications when the zoom ratio or object distance changes.

[0004] According to a first aspect of an embodiment of the present application, there is provided an image processing method, which is applied to an electronic device, and the method comprises: starting a shooting function based on a third-party application, and displaying a first preview image on a camera preview interface of the third-party application. The first preview image is associated with a first physical camera, and the zoom ratio corresponding to the first preview image is a first zoom ratio. In response to a zoom operation and / or a change in the distance between the electronic device and the photographed object, a second preview image is displayed on the camera preview interface. The second preview image is associated with a second physical camera, and the zoom ratio corresponding to the second preview image is a second zoom ratio, and the second physical camera is different from the first physical camera.

[0005] In this embodiment, since the logical cameras supported by the third-party application include multiple physical cameras, such as a wide-angle camera, an ultra-wide-angle camera, and a telephoto camera, and multi-camera switching permissions are open to the third-party application, when the zoom ratio or the distance between the electronic device and the subject changes, it can switch to a different physical camera accordingly, thereby improving the photo performance and shooting effect of the third-party application.

[0006] In one embodiment, in response to a zoom operation and / or a change in the distance between the electronic device and the subject, a second preview image is displayed on the camera preview interface, including: based on the first physical camera being a wide-angle camera, in response to the zoom operation, the second zoom ratio is less than the first zoom ratio, and the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is an ultra-wide-angle camera.

[0007] In another embodiment, in response to a zoom operation and / or a change in the distance between the electronic device and the subject, a second preview image is displayed on the camera preview interface, including: based on the first physical camera being a wide-angle camera, in response to the zoom operation, the second zoom ratio is greater than the first zoom ratio, and the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a telephoto camera.

[0008] In another embodiment, in response to a zoom operation and / or a change in the distance between the electronic device and the subject, a second preview image is displayed on the camera preview interface, including: based on the first physical camera being a wide-angle camera, in response to the distance between the electronic device and the subject being less than a distance threshold, the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is an ultra-wide-angle camera.

[0009] In another embodiment, in response to a zoom operation and / or a change in the distance between the electronic device and the subject, a second preview image is displayed on the camera preview interface, including: based on the first physical camera being an ultra-wide-angle camera, in response to the zoom operation, the second zoom ratio is greater than the first zoom ratio, and the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera or a telephoto camera.

[0010] Specifically, based on the second zoom ratio being equal to 1X, the second physical camera is a wide-angle camera. Based on the second zoom ratio being greater than 1X, the second physical camera is a telephoto camera.

[0011] In another embodiment, in response to a zoom operation and / or a change in the distance between the electronic device and the subject, a second preview image is displayed on the camera preview interface, including: based on the first physical camera being an ultra-wide-angle camera, in response to the distance between the electronic device and the subject being greater than or equal to a distance threshold, the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera.

[0012] In another embodiment, in response to a zoom operation and / or a change in the distance between the electronic device and the subject, a second preview image is displayed on the camera preview interface, including: based on the first physical camera being a telephoto camera, in response to the zoom operation, the second zoom ratio is less than the first zoom ratio, and the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera or an ultra-wide-angle camera.

[0013] In another embodiment, the method further includes: based on the third-party application turning off the shooting function and the system camera application starting the shooting function, displaying a third preview image on the preview interface of the system camera application. The third preview image is associated with the first physical camera, and the zoom ratio corresponding to the third preview image is a third zoom ratio. In response to the zoom operation and / or the change in the distance between the electronic device and the photographed object, displaying a fourth preview image on the preview interface. The fourth preview image is associated with the second physical camera, and the zoom ratio corresponding to the fourth preview image is a fourth zoom ratio.

[0014] In this embodiment, in the scenario where the third-party application turns off the shooting function and the system camera application starts the shooting function, since the logical cameras supported by the system camera application include multiple physical cameras, such as a wide-angle camera, an ultra-wide-angle camera, and a telephoto camera, and multi-camera switching permissions are open to the system camera application, when the zoom ratio or the distance between the electronic device and the subject changes, it can switch to a different physical camera accordingly, thereby improving the system camera application's photo performance and shooting effects.

[0015] In another embodiment, the method further includes: based on the third-party application turning off the shooting function and the system camera application starting the shooting function, displaying a fifth preview image on the preview interface of the system camera application. The fifth preview image is associated with the first physical camera, and the zoom ratio corresponding to the fifth preview image is a fifth zoom ratio. In response to the zoom operation and / or the change in the distance between the electronic device and the photographed object, the fifth preview image is displayed on the preview interface.

[0016] In this embodiment, in the scenario where the third-party application turns off the shooting function and the system camera application starts the shooting function, since the original logical camera that supports the separate physical camera is the logical camera called by default by the third-party application, and the physical camera configuration of the logical camera called by default by the third-party application is modified, a new logical camera that supports the separate physical camera is added, so that the system camera application can use the separate physical camera to take pictures by calling the newly added logical camera.

[0017] A second aspect of an embodiment of the present application provides an electronic device, which includes a memory, a processor, a camera and a display screen, wherein the camera includes multiple physical cameras, the display screen is used to display images or videos taken by the camera, the memory is used to store instructions, and the processor is used to run the instructions stored in the memory, so that the electronic device executes the image processing method of the embodiment of the present application.

[0018] A third aspect of an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a computer, the computer executes the image processing method of the embodiment of the present application.

[0019] The technical effects brought about by the second and third aspects of the embodiments of the present application can be found in the relevant description of the image processing method of the first aspect above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of the camera call provided by the example.

[0021] Figure 2 It is a schematic diagram of the software structure of an electronic device provided in one embodiment of the present application.

[0022] Figure 3 This is a schematic diagram of camera calling provided by an embodiment of the present application.

[0023] Figure 4A The diagram is a schematic diagram of the camera preview interface of a third-party application when the zoom ratio is 1X, which is provided as an example.

[0024] Figure 4B The following is a schematic diagram of the camera preview interface of a third-party application when the zoom ratio is 0.5X, which is provided as an example.

[0025] Figure 4C The diagram is a schematic diagram of the camera preview interface of a third-party application when the zoom ratio is 3X, which is provided as an example.

[0026] Figure 5A This is a schematic diagram of the camera preview interface of a third-party application when the object distance is 0.5m, which is provided as an example.

[0027] Figure 5B This is a schematic diagram of the camera preview interface of a third-party application when the object distance is 0.1m, which is provided as an example.

[0028] Figure 6 It is a flowchart of an image processing method provided by an embodiment of the present application.

[0029] Figure 7 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0030] It should be noted that in the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", etc. in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0031] It should also be noted that the method disclosed in the embodiments of the present application or the method shown in the flowchart includes one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchangeable with each other, and some of the steps can also be deleted.

[0032] The electronic devices of the embodiments of the present application may include smart phones with shooting functions, tablet computers, PDAs, laptop computers, mobile Internet devices (MID), virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control (Industrial Control), wireless terminals in self-driving (Self Driving), wireless terminals in remote medical surgery (Remote Medical Surgery), wireless terminals in smart grids (Smart Grid), wireless terminals in transportation safety (Transportation Safety), wireless terminals in smart cities (Smart City), wireless terminals in smart homes (Smart Home), cellular phones, cordless phones, Session Initiation Protocol (Session Initiation Protocol, SIP) phones, Wireless Local Loop (Wireless Local Loop, WLL) stations, Personal Digital Assistants (Personal Digital Assistant, PDA), handheld devices with wireless communication functions, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or public land mobile communication networks (Public Land Mobile Terminal equipment in Network, PLMN, etc.

[0033] To meet the user's shooting needs, the electronic device may include multiple physical cameras, such as a wide-angle (Wide) camera, an ultra-wide-angle (Ultrawide, UW) camera, a telephoto (Tele) camera, etc. Each physical camera has a corresponding field of view (Field of View, FOV) and focal length. For example, when using an electronic device to shoot a distant object, the zoom ratio can be enlarged to bring the distance between the electronic device and the object closer. Based on different zoom ratios and different object distances, using physical cameras with different focal lengths to take pictures / records can obtain a higher-definition picture. During the zoom process, when a certain zoom ratio is reached, the electronic device will switch to a different physical camera. For example, in the process of the zoom ratio increasing from the minimum value, the electronic device will use an ultra-wide-angle camera, a wide-angle camera, and a telephoto camera in turn.

[0034] To achieve different shooting modes, the electronic device may include multiple logical cameras, and the logical camera may include at least one physical camera. Different logical cameras have corresponding camera identifications (CameraIdentification, CameraID). The CameraID corresponding to the logical camera can be customized by the electronic device manufacturer. Exemplarily, the logical camera with CameraID 0 includes a rear main camera (referred to as rear main camera), and the rear main camera is usually a wide-angle camera. The logical camera with CameraID 5 includes a rear main camera, a rear ultra-wide-angle camera (referred to as rear ultra-wide) and a rear telephoto camera (referred to as rear telephoto).

[0035] Currently, many third-party applications on electronic devices have shooting functions. When using these third-party applications to take photos, the rear main camera is usually used to take photos. Since the rear main camera has a specific FOV and focal length, when the zoom ratio or object distance changes, the photo may not be clear or the preview effect may be poor. For example, Figure 1 As shown, when using a third-party application to take pictures, the third-party application will call the logical camera with CameraID 0, that is, use the rear main camera to take pictures. When using the system camera application to take pictures, the system camera application can call the logical camera with CameraID 0, that is, use the rear main camera alone to take pictures. The system camera application can also call the logical camera with CameraID 5, and enable the multi-camera processing engine for camera switching, that is, support the use of any of the rear main camera, rear ultra-wide and rear telephoto cameras to take pictures. Therefore, compared with the system camera application, due to the limitations of third-party application photography, the output effect is not good in some scenarios, such as unclear close-up photos, or poor preview of long-distance zoom.

[0036] Based on this, the embodiments of the present application provide an image processing method, an electronic device, and a computer-readable storage medium, which aim to solve the problem of poor shooting effects of three-party applications when the zoom ratio or object distance changes.

[0037] The image processing method of the embodiment of the present application is described in detail below in conjunction with the software structure of the electronic device.

[0038] Figure 2 It is a schematic diagram of the software structure of an electronic device provided in one embodiment of the present application.

[0039] The software system of electronic equipment can adopt a layered architecture, which divides the software into several layers. Each layer has a clear role and division of labor, and the layers communicate with each other through software interfaces. Figure 2 As shown, the software system of the electronic device is divided into three layers, from top to bottom, namely, the application (Application, APP) layer, the framework (Framework, FWK) layer and the hardware abstraction layer (HAL).

[0040] The application layer includes a series of application packages, which can include system applications and third-party applications.

[0041] The framework layer provides application programming interfaces (API) and programming frameworks for various apps in the application layer. The framework layer includes the camera framework (CameraFWK), which provides the camera API (CameraAPI) for third-party applications.

[0042] The camera framework may include a scene recognition module, which is used to identify third-party applications that request to start the camera. The scene recognition module can establish a whitelist by identifying third-party applications. The whitelist is used to store application identifiers that support multi-camera calls and switching. The application identifier may include the package name or signature of the application, etc.

[0043] In some embodiments, the scene recognition module is further used to determine whether the third-party application is an application in the white list. If the third-party application is an application in the white list, the third-party application is allowed to call multiple cameras. If the third-party application is not an application in the white list, the third-party application is prohibited from calling multiple cameras.

[0044] After the scene recognition module identifies the third-party application, the camera framework obtains the camera capabilities from the camera configuration file. The camera capabilities include the relevant configuration information of each logical camera, such as the CameraID corresponding to each logical camera and the physical camera configuration.

[0045] It is understood that the camera configuration file is a file pre-configured in the system. The camera configuration file is used to store camera capabilities. For example, Figure 3 As shown in the figure, since third-party applications call the logical camera with CameraID 0 by default, in the camera configuration file, the physical camera configuration of the logical camera with CameraID 0 can be modified from supporting the rear main camera to supporting the rear main camera, rear ultra-wide camera, and rear telephoto camera, and the multi-camera switching permission can be opened to third-party applications, that is, the multi-camera processing engine can switch the camera of the logical camera with CameraID 0, so that third-party applications can support the use of any of the rear main camera, rear ultra-wide camera, and rear telephoto camera to take pictures, thereby improving the photo performance and shooting effect of third-party applications. The system camera application can call the logical camera with CameraID 5 and enable the multi-camera processing engine to switch the camera. In some scenarios, the system camera application needs to use the rear main camera alone to take pictures. Since the original support for the rear main camera is the logical camera with CameraID 0, and the physical camera configuration of the logical camera with CameraID 0 has been modified, a new logical camera that supports the rear main camera is added, for example, the logical camera with CameraID 8. This allows the system camera application to use the rear main camera alone to take pictures by calling the logical camera with CameraID 8.

[0046] The hardware abstraction layer is used to execute the functional applications and data processing of various apps. The hardware abstraction layer includes the camera hardware abstraction layer (CameraHAL), which is used to implement multi-camera calling and switching.

[0047] Specifically, the camera hardware abstraction layer includes a camera startup module, a camera call module, a class object creation module, a customized extension module, an enabling module, a multi-camera capability management module, a multi-camera decision engine, a pipeline, and a multi-camera processing engine.

[0048] The camera startup module generates a camera call request corresponding to the third-party application based on the camera capabilities from the camera framework, and sends the camera call request to the camera call module. The camera call request includes the CameraID corresponding to the target logical camera, and the camera call request is used to request to call the target logical camera. The target logical camera is a logical camera supported by the third-party application, such as a logical camera with a CameraID of 0.

[0049] After receiving the camera call request, the camera call module calls the target logical camera and sends a camera call response to the camera start module. The camera call response includes the call result of the target logical camera, and the camera call response is used to indicate whether the call of the target logical camera is successful or failed.

[0050] The camera startup module starts the target logical camera based on the successful call of the target logical camera, and sends a class object creation instruction to the class object creation module. The class object creation instruction is used to instruct the creation of a class object corresponding to the target logical camera.

[0051] After receiving the class object creation instruction, the class object creation module creates a target class object (such as HALDevice) corresponding to the target logical camera, and sends relevant information of the target class object to the customized extension module. The relevant information of the target class object may include the class name, class variables and class methods of the target class object.

[0052] The customized extension module is a function application integration module customized by each electronic device manufacturer. After receiving the relevant information of the target class object, the customized extension module sends a multi-camera switching request corresponding to the target class object to the enabling module. The multi-camera switching request is used to request multi-camera switching permission.

[0053] After receiving the multi-camera switching request, the enabling module enables or disables the multi-camera switching function, fills the flag bit, and sends the flag bit value to the customized extension module. The flag bit value is used to indicate whether the multi-camera switching permission is open. Exemplarily, the flag bit value may include 1 or 0. The flag bit value of 1 indicates that the multi-camera switching permission is open, that is, the multi-camera switching function is enabled. The flag bit value of 0 indicates that the multi-camera switching permission is prohibited, that is, the multi-camera switching function is prohibited.

[0054] The customized extension module can determine whether the enabling module has opened the multi-camera switching permission based on the value of the flag bit. The customized extension module creates a session based on the determination that the enabling module has opened the multi-camera switching permission, and sends a multi-camera management request to the multi-camera capability management module. The multi-camera management request is used to request the management of multi-camera capabilities.

[0055] The multi-camera capability management module sends a multi-camera management instruction to the multi-camera decision engine based on the multi-camera management request. The multi-camera management instruction is used to start the multi-camera decision engine.

[0056] The multi-camera decision engine includes a multi-camera strategy initialization module, a multi-camera strategy selection module, and a multi-camera strategy output module. Among them, the multi-camera strategy initialization module is used to obtain the initialization configuration of multi-camera switching from the initialization configuration file, and perform multi-camera strategy initialization according to the initialization configuration. The multi-camera strategy selection module is used to obtain the decision configuration of multi-camera switching from the decision configuration file, and perform multi-camera strategy selection according to the decision configuration. The multi-camera strategy selection is based on the current zoom magnification to select the corresponding target physical camera. The multi-camera strategy output module outputs the multi-camera strategy to the Pipeline based on the multi-camera strategy selection result. The multi-camera strategy includes a channel flag corresponding to the target physical camera, which is used to select the real-time processing channel corresponding to the target physical camera. The real-time processing channel is used to perform real-time processing on the image collected by the sensor (Sensor), and the sensor includes each physical camera. Exemplarily, the channel flag may include 1 to 3. A channel flag of 1 indicates a real-time processing channel corresponding to the telephoto camera, a channel flag of 2 indicates a real-time processing channel corresponding to the ultra-wide-angle camera, and a channel flag of 3 indicates a real-time processing channel corresponding to the wide-angle camera.

[0057] It can be understood that both the initialization configuration file and the decision configuration file are pre-configured files in the system. The initialization configuration file includes the initialization configuration of multi-camera switching, and the initialization configuration may include the physical camera configuration supported by the third-party application and the value range of the zoom ratio. For example, the value range of the zoom ratio is greater than or equal to 0.1X and less than or equal to 50X. The decision configuration file includes the decision configuration of multi-camera switching, and the decision configuration may include the zoom ratio corresponding to each physical camera. For example, the zoom ratio corresponding to the ultra-wide-angle camera is greater than or equal to 0.1X and less than 1X, the zoom ratio corresponding to the wide-angle camera is 1X, and the zoom ratio corresponding to the telephoto camera is greater than 1X and less than or equal to 50X.

[0058] The pipeline includes a real-time processing path and a post-processing path corresponding to each physical camera. The pipeline selects the real-time processing path corresponding to the target physical camera based on the multi-camera strategy from the multi-camera strategy output module. The real-time processing path includes a sensor node, an image signal processing front end (Image singnal processing Front End, IFE) module and a statistical module. Among them, the sensor node can be a sensor-oriented control node, which is used to control the sensor through the sensor driver, such as controlling the target physical camera to collect images. After obtaining the original image collected by the sensor, the sensor node sends the original image to the IFE module. The IFE module is used to obtain statistical data from the original image, send the statistical data to the statistical module, and perform preliminary cropping processing on the original image, reserve the image edge (margin), so as to obtain the original image format (Raw Image Format, RAW) image, and send the RAW image to the post-processing path. After receiving the statistical data, the statistical module sends the statistical data to the multi-camera processing engine.

[0059] In some embodiments, the IFE module may also obtain statistical data from the RAW images.

[0060] It can be understood that the statistical data may include 3A statistical information, and the 3A statistical information includes automatic exposure (AutomaticExposure, AE) parameters, automatic focus (AutomaticFocus, AF) parameters and automatic white balance (Auto WhiteBalance, AWB) parameters.

[0061] The post-processing path includes a multi-camera module and an image signal processing post end (IPE) module. After receiving the RAW image from the IFE module, the multi-camera module sends the RAW image to the multi-camera processing engine, receives the transformed image from the multi-camera processing engine, and sends the transformed image to the IPE module. The IPE module is used to crop and warp the transformed image to obtain a preview image, and send the preview image to the camera framework. After receiving the preview image, the camera framework sends the preview image to the third-party application. After receiving the preview image, the third-party application displays the preview image on the camera preview interface.

[0062] It is understood that in other embodiments, the IFE module may perform more processing on the original image, such as color processing, denoising, enhancement, sharpening, etc. The IPE module may perform more processing on the transformed image, such as white balance, color correction, denoising, sharpening, exposure control, autofocus, etc. The preview image output by the IPE module may include the Joint Photographic Experts Group (JPEG) format or other image formats.

[0063] The multi-camera processing engine includes a first processing module, a second processing module and a perception engine. Among them, the first processing module includes a first front-end module, an algorithm processing module and a first back-end module. The first front-end module is used to receive statistical data from the statistical module and send the statistical data to the algorithm processing module. After receiving the statistical data, the algorithm processing module performs various algorithm processing on the statistical data by calling the perception engine, and sends the algorithm processing results to the first back-end module. After receiving the algorithm processing results, the first back-end module caches the algorithm processing results. The multi-camera processing engine sends a camera switching instruction to the Pipeline based on the algorithm processing results to switch the camera. The camera switching instruction is used to indicate switching to the camera selected by the algorithm. After receiving the camera switching instruction, the Pipeline switches to the real-time processing path corresponding to the camera selected by the algorithm.

[0064] The perception engine is used to execute various algorithms, thereby assisting the algorithm processing module to implement corresponding algorithm functions.

[0065] Exemplarily, the algorithm processing module calls the perception engine, and the perception engine identifies the distance between the target physical camera and the photographed object (i.e., the object distance) by executing the distance recognition algorithm. The algorithm processing module determines whether to switch the camera and which camera to switch to based on the object distance. Taking the target physical camera as a wide-angle camera as an example, since the wide-angle camera may not take clear photos when shooting close objects. Therefore, when the object distance is less than the distance threshold, the algorithm processing module determines to switch the wide-angle camera to an ultra-wide-angle camera to improve the close-up shooting effect.

[0066] The second processing module includes a second front-end module, a multi-camera switching module and a second back-end module. The second front-end module is used to receive the RAW image from the multi-camera module and send the RAW image to the multi-camera switching module. After receiving the RAW image, the multi-camera switching module spatially aligns the RAW image according to the spatial alignment transform (Spatial Alignment Transform, SAT) algorithm to obtain a transformed image, and sends the transformed image to the second back-end module. After receiving the transformed image, the second back-end module sends the transformed image to the multi-camera module. After being processed by the second processing module, the camera switching can be made smoother, thereby reducing the sense of disharmony of the picture before and after the camera switching.

[0067] Understandably, Figure 2 The layers in the software structure shown and the components contained in each layer do not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the embodiments of the present application.

[0068] The image processing method of the embodiment of the present application is described in detail below in combination with scenes one to three.

[0069] For example, taking the current physical camera used by the third-party application as a wide-angle camera, the zoom ratio corresponding to the wide-angle camera is 1X.

[0070] Scenario 1: The zoom ratio changes from 1X to 0.5X.

[0071] Scenario 2: The zoom ratio changes from 1X to 3X.

[0072] Scenario 3: The object distance changes from 0.5m to 0.1m.

[0073] In the following scenario, the electronic device adjusts the zoom ratio from 1X to 0.5X in response to the zoom operation. The multi-camera decision engine performs multi-camera strategy selection through the multi-camera strategy selection module based on the change in zoom ratio from 1X to 0.5X, and outputs the multi-camera strategy to the Pipeline through the multi-camera strategy output module. At this time, the multi-camera strategy includes the channel flag corresponding to the ultra-wide-angle camera. The Pipeline selects the real-time processing channel corresponding to the ultra-wide-angle camera based on the multi-camera strategy from the multi-camera strategy output module.

[0074] The real-time processing path first obtains the original image collected by the sensor through the sensor node. Then, the IFE module obtains statistical data from the original image, sends the statistical data to the statistical module, and performs preliminary cropping processing on the original image to obtain a RAW image, and sends the RAW image to the post-processing path. Then, the real-time processing path sends the statistical data to the multi-camera processing engine through the statistical module. The multi-camera processing engine performs various algorithm processing on the statistical data through the algorithm processing module, such as using the distance recognition algorithm to identify the object distance. Based on the unchanged object distance, the multi-camera processing engine will not send a camera switching instruction to the Pipeline. Then, the post-processing path sends the RAW image to the multi-camera processing engine through the multi-camera module. The multi-camera processing engine performs SAT algorithm processing on the RAW image through the multi-camera switching module to obtain a transformed image. The multi-camera processing engine then sends the transformed image to the multi-camera module. Then, the multi-camera module sends the transformed image to the IPE module. The IPE module crops and distorts the transformed image to obtain a preview image, and sends the preview image to the camera framework. The camera framework then sends the preview image to the third-party application. Then, the third-party application displays the preview image on the camera preview interface.

[0075] It can be understood that the zoom operation may include an operation of clicking a zoom control, an operation of sliding a zoom control, and an operation of sliding a two-finger interface. The operation of sliding a two-finger interface may include a sliding operation of bringing two fingers together and a sliding operation of separating two fingers.

[0076] like Figure 4A and Figure 4B As shown, since the zoom ratio changes from 1X to 0.5X, the physical camera used by the third-party application switches from a wide-angle camera to an ultra-wide-angle camera, so that the FOV of the camera preview interface of the third-party application becomes significantly larger.

[0077] In scenario 2, the electronic device adjusts the zoom ratio from 1X to 3X in response to the zoom operation. Based on the change in zoom ratio from 1X to 3X, the multi-camera decision engine performs multi-camera strategy selection through the multi-camera strategy selection module, and outputs the multi-camera strategy to the Pipeline through the multi-camera strategy output module. At this time, the multi-camera strategy includes the channel flag corresponding to the telephoto camera. The Pipeline selects the real-time processing channel corresponding to the telephoto camera based on the multi-camera strategy from the multi-camera strategy output module.

[0078] It can be understood that after the Pipeline selects the real-time processing path, the image processing process of scene 2 is roughly the same as that of scene 1, and will not be repeated here.

[0079] like Figure 4A and Figure 4CAs shown, since the zoom ratio changes from 1X to 3X, the physical camera used by the third-party application switches from a wide-angle camera to a telephoto camera, so that the FOV of the camera preview interface of the third-party application becomes significantly smaller.

[0080] In scenario three, the object distance changes from 0.5m to 0.1m based on the electronic device approaching the subject. The multi-camera processing engine uses the distance recognition algorithm to identify the object distance, and sends a camera switching instruction to the Pipeline based on the object distance changing from 0.5m to 0.1m. At this time, the camera switching instruction indicates to switch to the ultra-wide-angle camera. Then, the Pipeline switches to the real-time processing path corresponding to the ultra-wide-angle camera according to the camera switching instruction.

[0081] It can be understood that after Pipeline selects the real-time processing path, the image processing process of scene three is roughly the same as that of scene one / scene two, and will not be repeated here.

[0082] like Figure 5A and Figure 5B As shown, since the object distance changes from 0.5m to 0.1m, the physical camera used by the third-party application switches from a wide-angle camera to an ultra-wide-angle camera, so that the FOV of the camera preview interface of the third-party application becomes significantly larger.

[0083] Figure 6 It is a flowchart of an image processing method provided by an embodiment of the present application.

[0084] Image processing methods are applied to electronic devices, such as Figure 6 As shown, the image processing method comprises the following steps:

[0085] S101, starting a shooting function based on a third-party application, and displaying a first preview image on a camera preview interface of the third-party application.

[0086] The first preview image is associated with the first physical camera, and the zoom ratio corresponding to the first preview image is the first zoom ratio.

[0087] S102: In response to a zoom operation and / or a change in the distance between the electronic device and the photographed object, display a second preview image on the camera preview interface of the third-party application.

[0088] The second preview image is associated with a second physical camera, and the zoom ratio corresponding to the second preview image is a second zoom ratio. The second physical camera is different from the first physical camera.

[0089] In one embodiment, step S102 includes: based on the first physical camera being a wide-angle camera, in response to a zoom operation, the second zoom ratio is less than the first zoom ratio, a second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is an ultra-wide-angle camera.

[0090] In another embodiment, step S102 includes: based on the first physical camera being a wide-angle camera, in response to a zoom operation, the second zoom ratio is greater than the first zoom ratio, a second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a telephoto camera.

[0091] In another embodiment, step S102 includes: based on the first physical camera being a wide-angle camera, in response to the distance between the electronic device and the photographed object being less than a distance threshold, displaying a second preview image on the camera preview interface, and the second physical camera corresponding to the second preview image is an ultra-wide-angle camera.

[0092] In another embodiment, step S102 includes: based on the first physical camera being an ultra-wide-angle camera, in response to a zoom operation, the second zoom ratio is greater than the first zoom ratio, a second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera or a telephoto camera.

[0093] Specifically, when the second zoom ratio is equal to 1X, the second physical camera is a wide-angle camera. When the second zoom ratio is greater than 1X, the second physical camera is a telephoto camera.

[0094] In another embodiment, step S102 includes: based on the first physical camera being an ultra-wide-angle camera, in response to the distance between the electronic device and the photographed object being greater than or equal to a distance threshold, displaying a second preview image on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera.

[0095] In another embodiment, step S102 includes: based on the first physical camera being a telephoto camera, in response to a zoom operation, the second zoom ratio is less than the first zoom ratio, a second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera or an ultra-wide-angle camera.

[0096] It can be understood that in the above embodiment, since the logical cameras supported by the third-party application include multiple physical cameras, such as a wide-angle camera, an ultra-wide-angle camera and a telephoto camera, and the multi-camera switching permission is open to the third-party application, when the zoom ratio or the distance between the electronic device and the subject changes, the Pipeline can switch the real-time processing paths corresponding to different physical cameras accordingly, thereby switching to different physical cameras, thereby improving the photo performance and shooting effects of the third-party application.

[0097] In some embodiments, in a scenario where the third-party application turns off the shooting function and the system camera application starts the shooting function, the image processing method further includes: based on the third-party application turning off the shooting function and the system camera application starting the shooting function, displaying a third preview image on the preview interface of the system camera application. The third preview image is associated with the first physical camera, and the zoom ratio corresponding to the third preview image is the third zoom ratio. In response to the zoom operation and / or the change in the distance between the electronic device and the photographed object, a fourth preview image is displayed on the preview interface. The fourth preview image is associated with the second physical camera, and the zoom ratio corresponding to the fourth preview image is the fourth zoom ratio.

[0098] In the above embodiment, in the scenario where the third-party application turns off the shooting function and the system camera application starts the shooting function, since the logical cameras supported by the system camera application include multiple physical cameras, such as a wide-angle camera, an ultra-wide-angle camera, and a telephoto camera, and the multi-camera switching permission is open to the system camera application, when the zoom ratio or the distance between the electronic device and the subject changes, it can switch to a different physical camera accordingly, thereby improving the system camera application's shooting performance and shooting effect.

[0099] In some other embodiments, in the scenario where the third-party application turns off the shooting function and the system camera application starts the shooting function, the image processing method further includes: based on the third-party application turning off the shooting function and the system camera application starting the shooting function, displaying a fifth preview image on the preview interface of the system camera application. The fifth preview image is associated with the first physical camera, and the zoom ratio corresponding to the fifth preview image is the fifth zoom ratio. In response to the zoom operation and / or the change in the distance between the electronic device and the photographed object, the fifth preview image is displayed on the preview interface.

[0100] In the above embodiment, in the scenario where the third-party application turns off the shooting function and the system camera application starts the shooting function, since the original logical camera that supports the separate physical camera is the logical camera called by default by the third-party application, and the physical camera configuration of the logical camera called by default by the third-party application is modified, a new logical camera that supports the separate physical camera is added, so that the system camera application can use the separate physical camera to take pictures by calling the newly added logical camera.

[0101] Figure 7 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application.

[0102] like Figure 7 As shown, the electronic device 100 includes a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K and an ambient light sensor 180L, etc.

[0103] The processor 110 may execute instructions stored in the internal memory 121 , so that the electronic device 100 executes the image processing method provided in the above embodiment.

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

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

[0106] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0107] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and / or a Universal Serial Bus (USB) interface, etc.

[0108] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to realize the touch function of the electronic device 100.

[0109] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0110] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to implement the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0111] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0112] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to realize the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the electronic device 100.

[0113] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0114] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0115] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0116] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0117] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193 and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0118] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.

[0119] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0120] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (Low Noise Amplifier, LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0121] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0122] The wireless communication module 160 can provide wireless communication solutions including wireless local area network (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0123] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include Global System For Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM and / or IR technology, etc. GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS) and / or the Satellite Based Augmentation System (SBAS).

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

[0125] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0126] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.

[0127] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0128] The camera 193 is used to capture still images or videos. The scene generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then passed to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0129] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0130] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0131] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. NPU can realize applications such as intelligent cognition of electronic device 100, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0132] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing files such as music and videos in the external memory card.

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

[0134] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

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

[0136] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0137] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0138] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting his mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0139] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm Open Mobile Terminal Platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.

[0140] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0141] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used in scenes such as navigation and somatosensory games.

[0142] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0143] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0144] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0145] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0146] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby scenes. When sufficient reflected light is detected, it can be determined that there is a scene near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no scene near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0147] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0148] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0149] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0150] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0151] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0152] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0153] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0154] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0155] It is to be understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0156] The embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a computer, the computer executes the image processing method of the embodiment of the present application.

[0157] Computer-readable storage media include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer-readable storage media include, but are not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), flash memory or other memory, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), digital versatile disc (Digital Versatile Disc, DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.

[0158] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present application.

Claims

1. An image processing method, applied to an electronic device, characterized in that: The method comprises: Based on the third-party application, a shooting function is started, and a first preview image is displayed on the camera preview interface of the third-party application; the first preview image is associated with a first physical camera, and a zoom ratio corresponding to the first preview image is a first zoom ratio; In response to a zoom operation and / or a change in the distance between the electronic device and the subject, a second preview image is displayed on the camera preview interface; the second preview image is associated with a second physical camera, the zoom ratio corresponding to the second preview image is a second zoom ratio, and the second physical camera is different from the first physical camera.

2. The image processing method according to claim 1, characterized in that: The method of displaying a second preview image on the camera preview interface in response to a zoom operation and / or a change in the distance between the electronic device and the photographed object comprises: Based on that the first physical camera is a wide-angle camera, in response to the zoom operation, the second zoom ratio is less than the first zoom ratio, the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is an ultra-wide-angle camera.

3. The image processing method according to claim 1, characterized in that: The method of displaying a second preview image on the camera preview interface in response to a zoom operation and / or a change in the distance between the electronic device and the photographed object comprises: Based on that the first physical camera is a wide-angle camera, in response to the zoom operation, the second zoom ratio is greater than the first zoom ratio, the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a telephoto camera.

4. The image processing method according to claim 1, wherein: The method of displaying a second preview image on the camera preview interface in response to a zoom operation and / or a change in the distance between the electronic device and the photographed object comprises: Based on the fact that the first physical camera is a wide-angle camera, in response to the distance between the electronic device and the photographed object being less than a distance threshold, the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is an ultra-wide-angle camera.

5. The image processing method according to claim 1, wherein: The method of displaying a second preview image on the camera preview interface in response to a zoom operation and / or a change in the distance between the electronic device and the photographed object comprises: Based on that the first physical camera is an ultra-wide-angle camera, in response to the zoom operation, the second zoom ratio is greater than the first zoom ratio, and the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera or a telephoto camera.

6. The image processing method according to claim 1, characterized in that: The method of displaying a second preview image on the camera preview interface in response to a zoom operation and / or a change in the distance between the electronic device and the photographed object comprises: Based on the fact that the first physical camera is an ultra-wide-angle camera, in response to the distance between the electronic device and the photographed object being greater than or equal to a distance threshold, the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera.

7. The image processing method according to claim 1, characterized in that: The method of displaying a second preview image on the camera preview interface in response to a zoom operation and / or a change in the distance between the electronic device and the photographed object comprises: Based on that the first physical camera is a telephoto camera, in response to the zoom operation, the second zoom ratio is less than the first zoom ratio, the second preview image is displayed on the camera preview interface, and the second physical camera corresponding to the second preview image is a wide-angle camera or an ultra-wide-angle camera.

8. The image processing method according to any one of claims 1 to 7, characterized in that: The method further comprises: Based on the third-party application turning off the shooting function and the system camera application starting the shooting function, displaying a third preview image on the preview interface of the system camera application; the third preview image is associated with the first physical camera, and the zoom ratio corresponding to the third preview image is a third zoom ratio; In response to the zoom operation and / or the change in the distance between the electronic device and the photographed object, a fourth preview image is displayed on the preview interface; the fourth preview image is associated with the second physical camera, and the zoom ratio corresponding to the fourth preview image is a fourth zoom ratio.

9. The image processing method according to any one of claims 1 to 7, characterized in that: The method further comprises: Based on the third-party application turning off the shooting function and the system camera application starting the shooting function, displaying a fifth preview image on the preview interface of the system camera application; the fifth preview image is associated with the first physical camera, and the zoom ratio corresponding to the fifth preview image is a fifth zoom ratio; In response to the zoom operation and / or a change in the distance between the electronic device and the photographed object, the fifth preview image is displayed on the preview interface.

10. An electronic device, characterized in that: The electronic device includes a memory, a processor, a camera and a display screen, the camera includes multiple physical cameras, the display screen is used to display images or videos taken by the camera, the memory is used to store instructions, and the processor is used to run the instructions stored in the memory, so that the electronic device executes the image processing method as described in any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer is enabled to execute the image processing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Preview picture processing method and device, storage medium and electronic equipment

    CN111885305A

  • Video shooting method and device, shooting terminal and storage medium

    CN113473018A

  • Camera switching method and electronic equipment

    CN116546316A

  • Shooting method and electronic equipment

    CN117278850A

  • Display method and apparatus for preview image, and computer device and storage medium

    WO2022241907A1