Camera request processing method and related apparatus
By implementing the camera request processing method in the electronic device, a first camera request is used to acquire an image frame, and processing it when the camera parameters change, the response delay problem when the user changes the camera shooting mode is solved, and the user experience is improved.
Patent Information
- Application Number
- PCT/CN2024/137197
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-08
- Filing Date
- 2024-12-05
- Publication Date
- 2025-06-12
AI Technical Summary
When existing electronic devices change camera shooting mode, there is a response delay, affecting the user experience.
Through a camera request processing method, the image frame is acquired using the first camera request, and the image frame is processed when the camera parameters change, an image frame matching the second camera request parameters is generated, and the preview image is quickly updated.
Reduces the delay in response to users' changes in shooting mode operations and improves user experience.
Smart Images

Figure CN2024137197_12062025_PF_FP_ABST
Abstract
Description
Camera request processing method and related device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 8, 2023, with application number 202311692535.5 and application name “A Camera Request Processing Method and Related Devices”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of camera framework and electronic technology, and in particular to a camera request processing method and related devices. Background Art
[0003] Currently, electronic devices such as mobile phones and tablets all have camera applications. Users can use the camera application on their mobile phones to take photos and record videos. As the photo and video recording functions of camera applications in mobile phones and other electronic devices continue to develop, more and more shooting modes are available on mobile phones and other electronic devices. Users can change the camera's shooting mode in the camera shooting interface, for example, changing the camera's current focal length or adding filters. After the user changes the camera's shooting mode, the shooting interface of the electronic device will display a preview image frame in the new shooting mode in response to the user's operation.
[0004] However, when a user changes the camera shooting mode in the camera shooting interface, there is a delay between the electronic device sensing the user's operation and displaying the preview image frame of the new shooting mode. For example, a user can change the current zoom factor of the camera. After the electronic device senses the user's zoom operation, it takes some time to respond before displaying the preview image frame at the new zoom factor. This delay between the user's operation and the actual camera image is affected by the user experience.
[0005] Therefore, how to reduce the response delay of the electronic device to the user's operation of changing the shooting mode is an urgent problem to be solved. Summary of the Invention
[0006] This application provides a camera request processing method and related apparatus. Implementation of the camera request processing method provided in the embodiments of this application can reduce the response delay of an electronic device to a user's operation to change a shooting mode, thereby improving the user experience.
[0007] In a first aspect, the present application provides a camera request processing method, which can be applied to an electronic device with a camera module, which electronic device may include a camera application, and the method may include: a first camera application sends a first camera request; the camera module in the electronic device obtains a first image frame according to the camera parameters in the first camera request, and the camera parameters include one or more of zoom ratio, focus parameters, exposure parameters, and filter parameters; the camera application sends a second camera request; when it is determined that at least one camera parameter corresponding to the first image frame is different from the camera parameter corresponding to the second camera request, the first image frame is processed to obtain a second image frame, the camera parameters corresponding to the first image frame are the camera parameters in the first camera request, and the camera parameters corresponding to the second image frame are the same as the camera parameters in the second camera request; the camera application displays the second image frame.
[0008] In this way, when the camera parameters in the second camera request are inconsistent with the camera parameters in the first camera request, the electronic device can process the first image frame captured by the camera into a second image frame. The camera parameters of the second image frame are the same as the camera parameters in the second camera request. In this way, when the camera module in the electronic device has not yet obtained the image frame according to the second camera request or when the image frame obtained by the camera module in the electronic device according to the camera parameters of the second camera request has not yet been sent to the upper framework of the electronic device (for example, the application framework layer), the electronic device can display the image frame corresponding to the second camera request in the camera application more quickly.
[0009] For example, when the first camera request and the second camera request are used to change the camera zoom ratio, the electronic device can process the first image frame to obtain a second image frame with the same zoom ratio as the second camera request. This can improve the tracking performance of the camera zoom in the electronic device.
[0010] In conjunction with the first aspect, in one possible implementation, upon determining that at least one camera parameter corresponding to the first image frame is different from the camera parameter corresponding to the second camera request, processing the first image frame to obtain the second image frame includes: upon determining that the zoom factor corresponding to the first image frame is different from the zoom factor corresponding to the second camera request, changing the field of view (FOV) in the first image frame to obtain the second image frame. Thus, by changing the FOV of the first image frame, the second image frame can be obtained.
[0011] In conjunction with the first aspect, in one possible implementation, changing the field of view (FOV) of a first image frame to obtain a second image frame includes: multiplying the field of view (FOV) of the first image frame by a first scaling factor to obtain the second image frame; the first scaling factor is the ratio of the zoom factor corresponding to the second camera request to the zoom factor corresponding to the first camera request. Thus, the first scaling factor can be determined using the zoom factor in the first camera request and the zoom factor in the second camera request. The FOV of the second image frame can then be determined using the first scaling factor.
[0012] In conjunction with the first aspect, in one possible implementation, the FOV of the first image frame is a first FOV, and the FOV of the second image frame is a second FOV, where the second FOV is the product of the first FOV and a first scaling factor. Thus, when the FOV of the first image frame and the first scaling factor are determined, the FOV of the second image frame can be obtained.
[0013] In conjunction with the first aspect, in one possible implementation, the size of the first image frame is a first size. When it is determined that the zoom magnification corresponding to the first image frame is different from the zoom magnification corresponding to the second camera request, the field of view (FOV) of the first image frame is changed to obtain a second image frame. Specifically, this may include: cropping the first image frame from the first size to a second size; the second size being the product of the first size and a second scaling factor, where the second scaling factor is the reciprocal of the first scaling factor; changing the first image frame at the second size from the first FOV to the second FOV; and scaling the first image frame from the second size to the first size to obtain the second image frame. In this way, through cropping and scaling, the first image frame can be processed into the second image frame.
[0014] In conjunction with the first aspect, in one possible implementation, before the camera application issues the first camera request, the method may further include: detecting a first user operation of changing the zoom magnification of the camera application to the first zoom magnification. In this way, the camera application may issue the first camera request in response to the user zoom operation (i.e., the first operation).
[0015] In conjunction with the first aspect, in one possible implementation, before the camera application issues the second camera request, the method may further include: detecting a second user operation of changing the zoom magnification of the camera application to a second zoom magnification. In this way, the camera application may issue the second camera request in response to the user zoom operation (i.e., the second operation).
[0016] In conjunction with the first aspect, in one possible implementation, the method may further include: after detecting the first operation, the camera application displays a first preview interface, the first preview interface including a zoom magnification control, the zoom magnification control indicating that the zoom magnification value of the image frame displayed in the first preview interface is a first zoom magnification; after detecting the second operation, the camera application displays a second preview interface, the second preview interface including a zoom magnification control, the zoom magnification control indicating that the zoom magnification value of the image frame displayed in the second preview interface is a second zoom magnification. In this way, the user can obtain the current zoom magnification from the zoom magnification control on the camera preview interface.
[0017] In combination with the first aspect, in a possible implementation manner, the second image frame is displayed in the second preview interface, and the first proportional coefficient is a ratio of the second zoom ratio to the first zoom ratio.
[0018] In combination with the first aspect, in one possible implementation, the electronic device may include a shooting parameter generation module and an image cropping module; obtaining a first image frame according to the camera parameters in the first camera request includes: the shooting parameter generation module extracts the camera parameters in the first camera request and sends them to the camera module; the camera module shoots the first image frame according to the camera parameters in the first camera request; and the camera module sends the first image frame to the image cropping module.
[0019] In this way, the electronic device can send a camera request to the camera module through the shooting parameter generation module, and can also obtain the image frame shot by the camera module through the image cropping module.
[0020] In combination with the first aspect, in a possible implementation, after the camera application sends the second camera request, the method may further include: a shooting parameter generation module extracting the camera parameters in the second camera request and sending them to the image cropping module.
[0021] In this way, the electronic device can extract the camera parameters in the camera request through the shooting parameter generation module, and the shooting parameter generation module can send the extracted camera parameters to the image cropping module.
[0022] In combination with the first aspect, in one possible implementation, when it is determined that at least one camera parameter corresponding to the first image frame is different from the corresponding camera parameter in the second camera request, the first image frame is processed to obtain the second image frame, including: an image cropping module determines that at least one camera parameter corresponding to the first image frame is different from the corresponding camera parameter in the second camera request; and the image cropping module processes the first image frame to obtain the second image frame.
[0023] In this way, the electronic device can compare the camera parameters of the image frame with the camera parameters in the current camera request through the image frame cropping module. In addition, the electronic device can also process the image frame through the image cropping module to process the first image frame into a second image frame.
[0024] In conjunction with the first aspect, in one possible implementation, the electronic device may further include a rendering process module; after the image cropping module processes the first image frame to obtain a second image frame, the method may further include: the image cropping module sending the second image frame to the rendering process module; the rendering process module displaying the second image frame; and a camera application displaying the second image frame. In this way, the electronic device can send the second image frame to the rendering process module via the image cropping module, display the second image frame via the rendering process module, and display the second image frame via the camera application.
[0025] In conjunction with the first aspect, in one possible implementation, after the camera application issues the second camera request, the method may further include: obtaining, by the camera module in the electronic device, a third image frame according to the camera parameters in the second camera request. In this manner, the camera module in the electronic device still captures the image frame according to the camera parameters in the second camera request.
[0026] In a second aspect, an electronic device is provided, which may include one or more cameras, a display, one or more processors and one or more memories; wherein the one or more cameras, the display, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method involved in any possible implementation method of the first aspect.
[0027] According to a third aspect, an electronic device is provided. The electronic device may include one or more functional modules, and the one or more functional modules are used for the method involved in any possible implementation of the first aspect.
[0028] In a fourth aspect, a chip system is provided, which is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute the method involved in any possible implementation of the first aspect.
[0029] In a fifth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method involved in any possible implementation of the first aspect.
[0030] In a sixth aspect, a computer program product is provided. When the program product is run on an electronic device, the electronic device executes the method involved in any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] FIG1 is a schematic diagram of a user interface provided in an embodiment of the present application;
[0032] Figures 2A-2C are a set of user interface schematic diagrams provided in an embodiment of the present application;
[0033] FIG3 is a schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;
[0034] FIG4 is a schematic diagram of a response of an electronic device to a user's zoom operation according to an embodiment of the present application;
[0035] FIG5A is a schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;
[0036] FIG5B is a schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;
[0037] FIG6 is a schematic diagram of the interaction between software and hardware modules of a camera request processing method provided by an embodiment of the present application;
[0038] FIG7 is a schematic diagram of a response of an electronic device to a user's zoom operation according to an embodiment of the present application;
[0039] FIG8 is a schematic diagram showing a comparison of a user zoom operation effectiveness curve provided by an embodiment of the present application;
[0040] FIG9 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0042] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of this application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear contrary indication in the context. The terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. "First" and "second" etc. are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first object and the second object are used to distinguish different objects, rather than to describe a specific order of objects.
[0043] In the description of the embodiments of this application, unless otherwise specified, "a plurality" means two or more. For example, a plurality of processing units refers to two or more processing units; a plurality of systems refers to two or more systems.
[0044] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0045] The term "and / or" in this application is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0046] To better understand the technical solutions provided by this application, before describing the technical solutions of this application, we first describe the electronic device 100 with a camera function to which this application is applicable, with reference to the accompanying drawings. In the embodiments of this application, the electronic device 100 may include, but is not limited to, devices with a camera function, such as mobile phones, tablet computers, and smart watches. This embodiment of the application does not limit the specific form or type of the electronic device 100.
[0047] The term "user interface (UI)" in the following embodiments of this application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device and finally presented as content that the user can recognize. The commonly used form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0048] To better understand the technical solutions provided by this application, before describing the technical solutions of this application, we first describe the electronic device 100 with a camera function to which this application is applicable, with reference to the accompanying drawings. In the embodiments of this application, the electronic device 100 may include, but is not limited to, devices with a camera function, such as mobile phones, tablet computers, and smart watches. This embodiment of the application does not limit the specific form or type of the electronic device 100.
[0049] Currently, electronic devices such as mobile phones have an increasing number of shooting modes. Users can change the camera's shooting mode within the camera interface, for example, by changing the current focal length or adding filters, exposure, focus, and other camera parameters. In some scenarios, when users change camera parameters on electronic devices such as mobile phones, after the mobile phone or other electronic device detects the user's zoom operation, it takes a long time to respond before displaying the preview image frame at the new zoom factor. This results in poor camera zoom tracking, affecting the user experience.
[0050] In the embodiments of the present application, the chirality of camera zoom refers to the electronic device's response to the zoom operation after the user operates the camera, that is, the electronic device displays a preview image frame at the new zoom factor. The longer the electronic device takes to respond, the worse the chirality of the camera zoom.
[0051] The following description will take the electronic device 100 as a mobile phone and an example in which a user changes the zoom ratio of a camera in the mobile phone.
[0052] FIG1 and FIG2A-FIG2C exemplarily show schematic diagrams of interfaces related to a user changing the zoom ratio of a camera in a mobile phone.
[0053] Exemplarily, the electronic device 100 may display a desktop 101, in which a page with application icons is displayed, and the page includes multiple application icons (for example, a settings application icon, an application market application icon, a gallery application icon, a browser application icon, etc.). A page indicator 104 is also displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. A tray area 102 is displayed below the page indicator 104. Among them, the tray area 102 includes multiple tray icons, for example, a camera application icon 103, an address book application icon, a phone application icon, and a message application icon. The tray area 102 remains displayed when the page is switched. In some embodiments, the above-mentioned page may also include multiple application icons and a page indicator 104. The page indicator 104 may not be part of the page and may exist independently. The above-mentioned tray icon is also optional, and the embodiments of the present application are not limited to this.
[0054] The electronic device 100 may receive an input operation (eg, a single click) from a user on the camera application icon 103 . In response to the input operation, the electronic device 100 may display the shooting interface 200 as shown in FIG. 2A .
[0055] As shown in Figure 2A, the shooting interface 200 may include an echo control 203A, a shooting control 203B, a camera conversion control 203C, a preview box 201, a zoom ratio control 202, and controls for one or more shooting modes (for example, a control 204A for the large aperture shooting mode, a control 204B for the night scene shooting mode, a control 204C for the portrait shooting mode, a control 204D for the shooting mode, a control 204E for the video recording mode, a control 204F for the multi-lens video recording mode, and a control 204G for more modes).
[0056] As shown in FIG2A , the control 204D for the photo mode is selected, and the electronic device 100 is in photo mode. The preview box 201 displays a preview image 205 captured by the electronic device 100 through the camera in photo mode. The echo control 203A can be used to trigger the display of the captured image or video. The capture control 203B is used to trigger the saving of the image captured by the camera. The camera conversion control 203C can be used to switch the camera used by the electronic device 100 to capture images (for example, the front camera is switched to the rear camera, or the rear camera is switched to the front camera). The zoom ratio control 202 can be used to set the zoom factor for the electronic device 100 to capture photos or videos. The zoom ratio control 202 can display the currently used zoom factor (for example, 1x), a commonly used zoom factor 1 (for example, 0.6x) that is smaller than the currently used zoom factor, and a commonly used zoom factor 2 (for example, 2x) that is larger than the currently used zoom factor.
[0057] The controls for the shooting mode can be used to trigger the image processing process corresponding to the shooting mode. For example, the control 204A for the large aperture shooting mode can be used to trigger the camera to shoot images using large aperture parameters. The control 204B for the night scene shooting mode can be used to trigger increasing the brightness and color richness in the captured image. The control 204C for the portrait shooting mode can be used to trigger the electronic device 100 to beautify the portrait in the captured image. The control 204D for the shooting mode can be used to trigger the electronic device 100 to shoot images using default parameters and use the default image processing process to process the images captured by the camera. The control 204E for the video recording mode can be used to trigger the electronic device 100 to record a video through a single camera. The control 204F for the multi-lens recording mode can be used to trigger the electronic device 100 to record a video simultaneously through multiple cameras. The more mode control 204G can be used to trigger the electronic device 100 to display controls for more shooting modes.
[0058] The electronic device 100 may receive a user input operation for the zoom magnification control 202 (e.g., clicking the commonly used zoom magnification 2 (e.g., 2x)). In response to the input operation, the zoom magnification of the electronic device 100 may be switched from the currently used zoom magnification to the commonly used zoom magnification 2.
[0059] Since it takes some time for the electronic device 100 to respond to the user's zoom operation, after receiving the user's input operation on the zoom ratio control 202, the electronic device 100 takes some time to respond before displaying the preview image frame under the new zoom ratio (i.e., the commonly used zoom ratio 2, such as 2x).
[0060] 2B , the zoom magnification control 202 in the user interface 210 shown in FIG2B shows that the currently used zoom magnification is 2x. The zoom magnification of the preview image 205 displayed in the preview frame 201 is still the previous zoom magnification, which is 1x.
[0061] As shown in Figure 2C, after the electronic device 100 responds for a period of time, the user interface 220 of the electronic device 100 may display a preview image 221 obtained after the electronic device 100 switches from the currently used zoom magnification (for example, 1x) to the commonly used zoom magnification 2 (for example, 2x).
[0062] 2A to 2C , the camera zoom of the electronic device 100 has poor chirality, so the user will perceive a response delay between the user operation and the actual camera image change, which affects the user experience.
[0063] The following describes the software structure of the electronic device 100. Before describing the software structure of the electronic device 100, the architecture that can be adopted by the software system of the electronic device 100 is first described.
[0064] Specifically, in actual applications, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
[0065] In addition, it is understandable that the software systems used by current mainstream electronic devices include but are not limited to Windows systems, Android systems, and iOS systems. For ease of explanation, the embodiment of the present application takes the layered architecture Android system as an example to exemplify the software structure of the electronic device 100.
[0066] In addition, the subsequent camera request processing method provided in the embodiment of the present application is also applicable to other systems in specific implementation.
[0067] FIG3 shows a schematic diagram of the software and hardware architecture of a camera service on an electronic device 100 provided in an embodiment of the present application.
[0068] As shown in Figure 3, the software and hardware architecture of the electronic device 100 includes a software system and a hardware layer that implements related camera services (for example, preview, photo taking, video recording, etc.) together with the software structure. Among them, the layered architecture divides the software system of the electronic device 100 into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (application layer), the application framework layer (framework layer, FWK), the hardware abstraction layer (hardware abstraction layer, HAL), and the drive layer (drive layer).
[0069] The application layer can include a series of application packages. As shown in Figure 3, the application package can include a camera application. The camera application can receive user zoom operations.
[0070] Optionally, the application package may also include application programs (also referred to as applications) such as gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. This embodiment of the present application does not limit this.
[0071] The application framework layer provides an application programming interface (API) and programming framework for the application packages in the application layer. The application framework layer includes some predefined functions.
[0072] In some embodiments, the application framework layer may include a request queue processing module. The request queue processing module may include a WaitForRequest module, a SendRequestsBatch module, and a PrepareHardwareAbstractLayerRequest (PrepareHALRequest) module. The WaitForRequest module may be used to, when there are no empty buffers in the N buffers allocated to the camera request of the camera application in the buffer area of the electronic device, keep the camera request to be executed in the request queue module waiting. The PrepareHALRequest module may be used to construct the camera request and output buffers (outputBuffers) of the HAL layer. When there are empty buffers in the N buffers allocated to the camera request of the camera application, the PrepareHALRequest module may obtain a buffer from the AllocateBuffer interface for the camera request issued by the camera application. The SendRequestBatch module may be used to send the Capture request of the HAL layer constructed by the PrepareHALRequest module to the HAL layer.
[0073] For example, N can be 8, meaning that the number of buffers allocated by the electronic device to the camera application for camera requests can be 8. N can also be other values, such as 7 or 9, and the present application does not limit the value of N. The following description uses the example of N being 8 as an example.
[0074] In some embodiments, the application framework layer may further include an Allocate Buffer interface for allocating a buffer for a camera request issued by a camera application. For example, the Allocate Buffer interface may specify the address of a buffer for storing the camera request.
[0075] The request queue processing module can receive camera requests sent by the camera application through the camera interface. The request queue processing module can then obtain the buffer allocated for the camera request from the buffer allocation interface module. The request queue processing module can then send the camera request and buffer address to the camera hardware abstraction layer. Specifically, the waiting request module within the request queue processing module can receive camera requests sent by the camera application through the camera interface. The waiting request module can then send the received camera request to the HAL request preparation module. The HAL request preparation module can then obtain the buffer for storing the camera request from the buffer allocation interface module. The HAL request preparation module can then send the camera request and the buffer address of the camera request to the batch request issuance module. The batch request issuance module can then send the camera request and the buffer address of the camera request to the camera hardware abstraction layer. Optionally, when the buffer for storing camera requests has an empty buffer, the HAL request preparation module can directly receive the camera request sent by the camera application through the camera interface. In this embodiment of the present application, camera requests can include preview requests, photo requests, video recording requests, and the like. This embodiment of the present application does not limit the specific nature of camera requests.
[0076] In some possible implementations, the application framework layer may further include a camera interface. For example, the camera interface may include an image acquisition interface and an interface for continuously acquiring images. The application request receiving module may receive camera requests issued by the camera application via the camera interface. Specifically, the application request receiving module may receive a photo request issued by the camera application via the image acquisition interface. The application request receiving module may receive a preview request or a video recording request issued by the camera application via the interface for continuously acquiring images.
[0077] In some embodiments, the application framework layer may include an image data consumption module, wherein the image data consumption module may receive the image frame returned by the HAL.
[0078] In some embodiments, the application framework layer may further include a rendering process Surface flinger module. This rendering process module may be used to render and synthesize image frames for display. Specifically, the image data consumption module may send the image frames returned by the HAL to the rendering process module. After receiving the image frames sent by the image data consumption module, the rendering process module may first render and synthesize the image frames before sending them to the display.
[0079] Optionally, in some examples, the image data consumption module can send the received image frames to the camera application. The camera application can then process the received image frames according to some camera algorithms in the camera application and then send the processed image frames to the rendering process module. Alternatively, the camera application can directly send the received image frames to the rendering process module.
[0080] Optionally, in some examples, the rendering process module may render and synthesize the received image frames before sending them to the camera application. The camera application may send the rendered and synthesized image frames to the display for display. Alternatively, the camera application may send the preview frame size of the camera application to the display at the same time as sending the rendered and synthesized image frames to the display.
[0081] In some embodiments, the application framework layer may also be referred to as the application framework layer.
[0082] The hardware abstraction layer (HAL) is an interface layer between the application framework layer and the driver layer, providing a virtual hardware platform for the operating system.
[0083] The hardware abstraction layer may include a camera hardware abstraction layer. The camera hardware abstraction layer may include a FWK request receiving module and a request enqueue module. The FWK request receiving module may receive camera requests from a request issuing module in the application framework layer. The FWK request receiving module may then temporarily store the received camera requests in the request enqueue module. The request enqueue module may store one or more camera requests issued by the application framework layer. The request enqueue module may sequentially transmit the camera parameters in the stored camera requests to the camera module via the driver layer in the order in which they were enqueued.
[0084] In some embodiments, the hardware abstraction layer may further include a result processing module. The result processing module may include a buffer filling module and a result return module. After the camera acquires an image frame according to the camera parameters in the camera request, the driver layer may transmit the image frame to the result processing module. The buffer filling module in the result processing module may fill the image frame into the buffer storing the camera request corresponding to the image frame. The result return module may then upload the image frame, or the buffer address storing the image frame, to the application framework layer.
[0085] In this embodiment of the present application, a camera request corresponding to an image frame refers to a camera request that includes camera parameters for obtaining the image frame. That is, the camera can obtain the image frame according to the camera parameters in the camera request. For example, if the camera obtains image frame 1 according to the camera parameters in camera request 1, then camera request 1 can be referred to as the camera request corresponding to image frame 1.
[0086] The driver layer is the layer between hardware and software. It includes drivers for various hardware components. These include camera drivers, image processor drivers, and display drivers. The camera driver drives the image sensors (e.g., image sensor 1, image sensor 2, etc.) of one or more cameras in the camera module to capture images and drives the image signal processor to pre-process the images. The image processor driver drives the graphics processor to process images. The display driver drives the display.
[0087] The hardware layer may include a camera module, an image signal processor, a display, and the like. The camera module may include one or more camera image sensors (e.g., image sensor 1, image sensor 2, etc.). Optionally, the camera module may also include a time of flight (TOF) sensor, a multispectral sensor, and the like. The image signal processor may be used to process image frames captured by the camera module. The display may be used to display image frames sent by the rendering process module or the camera application.
[0088] In combination with the above system structure, the following describes in detail the processing mechanism of the electronic device 100 for a camera request generated based on a user's operation for changing the focus, taking zoom as an example:
[0089] ①. The electronic device 100 receives the user's operation to open the camera application and sends a camera request 0 for obtaining a preview image.
[0090] When the electronic device 100 receives the user's operation to start the camera application, the electronic device 100 starts the camera application and can send a camera request 0 (with a zoom ratio of zoom0) for obtaining a preview image.
[0091] It is understandable that after the camera application in the electronic device 100 is turned on, it can periodically send a camera request for obtaining a preview image.
[0092] The zoom magnification when the camera application is started may be the default zoom magnification of the camera application, for example, 1.0x.
[0093] After receiving the camera request 0 sent by the camera application, the application framework layer of the electronic device 100 can obtain the buffer address for storing the camera request 0. The application framework layer can also store the camera request in buffer0 corresponding to the buffer address. It can be understood that the number of buffers used to store camera requests in the electronic device 100 is limited. When the camera application sends multiple camera requests in sequence, the application framework layer can store the multiple camera requests in the buffer in sequence. When the buffers in the cache area are all filled with camera requests and there is no empty buffer, the camera requests sent by the subsequent camera application need to wait for the camera requests stored in the buffer to be processed and the empty buffer to be released before they can be stored in the empty buffer.
[0094] For example, the camera application of the electronic device 100 can send a camera request 0. The request queue processing module in the application framework layer of the electronic device 100 can receive the camera request 0 through the camera interface. When there is an empty buffer in the N buffers reserved for the camera request in the cache area of the electronic device 100, the electronic device 100 can send the camera request 0 from the waiting request module in the request queue processing module to the prepare HAL request module in the request queue processing module. After the prepare HAL request module obtains the buffer address allocated by the Allocate Buffer interface for the camera request, it can store the camera request in the buffer. The prepare HAL request module can construct the camera request 0 into a Capture request of the HAL layer, and send it to the HAL layer through the batch request module.
[0095] Optionally, the HAL layer may also include a camera request waiting module. The batch request sending module may send camera request 0 to the camera request waiting module in the HAL layer. When the camera hardware abstraction module has completed processing the previous camera request, the camera request waiting module may send the new camera request 0 to the camera hardware abstraction processing module. The camera hardware abstraction processing module may then send the camera parameters in the new camera request 0 and the buffer address of the camera request to the camera module via the driver layer.
[0096] As can be understood, if camera requests are stored in multiple buffers in the buffer queue of the cache area and no buffer is empty, the request thread module needs to wait for the camera request in the first buffer in the buffer queue (for example, buffer0) to be processed. Then, when the first buffer, buffer0, is cleared, the request thread module can obtain the address of buffer0 and store camera request 0 in buffer0.
[0097] It is understood that after camera request 0 is stored in buffer 0, buffer 0 may be placed last in the buffer queue. The position of buffer 0 in the buffer queue is not fixed; the buffers in the buffer queue take turns storing camera requests. In the buffer queue, the buffer that stores camera requests first may be placed before the buffer that stores camera requests later, in the order in which the camera requests were stored. Electronic device 100 may first process the camera requests stored in the buffers at the front of the buffer queue, and then process the camera requests stored in the buffers at the back of the buffer queue.
[0098] ②. The electronic device 100 turns on the camera and obtains the image frame 0 captured by the camera based on the camera request.
[0099] After receiving camera parameter 0, the camera driver in electronic device 100 may drive electronic device 100 to turn on the camera module. The camera driver may send camera parameter 0 to the camera module. The camera module may obtain image frame 0 according to camera parameter 0. The zoom ratio of image frame 0 is zoom0.
[0100] In the embodiment of the present application, camera parameter 0 may include camera intrinsic parameters and camera extrinsic parameters. Among them, camera intrinsic parameters may include parameters such as focal length (for example, zoom ratio is zoom0), pixel focal length, etc. Camera extrinsic parameters may include the transformation relationship between different coordinate systems, for example, the transformation relationship between the world coordinate system and the camera coordinate system. The embodiment of the present application does not limit the specific camera parameters.
[0101] ③. The electronic device 100 sends the image frame 0 captured by the camera to the application framework layer, and the application framework layer renders the image frame 0.
[0102] Electronic device 100 can upload image frame 0 (zoom magnification: zoom1) captured by the camera module to the hardware abstraction layer through the camera driver. The hardware abstraction layer can store image frame 0 in the buffer of camera request 1. The camera hardware abstraction layer in the hardware abstraction layer can upload image frame 0 and the buffer address storing the image frame to the HAL frame return data processing module in the application framework layer.
[0103] Optionally, in some examples, image frame 0 captured by the camera module can be transmitted to the image signal processor. The image signal processor can pre-process image frame 0 and upload it to the hardware abstraction layer via the camera driver or image processor driver. The hardware abstraction layer can store image frame 0 in buffer 0 of camera request 1. The camera hardware abstraction layer in the hardware abstraction layer can upload image frame 0 and the address of buffer 0 storing image frame 0 to the image data consumption module in the application framework layer.
[0104] Then, the image data consumption module in the application framework layer can send the address of the image frame and / or buffer0 to the rendering process module for rendering synthesis. The rendering process module can send the rendered and synthesized image frame 0 to the display.
[0105] Optionally, in some feasible examples, after the hardware abstraction layer stores image frame 0 acquired by the camera module in buffer 0, it uploads the address of buffer 0 to the image data consumption module in the application framework layer. The image data consumption module then uploads the address of buffer 0 to the camera application. After receiving the address of buffer 0, the camera application notifies the rendering process module in the application framework layer to render the image and informs the rendering process module of the address of buffer 0. The rendering process module can retrieve image frame 0 from buffer 0 and render and synthesize image frame 0. The rendering process module can then send the rendered and synthesized image frame 0 to the camera application.
[0106] Alternatively, in some feasible examples, the rendering process module can directly render and synthesize image frame 0 in buffer0. When the rendering and synthesis are complete, the camera application can be notified of the completion of the rendering and synthesis. The camera application can then notify the display driver through the display driver to display image frame 0 and inform the address of buffer0. The display can then retrieve the rendered and synthesized image frame 0 from buffer0 and display it.
[0107] ④. The electronic device 100 displays image frame 0.
[0108] After receiving the rendered and synthesized image frame 0, the display of the electronic device 100 may display the image frame 0 (with a zoom ratio of zoom0).
[0109] Furthermore, in some examples, after the display successfully displays image frame 0, buffer0 in the electronic device's buffer area storing image frame 0 and the camera request for the image frame is cleared, so that the requesting process in the application framework layer can store another camera request in buffer0.
[0110] ⑤. The electronic device 100 receives the user's zoom operation 1 and sends a camera request 1.
[0111] In some scenarios, after the camera application is started, the electronic device 100 may receive a user zoom operation and then issue a camera request 1. The zoom ratio in the camera request 1 is zoom1. Specifically, the camera application of the electronic device 100 may issue the camera request 1. The request queue processing module in the application framework layer of the electronic device 100 may receive the camera request 1 through the camera interface.
[0112] When an empty buffer exists among the N buffers reserved for camera requests in the cache area of electronic device 100, electronic device 100 can forward camera request 1 from the waiting request module in the request queue processing module to the prepare HAL request module in the request queue processing module. After obtaining the buffer address allocated for the camera request by the Allocate Buffer interface, the prepare HAL request module can store the camera request in the buffer. The prepare HAL request module can construct camera request 1 into a Capture request of the HAL layer and forward it to the HAL layer via the batch request module.
[0113] Optionally, the HAL layer may also include a camera request waiting module. The batch request sending module may send camera request 1 to the camera request waiting module in the HAL layer. When the camera hardware abstraction module has completed processing the previous camera request, the camera request waiting module may send the new camera request 1 to the camera hardware abstraction processing module. The camera hardware abstraction processing module may then send the camera parameters in the new camera request 1 and the buffer address of the camera request to the camera module via the driver layer.
[0114] The electronic device 100 may process the camera request 1 according to the above steps ② and ③, and use the camera to obtain the image frame 1 (with the zoom ratio being zoom1) according to the camera parameter 1.
[0115] In the embodiment of the present application, the user's zoom operation 1 may include, but is not limited to, the user clicking a new zoom factor in the camera's user interface, pinching with two fingers in the camera's user interface, sliding the zoom bar in the camera's user interface, and so on. For example, FIG2A illustrates the user clicking a new zoom factor in the camera's user interface. As shown in FIG2A , the current zoom factor displayed in the camera's user interface 200 is 1x, and the user clicks a zoom factor of 2x. The embodiment of the present application does not limit the specific zoom operation of the user.
[0116] ⑥. The electronic device 100 receives the user's zoom operation 2 and issues a camera request 2.
[0117] Before electronic device 100 displays image frame 1, it may receive a user zoom operation 2. Zoom operation 2 is used to change the camera's zoom magnification from zoom 1 to zoom 2. In response to zoom operation 2, electronic device 100 may issue a camera request 2, in which the zoom magnification is zoom 2.
[0118] It is understandable that the application framework layer and HAL, driver layer, and hardware layer of the electronic device 100 will first process camera request 1 according to steps ① to ④ above. Then, when camera request 2 is sent, the electronic device 100 will also process request 2 according to the steps for processing camera request 1. For example, in some examples, after camera request 2 is sent to the HAL, the application framework layer of the electronic device 100 can start processing camera request 2. After the application framework layer processes camera request 2, it can send camera request 2 to the HAL. If the HAL has not yet processed camera request 1, camera request 2 can be temporarily stored in the pending request queue in the HAL. After the HAL processes camera request 1 and returns the image frame corresponding to camera request 1 to the application framework layer, the HAL can continue to process camera request 2.
[0119] ⑦. The electronic device 100 displays the image frame acquired according to the zoom operation 1.
[0120] While the electronic device 100 is processing the camera request 2, the electronic device 100 may also display an image frame acquired according to the zoom operation 1, that is, image frame 1. The zoom magnification of the image frame 1 is zoom1.
[0121] Because electronic device 100 must follow the aforementioned process for processing camera request 0 to process each camera request, it first sends the camera request to the HAL through the application framework layer. The HAL then retrieves the image frame corresponding to the camera request from the camera. The HAL then sends the retrieved image frame to the application framework layer for display. Finally, the user can view the image frame corresponding to the camera request. For details, see steps 1 through 4. Thus, after the user performs a zoom operation, electronic device 100 must also respond to the user's zoom operation 2 according to the aforementioned process for processing camera request 1. Therefore, if the user performs zoom operation 1 and then subsequently performs zoom operation 2 (for example, by clicking on the original zoom magnification, zoom1, to switch to a new zoom magnification, zoom2), electronic device 100 will not immediately display the image frame with zoom magnification zoom2. Instead, electronic device 100 will respond to zoom operation 1 and then zoom operation 2. While electronic device 100 is responding to camera request 2 with zoom magnification zoom2, it will continue to display the image frame with zoom magnification zoom1. Thus, the camera zoom of the electronic device 100 has poor chirality, which affects the user experience.
[0122] For example, as shown in Figure 4, the camera application in electronic device 100 can sequentially send multiple zoom requests to the application framework layer FWK. For example, zoom request 1, zoom request 2, zoom request 3, zoom request 4, and so on. After the FWK receives zoom request 1, zoom request 2, zoom request 3, and zoom request 4, it can sequentially send the camera parameters corresponding to each zoom request to the HAL. These camera parameters may include a zoom value. After receiving a zoom operation from the user, the camera application can send multiple zoom requests and determine the zoom value (i.e., zoom magnification) corresponding to each zoom request. Alternatively, the camera application can send a zoom request after receiving each zoom operation from the user, with the zoom value in each zoom request determined by the camera application based on the user operation. As shown in Figure 7, the zoom value (i.e., zoom magnification) corresponding to zoom request 1 may be 1.5x. The zoom value corresponding to zoom request 2 may be 1.6x. The zoom value corresponding to zoom request 3 may be 1.7x. The zoom value corresponding to zoom request 4 can be 1.8x. After the camera parameters corresponding to each zoom request are sent to HAL, HAL can process and return the corresponding image frame. After the camera application sends zoom request 4, HAL obtains image frame 1 according to the zoom value in zoom request 1, and the zoom magnification of image frame 1 is 1.5x. In this way, when the user sets the zoom magnification to 1.8x in the camera user interface, the electronic device 100 displays the image frame with a zoom magnification of 1.5x. In this way, the camera zoom of the electronic device 100 has poor chirality, resulting in a poor user experience.
[0123] To reduce the chirality delay of camera-related parameters (e.g., zoom, focus, exposure, and filters) and improve user experience, an embodiment of the present application provides a camera request processing method. The method may include: electronic device 100 receiving a user zoom operation 1, wherein zoom operation 1 is used to switch the zoom magnification of the camera application to zoom1. In response to zoom operation 1, electronic device 100 issues camera request 1 and, based on camera request 1, obtains image frame 1, wherein the zoom magnification of image frame 1 is zoom1. Before electronic device 100 displays image frame 1, electronic device 100 receives a user zoom operation 2, wherein zoom operation 2 is used to switch the zoom magnification of the camera application to zoom2. When electronic device 100 displays image frame 1, it compares the zoom magnification of image frame 1 with the current zoom magnification. If the zoom magnification of image frame 1 is inconsistent with the current zoom magnification, electronic device 100 processes image frame 1 to obtain image frame 2, wherein the zoom magnification of image frame 2 is zoom2. Electronic device 100 displays image frame 2. In this way, by processing the image frames acquired by the electronic device 100, the chirality of the camera zoom can be optimized, thereby improving the user experience.
[0124] FIG5A exemplarily shows a schematic diagram of the software and hardware architecture of a camera service on another electronic device provided in an embodiment of the present application.
[0125] As shown in Figure 5A, the software and hardware architecture of the electronic device 100 includes a software system and a hardware layer that implements related camera services (for example, preview, photo taking, video recording, etc.) together with the hardware structure. Among them, the layered architecture divides the software system of the electronic device 100 into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (application layer), the application framework layer (framework layer, FWK), the hardware abstraction layer (hardware abstraction layer, HAL), and the drive layer (drive layer).
[0126] The application layer may include a series of application packages. As shown in FIG5A , an application package may include a camera application.
[0127] Optionally, the application package may also include application programs (also referred to as applications) such as gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. This embodiment of the present application does not limit this.
[0128] The application framework layer provides an application programming interface (API) and programming framework for the application packages in the application layer. The application framework layer includes some predefined functions.
[0129] As shown in Figure 5A, the application framework layer also includes a shooting parameter generation module, a request queue processing module, an allocation buffer interface, a result processing module, an image cropping module, a vsync signal monitoring module, a display thread, a timer, a buffer manager, and a rendering process surface flinger.
[0130] The shooting parameter generation module is configured to generate a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters sent by the camera application when detecting that the user has adjusted the shooting parameters. The module also determines one or more transition shooting parameters based on the image frame return time and the smooth adjustment curve.
[0131] The shooting parameter generation module is also used to send a transition shooting parameter to the HAL layer when it detects that the HAL layer uploads an image frame to the result processing module. The HAL layer then sends the transition shooting parameter to the camera module, so that the camera module can obtain the image frame based on the transition shooting parameter.
[0132] In some embodiments, the shooting parameter generation module may also be located in the HAL layer. This application does not limit the location of the shooting parameter generation module.
[0133] For the request queue processing module and the allocation buffer area interface, please refer to the description in Figure 3, and this application will not go into details here.
[0134] The image cropping module is used to crop or scale the acquired image frame based on the camera parameters requested by the current camera and the camera parameters of the acquired image frame.
[0135] The result processing module is used to receive the image frame and the shooting parameters of the image frame sent by the HAL layer, or store the buffer address of the image frame and the shooting parameters of the image frame.
[0136] The result processing module is further used to send the image frame and the shooting parameters of the image frame, or the buffer address storing the image frame and the shooting parameters of image frame A to the image cropping module.
[0137] In some embodiments, the result processing module is further configured to store the image frame and the shooting parameters of the image frame, or the buffer address storing the image frame and the shooting parameters of the image frame in the buffer manager.
[0138] The buffer manager is used to store image frames to be displayed or to store the buffer address of image frames to be displayed.
[0139] The buffer manager is further configured to send the stored image frame or the buffer address storing the image frame to the display sending thread when the display sending thread obtains the image frame.
[0140] The display sending thread is used to determine the timing of obtaining the next image frame to be sent for display from the buffer manager based on the vsync signal period or the timer period.
[0141] Specifically, in one possible implementation, the display thread can be configured to obtain the next image frame to be displayed from the buffer manager after m vsync signal cycles have elapsed since the previous image frame was displayed, and send the obtained image frame to the camera application. The camera application can then send the obtained image frame to the rendering process module.
[0142] Optionally, in one possible implementation, the display thread may also obtain the next image frame to be displayed from the buffer manager after a timer display period has elapsed since the previous image frame was displayed, and send the obtained image frame to the camera application. The camera application may send the obtained image frame to the rendering process module.
[0143] The vsync signal monitoring module is used to monitor the vsync signal cycle in the rendering process and send the vsync signal cycle to the display process.
[0144] The timer can be used to send a timer period signal to the display thread, wherein the period of the timer can be determined by the screen refresh frame rate of the electronic device.
[0145] The rendering process module is used to render the image frames sent by the camera application and send the rendering results (i.e., the rendered image frames) to the camera application. The camera application can display the rendering results.
[0146] In some embodiments, the application framework layer may also be referred to as the application framework layer.
[0147] The hardware abstraction layer HAL, driver layer and hardware layer can refer to the description in Figure 3 and will not be repeated here.
[0148] In combination with the software and hardware framework of the electronic device 100 provided in Figure 5A above, Figure 5B shows the interaction of relevant modules involved in an embodiment of the present application and the specific data flow of the electronic device processing camera requests in order to improve the tracking performance of camera zoom requests.
[0149] As shown in FIG5B , the application framework layer may include a shooting parameter generation module, a request queue processing module, and an image cropping module. The request queue processing module may include a waiting request module, a HAL request preparation module, and a batch request issuance module. The request queue processing module may be described in FIG3 above and will not be further elaborated here.
[0150] In some embodiments, the shooting parameter generation module may further transmit control parameters (e.g., resolution, zoom ratio, frame rate, etc.) obtained from the camera request or transition shooting parameters generated based on the control parameters in the camera request to the image cropping module. The shooting parameter generation module may also refer to the description in FIG. 5A .
[0151] In one possible implementation, the image cropping module may send the image frame to the rendering process module. Before the image cropping module sends the image frame to the rendering process module, the image cropping module may also generate the camera parameters in the current camera request from the shooting parameters. The image cropping module may compare the control parameters in the image frame to be displayed with the control parameters included in the camera parameters in the current camera request. When the control parameters in the image frame to be displayed are inconsistent with the control parameters included in the camera parameters in the current camera request, the image cropping module may process the image frame to be displayed to obtain a processed image frame, in which the control parameters in the processed image frame are the same as the control parameters included in the camera parameters in the current camera request. Then, the image cropping module may send the processed image frame to the rendering process module. When the control parameters in the image frame to be displayed are consistent with the control parameters included in the camera parameters in the current camera request, the image cropping module may directly send the image frame to be displayed to the rendering process module.
[0152] In some embodiments, the application framework layer may further include a rendering process module. The rendering process module may be as described in FIG3 above, and will not be described in detail here.
[0153] The hardware abstraction layer HAL, driver layer and hardware layer can refer to the description in Figure 3 and will not be repeated here.
[0154] In combination with the above system structure, the following describes in detail the processing mechanism of the electronic device 100 for a camera request generated based on a user's operation for changing the focus, taking zoom as an example:
[0155] ①. The electronic device 100 receives the user's operation to open the camera application and sends a camera request 0 for obtaining a preview image.
[0156] ②. The electronic device 100 turns on the camera and obtains the image frame 0 captured by the camera based on the camera request.
[0157] For the above steps ① and ②, please refer to the description of steps ① and ② in FIG3 , which will not be repeated here.
[0158] ③. The electronic device 100 sends the image frame 0 captured by the camera to the application framework layer, and the application framework layer renders the image frame 0.
[0159] The electronic device 100 sends the image frame 0 captured by the camera to the image cropping module in the application framework layer. The image cropping module can obtain the control parameters contained in the camera parameters of the current camera request from the shooting parameter generation module. In some scenarios, since the electronic device 100 does not receive any user operation, such as the operation of changing the camera zoom ratio, during the process from the electronic device 100 starting the camera application to the electronic device 100 obtaining the image frame 0 and sending the image frame 0 for display. Therefore, the control parameters of the current frame obtained by the image cropping module are the same as the control parameters in the image frame, and the image cropping module can send the image frame 0 to the rendering process module. The rendering process module can render the image frame 0.
[0160] ④. The electronic device 100 displays image frame 0.
[0161] For step ④, please refer to the description of step ④ in FIG3 above, which will not be repeated here.
[0162] ⑤. The electronic device 100 receives the user's zoom operation 1 and sends a camera request 1.
[0163] ⑥. The electronic device 100 receives the user's zoom operation 2 and issues a camera request 2.
[0164] Step ⑤ and step ⑥ can be described in the above-mentioned step ⑤ and step ⑥ in FIG3 , which will not be repeated here.
[0165] For example, zoom operation 1 may be when a user sets the zoom magnification of a camera application to zoom1. Accordingly, the zoom magnification in the camera parameters carried in camera request 1 is zoom1. Zoom operation 2 may be when a user changes the zoom magnification of a camera application from zoom1 to zoom2. Accordingly, the zoom magnification in the camera parameters carried in camera request 2 is zoom2.
[0166] ⑦. The electronic device 100 obtains the image frame 1 corresponding to the camera request 1, and determines that the control parameters in the image frame 1 are inconsistent with the control parameters in the camera parameter of the current camera request, and processes the image frame 1 into the image frame 2.
[0167] The electronic device 100 can process the camera request 1 and obtain the image frame 1 corresponding to the camera request 1. How the electronic device 100 obtains the image frame 1 can refer to the description of how the electronic device 100 obtains the image frame 0 in steps ① to ③ in FIG3 above, which will not be repeated here.
[0168] After the HAL of the electronic device 100 sends the acquired image frame 1 to the image cropping module in the application framework layer, the image cropping module can determine whether the control parameters of image frame 1 (e.g., zoom ratio) are consistent with the control parameters in the current camera request (e.g., camera request 2). Since the zoom ratio of image frame 1 is zoom1 and the zoom ratio in camera request 2 is zoom2, the image cropping module can determine that the control parameters of image frame 1 are inconsistent (also called different) with the control parameters in the current camera request. Then, the image cropping module can process image frame 1 to obtain image frame 2. The size of image frame 2 is the same as that of image frame 1, and the control parameters in image frame 2 are consistent with the control parameters in the current camera request. For example, if the current camera request is camera request 2 and the zoom ratio in camera request 2 is zoom2, then the zoom ratio of image frame 2 is also zoom2.
[0169] In the embodiment of the present application, the current camera request refers to the camera request issued by the electronic device 100 before the image frame obtained by the HAL is sent for display, at the moment closest to the time when the HAL returns the image frame to the image cropping module in the application framework layer.
[0170] ⑧. The electronic device 100 displays the image frame 2.
[0171] Electronic device 100 can display image frame 2. Specifically, after the image cropping module processes image frame 1 to obtain image frame 2, the image cropping module can send image frame 2 to the rendering process module. The rendering process module can render and synthesize image frame 2, and then send the rendered and synthesized image frame 2 to the display via the display driver. The display can display image frame 2.
[0172] It is understandable that after the HAL processes the camera request sent to the HAL before the camera request 2, the HAL will send the camera parameters in the camera request 2 to the camera module through the camera driver. The camera module can capture the image frame according to the camera parameters in the camera request 2 and send the image frame to the HAL layer. The HAL layer uploads it to the image cropping module. The image cropping module needs to determine whether the camera parameters of the image frame are consistent with the camera parameters in the current camera request. If they are consistent, the image cropping module directly sends the image frame to the rendering process module. If they are inconsistent, the image cropping module processes the image frame. The specific processing process can be referred to the process of the image cropping module processing image frame 1 into image frame 2, which will not be repeated here.
[0173] 5A and 5B , a camera request processing method provided in an embodiment of the present application is described in detail, taking the example of a user changing the current zoom ratio in the shooting interface of a camera application after the camera application is started as an example.
[0174] FIG6 shows a schematic diagram of the interaction between software and hardware modules of a camera request processing method in an embodiment of the present application.
[0175] As shown in Figure 6, the electronic device 100 may include a camera application, an application framework layer (framework, FWK), a hardware abstraction layer (HAL), and a hardware layer. Among them, the application framework layer may include a shooting parameter generation module 610, an image cropping module 620, and a rendering process module 630. The hardware abstraction layer may include a camera hardware abstraction layer 640. The hardware layer may include a camera module and a display.
[0176] When processing a camera request, the interaction process between the software and hardware modules of the electronic device 100 may include the following steps:
[0177] S601: Detecting an operation of starting a camera, and starting a camera application.
[0178] The electronic device 100 may detect an operation of starting the camera, for example, the user may click the camera application icon 103 as shown in FIG1. In response to the user operation, the camera application is started and a shooting interface of the camera application is displayed, for example, the shooting interface 200 shown in FIG2A.
[0179] S602 : The camera application sends a camera request 0 (zoom magnification is zoom0) to the shooting parameter generation module 610 .
[0180] After the camera application is started, the camera application can send multiple camera requests to the application framework layer for obtaining preview image frames. The multiple camera requests can include camera request 0. The zoom ratio corresponding to camera request 0 can be zoom0.
[0181] Zoom0 can be the default zoom ratio after the camera application is opened, for example, 1x. Zoom0 can also be the zoom ratio set by the user before the camera application is last closed. This embodiment of the application is not limited to this. This embodiment of the application also does not limit the specific value of zoom0.
[0182] The camera application may send a camera request 0 to the shooting parameter generation module 610 in the application framework layer.
[0183] The shooting parameter generation module 610 can obtain the control parameters in the camera request 0. Alternatively, upon detecting that the user has adjusted the shooting parameters, it can generate a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters sent by the camera application. Furthermore, it can determine one or more transition control parameters based on the image frame return time and the smooth adjustment curve.
[0184] S603a: The shooting parameter generating module 610 sends the current zoom magnification zoom0 to the image cropping module 620.
[0185] In one possible implementation, the shooting parameter generation module 610 may obtain the current zoom magnification zoom0 from the camera request 0 and send the zoom magnification zoom0 to the image cropping module 620. It is understandable that the shooting parameter generation module 610 may send not only the zoom magnification 0 but also all the control parameters in the camera request 0 to the image cropping module 620.
[0186] Optionally, in one possible implementation, the shooting parameter generation module 610 may obtain camera parameter 0 from camera request 0. Camera parameter 0 may include camera extrinsic parameters and camera intrinsic parameters (also referred to as control parameters). The shooting parameter generation module 610 may send camera parameter 0 or the control parameters in camera parameter 0 to the image cropping module 620.
[0187] S603b: The shooting parameter generation module 610 sends a camera request 0 (zoom ratio is zoom0) to the camera hardware abstraction layer 640 .
[0188] 5B , the shooting parameter generation module 610 may send a camera request 0 (zoom magnification is zoom0) to the request queue processing module 610. The request queue processing module may then send the camera request 0 to the camera hardware abstraction layer 640.
[0189] Optionally, in a possible implementation, the shooting parameter generation module 610 may extract the camera parameter 0 from the camera request 0, and then send the camera parameter 0 to the camera hardware abstraction layer 640 through the request queue processing module.
[0190] It is understandable that the embodiment of the present application does not limit the execution order of the above steps S603a and S603b. After the shooting parameter generation module 610 extracts camera parameter 0 from camera request 0, the shooting parameter generation module 610 may also first send camera parameter 0 to the image cropping module 620. Then, the shooting parameter generation module 610 sends camera parameter 0 or camera request 0 to the camera hardware abstraction layer 640. Optionally, after extracting camera parameter 0 from camera request 0, the shooting parameter generation module 610 may first send camera parameter 0 or camera request 0 to the camera hardware abstraction layer 640. Then, the shooting parameter generation module 610 sends camera parameter 0 to the image cropping module 620. This embodiment of the present application does not limit this.
[0191] S604 : The camera hardware abstraction layer 640 extracts the camera parameter 0 in the camera request 0 .
[0192] In the case that the shooting parameter generation module 610 directly sends the camera request 0 to the camera hardware abstraction layer 640 through the request queue processing module, the camera hardware abstraction layer 640 may extract the camera parameter 0 from the camera request 0 .
[0193] Alternatively, in one possible implementation, when the shooting parameter generation module 610 extracts camera parameter 0 from camera request 0 and then sends camera parameter 0 to the camera hardware abstraction layer 640 via the request queue processing module, the camera hardware abstraction layer may not execute step S604. In other words, step S604 is optional.
[0194] S605 : The camera hardware abstraction layer 640 sends camera parameter 0 to the camera module.
[0195] S606 : The camera module obtains image frame 0 (zoom ratio is zoom0) according to camera parameter 0.
[0196] S607 : The camera module sends image frame 0 (zoom ratio is zoom0) to the camera hardware abstraction layer 640 .
[0197] The camera hardware abstraction layer 640 may send camera parameter 0 to the camera driver. After receiving camera parameter 0, the camera driver may drive the electronic device 100 to turn on the camera module. The camera driver may send camera parameter 0 to the camera module. The camera module may obtain image frame 0 according to camera parameter 0. The zoom ratio of image frame 0 is zoom0. The camera module may send image frame 0 to the camera hardware abstraction layer via the camera driver.
[0198] S608 : The camera hardware abstraction layer sends image frame 0 (zoom ratio is zoom0 ) to the image cropping module 620 .
[0199] The camera hardware abstraction layer may send image frame 0 to the image cropping module 620 .
[0200] S609 , the image cropping module 620 determines that the zoom magnification of the image frame 0 is consistent with the current zoom magnification, and sends the image frame 0 for display.
[0201] S610 , the image cropping module 620 sends the display image frame 0 (zoom magnification is zoom0) to the rendering process module 630 .
[0202] S611 , the rendering process module 630 sends the display image frame 0 (zoom magnification is zoom0) to the display.
[0203] S612: The display shows image frame 0 (zoom ratio is zoom0).
[0204] After receiving image frame 0, the image cropping module 620 can compare the zoom magnification in image frame 0 with the zoom magnification in the current camera request. In some scenarios, after the camera application is started, if there is no zoom operation by the user, the camera application can periodically issue camera requests for obtaining preview image frames according to the default zoom magnification. Before the image consumption data module obtains image frame 0, the image cropping module 620 can obtain the zoom magnification in the current camera request. Since the zoom magnification in the camera application has not changed, the image cropping module can determine that the zoom magnification of image frame 0 is consistent with the zoom magnification in the current camera request. Then, the image cropping module can send the image frame 0 to the rendering process module 630 for display. That is, the image cropping module sends image frame 0 to the rendering process module 630.
[0205] After receiving the image frame 0, the rendering process module 630 may render and synthesize the image frame 0, and send the rendered and synthesized image frame 0 to the display through the display driver. The display may display the rendered and synthesized image frame 0.
[0206] S613: The camera application detects a zoom operation 1 in which the user changes the zoom magnification of the camera application to zoom1.
[0207] S614 : In response to zoom operation 1 , the camera application sends a camera request 1 (with a zoom magnification of zoom1 ) to the shooting parameter generation module 610 .
[0208] The camera application may detect a zoom operation 1 in which the user changes the zoom magnification of the camera application to zoom 1. In response to the zoom operation 1, the camera application may send a camera request 1 to the shooting parameter generation module 610.
[0209] Step S613 and step S614 may refer to the description of step ⑤ in FIG3 above, and will not be repeated here.
[0210] S615 a , the shooting parameter generating module 610 sends the current zoom magnification zoom1 to the image cropping module 620 .
[0211] The shooting parameter generation 610 may send the current zoom magnification zoom1 to the image cropping module 620. Step S615a may refer to the description of the above step S603a, which will not be repeated here.
[0212] S615b: The shooting parameter generation module 610 sends a camera request 1 (zoom ratio is zoom1) to the camera hardware abstraction layer 640.
[0213] 5B , the shooting parameter generation module 610 may send a camera request 1 (zoom magnification is zoom1) to the request queue processing module 610. The request queue processing module may then send the camera request 1 to the camera hardware abstraction layer 640.
[0214] Optionally, in a possible implementation, the shooting parameter generation module 610 may extract the camera parameter 1 from the camera request 1, and then send the camera parameter 1 to the camera hardware abstraction layer 640 through the request queue processing module.
[0215] It is understood that the embodiment of the present application does not limit the execution order of the above steps S615a and S615b. After the shooting parameter generation module 610 extracts the camera parameter 1 from the camera request 1, the shooting parameter generation module 610 may also first send the camera parameter 1 to the image cropping module 620. Then, the shooting parameter generation module 610 sends the camera parameter 1 or camera request 1 to the camera hardware abstraction layer 640. Optionally, after extracting the camera parameter 1 from the camera request 1, the shooting parameter generation module 610 may first send the camera parameter 1 or camera request 1 to the camera hardware abstraction layer 640. Then, the shooting parameter generation module 610 sends the camera parameter 1 to the image cropping module 620. This embodiment of the present application does not limit this.
[0216] S616 . The camera hardware abstraction layer 640 extracts the camera parameter 1 in the camera request 1 .
[0217] In the case that the shooting parameter generation module 610 directly sends the camera request 1 to the camera hardware abstraction layer 640 , the camera hardware abstraction layer 640 may extract the camera parameter 1 from the camera request 1 .
[0218] Alternatively, in one possible implementation, when the shooting parameter generation module 610 extracts the camera parameter 1 from the camera request 1 and then sends the camera parameter 1 to the camera hardware abstraction layer 640, the camera hardware abstraction layer may not perform step S604. In other words, step S604 is optional.
[0219] S617 . The camera hardware abstraction layer 640 sends camera parameter 1 to the camera module.
[0220] S618: The camera module obtains image frame 1 (zoom ratio is zoom1) according to camera parameter 1.
[0221] S619a: The camera module sends image frame 1 (zoom ratio is zoom1) to the camera hardware abstraction layer 640.
[0222] The camera hardware abstraction layer 640 may send camera parameter 1 to the camera driver. After receiving camera parameter 1, the camera driver may drive the electronic device 100 to turn on the camera module. The camera driver may send camera parameter 1 to the camera module. The camera module may obtain image frame 1 according to camera parameter 1. The zoom ratio of image frame 1 is zoom1. The camera module may send image frame 1 to the camera hardware abstraction layer via the camera driver.
[0223] S619b: The camera application detects a zoom operation 2 in which the user changes the zoom magnification of the camera application to zoom2.
[0224] S619c: In response to zoom operation 2, the camera application sends a camera request 2 (zoom magnification is zoom2) to the shooting parameter generation module 610.
[0225] S619d: The shooting parameter generation module 610 sends the current zoom ratio zoom2 to the image cropping module 620.
[0226] The camera application may detect a zoom operation 2 in which the user changes the zoom magnification of the camera application to zoom 2. In response to the zoom operation 2, the camera application may send a camera request 2 to the shooting parameter generation module 610. The shooting parameter generation module 610 may send the current zoom magnification zoom 2 to the image cropping module 620.
[0227] It is understandable that the shooting parameter generating module 610 may send all the control parameters in the camera request 2 to the image cropping module 620. The control parameters in the camera request 2 include the current zoom magnification zoom2.
[0228] Step S619b and step S619c can refer to the description of step ⑥ in Figure 3 above, and will not be repeated here. Step S619d can refer to the description of step S603a above, and will not be repeated here.
[0229] It is understood that the present embodiment of the present application does not limit the order in which steps S619a and S619b are executed. In other words, the electronic device 100 can detect the user's zoom operation 2 before the camera module sends the image frame 1 to the camera hardware abstraction layer. The electronic device 100 can also detect the user's zoom operation 2 at any time after step S614 and before step S619a. This embodiment of the present application does not limit this.
[0230] Optionally, the user may not input zoom operation 2. After detecting the user's zoom operation 1, the camera application may sequentially issue camera request 1 and camera request 2. The camera application may also determine the zoom magnification value corresponding to camera request 1 and the zoom magnification value corresponding to camera request 2 based on zoom operation 1. This embodiment of the present application is not limited to this.
[0231] S620 , the camera hardware abstraction layer 640 sends image frame 1 (zoom ratio is zoom1 ) to the image cropping module 620 .
[0232] The camera hardware abstraction layer may send the image frame 1 to the image cropping module 620 .
[0233] S621 : The image cropping module 620 determines that the zoom magnification of the image frame 1 is inconsistent with the current zoom magnification, and processes the image frame 1 into the image frame 2 (with the zoom magnification being zoom2 ).
[0234] After receiving image frame 1, image cropping module 620 can compare the zoom factor in image frame 1 with the zoom factor in the current camera request. Before image cropping module 620 obtains image frame 1, image cropping module 620 can obtain the zoom factor in the current camera request. Because the zoom factor in the camera application changes from zoom1 to zoom2, image cropping module 620 can determine that the zoom factor of image frame 1 is inconsistent with the zoom factor in the current camera request. Then, image cropping module 620 can process image frame 1 into image frame 2, with the zoom factor of image frame 2 being zoom2.
[0235] In a possible implementation, the image cropping module 620 processes image frame 1 into image frame 2, which may include: the image cropping module 620 crops image frame 1 to obtain image frame 3; then, the image cropping module 620 scales image frame 3 to obtain image frame 2.
[0236] Furthermore, in one possible implementation, the relationship between the field of view (FOV) and size of image frame 3 and the FOV and size of image frame 1 can be seen in the following formula: FOV of image frame 3 = FOV of image frame 1 (Formula 1) Size of image frame 3 = Size of image frame 1 * (zoom factor value of image frame 1 / zoom factor value currently operated by the user) (Formula 2)
[0237] As shown in the above formula 1, the FOV of the cropped image frame (ie, image frame 3) is equal to the FOV of the original image (ie, image frame 1).
[0238] In Formula 2, "*" represents a multiplication sign and " / " represents a division sign. When cropping image frame 1, the electronic device 100 can multiply the size of image frame 1 by the scale factor 0 to obtain the size of image frame 3. The scale factor 0 is determined by the zoom magnification value of image frame 1 and the zoom magnification value of the current user operation. Specifically, the scale factor 0 is equal to the zoom magnification value of image frame 1 divided by the zoom magnification value of the current user operation. When the zoom magnification value of image frame 1 (e.g., zoom1) is equal to the zoom magnification value (e.g., zoom2) of the current user operation (e.g., zoom operation 2), the size of image frame 3 is equal to the size of image frame 1. When the zoom magnification value of image frame 1 is greater than the zoom magnification value of the current user operation, the size of image frame 3 is greater than the size of image frame 1. When the zoom magnification value of image frame 1 is less than the zoom magnification value of the current user operation, the size of image frame 3 is smaller than the size of image frame 1.
[0239] Furthermore, in one possible implementation, the relationship between the field of view (FOV) and size of image frame 2 and the FOV and size of image frame 3 can be seen in the following formula: FOV of image frame 2 = FOV of image frame 3 * (zoom magnification value currently operated by the user / zoom magnification value of image frame 1) (Formula 3) Size of image frame 2 = Size of image frame 3 * (zoom magnification value currently operated by the user / zoom magnification value of image frame 1) (Formula 4)
[0240] As shown in Formulas 3 and 4, the FOV of image frame 2 is obtained by multiplying the FOV of image frame 3 by the scaling factor 1. The size of image frame 2 is also obtained by multiplying image frame 3 by the scaling factor 1. The scaling factor 1 is equal to the current user zoom factor divided by the zoom factor of image frame 1. The scaling factors 0 and 1 are reciprocals of each other.
[0241] Furthermore, in a possible implementation, based on the above formulas 1, 2, 3, and 4, the field of view (FOV) and size of image frame 2, and their relationship to the FOV and size of image frame 1 can be determined. The relationship between the field of view (FOV) and size of image frame 2 and the FOV and size of image frame 1 can be specifically referred to in the following formula: FOV of image frame 2 = FOV of image frame 1 * (zoom factor value currently operated by the user / zoom factor value of image frame 1) (Formula 5) Size of image frame 2 = Size of image frame 1 (Formula 6)
[0242] As shown in Formulas 5 and 6 above, when compared to the original image, i.e., image frame 1, the FOV of image frame 2 is different from the FOV of image frame 1 when the zoom magnification value currently operated by the user differs from the zoom magnification value of image frame 1. The FOV of image frame 2 can be determined by the FOV of image frame 1, the zoom magnification value currently operated by the user, and the zoom magnification value of image frame 1.
[0243] It is understood that the FOV of image frame 2 is the same as the FOV of the image frame obtained by the electronic device 100 according to the zoom magnification value of the current user operation. For example, taking the current user operation as the aforementioned camera request 2 and the zoom magnification value of the current user operation as zoom2 as an example, the FOV of image frame 2 is the same as the FOV of the image frame obtained by the electronic device 100 according to zoom2. Therefore, in this embodiment of the application, the zoom magnification value of image frame 2 can also be referred to as zoom2.
[0244] S622 , the image cropping module 620 sends the display image frame 2 (with a zoom ratio of zoom2 ) to the rendering process module 630 .
[0245] S623 , the rendering process module 630 sends the image frame 2 (with a zoom ratio of zoom2) to the display.
[0246] S624: The display shows image frame 2 (zoom ratio is zoom2).
[0247] The image cropping module 620 may send the image frame 2 to the rendering process module 630 for display. That is, the image cropping module sends the image frame 2 to the rendering process module 630.
[0248] After receiving the image frame 2, the rendering process module 630 may render and synthesize the image frame 2, and send the rendered and synthesized image frame 2 to the display through the display driver. The display may display the rendered and synthesized image frame 2.
[0249] It is understandable that after the HAL of the electronic device 100 processes camera request 1 and returns image frame 1. HAL can process camera request 2 and obtain the image frame corresponding to camera request 2. Specifically, HAL will send the camera parameters in camera request 2 to the camera module through the camera driver. The camera module can shoot the image frame according to the camera parameters in camera request 2 and send the image frame to the HAL layer. The HAL layer uploads it to the image cropping module. The image cropping module needs to determine whether the camera parameters of the image frame are consistent with the camera parameters in the current camera request. If they are consistent, the image cropping module directly sends the image frame to the rendering process module. If they are inconsistent, the image cropping module processes the image frame. The specific processing process can be referred to the process of the image cropping module processing image frame 1 into image frame 2, which will not be repeated here.
[0250] The electronic device 100 may process the camera request 2 according to the above process of processing the camera request 1, which will not be repeated here.
[0251] It is understood that after the electronic device 100 receives the user's zoom operation 1 and before receiving the user's zoom operation 2, the electronic device 100 may receive one or more zoom operations. In response to the one or more zoom operations, the electronic device 100 may issue one or more camera requests. The electronic device 100 may process the one or more camera requests according to the process for processing camera request 1 described above.
[0252] In this way, through the method provided by the embodiment of the present application, when the user performs a zoom operation in the camera application of the electronic device 100, the electronic device 100 will not wait for the HAL to obtain the image frame corresponding to the zoom operation from the camera module according to the zoom operation, and then display the image frame corresponding to the zoom operation. Instead, directly at the application framework layer, the image frame that the electronic device outputs according to other zoom magnifications before the zoom operation is processed to obtain a processed image frame. The zoom magnification of the processed image frame is the same as the zoom magnification of the current zoom operation. Then, the electronic device 100 can display the processed image frame. In this way, the hand tracking performance of the camera zoom can be improved. The user can see the image frame of the zoom magnification corresponding to the zoom operation more quickly, thereby improving the user experience.
[0253] For example, as shown in Figure 7, the camera application in electronic device 100 can sequentially send multiple zoom requests to the application framework layer FWK. For example, zoom request 1, zoom request 2, zoom request 3, zoom request 4, and so on. After the FWK receives zoom request 1, zoom request 2, zoom request 3, and zoom request 4, it can sequentially send the camera parameters corresponding to each zoom request to the HAL. These camera parameters may include a zoom value. After receiving a zoom operation from the user, the camera application can send multiple zoom requests and determine the zoom value (i.e., zoom magnification) corresponding to each zoom request. Alternatively, the camera application can send a zoom request after receiving each zoom operation from the user, with the zoom value in each zoom request determined by the camera application based on the user operation. As shown in Figure 7, the zoom value (i.e., zoom magnification) corresponding to zoom request 1 may be 1.5x. The zoom value corresponding to zoom request 2 may be 1.6x. The zoom value corresponding to zoom request 3 may be 1.7x. The zoom value corresponding to zoom request 4 can be 1.8x. After the camera parameters corresponding to each zoom request are sent to HAL, HAL can process and return the corresponding image frame. After the camera application sends zoom request 4, HAL obtains image frame 1 according to the zoom value in zoom request 1, and the zoom magnification of image frame 1 is 1.5x. The electronic device 100 can crop and scale image frame 1 according to the latest zoom value, that is, the zoom magnification of 1.8x, to obtain image frame 2. The zoom magnification corresponding to image frame 2 is 1.8x. In this way, when the user sets the zoom magnification to 1.8x in the camera's user interface, the image frame with a zoom magnification of 1.8x in the camera application can be seen more quickly, thereby improving the user experience.
[0254] In some examples, the zoom request 1 may be the camera request 1 mentioned above, and the zoom request 4 may be the camera request 2 mentioned above.
[0255] Figure 8 shows a schematic diagram of the zoom operation effectiveness curves corresponding to the camera request processing method provided in an embodiment of the present application and a camera request processing method in the prior art. As shown in Figure 8, Curve 1 is a user point-cut Bezier curve generated based on different zoom operations (different zoom magnifications) performed by the user at different times. Curve 2 is a curve plotted based on the zoom operation effectiveness time of the user according to the camera request processing method provided in an embodiment of the present application. Curve 3 is a curve plotted based on the zoom operation effectiveness time of the user according to the prior art. As shown in Figure 8, after a user inputs a zoom operation on electronic device 100, according to the camera request processing method provided in an embodiment of the present application, electronic device 100 requires approximately 65 ms (ms: a unit of time representing milliseconds) to display an image frame at the zoom magnification corresponding to the zoom operation. In the prior art, electronic device 100 must first process the camera request prior to the zoom operation and then process the camera request issued in response to the zoom operation. Electronic device 100 must wait for the HAL to return the image frame acquired by the camera module at the zoom magnification corresponding to the zoom operation before displaying the image frame at the zoom magnification corresponding to the zoom operation. It takes about 180ms for the electronic device 100 to receive a user zoom operation and display an image frame with the zoom magnification corresponding to the zoom operation. Compared with the prior art, the camera request processing method provided in the embodiment of the present application can improve the tracking performance of camera zoom.
[0256] In an embodiment of the present application, the first camera request may be one or more of camera request 1 and zoom request 1. The second camera request may be one or more of camera request 2 and zoom request 4. The first zoom ratio may be one or more of zoom 1 and 1.5x. The second zoom ratio may be one or more of zoom 2 and 1.8x. The first image frame may be image frame 1. The second image frame may be image frame 2. The first image frame at the second size may be image frame 3.
[0257] It is understandable that the application scenario of the camera request processing method provided in the embodiment of the present application is not limited to the scenario where the user changes the camera zoom ratio, but can also be applied to the user changing the camera shooting mode through other operations. For example, the user inputs user operations such as adding filters, turning on or off exposure, and setting focus in the camera. The electronic device can process the camera request issued by the electronic device in response to the user operations such as adding filters, turning on or off exposure, and setting focus in the camera according to the camera request processing method shown in Figure 6 above. Through the camera request processing method provided in the embodiment of the present application, the electronic device can reduce the response delay to the user's operation of changing the shooting mode. In this way, the user experience can be improved.
[0258] The following introduces an exemplary electronic device 100 provided in an embodiment of the present application.
[0259] FIG9 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0260] The following embodiments are described in detail using electronic device 100 as an example. It should be understood that electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have a different component configuration. The various components shown in the figure may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.
[0261] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0262] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0263] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0264] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0265] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0266] In some embodiments, the processor 110 may include one or more interfaces. The interfaces 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.
[0267] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.
[0268] 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 enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0269] 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, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0270] The UART interface is a universal serial data bus used for asynchronous communication. This 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 typically 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 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.
[0271] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0272] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, 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.
[0273] The SIM interface can be used to communicate with the SIM card interface 195 to implement the function of transmitting data to the SIM card or reading data in the SIM card.
[0274] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0275] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0276] The charging management module 140 is configured to receive charging input from a charger, which may be a wireless charger or a wired charger.
[0277] 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 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.
[0278] 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 and the baseband processor.
[0279] 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 antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0280] 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 (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.
[0281] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted 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 being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the 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.
[0282] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), 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 that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0283] 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 a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (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. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0284] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0285] Display screen 194 is used to display images, videos, and the like. 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0286] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0287] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and color. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0288] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0289] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0290] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0291] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0292] 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 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0293] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. 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, applications required for at least one function (such as face recognition function, fingerprint recognition function, mobile payment function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as face information template data, fingerprint information template, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0294] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0295] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0296] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0297] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0298] Microphone 170C, also known as "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 their mouth close to the microphone 170C to input the sound signal into the 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.
[0299] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0300] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.
[0301] The gyroscope 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 gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope 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 gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0302] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0303] 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 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 based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.
[0304] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.
[0305] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
[0306] 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 objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding 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.
[0307] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.
[0308] 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.
[0309] 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 the 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 prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.
[0310] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.
[0311] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0312] 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.
[0313] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0314] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and disconnected from the electronic device 100 by inserting it into or removing it 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.
[0315] It should be understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. The electronic device 100 shown in FIG9 is merely an example. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0316] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0317] As used in the above embodiments, the term “when…” may be interpreted to mean “if…” or “after…” or “in response to determining…” or “in response to detecting…”, depending on the context. Similarly, the phrases “upon determining…” or “if (stated condition or event) is detected” may be interpreted to mean “if determining…” or “in response to determining…” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.
[0318] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).
[0319] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A camera request processing method, characterized in that: The method is applied to an electronic device having a camera module, wherein the electronic device includes a camera application, and the method includes: The first camera application sends a first camera request; The camera module in the electronic device acquires a first image frame according to camera parameters in the first camera request, where the camera parameters include one or more of a zoom ratio, a focus parameter, an exposure parameter, and a filter parameter; The camera application sends a second camera request; When it is determined that at least one camera parameter corresponding to the first image frame is different from a camera parameter corresponding to the second camera request, processing the first image frame to obtain a second image frame, wherein the camera parameter corresponding to the first image frame is the camera parameter in the first camera request, and the camera parameter corresponding to the second image frame is the same as the camera parameter in the second camera request; The camera application displays the second image frame.
2. The method according to claim 1, characterized in that The step of processing the first image frame to obtain a second image frame when it is determined that at least one camera parameter corresponding to the first image frame is different from a camera parameter corresponding to the second camera request includes: When it is determined that the zoom magnification corresponding to the first image frame is different from the zoom magnification corresponding to the second camera request, the field of view FOV in the first image frame is changed to obtain a second image frame.
3. The method according to claim 2, characterized in that The changing the field of view FOV in the first image frame to obtain a second image frame includes: The field of view FOV of the first image frame is multiplied by a first proportional coefficient to obtain the second image frame; the first proportional coefficient is a ratio of a zoom factor corresponding to the second camera request to a zoom factor corresponding to the first camera request.
4. The method according to claim 3, characterized in that The FOV of the first image frame is a first FOV, the FOV of the second image frame is a second FOV, and the second FOV is a product of the first FOV and the first proportional coefficient.
5. The method according to claim 4, characterized in that The size of the first image frame is a first size, and when it is determined that the zoom magnification corresponding to the first image frame is different from the zoom magnification corresponding to the second camera request, changing the field of view FOV in the first image frame to obtain the second image frame specifically includes: Cropping the first image frame from a first size to a second size; the second size is the product of the first size and a second proportional coefficient, and the second proportional coefficient is the reciprocal of the first proportional coefficient; changing the first image frame at the second size from the first FOV to the second FOV; The first image frame is scaled from the second size to the first size to obtain the second image frame.
6. The method according to claim 5, characterized in that Before the camera application sends the first camera request, the method further includes: detecting a first operation of a user changing a zoom magnification of the camera application to a first zoom magnification; Before the camera application sends the second camera request, the method further includes: A second operation of the user changing the zoom magnification of the camera application to a second zoom magnification is detected.
7. The method according to claim 6, characterized in that The method further comprises: After detecting the first operation, the camera application displays a first preview interface, wherein the first preview interface includes a zoom ratio control, and the zoom ratio control indicates that a zoom ratio value of an image frame displayed in the first preview interface is the first zoom ratio; After detecting the second operation, the camera application displays a second preview interface, where the second preview interface includes the zoom ratio control, and the zoom ratio control indicates that the zoom ratio value of the image frame displayed in the second preview interface is the second zoom ratio.
8. According to claim 7, it is characterized in that: The second image frame is displayed in the second preview interface, and the first proportionality factor is a ratio of the second zoom ratio to the first zoom ratio.
9. The method according to any one of claims 1 to 8, characterized in that: The electronic device comprises a shooting parameter generating module and an image cropping module; The acquiring the first image frame according to the camera parameters in the first camera request includes: The shooting parameter generation module extracts the camera parameters in the first camera request and sends them to the camera module; The camera module captures a first image frame according to the camera parameters in the first camera request; The camera module sends the first image frame to the image cropping module.
10. The method according to claim 9, characterized in that After the camera application sends the second camera request, the method further includes: The shooting parameter generation module extracts the camera parameters in the second camera request and sends them to the image cropping module.
11. The method according to claim 10, characterized in that The step of processing the first image frame to obtain a second image frame when it is determined that at least one camera parameter corresponding to the first image frame is different from a camera parameter corresponding to the second camera request includes: The image cropping module determines that at least one camera parameter corresponding to the first image frame is different from a corresponding camera parameter in the second camera request; The image cropping module processes the first image frame to obtain a second image frame.
12. The method according to claim 11, characterized in that The electronic device further includes a rendering process module; after the image cropping module processes the first image frame to obtain a second image frame, the method further includes: The image cropping module sends the second image frame to the rendering process module; The rendering process module sends the second image frame for display; The camera application displays the second image frame.
13. The method according to any one of claims 10 to 12, characterized in that: After the camera application sends the second camera request, the method further includes: The camera module in the electronic device obtains a third image frame according to the camera parameters in the second camera request.
14. An electronic device, characterized in that: It comprises a camera, one or more processors and one or more memories; wherein the camera, the one or more memories are coupled to the one or more processors, the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the method as described in any one of claims 1-13 is executed.
15. A chip system, the chip system is applied to electronic equipment, the chip system comprises one or more processors, characterized in that: The processor is configured to call computer instructions so as to execute the method according to any one of claims 1 to 13.
16. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the method according to any one of claims 1 to 13 is executed.
Citation Information
Patent Citations
Shooting method and electronic equipment
CN114531539A
Multi-camera zooming method, device and equipment
CN115225800A
Shooting method and electronic equipment
CN115802145A
Image processing method and electronic equipment
CN116939363A