Shooting parameter adjusting method, electronic equipment and storage medium

By calculating the frame return time of the image frame in real time, determining the transition shooting parameters and performing smooth switching, the jitter or lag problems of electronic devices when changing the shooting parameters are solved, and the user experience is improved.

CN120128791APending Publication Date: 2025-06-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311693137.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

When existing electronic devices change shooting parameters, the screen may jitter or stutter, resulting in poor user experience.

Method used

By calculating the return time of the image frame in real time, determining the transition shooting parameters, and switching from the initial shooting parameters to the target shooting parameters according to the smooth adjustment curve to avoid sudden parameter changes.

Benefits of technology

It effectively avoids the situation of shaking or stuttering of the screen, improves the user's visual experience, and makes the changes in shooting parameters smoother.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128791A_ABST
    Figure CN120128791A_ABST
Patent Text Reader

Abstract

The invention provides a shooting parameter adjusting method, electronic equipment and a storage medium. The method comprises the steps that the electronic equipment receives and responds to a first operation of a user for a camera application, and target shooting parameters are acquired; the electronic device obtains a frame returning moment of a first image frame, wherein the first image frame is an image frame collected based on the initial shooting parameter after the electronic device receives the first operation. And the electronic equipment determines a first transition shooting parameter based on the frame returning moment of the first image frame, the initial shooting parameter and the target shooting parameter. And the electronic equipment collects and displays a second image frame based on the first transition shooting parameter. Through the method, the electronic equipment can calculate in real time based on the frame returning moment of the image frame to obtain one or more transition shooting parameters, and smoothly switch from the initial shooting parameter to the target shooting parameter according to the one or more transition shooting parameters in sequence, so that the situation of picture jitter or lagging in the shooting parameter switching process is avoided, and the shooting efficiency is improved. And the visual experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminals, and in particular, to a method for adjusting shooting parameters, an electronic device, and a storage medium. Background Art

[0002] With the development of technology, the shooting effects of electronic devices (such as digital cameras, or mobile phones, tablet computers, etc. with cameras) are getting better and better, and using electronic devices to take pictures has become a common choice for people.

[0003] When a user uses an electronic device to take pictures, the shooting parameters can be adjusted to achieve the required shooting effects. For example, the user can adjust the shooting range through a zoom operation, and the user can also adjust shooting parameters such as the exposure. Currently, when the user changes the shooting parameters of the camera, the response of the electronic device to the user's operation has a delay, and there will be situations such as screen jitter or freezing, resulting in a poor user experience. Summary of the Invention

[0004] This application provides a method for adjusting shooting parameters, an electronic device, and a storage medium. The electronic device can calculate one or more transition shooting parameters in real time based on the frame return time of the image frame, and smoothly switch to the target shooting parameter in sequence according to the one or more transition shooting parameters, avoiding screen jitter or freezing, and improving the user's visual experience.

[0005] In a first aspect, this application provides a method for adjusting shooting parameters. The method includes: the electronic device receives and responds to a first operation of the user for the camera application, and obtains a target shooting parameter, where the target shooting parameter is the shooting parameter set by the first operation; the electronic device obtains the frame return time of the first image frame, and the first image frame is the image frame collected based on the initial shooting parameter after the electronic device receives the first operation; the electronic device determines a first transition shooting parameter based on the frame return time of the first image frame, the initial shooting parameter, and the target shooting parameter; the electronic device collects a second image frame based on the first transition shooting parameter; the electronic device displays the second image frame in the camera application.

[0006] Optionally, the electronic device can determine other more transition shooting parameters, not limited to determining one transition shooting parameter, and this application does not make a limitation on this.

[0007] Through this method, the electronic device can calculate one or more transition shooting parameters in real time based on the frame return time of the image frame, and smoothly switch from the initial shooting parameter to the target shooting parameter in sequence according to the one or more transition shooting parameters, avoiding screen jitter or freezing during the process of switching shooting parameters, and improving the user's visual experience.

[0008] In combination with the first aspect, in a possible implementation, the electronic device determines a first transition shooting parameter based on the frame return time of the first image frame, the initial shooting parameter, and the target shooting parameter. Specifically, the electronic device obtains a smooth adjustment curve based on the initial shooting parameter and the target shooting parameter. The starting point of the smooth adjustment curve is the initial shooting parameter, and the end point of the smooth adjustment curve is the target shooting parameter. The electronic device determines the first transition shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame.

[0009] In some embodiments, the type of the smooth adjustment curve may be a Bezier curve. The total duration of the smooth adjustment curve may be fixed, or the total duration of the smooth adjustment curve may be determined by the initial shooting parameter and the target shooting parameter. When the initial shooting parameter and the target shooting parameter are different, the total duration of the smooth adjustment curve may also be different.

[0010] The moment corresponding to the starting point of the smooth adjustment curve may be the moment when the electronic device receives the first operation for the camera application. The moment corresponding to the end point of the smooth adjustment curve may be the moment determined by adding the total duration of the smooth adjustment curve to the starting point of the smooth adjustment curve.

[0011] The electronic device can obtain a smooth adjustment curve based on the initial shooting parameter and the target shooting parameter, and determine one or more transition shooting parameters from the smooth adjustment curve through the frame return time of the image frame, so that the camera application can smoothly switch from the initial shooting parameter to the target shooting parameter based on the one or more transition shooting parameters. The change of the shooting parameter of the image frame finally obtained by the electronic device conforms to the change rule of the smooth adjustment curve, so as to realize that the shooting parameter can be smoothly transitioned to the target shooting parameter, avoid the situation of screen jitter or freeze, and improve the user's visual experience.

[0012] In combination with the first aspect, in a possible implementation, before the electronic device receives and responds to the first operation of the user for the camera application, the method further includes: the electronic device receives and responds to the second operation of opening the camera application, and obtains the initial shooting parameter; the electronic device collects and displays the image frame based on the initial shooting parameter.

[0013] In this way, before the electronic device receives the user operation to change the shooting parameter, the electronic device collects and displays the image frame with the initial shooting parameter.

[0014] In combination with the first aspect, in a possible implementation, the electronic device determines a first transition shooting parameter from a smooth adjustment curve based on the frame return time of the first image frame, specifically including: the electronic device determines whether the frame return time of the first image frame is earlier than the time corresponding to the target shooting parameter in the smooth adjustment curve; in the case where the frame return time of the first image frame is earlier than the time corresponding to the target shooting parameter, the electronic device determines a first transition shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame.

[0015] In a possible implementation, the method further includes: in the case where the frame return time of the first image frame is later than the time corresponding to the target shooting parameter, the electronic device acquires a third image frame based on the target shooting parameter; the electronic device displays the third image frame in the camera application.

[0016] In this way, the electronic device can determine whether to determine a transition shooting parameter based on the frame return time of the image frame and the time corresponding to the target shooting parameter in the smooth adjustment curve. In the case where the frame return time of the image frame is earlier than the time corresponding to the target shooting parameter in the smooth adjustment curve, the electronic device can determine one or more transition shooting parameters based on the frame return time of the image frame. In the case where the frame return time of the image frame is later than the time corresponding to the target shooting parameter in the smooth adjustment curve, the electronic device does not need to determine other transition zoom parameters, and the zoom ends.

[0017] In combination with the first aspect, in a possible implementation, the electronic device includes an application framework layer and a hardware abstraction layer; the first image frame is an image frame sent by the hardware abstraction layer to the application framework layer after the electronic device receives a first operation, and the frame return time of the first image frame is the time when the hardware abstraction layer sends the first image frame to the application framework layer.

[0018] In combination with the first aspect, in a possible implementation, the electronic device determines a first transition shooting parameter from a smooth adjustment curve based on the frame return time of the first image frame, specifically including; the electronic device determines a first transition shooting parameter from the smooth adjustment curve through the application framework layer based on the frame return time of the first image frame.

[0019] In this way, first, the calculation process of the transition shooting parameters is completed at the application framework layer, reducing the interaction steps between the application layer and the application framework layer, saving the time for the application layer to send the transition shooting parameters to the application framework layer. After the HAL layer returns the image frame, the application framework layer can promptly send the camera request carrying the transition shooting parameters to the HAL layer. Secondly, when the HAL layer returns the image frame to the application framework layer, the application framework layer can determine the transition shooting parameters in real time based on the frame return time of the image frame returned by the HAL layer, so that the smooth adjustment curve corresponding to the image frame returned during the shooting parameter adjustment process by the HAL layer conforms to the variation law of the preset smooth adjustment curve, making the shooting parameter adjustment process smoother without screen jitter or freezing, thus enhancing the user's visual experience.

[0020] In combination with the first aspect, in a possible implementation manner, the electronic device further includes a camera module; before the electronic device acquires a second image frame based on the first transition shooting parameter, the method further includes: in response to the electronic device determining the first transition shooting parameter from the smooth adjustment curve through the application framework layer based on the frame return time of the first image frame, the electronic device sends a first request carrying the first transition shooting parameter to the HAL layer through the application framework layer; the electronic device sends the first request to the camera module through the HAL layer; the electronic device acquires the second image frame based on the first transition shooting parameter, which specifically includes: in response to the first request, the electronic device acquires the second image frame based on the first transition shooting parameter through the camera module.

[0021] In this way, the application framework layer, the HAL layer, and the hardware layer can cooperate with each other to complete the shooting parameter adjustment process.

[0022] In combination with the first aspect, in a possible implementation manner, the shooting parameter includes any one of the following: zoom ratio, exposure, aperture, white balance, sharpness, contrast, saturation.

[0023] In a second aspect, the present application provides an electronic device, which includes a memory and a processor. The memory and the processor are coupled. The memory is used to store a computer program. When the processor executes and calls the computer program, the electronic device executes a shooting parameter adjustment method provided in any possible implementation manner of the first aspect.

[0024] In a third aspect, the present application provides a computer-readable storage medium, including instructions. When the instructions run on the electronic device, the electronic device executes a shooting parameter adjustment method provided in any possible implementation manner of the first aspect.

[0025] Fourthly, the present application provides a computer program product containing instructions. When the computer program product runs on an electronic device, it enables the electronic device to execute a shooting parameter adjustment method provided in any possible implementation manner of the first aspect above.

[0026] Fifthly, the present application provides a chip system. The chip system includes one or more processors, and the processors are used to call computer instructions to enable the electronic device to execute a shooting parameter adjustment method provided in any possible implementation manner of the first aspect above.

[0027] For the description of the beneficial effects of the second aspect to the fifth aspect, reference can be made to the description of the beneficial effects in the first aspect, and the present application will not repeat them here. Description of the Drawings

[0028] Figure 1 Shows a schematic diagram of a zoom smooth adjustment curve;

[0029] Figure 2 Shows a schematic diagram of the interaction between the software and hardware architectures of a camera application for switching the initial zoom ratio to the target zoom ratio based on the smooth adjustment curve;

[0030] Figure 3 Shows a schematic diagram of a zoom curve;

[0031] Figure 4A Shows a schematic diagram of the structure of the electronic device 100;

[0032] Figure 4B Is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention;

[0033] Figures 5A - 5I Shows a schematic diagram of the electronic device 100 adjusting the zoom ratio of the camera application based on user operations;

[0034] Figure 6A Shows a software architecture diagram of the electronic device 100 collecting an image at the initial zoom ratio provided by an embodiment of the present application;

[0035] Figure 6B Shows a software architecture diagram of the electronic device 100 collecting an image at a transition zoom ratio provided by another embodiment of the present application;

[0036] Figure 6C Shows a schematic diagram of the method flow of a shooting method provided by an embodiment of the present application;

[0037] Figures 7A - 7D Shows a schematic diagram of a zoom smooth adjustment curve;

[0038] Figure 8A flowchart showing a method for adjusting shooting parameters provided by this application. Detailed implementation manners

[0039] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. Among them, in the description of the embodiments of this application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B. The "and / or" in the text is only a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "a plurality of" means two or more than two.

[0040] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of this application, unless otherwise specified, the meaning of "a plurality of" is two or more than two.

[0041] The term "user interface (UI)" in the following embodiments of this application is a media interface for interaction and information exchange between an application or an operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The common manifestation form of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations displayed in a graphical manner. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc. displayed on the display screen of the wearable device.

[0042] When the electronic device displays the shooting preview interface or the video preview interface of the camera application, the user can change the shooting parameters. The shooting parameters can include but are not limited to any one of the following: zoom ratio, exposure, aperture, white balance, sharpness, contrast, saturation, etc.

[0043] If a user operation for adjusting the shooting parameters is detected, the electronic device can obtain a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters, and based on this smooth adjustment curve, smoothly adjust the parameter to be adjusted from the initial shooting parameters to the target shooting parameters. Among them, the initial shooting parameter value refers to the shooting parameter value before detecting this shooting parameter adjustment operation, and the target shooting parameter value is the shooting parameter value after detecting the adjustment trigger operation.

[0044] It can be understood that the smooth adjustment curve may include an initial shooting parameter, one or more transition shooting parameters, and a target shooting parameter. The electronic device can obtain preview image frames successively through the initial shooting parameter, one or more transition shooting parameters, and the target shooting parameter. In this way, it is possible to avoid the situation where the electronic device directly adjusts the shooting parameter to the target shooting parameter and causes a sudden change in the picture.

[0045] Exemplarily, the shooting parameter may be a zoom ratio, the initial shooting parameter may be an initial zoom ratio, and the target shooting parameter may be a target zoom ratio.

[0046] Figure 1 A schematic diagram of a zoom smooth adjustment curve is shown.

[0047] As Figure 1 shown, upon detecting a user operation to adjust the zoom ratio, the electronic device can obtain the Figure 1 zoom smooth adjustment curve shown as follows. Figure 1 The Bezier curve shown is a curve obtained with the initial zoom ratio as the starting point and the target zoom ratio as the ending point. One or more transition zoom ratios are included on the Bezier curve. Exemplarily, Figure 1 the shown Bezier curve includes transition zoom ratio 1, transition zoom ratio 2, and transition zoom ratio 3.

[0048] In response to detecting a user operation to adjust the zoom ratio, the electronic device can obtain preview image frames successively through transition zoom ratio 1, transition zoom ratio 2, transition zoom ratio 3, and the target zoom ratio, achieving a smooth transition from the initial zoom ratio to the target zoom ratio.

[0049] Currently, the electronic device smoothly adjusts the parameter to be adjusted from the initial shooting parameter to the target shooting parameter through the camera application.

[0050] Figure 2 A schematic diagram of the interaction between software and hardware architectures for the camera application to switch from the initial zoom ratio to the target zoom ratio based on the smooth adjustment curve is shown.

[0051] As Figure 2 shown, the layered architecture divides the system into several layers, and 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, the application framework layer, the hardware abstraction layer, and the hardware layer.

[0052] The application layer may include a series of application packages, and the application packages may include the camera application, etc.

[0053] The camera application integrates a camera request sending module and a timing module.

[0054] Among them, the camera request sending module is used to send a camera request and a zoom magnification adjustment request to the application framework layer. The camera request may include, but is not limited to, a preview request, a photo-taking request, etc.

[0055] Among them, the preview request may be sent after the camera application is started. The photo-taking request may be sent after the camera application detects a photo-taking operation. The zoom magnification adjustment request may be sent after the camera application detects an operation for adjusting the zoom magnification.

[0056] The timing module is used to obtain a frame interval, and after detecting a user operation for adjusting the zoom magnification, determine one or more transition zoom magnifications based on the frame interval and a Bezier curve, so that the camera request sending module can determine the number of times to send a zoom magnification adjustment request to the program framework layer based on the one or more transition zoom magnifications.

[0057] The application framework layer (Frameworks, FWK) provides an application programming interface (API) and a programming framework for the application packages in the application layer. The application framework layer also includes some predefined functions.

[0058] In some embodiments, the application framework layer may further include a RequestQueue module, and the request queue processing module may include a camera request and a zoom magnification adjustment request sent by the camera application.

[0059] In some embodiments, the application framework layer may further include a RequestThread module. The request queue processing module may include a WaitForRequest module, a SendRequestsBatch module, and a PrepareHardwareAbstractionLayerRequest (which may be abbreviated as PrepareHALRequest) module.

[0060] Among them, the WaitForRequest module can be used to make the camera requests to be executed in the request queue module wait when there is no empty buffer among the N buffer buffers allocated to the camera application in the buffer area of the electronic device. The PrepareHALRequest module can be used to construct the Capture request of the HAL layer and the output buffer outputBuffers. When there is an empty buffer among the N buffer buffers allocated to the camera application's camera requests, the PrepareHALRequest module can obtain a buffer from the AllocateBuffer interface for the camera requests issued by the camera application. The Send batch request module can be used to send the Capture request of the HAL layer constructed by the PrepareHALRequest module to the HAL layer.

[0061] Exemplarily, the above N can be 8, that is, the number of buffer buffers allocated by the electronic device to the camera application's camera requests can be 8. N can also be other values, for example, 7, or 9, etc. The embodiments of the present application do not limit the value of N. Hereinafter, an example where the value of N is 8 will be described.

[0062] In some embodiments, the application framework layer may further include an Allocate Buffer interface, and the Allocate Buffer interface is used to allocate a buffer for the camera requests issued by the camera application. Exemplarily, the AllocateBuffer interface can specify the address of the buffer used to store the camera request for the camera request.

[0063] In some embodiments, the application framework layer may further include a result processing module, and the result processing module can be used to obtain the image frame uploaded by the HAL layer and display the obtained image frame. After the image frame is successfully displayed, the buffer storing the successfully displayed image frame is cleared. The result processing module can notify the Allocate Buffer interface of the buffer address storing the successfully displayed image frame.

[0064] In some embodiments, the application framework layer may further include a frame return data processing module. After the result processing module obtains the image frame uploaded by the HAL layer, the result processing module then sends the frame return moment of the image frame to the frame return data processing module, and the frame return data processing module can determine the frame interval based on the frame return moment of the image frame. The frame return moment of the image frame may refer to the moment when the result processing module receives the image frame uploaded by the HAL layer, and the frame interval may refer to the time difference between the frame return moments of two adjacent image frames.

[0065] In some embodiments, the application framework layer may also be referred to as the app framework layer.

[0066] The Hardware Abstraction Layer (HAL) is an interface layer between the application framework layer and the hardware layer, providing a virtual hardware platform for the operating system.

[0067] The Hardware Abstraction Layer (HAL) can be used to receive camera requests sent from the application framework layer, and send the camera parameters and the buffer address of the camera request to the camera module. It can also call the interface for returning results (e.g., ProcessCaptureResult) to send the image frames obtained by the camera module according to the camera parameters to the result processing module in the application framework layer.

[0068] The hardware layer may include a camera module, an image signal processor, a display, etc. The camera module may include image sensors of one or more cameras (e.g., Image Sensor 1, Image Sensor 2, etc.). Optionally, the camera module may also include a Time of Flight (TOF) sensor, a multispectral sensor, etc. The image signal processor can be used to process the image frames captured by the camera module. The display can be used to display the image frames sent by the result processing module.

[0069] Next, in combination with the above system structure, taking zooming as an example, the processing mechanism of the camera request generated by the user's operation for changing the zoom ratio of the electronic device 100 will be specifically described.

[0070] 1. After the electronic device 100 receives the operation of the user to start the camera application, the electronic device 100 starts the camera application. The camera application can send multiple camera requests for obtaining preview images. The first camera request sent by the camera application for obtaining a preview image can fill up the N buffers reserved for camera requests in the buffer area.

[0071] Optionally, after the camera application is started, when the shooting parameters do not change, the camera application can send only one camera request to the application framework layer.

[0072] The process of how the electronic device 100 processes the camera requests sent by the camera application and sends the image frames can refer to the description of the process of how the electronic device 100 processes the zoom ratio adjustment requests and sends the image frames in steps 6 to 14. This application will not elaborate here.

[0073] 2. The application framework layer of the electronic device 100 obtains the frame return time of the image frames.

[0074] When the application framework layer of the electronic device 100 obtains the image frames uploaded by the HAL layer, it can determine the frame return time of the image frames based on the time of the image frames uploaded by the HAL layer.

[0075] The application framework layer of the electronic device 100 can determine the frame interval based on the frame return times of two adjacent image frames.

[0076] 3. The camera application obtains the frame interval.

[0077] In some embodiments, the frame interval may refer to the average frame interval, that is, the average value of multiple frame intervals. In other embodiments, the frame interval may also refer to the real-time frame interval, and the real-time frame interval may refer to the time difference between the frame return time of the latest returned image frame and the frame return time of the adjacent previous returned image frame.

[0078] 4. The camera application receives a zoom operation.

[0079] The camera application can receive and respond to the user's zoom operation to determine the initial zoom ratio and the target zoom ratio. The camera application can then determine the zoom smooth adjustment curve based on the initial zoom ratio and the target zoom ratio, and the zoom smooth adjustment curve shows the corresponding relationship between time and the zoom ratio.

[0080] 5. The camera application determines one or more transitional zoom ratios based on the frame interval and the zoom smooth adjustment curve.

[0081] After obtaining the frame interval and the zoom smooth adjustment curve, the camera application can determine one or more transitional zoom ratios based on the frame interval and the zoom smooth adjustment curve. So that the camera application can determine the number of times to send a request to the program framework layer to adjust the zoom ratio based on one or more transitional zoom ratios.

[0082] Exemplarily, as Figure 1 shown, Figure 1 The shown moment t1 may be the moment when the camera application receives the zoom operation, Figure 1 The shown moment t2 may be the cut-off time of the zoom smooth adjustment curve. After moment t1, the camera application can determine moment t3, moment t4, and moment t5 based on the first frame interval. And determine the transitional zoom ratio 1, the transitional zoom ratio 2, and the transitional zoom ratio 3 respectively based on moment t3, moment t4, and moment t5 and the zoom smooth adjustment curve.

[0083] The camera application can sequentially send a zoom magnification adjustment request 1 including a transition zoom magnification 1, a zoom magnification adjustment request 2 including a transition zoom magnification 2, a zoom magnification adjustment request 3 including a transition zoom magnification 3, and a zoom magnification adjustment request 4 including a target zoom magnification to the application framework layer, enabling the camera module to collect and display image frames based on the transition zoom magnification.

[0084] 6. The camera application sends a zoom magnification adjustment request 1 to the application framework layer.

[0085] The electronic device 100 can receive an operation from the user to change the zoom magnification for the camera application. Based on this operation, after the application framework layer receives an image frame returned by the HAL layer, the camera application in the electronic device 100 can send a zoom magnification adjustment request 1 to the application framework layer.

[0086] 7. The request queue processing module obtains a cache get buffer.

[0087] In some embodiments, the application framework layer may include an Allocate Buffer interface. In response to the zoom magnification request 1 sent by the camera application, the prepare HAL request module can send a cache acquisition request to the Allocate Buffer interface to obtain an idle buffer and allocate the idle buffer for the zoom magnification request 1.

[0088] 8. The application framework layer allocates a cache for the zoom magnification adjustment request 1.

[0089] When there is an idle buffer among the N buffers reserved for camera requests in the cache area of the electronic device 100, the electronic device 100 can send the zoom magnification adjustment request 1 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 zoom magnification adjustment request 1, it can store the zoom magnification adjustment request 1 in this buffer.

[0090] 9. The application framework layer sends a zoom magnification adjustment request to the HAL layer.

[0091] After the application framework layer allocates a cache for the zoom magnification adjustment request 1, the application framework layer sends the zoom magnification adjustment request 1 to the HAL layer. The zoom magnification adjustment request 1 carries the transition zoom magnification 1. The zoom magnification adjustment request 1 may also carry other data, which is not limited in this application.

[0092] Specifically, the prepared HAL request module can construct the zoom magnification adjustment request 1 into a Capture request at the HAL layer and send it to the HAL layer through the batch request sending module. The HAL layer then sends the camera parameters in the Capture request and the buffer address of the Capture request to the camera module. The camera parameters in the Capture request can include, but are not limited to, the transitional zoom magnification 1.

[0093] 10. The HAL layer sends a zoom magnification adjustment request to the camera module.

[0094] In response to the zoom magnification adjustment request sent by the application framework layer, the HAL layer sends the zoom magnification adjustment request to the camera module again.

[0095] 11. The electronic device 100 turns on the camera, obtains an image frame captured by the camera based on the zoom magnification adjustment request, and sends the image frame to the HAL layer.

[0096] The camera module in the electronic device 100 can receive the zoom magnification adjustment request sent by the HAL layer and the buffer address of the zoom magnification adjustment request. Then, the camera module can obtain an image frame according to the camera parameters (such as the transitional zoom magnification 1) and store the obtained image frame in the buffer corresponding to the buffer address carried by the zoom magnification adjustment request.

[0097] In some examples, the image frame obtained by the camera module can be transmitted to the image signal processor, and the image signal processor can preprocess the image frame and upload it to the HAL layer through the camera driver or the image processor driver.

[0098] 12. The HAL layer uploads the image frame to the result processing module in the application framework layer.

[0099] After receiving the image frame uploaded by the image signal processor, the HAL layer uploads the image frame to the result processing module in the application framework layer again.

[0100] In some examples, the HAL layer can upload the image frame to the camera application through the application framework layer, and the camera application can process the image frame and then send it to the result processing module.

[0101] 13. The result processing module sends the image frame to the display.

[0102] After receiving the image frame uploaded by the HAL layer, the result processing module can display the image frame, that is, the result processing module sends the image frame to the display and displays the image frame through the display.

[0103] 14. The electronic device 100 clears the buffer storing the zoom magnification adjustment request.

[0104] In some embodiments, after the display successfully sends the display, it will notify the result processing module that the image frame is successfully displayed. It can be understood that when the image frame is sent for display, the buffer storing the image frame and the zoom magnification adjustment request for obtaining the image frame in the cache of the electronic device will be cleared. The result processing module can send the address of the cleared buffer to the Allocate Buffer interface. The Allocate Buffer interface can subsequently allocate the address of the cleared buffer to the next zoom magnification adjustment request.

[0105] In some embodiments, the result processing module will also send the frame return time of the image frame to the frame return data processing module, so that the frame return data processing module can statistically obtain the frame intervals of multiple image frames displayed by the electronic device 100.

[0106] After the HAL layer sends the image frame obtained in response to the zoom magnification adjustment request 1 to the application framework layer, the application layer can send the zoom magnification adjustment request 2 to the application framework layer again, and then obtain the image frame corresponding to the zoom magnification adjustment request 2 according to steps 7 - 13. And so on, until the application framework layer obtains the image frame corresponding to the zoom magnification adjustment request 4, and the application layer stops sending the zoom magnification adjustment request to the application framework layer. After that, the electronic device 100 continuously captures and displays image frames at the target zoom magnification.

[0107] As Figure 1 shown, the electronic device 100 smoothly adjusts the zoom magnification from the initial zoom magnification to the target zoom magnification through the camera application. Among them, the camera application determines one or more transitional zoom magnifications based on the frame interval and the zoom smooth adjustment curve. During the zoom process, the camera module can capture image frames based on one or more transitional zoom magnifications sent by the camera application and return them to the HAL layer, and the HAL layer then returns the image frames to the application framework layer.

[0108] During the zoom process, based on the zoom magnification of the image frame returned by the HAL layer to the application framework layer and the frame return time of the image frame, the HAL layer can obtain Figure 3 the zoom curve as Figure 3 shown. The zoom curve as

[0109] Based on the above analysis, one or more transition zoom ratios are determined by the camera application based on the frame interval and the zoom smoothing adjustment curve. However, due to hardware performance limitations, the time consumption of image acquisition and image processing algorithms is unstable, and the camera application can no longer adjust the transition zoom ratio according to the real-time image frame return time. Moreover, it takes time for the application layer to send a zoom request to the application framework layer. After the HAL layer returns an image frame, the application framework layer cannot promptly send the zoom request to the HAL layer. Furthermore, the time required for the application layer to send a zoom request to the application framework layer and the time required for the application framework layer to send a zoom request to the HAL layer are both unstable. Eventually, the moment when the HAL layer responds to the zoom request and returns the image frame and the corresponding transition zoom ratio of the image frame will deviate from the zoom smoothing adjustment curve. The HAL layer can finally obtain Figure 3 the zoom curve shown, Figure 3 the shown zoom curve has deviated from Figure 3 the zoom smoothing adjustment curve shown, which is manifested as picture delay and picture jitter in the display effect, affecting the user's visual experience.

[0110] Based on this, the present application provides a method for adjusting shooting parameters. The method includes the following steps;

[0111] Step 1: The electronic device 100 determines the initial shooting parameters and the target shooting parameters.

[0112] When the electronic device 100 displays the camera application's photo preview interface or video preview interface, the user can change the shooting parameters and adjust the shooting parameters from the initial shooting parameters to the target shooting parameters. The shooting parameters can include but are not limited to any one of the following: zoom ratio, exposure, aperture, white balance, sharpness, contrast, saturation, etc.

[0113] Among them, the initial shooting parameter value refers to the shooting parameter value before detecting the current shooting parameter adjustment operation, and the target shooting parameter value is the shooting parameter value after detecting the adjustment trigger operation.

[0114] Exemplarily, the shooting parameter can be the zoom ratio. The electronic device 100 can increase the zoom ratio of the camera application based on the user operation. For example, the electronic device 100 increases the zoom ratio from 1X to 5X based on the user operation. Then the initial zoom ratio is 1X and the target zoom ratio is 5X.

[0115] The electronic device 100 can also decrease the zoom ratio of the camera application based on the user operation. For example, the electronic device 100 decreases the zoom ratio from 1X to 0.5X based on the user operation. Then the initial zoom ratio is 1X and the target zoom ratio is 0.5X.

[0116] Step 2: The electronic device 100 obtains a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters.

[0117] It can be understood that the smooth adjustment curve may include the initial shooting parameters, one or more transitional shooting parameters, and the target shooting parameters. The electronic device can obtain preview image frames in sequence through the initial shooting parameters, one or more transitional shooting parameters, and the target shooting parameters. In this way, it is possible to avoid the situation where the electronic device directly adjusts the shooting parameters to the target shooting parameters and causes a sudden change in the picture.

[0118] Exemplarily, when the shooting parameter is the zoom ratio, the electronic device 100 can obtain a smooth zoom ratio adjustment curve based on the initial zoom ratio and the target zoom ratio. The smooth zoom ratio adjustment curve is a curve with the initial zoom ratio as the starting point and the target zoom ratio as the ending point. The initial zoom ratio corresponds to time t1, and the target zoom ratio corresponds to time t2, where t2 is later than t1, and t1 is the time when the user selects to switch to the target zoom ratio. The smooth zoom ratio adjustment curve is used for the electronic device 100 to sequentially pass through the initial zoom ratio, one or more zoom ratios, and the target zoom ratio to obtain multiple image frames, realizing a smooth switch from the initial zoom ratio to the target zoom ratio.

[0119] Step 3: The electronic device 100 determines one or more transitional shooting parameters based on the frame return time of the image frame and the smooth adjustment curve, sequentially passes through one or more zoom ratios and the target zoom ratio to obtain multiple image frames, and displays the multiple image frames.

[0120] The electronic device 100 collects image frames periodically / irregularly. After t1, the electronic device 100 obtains the image frame A collected based on the initial shooting parameters and displays the image frame A. The frame return time of the image frame A is t3.

[0121] In response to obtaining the image frame A, the electronic device 100 determines the transitional shooting parameter 1 based on t3 and the smooth adjustment curve. After that, the electronic device 100 collects the image frame B based on the transitional shooting parameter 1 and displays the image frame B. The frame return time of the image frame B is t4.

[0122] In response to obtaining the image frame B, the electronic device 100 determines the transitional shooting parameter 2 based on t4 and the smooth adjustment curve. After that, the electronic device 100 collects the image frame C based on the transitional shooting parameter 2 and displays the image frame C. The frame return time of the image frame C is t5.

[0123] If t5 is later than t2, the electronic device 100 no longer determines other transitional shooting parameters and continuously obtains and displays image frames with the target shooting parameters.

[0124] Not limited to transition shooting parameter 1, transition shooting parameter 2, and transition shooting parameter 3, the electronic device 100 can also determine more or fewer other transition shooting parameters, which are not limited in this application.

[0125] Through the above method, the electronic device 100 can calculate one or more transition shooting parameters in real time, enabling the electronic device 100 to collect and display image frames in a timely manner according to the one or more transition shooting parameters, making the change of the shooting parameters conform to a preset smooth adjustment curve, and the shooting parameters can smoothly transition to the target shooting parameters, avoiding situations such as screen jitter or freezing, and improving the user's visual experience.

[0126] The following introduces the hardware structure of an electronic device 100 provided in the embodiments of this application.

[0127] Figure 4A The structural schematic diagram of the electronic device 100 is shown.

[0128] The following takes the electronic device 100 as an example to specifically illustrate the embodiments. It should be understood that Figure 4A The shown electronic device 100 is only an example, and the electronic device 100 can have Figure 4A more or fewer components than those shown, can combine two or more components, or can have different component configurations. Figure 4A The various components shown can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0129] 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, a headphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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.

[0130] It can 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 some other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0131] 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), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0132] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

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

[0134] 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, etc.

[0135] 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 groups of I2C buses. The processor 110 may be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: The processor 110 may be coupled to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface to implement the touch function of the electronic device 100.

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

[0137] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through the PCM bus interface. In some embodiments, the audio module 170 may also transmit an audio signal to the wireless communication module 160 through the PCM interface to implement the function of answering a phone call through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0138] The UART interface is a general-purpose serial data bus for asynchronous communication. This bus can be a two-way 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 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

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

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

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

[0142] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are only illustrative descriptions and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

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

[0144] 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 the inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as the battery capacity, the number of battery charge cycles, and the battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0145] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

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

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

[0148] The modulation and demodulation processor may include a modulator and a demodulator. Among them, 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. Subsequently, the demodulator 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 transmitted 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 modulation and demodulation processor may be an independent device. In other embodiments, the modulation and demodulation processor may be independent of the processor 110 and disposed in the same device as the mobile communication module 150 or other functional modules.

[0149] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.

[0150] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to 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, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0151] Electronic device 100 implements a display function through a GPU, display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, connected to 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 change display information.

[0152] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD). The display screen panel can also adopt 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, a quantum dot light-emitting diode (QLED), etc. to manufacture. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0153] The electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, etc.

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

[0155] The camera 193 is used to capture static images or videos. An 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 optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it 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 standard RGB, YUV, etc. formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0156] The digital signal processor is used to process digital signals. Besides 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, etc.

[0157] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0158] The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission pattern between human brain neurons, it can quickly process input information and can also continuously learn on its own. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, voice recognition, text understanding, etc.

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

[0160] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes 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 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0161] The electronic device 100 can implement audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.

[0162] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.

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

[0164] The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be listened to by holding the receiver 170B close to the ear.

[0165] The microphone 170C, also known as the "microphone" or "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the 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 some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some 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 sound source, and implement functions such as directional recording.

[0166] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

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

[0168] 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., the x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the angle of jitter of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and enables the lens to offset the jitter 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 scenarios.

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

[0170] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip, features such as automatic flip unlocking can be set.

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

[0172] A distance sensor 180F for measuring distance. The electronic device 100 can measure distance through 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 rapid focusing.

[0173] 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 the photodiode to detect the 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 holds the electronic device 100 close to the ear for a call, so as to automatically turn off the screen to achieve the purpose of power saving. The proximity light sensor 180G can also be used for automatic unlocking and locking of the holster mode and pocket mode.

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

[0175] A fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.

[0176] A 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 in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In some other embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0177] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as the "touch screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from where the display screen 194 is located.

[0178] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals of the vibrating bone mass of the human vocal part. The bone conduction sensor 180M can also contact the human pulse and receive blood pressure pulsation signals. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone to form a bone conduction earphone. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bone mass of the vocal part acquired by the bone conduction sensor 180M to implement the voice function. The application processor can parse out heart rate information based on the blood pressure pulsation signals acquired by the bone conduction sensor 180M to implement the heart rate detection function.

[0179] The button 190 includes a power-on button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The electronic device 100 can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100.

[0180] The motor 191 can generate vibration prompts. The 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, playing audio, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (such as: time reminder, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0181] The indicator 192 can be an indicator light and can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0182] The SIM card interface 195 is used to connect the SIM card.

[0183] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, taking the Android system with a layered architecture as an example, the software structure of the electronic device 100 is exemplarily described.

[0184] Figure 4B It is a software structure block diagram of the electronic device 100 in the embodiments of the present invention.

[0185] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, from top to bottom, they are the application layer, the application framework layer, the hardware abstraction HAL layer, the driver layer, and the hardware layer.

[0186] The application layer may include a series of application packages.

[0187] Such as Figure 4B shown, the application packages may include a camera application. The application packages may also include applications such as a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth, music, a video, a short message, etc., Figure 4B not shown.

[0188] The camera application includes, but is not limited to, a camera request sending module. The camera request sending module can be used to send a camera request and a focal length adjustment request to the application framework layer. The camera request may include, but is not limited to, a preview request, a photo-taking request, etc.

[0189] Among them, the preview request may be sent after the camera application is started. The photo-taking request may be sent after the camera application detects a photo-taking operation. The focal length adjustment request may be sent after the camera application detects an operation of adjusting the focal length.

[0190] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. The application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, etc. The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures. The telephone manager is used to provide the communication function of the electronic device 100. For example, the management of call states (including connection, disconnection, etc.). The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar, can be used to convey notification-type messages, can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as a notification of a background-running application, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt tone, the electronic device vibrates, the indicator light flashes, etc.

[0191] As Figure 4B shown, the application framework layer further 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.

[0192] Among them, the shooting parameter generation module is used to generate a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters sent by the camera application when it detects that the user adjusts the shooting parameters. And determine one or more transition shooting parameters based on the frame return time of the image frame and the smooth adjustment curve.

[0193] The shooting parameter generation module is further configured to issue a transitional 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 issues the transitional shooting parameter to the camera module, enabling the camera module to obtain an image frame based on the transitional shooting parameter.

[0194] In some embodiments, the shooting parameter generation module may also be located in the HAL layer, and this application does not limit the location of the shooting parameter generation module.

[0195] For the functions of the request queue processing module and the buffer allocation interface, reference can be made to Figure 2 the description in the embodiments, and this application will not elaborate here.

[0196] The result processing module is configured to receive the image frame and the shooting parameter of the image frame sent by the HAL layer, or the buffer address storing the image frame and the shooting parameter of the image frame.

[0197] The result processing module is further configured to send the image frame and the shooting parameter of the image frame, or the buffer address storing the image frame and the shooting parameter of image frame A to the image cropping module.

[0198] In some embodiments, the result processing module is further configured to store the image frame and the shooting parameter of the image frame, or the buffer address storing the image frame and the shooting parameter of the image frame in the buffer manager.

[0199] The image cropping module is configured to obtain the frame return time of the image frame and send the frame return time of the image frame to the shooting parameter generation module. The shooting parameter generation module can obtain the transitional shooting parameter 1 based on the frame return time of the image frame and the smoothing adjustment curve. The image cropping module then determines the cropping ratio based on the shooting parameter of the image frame and the transitional shooting parameter 1, and crops the image frame received by the result processing module based on the cropping ratio to obtain the transitional image frame 1. And send the transitional image frame 1 or the buffer address storing the transitional image frame 1 to the buffer manager.

[0200] In some embodiments, the image cropping module is further configured to determine the transitional shooting parameter 2 from the smoothing adjustment curve based on the frame return time of the image frame and a preset duration. The image cropping module determines the cropping ratio 2 based on the shooting parameter of the image frame and the transitional shooting parameter 2, and crops the image frame based on the cropping ratio 2 to obtain the transitional image frame 2. And send the transitional image frame 2 or the buffer address storing the transitional image frame A2 to the buffer manager.

[0201] Among them, the preset duration can be related to the frame rate of the camera application for outputting images and the value of the number of interpolated frames a. For example, the preset duration = (a + 1) / (1 / (the frame rate of outputting images)). Exemplarily, if the frame rate of the camera application for outputting images is 30pfs, that is, the HAL layer returns an image frame to the application framework layer every 33.3ms. When a is 1, the preset duration can be 16.7ms.

[0202] For another example, if the frame rate of the camera application for outputting images is 60pfs, that is, the HAL layer returns an image frame to the application framework layer every 16.7ms. When a is 1, the preset duration can be 8.35ms.

[0203] The buffer manager is used to store the image frames to be sent for display or the buffer addresses of the image frames to be sent for display.

[0204] The buffer manager is further used to send the stored image frames or the buffer addresses storing the image frames to the display thread when the display thread obtains the image frames.

[0205] The display 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 period of the timer.

[0206] Specifically, in a possible implementation manner, the display thread can be used to obtain the next image frame to be sent for display from the buffer manager after an interval of m vsync signal periods from the time when the previous image frame was sent for display, and send the obtained image frame to be sent for display to the camera application. The camera application can send the obtained image frame to be sent for display to the rendering process.

[0207] Optionally, in a possible implementation manner, the display thread can also obtain the next image frame to be sent for display from the buffer manager after an interval of the display period of the timer from the time when the previous image frame was sent for display, and send the obtained image frame to be sent for display to the camera application. The camera application can send the obtained image frame to be sent for display to the rendering process.

[0208] The vsync signal monitoring module is used to monitor the vsync signal period in the rendering process and send the vsync signal period to the display thread.

[0209] The timer can be used to send the timer period signal to the display thread. Among them, the period of the timer can be determined by the screen refresh rate of the electronic device.

[0210] The rendering process is used to render the image frames sent by the camera application and send the rendering result (i.e., the rendered image frame) to the camera application, and the camera application can send the rendering result for display.

[0211] In some embodiments, the application framework layer may also be referred to as the application framework layer.

[0212] The Hardware Abstraction HAL layer is an interface layer located between the application framework layer and the hardware layer, providing a virtual hardware platform for the operating system.

[0213] The HAL layer can be used to receive camera requests sent by the application framework layer, and send the camera parameters in the camera request and the buffer address of the camera request to the camera module. It can also call the interface for returning results (for example, ProcessCaptureResult) to send the image frames obtained by the camera module according to the camera parameters to the result processing module in the application framework layer.

[0214] Optionally, the HAL layer can store the image frames obtained by the camera module in the buffer address corresponding to the camera request, and send the image frame or the buffer address of the image frame to the result processing module in the application framework layer.

[0215] In some embodiments, the HAL layer is also used to send the camera parameters of the image frame to the result processing module. For example, the camera parameters can be the shooting parameters corresponding to the image frame. Such as initial shooting parameters, or transition shooting parameters, or target shooting parameters, etc.

[0216] In some embodiments, the HAL layer is also used to send the frame return time of the image frame to the result processing module. Wherein, the frame return time of the image frame is the time when the HAL layer sends the image frame to the result processing module.

[0217] The driver layer includes but is not limited to the camera driver and the display driver. Among them, the camera driver is used to drive the camera module to collect image frames, and the display driver is used to drive the display to display image frames.

[0218] The hardware layer may include a camera module, an image signal processor, a display, etc. The camera module may include image sensors of one or more cameras (for example, image sensor 1, image sensor 2, etc.). Optionally, the camera module may also include a time of flight (TOF) sensor, a multispectral sensor, etc. The image signal processor can be used to process the image frames collected by the camera module. The display can be used to display the image frames sent by the camera application.

[0219] Next, the adjustment of shooting parameters by the electronic device 100 provided in the embodiments of the present application based on user operations will be described in combination with the UI diagram.

[0220] In the embodiments of the present application, the shooting parameter is taken as an example of the zoom ratio for illustration.

[0221] Figures 5A - 5I FIG. shows a schematic diagram of the electronic device 100 adjusting the zoom ratio of the camera application based on a user operation.

[0222] In some embodiments, the electronic device 100 may receive a user operation to increase the zoom ratio of the camera application. In other embodiments, the electronic device 100 may receive a user operation to decrease the zoom ratio of the camera application.

[0223] Increasing the zoom ratio of the camera application

[0224] Figures 5A - 5E FIG. shows a schematic diagram of the electronic device 100 increasing the zoom ratio of the camera application based on a user operation.

[0225] As Figure 5A shown, the electronic device 100 may display a desktop, and a page with application icons is displayed in the desktop. The page includes multiple application icons (e.g., settings application icon, app market application icon, gallery application icon, browser application icon, etc.). Below the multiple application icons, a page indicator is also displayed to indicate the positional relationship between the currently displayed page and other pages. Below the page indicator, a tray area is displayed. Among them, the tray area includes multiple tray icons, such as a camera application icon, a contacts application icon, a phone application icon, and a messages application icon. The tray area remains displayed during page switching. In some embodiments, the above page may also include multiple application icons and a page indicator. The page indicator may not be part of the page and exists separately. The above tray icons are also optional, and the embodiments of the present application do not limit this.

[0226] The electronic device 100 may receive an input (e.g., a click) from the user on the camera application icon. In response to this input operation, the electronic device 100 may display as Figure 5B shown in the user interface. Figure 5B FIG. is a user interface of a shooting and result processing module provided by the electronic device 100 according to an embodiment of the present application, and may also be referred to as a preview interface.

[0227] As Figure 5B shown, the preview interface may include a mode bar 501, shooting controls 502, a preview window 503, a review control 504, a quick function area 505, and a zoom ratio adjustment option 506.

[0228] The mode bar 501 may include multiple shooting mode options, such as "night scene", "portrait", "photo taking", "video recording", etc. Different shooting modes can provide users with shooting services with different effects. Users can select any shooting mode from multiple shooting modes according to different needs for shooting. For example, "photo taking" can be the default shooting mode for taking photos. "Video recording" is used for recording videos. The "night scene" mode is suitable for shooting scenes with relatively dim light, such as at night. The "portrait" mode is suitable for shooting scenes where the main subject is a person. The electronic device 100 can also provide more shooting modes, such as "large aperture", "movie", "professional", etc., which will not be listed one by one here.

[0229] The electronic device 100 can detect a user operation on the shooting mode option in the mode bar 501 and change the currently used shooting mode according to the above user operation. The above user operation is, for example, a left / right swipe operation. For example, when it is detected that the mode bar 501 is dragged and swiped to the left (left swipe operation) and the floating icon stops at the "portrait" option, the electronic device 100 can switch to the "portrait" mode. By default, the electronic device 100 first uses the "photo taking" mode.

[0230] The shooting control 502 is used to trigger photo taking. The electronic device 100 can detect whether there is a user operation on the shooting control 502, such as a click operation. After detecting a user operation on the shooting control 502, the electronic device 100 can generate a photo taking instruction. The electronic device 100 can obtain the image reported by the camera at the corresponding timestamp according to the photo taking instruction and then save it as a photo.

[0231] The preview window 503 can be used to display the image reported by the camera in real time. In different shooting modes, the electronic device 100 can process the image reported by the camera to improve the display effect of the image. For example, in the "portrait" mode, the electronic device 100 can blur the background in the image reported by the camera to highlight the portrait. Here, the preview window 503 can display the image processed by the image processing algorithm corresponding to different shooting modes in real time, so that users can perceive the shooting effects corresponding to different shooting modes in real time.

[0232] The review control 504 can be used to browse the thumbnails of the taken photos / videos. After detecting a user operation on the review control 504, the electronic device 100 can also display the best photo corresponding to the thumbnail.

[0233] The quick function area 505 may include controls 505A for the protagonist video recording mode, AI scene recognition control 505B, flash control 505C, color mode control 505D, settings control 505E, etc. The control 505A for the protagonist video recording mode can be used to trigger the electronic device 100 to identify the protagonist among multiple people in the preview screen when turned on. The AI scene recognition control 505B can be used to trigger the electronic device 100 to identify the shooting scene in the preview screen, and currently the AI scene recognition control 505B is in the off state. The flash control 505C can be used to trigger the electronic device 100 to turn on or off the flash. The color mode control 505D can be used to trigger the electronic device 100 to process the image captured by the camera using a color filter. The settings control 505E can be used to set the shooting parameters of the electronic device 100 (such as image size, image storage format, etc.), turn on the "automatic capture" function of the electronic device 100, and so on.

[0234] Multiple zoom ratio options are shown in the zoom ratio adjustment option 506. For example, 0.5x zoom ratio option, 1x zoom ratio option, 2.5x zoom ratio option, 10x zoom ratio option, etc.

[0235] The current zoom ratio is 1x. The image frame captured by the electronic device 100 at a zoom ratio of 1x is displayed in the preview window 503.

[0236] As Figure 5B shown, the electronic device 100 can receive a user's input operation for the 2.5x zoom ratio option in the zoom ratio adjustment option 506. In response to the user's input operation, the electronic device 100 can switch the zoom ratio from 1x to 2.5x.

[0237] In response to the electronic device 100 switching the zoom ratio from 1x to 2.5x, the electronic device 100 can determine multiple transitional zoom ratios based on the initial zoom ratio 1x and the target zoom ratio 2.5x. For example, the multiple transitional zoom ratios can be 1.4x and 1.9x.

[0238] Optionally, not limited to determining two transitional zoom ratios, the electronic device 100 can also determine other more or fewer transitional zoom ratios, which are not limited in this application. The values of the initial zoom ratio, target zoom ratio, and multiple transitional zoom ratios can also be other values. This application only uses this as an example to explain this application and does not constitute a limitation.

[0239] In response to the electronic device 100 determining multiple transitional zoom ratios, the electronic device 100 can sequentially capture and display image frames based on the multiple transitional zoom ratios.

[0240] As Figures 5C - 5D shown, Figure 5CShows an image frame captured by the electronic device 100 at a zoom ratio of 1.4x. Figure 5D Shows an image frame captured by the electronic device 100 at a zoom ratio of 1.9x.

[0241] After that, the electronic device 100 continuously captures and displays image frames at the target zoom ratio of 2.5x. Figure 5E Shows an image frame captured by the electronic device 100 at a zoom ratio of 2.5x.

[0242] From Figures 5A - 5E It can be seen that when the electronic device 100 increases the zoom ratio based on a user operation, the electronic device 100 can smoothly switch to the target zoom ratio through multiple transitional zoom ratios in sequence, achieving a smooth switch from the initial zoom ratio to the target zoom ratio.

[0243] Reducing the zoom ratio of the camera application

[0244] Figures 5F - 5I Shows a schematic diagram of the electronic device 100 reducing the zoom ratio of the camera application based on a user operation.

[0245] The electronic device 100 can display Figure 5F The preview interface of the camera application shown. The current zoom ratio is 2.5x. The image frame captured by the electronic device 100 at a zoom ratio of 2.5x is displayed in the preview window 503.

[0246] As Figure 5F Shown, the electronic device 100 can receive an input operation from the user for the 1x zoom ratio option in the zoom ratio adjustment option 506. In response to the user's input operation, the electronic device 100 can switch the zoom ratio from 2.5x to 1x.

[0247] In response to the electronic device 100 switching the zoom ratio from 2.5x to 1x, the electronic device 100 can determine multiple transitional zoom ratios based on the initial zoom ratio of 2.5x and the target zoom ratio of 1x. For example, the multiple transitional zoom ratios can be 1.9x and 1.4x.

[0248] Optionally, not limited to determining two transitional zoom ratios, the electronic device 100 can also determine other more or fewer transitional zoom ratios, which is not limited in this application. The values of the initial zoom ratio, target zoom ratio, and multiple transitional zoom ratios here can also be other values. This application only exemplarily explains this application and does not constitute a limitation.

[0249] In response to the electronic device 100 determining multiple transitional zoom ratios, the electronic device 100 can capture and display image frames based on the multiple transitional zoom ratios in sequence.

[0250] AsFigures 5G - 5H As shown Figure 5G shows an image frame captured by the electronic device 100 at a zoom ratio of 1.9x. Figure 5H shows an image frame captured by the electronic device 100 at a zoom ratio of 1.4x.

[0251] After that, the electronic device 100 continuously captures and displays image frames at the target zoom ratio of 1x. Figure 5I shows an image frame captured by the electronic device 100 at a zoom ratio of 1x.

[0252] From Figures 5F - 5I it can be seen that when the electronic device 100 reduces the zoom ratio based on a user operation, the electronic device 100 can smoothly switch to the target zoom ratio through multiple intermediate zoom ratios in sequence, achieving a smooth switch from the initial zoom ratio to the target zoom ratio.

[0253] It should be noted that the above Figures 5A - 5I is described by taking the user changing the zoom ratio in the photo preview interface of the camera application as an example. In other embodiments, the user can also change the zoom ratio in the video preview interface of the camera application, and the present application does not limit the application scenarios for changing the zoom ratio.

[0254] Figure 6A shows a software architecture diagram of an electronic device 100 capturing images at an initial zoom ratio provided by an embodiment of the present application.

[0255] As Figure 6A shown, the software architecture of the electronic device 100 includes but is not limited to: the interaction and cooperation between the application layer (such as the camera application), the application framework layer (framework), the hardware abstraction layer (hardware abstract layer, HAL), and the hardware layer. Among them, the application layer is mainly related to the camera request sending module in the camera application. The application framework layer is mainly related to several modules such as the shooting parameter generation module, the request queue processing module, the buffer allocation interface, the result processing module, and the algorithm. The hardware mainly includes the camera module and the display, etc.

[0256] Before the electronic device 100 receives a user operation to change the zoom ratio, the electronic device 100 can capture and display images at the initial zoom ratio. This includes but is not limited to the following steps:

[0257] 1. When the electronic device 100 receives an operation from the user to start the camera application, the electronic device 100 starts the camera application. The camera application can issue multiple camera requests for obtaining preview images. The first camera request issued by the camera application for obtaining preview images can fill up N buffers reserved for camera requests in the buffer area.

[0258] Optionally, after the camera application is launched and when the shooting parameters remain unchanged, the camera application can send a camera request to the application framework layer only once.

[0259] For the process of how the electronic device 100 processes the camera request sent by the camera application and displays the image frame, reference can be made to the description of the process of how the electronic device 100 processes the zoom magnification adjustment request and displays the image frame in steps 6 to 14, which will not be elaborated in this application.

[0260] The camera application sends a camera request to the request queue processing module in the application framework layer.

[0261] The electronic device 100 can receive the operation of the user to launch the camera application. Based on this operation, the camera application can send a camera request to the application framework layer, and the camera request carries the initial zoom magnification.

[0262] 2. The request queue processing module obtains a cache get buffer.

[0263] In some embodiments, the application framework layer may include an Allocate Buffer interface. In response to the camera request sent by the camera application, the prepare HAL request module can send a cache acquisition request to the Allocate Buffer interface to obtain an idle buffer and allocate an idle buffer for the camera request.

[0264] 3. The request queue processing module allocates a cache for the camera request.

[0265] The electronic device 100 can send the camera request to the prepare HAL request module in the request queue processing module. When there is an idle buffer among the N buffers in the cache area of the electronic device 100, 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 this buffer.

[0266] 4. The request queue processing module sends a camera request to the HAL layer.

[0267] After the application framework layer allocates a cache for the camera request, the application framework layer sends a camera request to the HAL layer, and the camera request carries the initial zoom magnification. The camera request may also carry other data, which is not limited in this application.

[0268] Specifically, the prepared HAL request module can construct the camera request into a Capture request at the HAL layer and send it to the HAL layer through the batch request sending module. The HAL layer then sends the camera parameters in the Capture request and the buffer address of the Capture request to the camera module. Among them, the camera parameters in the Capture request can include but are not limited to the initial zoom ratio.

[0269] 5. The HAL layer sends a camera request to the camera module.

[0270] In response to the camera request sent by the application framework layer, the HAL layer then sends the camera request to the camera module.

[0271] 6. The electronic device 100 turns on the camera, obtains an image frame captured by the camera based on the initial zoom ratio, and sends the image frame to the HAL layer.

[0272] The camera module in the electronic device 100 can receive the camera request sent by the HAL layer and the buffer address of the camera. Then, the camera module can obtain an image frame according to the camera parameters (such as the initial zoom ratio) and store the obtained image frame in the buffer corresponding to the buffer address carried by the adjusted zoom ratio request.

[0273] In some examples, the image frame obtained by the camera module can be transmitted to the image signal processor, and the image signal processor can preprocess the image frame and upload it to the HAL layer through the camera driver or the image processor driver.

[0274] 7. The HAL layer uploads the image frame to the result processing module in the application framework layer.

[0275] After receiving the image frame uploaded by the image signal processor, the HAL layer then uploads the image frame to the result processing module in the application framework layer.

[0276] In some examples, the HAL layer can upload the image frame to the camera application through the application framework layer, and the camera application can process the image frame and then send it to the result processing module.

[0277] 8. The electronic device 100 displays the image frame.

[0278] After receiving the image frame uploaded by the HAL layer, the result processing module can display the image frame, that is, the result processing module sends the image frame to the display and the display shows the image frame.

[0279] 9. The electronic device 100 clears the buffer storing the zoom magnification adjustment request.

[0280] In some embodiments, after the display successfully sends the display, it will notify the result processing module that the image frame has been successfully displayed. It can be understood that when the image frame is sent for display, the buffer storing the image frame and the zoom magnification adjustment request for obtaining the image frame in the cache of the electronic device will be cleared. The result processing module can send the address of the cleared buffer to the Allocate Buffer interface. The Allocate Buffer interface can subsequently allocate the address of the cleared buffer to the next camera request.

[0281] 10. The result processing module sends the frame return time of the image frame to the shooting parameter generation module.

[0282] Optionally, step 10 can be executed periodically / irregularly after the camera application is started. After the result processing module receives the image frame uploaded by the HAL layer, the result processing module can send the frame return time of the image frame to the shooting parameter generation module, so that the shooting parameter generation module can determine the transition shooting parameters based on the frame return time of the image frame.

[0283] Figure 6B Shows another software architecture diagram of the electronic device 100 for collecting images at a transition zoom magnification provided by an embodiment of the present application.

[0284] As Figure 6B shown, the software architecture of the electronic device 100 includes but is not limited to: the interaction and cooperation between the application layer (such as the camera application), the application framework layer (framework), the hardware abstraction layer (hardware abstract layer, HAL), and the hardware layer. Among them, the application layer mainly involves the camera request sending module in the camera application. The application framework layer mainly involves several modules such as the shooting parameter generation module, the request queue processing module, the allocate buffer interface, the result processing module, and the algorithm. The hardware mainly includes the camera module and the display, etc.

[0285] After the electronic device 100 receives the user's operation on the target zoom magnification option, the electronic device 100 can determine one or more transition zoom magnifications, and sequentially collect and display images based on the one or more transition zoom magnifications. It includes but is not limited to the following steps:

[0286] 1. The camera application receives the user's zoom operation.

[0287] For example, a camera application can receive an operation from a user for a target zoom ratio option. To enable the camera application to smoothly switch from an initial zoom ratio to the target zoom ratio, the electronic device can determine one or more transitional zoom ratios, and sequentially capture and display images based on the one or more transitional zoom ratios.

[0288] 2. The camera application sends a zoom request to the shooting parameter generation module in the application framework layer.

[0289] In response to the user's zoom operation, the camera application can send a zoom request to the shooting parameter generation module in the application framework layer, and the target zoom ratio is carried in the zoom request.

[0290] Exemplarily, the camera application can send a zoom request to the shooting parameter generation module in the application framework layer through a camera request sending module.

[0291] 3. The result processing module sends the frame return time of the image frame to the shooting parameter generation module.

[0292] Optionally, step 3 can be executed periodically / irregularly after the camera application is started. After the result processing module receives the image frame uploaded by the HAL layer, the result processing module can send the frame return time of the image frame to the shooting parameter generation module, so that the shooting parameter generation module can determine the transitional shooting parameters based on the frame return time of the image frame.

[0293] 4. The shooting parameter generation module sends a zoom request (transitional zoom ratio) to the request queue processing module.

[0294] In response to the zoom request sent by the camera application, the shooting parameter generation module can determine a zoom smooth adjustment curve based on the initial zoom ratio and the target zoom ratio. Then, the shooting parameter generation module can determine the transitional zoom ratio based on the frame return time of the image frame sent by the result processing module. After determining the transitional zoom ratio, the shooting parameter generation module sends a zoom request to the request queue processing module, and the transitional zoom ratio is carried in the zoom request.

[0295] 5. The request queue processing module obtains a cache get buffer.

[0296] In some embodiments, the application framework layer can include an Allocate Buffer interface. In response to the zoom request sent by the camera application, the prepare HAL request module can send a cache acquisition request to the Allocate Buffer interface to obtain an idle buffer and allocate the idle buffer for the zoom request.

[0297] 6. The request queue processing module allocates a cache for the zoom request.

[0298] The electronic device 100 can send the zoom request to the Prepare HAL Request Module in the request queue processing module. When there is an empty buffer among the N buffers in the buffer area of the electronic device 100, after the Prepare HAL Request Module obtains the buffer address allocated for the zoom request by the Allocate Buffer interface, it can store the zoom request in this buffer.

[0299] 7. The request queue processing module sends the zoom request to the HAL layer.

[0300] After the application framework layer allocates a buffer for the zoom request, the application framework layer sends the zoom request to the HAL layer. The zoom request carries the transitional zoom ratio. The zoom request can also carry other data, which is not limited in this application.

[0301] Specifically, the Prepare HAL Request Module can construct the zoom request into a Capture request of the HAL layer and send it to the HAL layer through the batch request sending module. The HAL layer then sends the camera parameters in the Capture request and the buffer address of this Capture request to the camera module. Among them, the camera parameters in the Capture request can include but are not limited to the transitional zoom ratio.

[0302] 8. The HAL layer sends the zoom request to the camera module.

[0303] In response to the zoom request sent by the application framework layer, the HAL layer sends the zoom request to the camera module again.

[0304] 9. The electronic device 100 turns on the camera, obtains the image frame captured by the camera based on the transitional zoom ratio, and sends the image frame to the HAL layer.

[0305] The camera module in the electronic device 100 can receive the zoom request sent by the HAL layer and the buffer address of this camera. Then, the camera module can obtain the image frame according to the camera parameters (such as the transitional zoom ratio) and store the obtained image frame in the buffer corresponding to the buffer address carried by the adjusted zoom ratio request.

[0306] In some examples, the image frame obtained by the camera module can be transmitted to the image signal processor, and the image signal processor can preprocess the image frame and upload it to the HAL layer through the camera driver or the image processor driver.

[0307] 10. The HAL layer uploads the image frame to the result processing module in the application framework layer.

[0308] After the HAL layer receives the image frame uploaded by the image signal processor, the HAL layer uploads the image frame to the result processing module in the application framework layer.

[0309] In some examples, the HAL layer can upload the image frame to the camera application through the application framework layer, and the camera application can process the image frame and then send it to the result processing module.

[0310] 11. The electronic device 100 displays the image frame.

[0311] After the result processing module receives the image frame uploaded by the HAL layer, the result processing module can send the image frame for display, that is, the result processing module sends the image frame to the display and the display shows the image frame.

[0312] 12. The electronic device 100 clears the buffer storing the adjustment zoom ratio request.

[0313] In some embodiments, after the display successfully sends the image for display, it notifies the result processing module that the image frame is successfully displayed. It can be understood that when the image frame is sent for display, the buffer storing the image frame and the adjustment zoom ratio request for obtaining the image frame in the cache of the electronic device will be cleared. The result processing module can send the address of the cleared buffer to the Allocate Buffer interface. The Allocate Buffer interface can subsequently allocate the address of the cleared buffer to the next zoom request.

[0314] Figure 6C The figure shows a schematic flowchart of a shooting method provided by an embodiment of the present application.

[0315] The implementation of this method can be based on the interaction and cooperation among the application layer (such as the camera application), the application framework layer (framework), the hardware abstraction layer (hardware abstract layer, HAL), and the hardware in the electronic device. Among them, the application layer mainly involves the camera request sending module in the camera application. The application framework layer mainly involves several modules such as the shooting parameter generation module, the request queue processing module, the allocate buffer interface, the result processing module, and the algorithm. The hardware mainly includes the camera module and the display, etc.

[0316] Among them, S601 - S613 show the process in which the electronic device 100 acquires and displays the image frame at the initial zoom ratio before the user changes the zoom ratio.

[0317] S614 - S633 show the process in which the electronic device 100 acquires and displays the image frame successively through one or more transition zoom ratios and the target zoom ratio after the user changes the zoom ratio.

[0318] S601. The user clicks on the "Camera" desktop icon.

[0319] The electronic device 100 can detect the user's operation of opening the camera application, such as the user clicking on the "Camera" desktop icon.

[0320] S602. In response to clicking on the "Camera" desktop icon, the camera application is launched, and the camera request sending module sends a first camera request (initial zoom ratio) to the request queue processing module.

[0321] For example, as Figure 5A shown, the user can click on the camera application icon. In response to this user operation, the electronic device 100 starts the camera application and displays the preview interface of the camera application. The preview interface of the camera application can be Figure 5B the photo-taking preview interface shown.

[0322] Not limited to the photo-taking preview interface, the preview interface of the camera application can also be a video recording preview interface, and this application does not make any limitations in this regard.

[0323] In response to launching the camera application, the camera request sending module can obtain the initial zoom ratio and send a first camera request to the request queue processing module in the application framework layer.

[0324] Among them, the first camera request carries the initial zoom ratio. The first camera request can also carry other parameter information, such as the initial zoom ratio, initial exposure, initial aperture, white initial balance, initial sharpness, initial contrast, initial saturation, etc.

[0325] Exemplarily, the initial zoom ratio can be 1x. The initial zoom ratio can also be 2.5x.

[0326] Optionally, the camera request sending module can also first send the first camera request to the shooting parameter generation module in the application framework layer, and then the shooting parameter generation module sends the first camera request to the request queue processing module. This application does not make any limitations in this regard.

[0327] S603. The request queue processing module allocates a first buffer for the first camera request through the buffer allocation interface.

[0328] Among them, the first buffer is an idle buffer.

[0329] In some embodiments, the application framework layer may further include an Allocate Buffer interface, which is used to allocate caches for camera requests sent by the camera application. Exemplarily, the Allocate Buffer interface may specify the address of the buffer used to store the camera request for the camera request.

[0330] In some embodiments, the request queue processing module may include a WaitForRequest module, a PrepareHALRequest module, and a SendRequestsBatch module.

[0331] Among them, the WaitForRequest module is used to make the first camera request to be executed in the request queue processing module wait when there is no empty buffer among the N cache buffers for the camera requests of the camera application allocated in the buffer area of the electronic device. The PrepareHALRequest module is used to construct the Capture request of the HAL layer and the output cache outputBuffers. The SendRequestsBatch module can be used to send the Capture request of the HAL layer constructed by the PrepareHALRequest module to the HAL layer.

[0332] When there is an empty buffer among the N cache buffers for the camera requests allocated to the camera application, the PrepareHALRequest module may obtain a first buffer from the Allocate Buffer interface for the first camera request sent by the camera application. And store the first camera request in the first buffer. After that, the PrepareHALRequest module may construct the Capture request of the HAL layer based on the first camera request. And send the Capture request of the HAL layer constructed by the PrepareHALRequest module based on the first camera request to the HAL layer through the SendRequestsBatch module.

[0333] Exemplarily, the above N may be 8, that is, the number of buffers for the camera requests allocated by the electronic device 100 to the camera application may be 8. N may also be other values, for example, 7, or 9, etc. The embodiments of the present application do not limit the value of N. The following will be described by taking the value of N as 8 as an example.

[0334] S604. The request queue processing module sends the first camera request and the address of the first buffer to the HAL layer.

[0335] Optionally, the address of the first buffer may be carried in the first camera request and sent to the HAL layer, or the address of the first buffer may be sent to the HAL layer independently of the first camera request. This application does not make any restrictions on this.

[0336] After receiving the first camera request and the address of the first buffer sent by the request queue processing module, the request queue processing module then sends the first camera request and the address of the first buffer to the HAL layer.

[0337] S605. The HAL layer sends the first camera request and the address of the first buffer to the camera module.

[0338] After receiving the first camera request and the address of the first buffer sent by the request queue processing module, the HAL layer then sends the first camera request and the address of the first buffer to the camera module.

[0339] S606. The camera module collects and processes the raw image stream to obtain Image Frame A (initial zoom ratio).

[0340] After receiving the first camera request and the address of the first buffer sent by the HAL layer, in response to the first camera request, the camera module turns on and starts to collect and process the raw image stream to obtain an image frame. Among them, the image frame obtained by the camera module may include Image Frame A, and Image Frame A is the image frame obtained by the camera module at the initial zoom ratio.

[0341] S607. The camera module sends Image Frame A (initial zoom ratio) and the address of the first buffer to the HAL layer.

[0342] S608. The HAL layer then sends Image Frame A (initial zoom ratio) and the address of the first buffer to the result processing module.

[0343] After the camera module obtains Image Frame A based on the initial zoom ratio, the camera module sends Image Frame A (initial zoom ratio) and the address of the first buffer to the HAL layer.

[0344] After obtaining Image Frame A (initial zoom ratio) and the address of the first buffer sent by the camera module, the HAL layer then sends Image Frame A (initial zoom ratio) and the address of the first buffer to the result processing module.

[0345] S609. The result processing module sends the return time of Image Frame A to the shooting parameter generation module.

[0346] The return frame time of image frame A can be the time when the HAL layer sends image frame A to the result processing module. When the result processing module obtains image frame A sent by the HAL layer, the result processing module can obtain the return frame time of image frame A. The result processing module then sends the return frame time of image frame A to the shooting parameter generation module.

[0347] S610. The result processing module stores image frame A in the first buffer.

[0348] After the result processing module obtains image frame A (initial zoom ratio) sent by the HAL layer and the address of the first buffer, the result processing module can store image frame A in the first buffer based on the address of the first buffer. So that subsequently, the first buffer can obtain the cached image frame A and display image frame A.

[0349] In some embodiments, S609 can also be executed after S610, and S609 can also be executed simultaneously with S610. This application does not make any limitations in this regard.

[0350] S611. The result processing module sends image frame A to the display.

[0351] S612. The result processing module clears the first buffer through the buffer allocation interface.

[0352] Optionally, after the result processing module takes out image frame A from the first buffer, the result processing module can clear the first buffer through the buffer allocation interface, so that the idle first buffer can store other image frames.

[0353] S613. The display shows image frame A.

[0354] When the display needs to show image frame A, the result processing module can obtain image frame A from the first buffer and send image frame A to the display, so that the display can show image frame A.

[0355] Exemplarily, when the initial zoom ratio is 1x, image frame A can be Figure 5B the image frame captured by the electronic device 100 at a zoom ratio of 1x as shown.

[0356] Exemplarily, when the initial zoom ratio is 2.5x, image frame A can be Figure 5F the image frame captured by the electronic device 100 at a zoom ratio of 2.5x as shown.

[0357] In some embodiments, S612 can also be executed after S613, and S612 can also be executed simultaneously with S613. This application does not make any limitations in this regard.

[0358] When the user does not change the shooting parameters, for example, the user does not change the zoom ratio, the electronic device 100 can continuously obtain and display multiple image frames based on the initial zoom ratio according to the method of S603 - S613.

[0359] In some embodiments, the electronic device 100 can also receive a user operation to change the shooting parameters of the camera application. For example, the electronic device 100 can receive a user operation to change the zoom ratio of the camera application. After the zoom ratio of the camera application changes, the camera application needs to re - send the target zoom ratio to the application framework layer, so that the camera module can collect and display the picture frames according to the target zoom ratio again. Reference can be made to the description in the embodiments of S614 - S633.

[0360] S614. The user clicks on the target zoom ratio option.

[0361] When the user needs to change the zoom ratio, the user can click on other zoom ratio options in the preview interface of the camera application, so that the camera application can switch to the zoom ratio selected by the user.

[0362] Exemplarily, the target zoom ratio option can be Figure 5B the 2.5x zoom ratio option shown. The user clicking on the target zoom ratio option can be Figure 5B the user clicking on the 2.5x zoom ratio option shown.

[0363] Exemplarily, the target zoom ratio option can also be Figure 5F the 1x zoom ratio option shown. The user clicking on the target zoom ratio option can be Figure 5F the 1x zoom ratio option shown.

[0364] S615. The camera request sending module sends a second camera request (target zoom ratio) to the shooting parameter generation module.

[0365] In response to the user clicking on the target zoom ratio option, the camera request sending module needs to send a second camera request to the shooting parameter generation module. The second camera request is used to send the target zoom ratio to the application framework layer.

[0366] Among them, the first camera request carries the target zoom ratio. The target camera request can also carry other parameter information, such as the initial zoom ratio, initial exposure, initial aperture, white initial balance, initial sharpness, initial contrast, initial saturation, etc. The target camera request can also not carry other parameter information, and this application does not make a limit on this.

[0367] Optionally, the camera request sending module may also first send the second camera request to the shooting parameter generation module in the application framework layer, and then the shooting parameter generation module sends the second camera request to the request queue processing module. This application does not make any limitations in this regard.

[0368] S616. The shooting parameter generation module obtains a zoom smooth adjustment curve based on the initial zoom ratio and the target zoom ratio.

[0369] After the shooting parameter generation module obtains the second camera request sent by the camera request sending module, the shooting parameter generation module can obtain the target zoom ratio from the second camera request.

[0370] In response to the target zoom ratio carried in the second camera request, the shooting parameter generation module can obtain a zoom smooth adjustment curve based on the initial zoom ratio and the target zoom ratio. The zoom smooth adjustment curve is a curve starting from the initial zoom ratio and ending at the target zoom ratio. The total duration of the zoom smooth adjustment curve is the first duration.

[0371] Among them, the moment corresponding to the starting point of the zoom smooth adjustment curve may be the moment when the user clicks the target zoom ratio option. The moment corresponding to the starting point of the zoom smooth adjustment curve may also be the moment when the shooting parameter generation module receives the second camera request sent by the camera request sending module. The difference between the moment corresponding to the ending point of the zoom smooth adjustment curve and the moment corresponding to the starting point of the zoom smooth adjustment curve is the first duration.

[0372] In some embodiments, the first duration may be a fixed duration, that is, the zoom duration is a fixed duration. In other embodiments, the first duration may also be determined by the shooting parameter generation module based on the initial zoom ratio and the target zoom ratio. For example, it is determined based on the difference between the initial zoom ratio and the target zoom ratio, that is, the zoom duration is not a fixed duration. The first duration can also be determined based on other methods. This application does not make any limitations in this regard.

[0373] It should be noted that different initial zoom ratios and / or target zoom ratios result in different obtained zoom smooth adjustment curves.

[0374] In some embodiments, the shooting parameter generation module may use a cubic Bezier curve to generate the zoom smooth adjustment curve. The cubic Bezier curve is a mathematical curve applied to two-dimensional graphic applications. The path of the cubic Bezier curve is described by the function B(t) of the given points P0 (starting point), P1 (control point), P2 (control point), P3 (ending point):

[0375] B(t) = P0(1 - t)3 + 3P1t(1 - t)2 + 3P22(1 - t) + P3t3 Formula (1)

[0376] As shown in formula (1), in formula (1), t represents the first duration, P0 represents the position point corresponding to the initial zoom ratio, P3 represents the position point corresponding to the target zoom ratio, and the shape of the Bezier curve can be adjusted by adjusting the two control points P1 and P2.

[0377] Exemplarily, the general shape of the cubic Bezier curve, such as an "S" shape, and the information of control point P1 and control point P2 corresponding to the shape of the cubic Bezier curve, that is, the relative position coordinates of control point P1 and position point P0, and the relative position coordinates of control point P2 and position point P3, can be determined through a finite number of trials. The information of control point P1 and control point P2 is preset in the electronic device 10. Each time the shooting parameter is adjusted, the shooting parameter generation module can adjust the coordinate positions of the starting point and the ending point according to the actual situation, and a smooth adjustment curve can be obtained.

[0378] When it is necessary to obtain a zoom smooth adjustment curve, the shooting parameter generation module can adjust the shape of the cubic Bezier curve based on the initial zoom ratio and the target zoom ratio, and then obtain a zoom smooth adjustment curve that matches the zoom reduction operation or the zoom increase operation.

[0379] In some embodiments, the initial zoom ratio may be less than the target zoom ratio, that is, the zoom ratio of the camera application is increased. The shooting parameter generation module can obtain a zoom smooth adjustment curve as Figure 7A shown.

[0380] As Figure 7A shown, the horizontal axis represents time, and the vertical axis represents the zoom ratio. The initial zoom ratio corresponds to time t1, the target zoom ratio corresponds to time t2, the target zoom ratio is greater than the initial zoom ratio, the time difference between t2 and t1 is the first duration, and t2 is greater than t1. Among them, time t1 may be the moment when the user clicks the target zoom ratio option, or time t1 may also be the moment when the shooting parameter generation module receives the second camera request sent by the camera request sending module. It can be Figure 7A seen that the zoom speed near the start zoom moment and near the end zoom moment is less than the zoom speed in the middle time period.

[0381] In other embodiments, the initial zoom ratio may be greater than the target zoom ratio, that is, the zoom ratio of the camera application is decreased. The shooting parameter generation module can obtain a zoom smooth adjustment curve as Figure 7B shown.

[0382] As Figure 7BAs shown, the horizontal axis represents time, and the vertical axis represents the zoom ratio. The initial zoom ratio corresponds to time t1, and the target zoom ratio corresponds to time t2. The target zoom ratio is less than the initial zoom ratio. The time difference between t2 and t1 is the first duration, and t2 is greater than t1. Among them, time t1 can be the moment when the user clicks on the target zoom ratio option, or time t1 can also be the moment when the shooting parameter generation module receives the second camera request sent by the camera request sending module. From Figure 7B It can be seen that the zoom speed near the start zoom time and near the end zoom time is less than the zoom speed in the middle time period.

[0383] It should be noted that Figure 7A and Figure 7B The zoom smooth adjustment curve shown is the zoom smooth adjustment curve under ideal conditions.

[0384] S617. The shooting parameter generation module obtains the frame return time of image frame B.

[0385] S618. The shooting parameter generation module needs to determine whether the frame return time of image frame B is later than the time corresponding to the target zoom ratio in the zoom smooth adjustment curve.

[0386] The HAL layer periodically / irregularly returns the image frames collected by the camera module to the application framework layer. Image frame B can be the image frame returned by the HAL layer to the application framework layer after the camera application receives the user's click on the target zoom ratio option. Image frame B can be the image frame collected at the initial zoom ratio.

[0387] After the camera module acquires image frame B based on the initial zoom ratio, the HAL layer can return image frame B to the application framework layer. After the application framework layer receives the image frame B uploaded by the HAL layer, the shooting parameter generation module in the application framework layer can obtain the frame return time of image frame B. The frame return time of image frame B is the time when the HAL layer uploads image frame B to the application framework layer.

[0388] After the shooting parameter generation module obtains the frame return time of image frame B, the shooting parameter generation module needs to determine whether the frame return time of image frame B is later than the time of the target zoom ratio in the zoom smooth adjustment curve, such as time t2.

[0389] When the frame return time of image frame B is earlier than the time of the target zoom ratio in the zoom smooth adjustment curve, the shooting parameter generation module needs to continue to obtain other transitional zoom ratios and acquire image frames based on the other transitional zoom ratios, that is, execute S619 - S631.

[0390] When the frame return time of image frame B is later than the time of the target zoom ratio in the zoom smooth adjustment curve, the shooting parameter generation module does not need to obtain other transition zoom ratios. The zoom ends, and the image frame can be obtained based on the target transition zoom ratio, that is, S632 is executed.

[0391] S619. The shooting parameter generation module determines the first transition zoom ratio based on the zoom smooth adjustment curve and the frame return time of image frame B.

[0392] S620. The shooting parameter generation module sends the second camera request to the request queue processing module.

[0393] In some embodiments, the second camera request may carry the first transition zoom ratio. In some embodiments, the first transition zoom ratio may also be referred to as the transition zoom ratio 1.

[0394] Before the electronic device 100 receives the user's click on the target zoom ratio option, the electronic device 100 continuously acquires and displays image frames at the initial zoom ratio. Based on the description of S609, the result processing module also sends the frame return time of the image frames acquired and displayed at the initial zoom ratio to the shooting parameter generation module.

[0395] After the electronic device 100 receives the user's click on the target zoom ratio option, for example, at time t1, the electronic device 100 also returns N image frames acquired at the initial zoom ratio. If, after time t1, at time t3, the shooting parameter generation module obtains the image frame B returned by HAL, that is, the frame return time of image frame B is time t3, and image frame B is an image frame acquired at the initial zoom ratio.

[0396] Exemplarily, image frame B can be Figure 5B or Figure 5F the image frames shown.

[0397] Optionally, after obtaining time t3, the shooting parameter generation module can also obtain the transition zoom ratio 1 based on a time before time t3 and the zoom smooth adjustment curve. The shooting parameter generation module then sends the second camera request to the request queue processing module. Optionally, after obtaining time t3, the shooting parameter generation module can also obtain the transition zoom ratio 1 based on a time after time t3 and the zoom smooth adjustment curve. The shooting parameter generation module then sends the second camera request to the request queue processing module. This application only takes the shooting parameter generation module obtaining the transition zoom ratio 1 based on time t3 and the zoom smooth adjustment curve as an example for illustration.

[0398] In some embodiments, the initial zoom ratio can be less than the target zoom ratio, that is, increasing the zoom ratio of the camera application. The shooting parameter generation module can obtain, for example, Figure 7CThe zoom smooth adjustment curve shown

[0399] Exemplarily, as Figure 7C shown, if the frame return time of the image frame B obtained by the shooting parameter generation module is time t3, the shooting parameter generation module can obtain the corresponding transition zoom ratio 1 from the zoom smooth adjustment curve based on time t3.

[0400] In some embodiments, the initial zoom ratio can be greater than the target zoom ratio, that is, the zoom ratio of the camera application is decreased. The shooting parameter generation module can obtain the zoom smooth adjustment curve as Figure 7D shown.

[0401] Exemplarily, as Figure 7D shown, if the frame return time of the image frame B obtained by the shooting parameter generation module is time t3, the shooting parameter generation module can obtain the corresponding transition zoom ratio 1 from the zoom smooth adjustment curve based on time t3.

[0402] Among them, the transition zoom ratio 1 is carried in the second camera request. Optionally, other shooting parameters can also be carried in the second camera request, such as the initial zoom ratio, initial exposure, initial aperture, white initial balance, initial sharpness, initial contrast, initial saturation, etc. Other shooting parameters may not be carried in the second camera request, and the present application does not limit this.

[0403] S621. The request queue processing module allocates a second buffer for the second camera request through the allocated buffer interface.

[0404] S622. The request queue processing module sends the second camera request and the address of the second buffer to the HAL layer.

[0405] S623. The HAL layer sends the second camera request and the address of the second buffer to the camera module.

[0406] S624. The camera module collects and processes the raw image stream to obtain the image frame C (the first transition zoom ratio).

[0407] S625. The camera module sends the image frame C (the first transition zoom ratio) and the address of the second buffer to the HAL layer.

[0408] S626. The HAL layer then sends the image frame C (the first transition zoom ratio) and the address of the second buffer to the result processing module.

[0409] S627. The result processing module sends the frame return time of the image frame C to the shooting parameter generation module.

[0410] S628. The result processing module stores the image frame C in the second buffer.

[0411] S629. The result processing module sends the image frame C to the display.

[0412] S630. The result processing module clears the second buffer through the allocated buffer interface.

[0413] S631. The display shows the image frame C.

[0414] Wherein, the second buffer may or may not be the same buffer as the first buffer, and the present application does not make any limitation on this.

[0415] For the detailed introduction of S621 - S631, reference can be made to the description in S603 - S613, and the present application will not elaborate herein.

[0416] Optionally, the shooting parameter generation module may also obtain the frame return time of the image frame C. The shooting parameter generation module may also determine whether to generate the next transition zoom ratio based on the frame return time of the image frame C.

[0417] Exemplarily, when the frame return time of the image frame C is later than the frame return time of the target zoom image frame C in the zoom smooth adjustment curve, the zoom ends, and the shooting parameter generation module no longer generates other transition zoom ratios, and directly obtains the image frame based on the target transition zoom ratio, that is, executes S632.

[0418] When the frame return time of the image frame C is earlier than the time of the target zoom ratio in the zoom smooth adjustment curve, the shooting parameter generation module may determine the transition zoom ratio 2 based on the zoom smooth adjustment curve and the frame return time of the image frame C.

[0419] In some embodiments, the initial zoom ratio may be less than the target zoom ratio, that is, increasing the zoom ratio of the camera application. The shooting parameter generation module may obtain the Figure 7C as shown in the zoom smooth adjustment curve

[0420] Exemplarily, as Figure 7C shown, if the shooting parameter generation module obtains that the frame return time of the image frame C is time t4, the shooting parameter generation module may obtain the corresponding transition zoom ratio 2 from the zoom smooth adjustment curve based on time t4.

[0421] In some embodiments, the initial zoom ratio may be greater than the target zoom ratio, that is, decreasing the zoom ratio of the camera application. The shooting parameter generation module may obtain the Figure 7D as shown in the zoom smooth adjustment curve.

[0422] Exemplarily, asFigure 7D As shown, if the return frame time of the image frame C obtained by the shooting parameter generation module is time t4, the shooting parameter generation module can obtain the corresponding transition zoom ratio 2 from the zoom smooth adjustment curve based on time t4.

[0423] After determining the transition zoom ratio 2, the electronic device 100 can collect the image frame D at the transition zoom ratio 2 and display the collected image frame D in a manner similar to S620 - S631.

[0424] The camera module can upload the image frame D to the HAL layer, and the HAL layer then uploads the image frame D to the application framework layer. After the application framework layer receives the image frame D uploaded by the HAL layer, the shooting parameter generation module in the application framework layer can obtain the return frame time of the image frame D, and the return frame time of the image frame D is the time when the HAL layer uploads the image frame C to the application framework layer.

[0425] After the shooting parameter generation module obtains the return frame time of the image frame D, the shooting parameter generation module needs to determine whether the return frame time of the image frame D is later than the time of the target zoom ratio in the zoom smooth adjustment curve, such as time t2.

[0426] When the return frame time of the image frame D is earlier than the time of the target zoom ratio in the zoom smooth adjustment curve, the shooting parameter generation module needs to continue to obtain other transition zoom ratios and obtain image frames based on the other transition zoom ratios.

[0427] In some embodiments, the initial zoom ratio can be less than the target zoom ratio, that is, increasing the zoom ratio of the camera application. The shooting parameter generation module can obtain a zoom smooth adjustment curve as Figure 7C shown.

[0428] Exemplarily, as Figure 7C shown, if the return frame time of the image frame C obtained by the shooting parameter generation module is time t5, the shooting parameter generation module can obtain the corresponding transition zoom ratio 3 from the zoom smooth adjustment curve based on time t5.

[0429] In some embodiments, the initial zoom ratio can be greater than the target zoom ratio, that is, decreasing the zoom ratio of the camera application. The shooting parameter generation module can obtain a zoom smooth adjustment curve as Figure 7D shown.

[0430] Exemplarily, as Figure 7D shown, if the return frame time of the image frame D obtained by the shooting parameter generation module is time t5, the shooting parameter generation module can obtain the corresponding transition zoom ratio 3 from the zoom smooth adjustment curve based on time t5.

[0431] After determining the transitional zoom ratio 3, the electronic device 100 can collect the image frame E at the transitional zoom ratio 3 and send and display the image frame E in a manner similar to S620 - S631.

[0432] When the frame return time of the image frame D is later than the time of the target zoom ratio in the zoom smooth adjustment curve, the shooting parameter generation module needs to continue to obtain other transitional zoom ratios and obtain the image frame based on the other transitional zoom ratios. The shooting parameter generation module does not need to obtain other transitional zoom ratios, and the zoom ends. Just obtain the image frame based on the target transitional zoom ratio, that is, execute S632.

[0433] And so on until the frame return time of the image frame returned by the HAL layer to the application framework layer is later than the time of the target zoom ratio in the zoom smooth adjustment curve, such as time t2, and the zoom ends.

[0434] S632: The electronic device 100 obtains and displays the picture frame at the target zoom ratio (refer to S602 - S613).

[0435] When the frame return time of the image frame B is later than the time of the target zoom ratio in the zoom smooth adjustment curve, the zoom ends, and the electronic device 100 can obtain and display the picture frame based on the target zoom ratio.

[0436] Specifically, for how the electronic device 100 obtains and displays the picture frame at the target zoom ratio, reference can be made to the description in S602 - S613, and details are not elaborated herein.

[0437] After the electronic device 100 obtains and displays the picture frame at the target zoom ratio, and when the electronic device 100 does not receive a user's change in the zoom ratio, the electronic device 100 continuously obtains and displays the picture frame at the target zoom ratio.

[0438] Optionally, during the zoom process, the HAL layer can obtain the zoom ratio of the image frame and the frame return time of the image frame, and obtain based on the zoom ratio of the image frame and the frame return time of the image frame Figure 7C the shown zoom curve or Figure 7D the shown zoom curve. Figure 7C Or Figure 7D the shown zoom curve reflects the zoom process of the image frames displayed by the electronic device 100 during the zoom process.

[0439] Such as Figure 7C Or Figure 7DAs shown, if the time when the user clicks on the target zoom ratio option is time t1, and the time when the HAL layer returns the image frame B to the application framework layer is time t6. It takes time for the application framework layer to send a camera request to the HAL layer, and it also takes time for the HAL layer to send a camera request to the camera module, and it takes time for the camera module to process the image. The time difference between time t1 and time t6 is the first duration. The first duration is the communication delay between layers and the image processing delay. If the HAL layer starts to return the image acquired at the transition zoom ratio to the application framework layer at time t6 and later, the HAL layer can obtain Figure 7C or Figure 7D the zoom curve shown

[0440] Based on Figure 6C analysis, first of all, the calculation process of the transition zoom ratio is completed in the application framework layer, reducing the interaction steps between the application layer and the application framework layer, saving the time for the application layer to send the transition zoom ratio to the application framework layer. After the HAL layer returns the image frame, the application framework layer can timely send the zoom request to the HAL layer. Secondly, when the HAL layer returns the image frame to the application framework layer, the application framework layer can determine the transition zoom ratio in real time based on the frame return time of the image frame returned by the HAL layer, so that the zoom curve corresponding to the image frame returned by the HAL layer during the zoom process conforms to the change law of the smooth zoom adjustment curve, making the zoom process smoother. The zoom ratio can transition from the initial zoom ratio to the target zoom ratio according to the change law of the smooth zoom adjustment curve, without the situation of screen jitter or freezing, improving the user's visual experience

[0441] Figure 8 It is a schematic flowchart of a shooting parameter adjustment method provided by this application

[0442] S801. The electronic device receives and responds to the first operation of the user for the camera application, and obtains the target shooting parameter. The target shooting parameter is the shooting parameter set by the first operation

[0443] Exemplarily, the first operation can be Figure 5B the input operation for the 2.5x zoom ratio option shown. The target shooting parameter can be 2.5x zoom ratio

[0444] Exemplarily, the first operation can also be Figure 5F the input operation for the 1x zoom ratio option shown. The target shooting parameter can also be 1x zoom ratio

[0445] S802. The electronic device obtains the frame return time of the first image frame. The first image frame is the image frame acquired based on the initial shooting parameter after the electronic device receives the first operation

[0446] In some embodiments, the first image frame may be Figure 6C the image frame B shown.

[0447] Exemplarily, the first image frame may be Figure 7C or Figure 7D the image frame 1 or image frame 2 or image frame 3 shown.

[0448] Exemplarily, the frame return time of the first image frame may be Figure 7C or Figure 7D the time t3 or time t4 or time t5 shown.

[0449] S803. The electronic device determines a first transition shooting parameter based on the frame return time of the first image frame, the initial shooting parameter, and the target shooting parameter.

[0450] In some embodiments, the initial shooting parameter may be an initial zoom ratio, and the target shooting parameter may be a target zoom ratio.

[0451] S804. The electronic device acquires a second image frame based on the first transition shooting parameter.

[0452] In some embodiments, the second image frame may be Figure 6C the image frame C shown.

[0453] Exemplarily, the first transition shooting parameter may be Figure 7C or Figure 7D the transition zoom ratio 1 or transition zoom ratio 2 or transition zoom ratio 3 shown.

[0454] S805. The electronic device displays the second image frame in the camera application.

[0455] Exemplarily, the second image frame may be Figure 5C the image frame shown or Figure 5D the image frame shown or.

[0456] Exemplarily, the second image frame may also be Figure 5G the image frame shown or Figure 5H the image frame shown or.

[0457] Optionally, not limited to determining only one transition shooting parameter, the electronic device may also determine other more transition shooting parameters, which are not limited in this application.

[0458] Through this method, the electronic device can calculate one or more transition shooting parameters in real time based on the frame return time of the image frame, and smoothly switch from the initial shooting parameters to the target shooting parameters in sequence according to the one or more transition shooting parameters, avoiding screen jitter or freezing during the process of switching shooting parameters, and improving the user's visual experience.

[0459] In a possible implementation manner, the electronic device determines a first transition shooting parameter based on the frame return time of the first image frame, the initial shooting parameters, and the target shooting parameters. Specifically, the electronic device obtains a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters. The starting point of the smooth adjustment curve is the initial shooting parameter, and the end point of the smooth adjustment curve is the target shooting parameter. The electronic device determines the first transition shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame.

[0460] In some embodiments, the type of the smooth adjustment curve may be a Bezier curve. The total duration of the smooth adjustment curve may be fixed, or the total duration of the smooth adjustment curve may be determined by the initial shooting parameters and the target shooting parameters. When the initial shooting parameters and the target shooting parameters are different, the total duration of the smooth adjustment curve may also be different.

[0461] The moment corresponding to the starting point of the smooth adjustment curve may be the moment when the electronic device receives the first operation for the camera application. The moment corresponding to the end point of the smooth adjustment curve may be the moment determined by adding the total duration of the smooth adjustment curve to the starting point of the smooth adjustment curve.

[0462] The electronic device can obtain a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters, and determine one or more transition shooting parameters from the smooth adjustment curve through the frame return time of the image frame, so that the camera application can smoothly switch from the initial shooting parameters to the target shooting parameters based on the one or more transition shooting parameters. The change of the shooting parameters of the image frame finally obtained by the electronic device conforms to the change law of the smooth adjustment curve, so as to realize that the shooting parameters can be smoothly transitioned to the target shooting parameters, avoid screen jitter or freezing, and improve the user's visual experience.

[0463] In the case where the initial shooting parameters are less than the target shooting parameters, for example, the initial shooting parameter may be a 1x zoom ratio, and the target shooting parameter may be a 2.5x shooting parameter. The smooth adjustment curve may be Figure 7A Or Figure 7C The shown zoom smooth adjustment curve. How the electronic device determines the first transition shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame can refer to the description in Figure 7C The embodiment.

[0464] When the initial shooting parameter is greater than the target shooting parameter, for example, the initial shooting parameter can be a 2.5x zoom ratio, the target shooting parameter can be a 1x shooting parameter, and the smooth adjustment curve can be Figure 7B or Figure 7D the zoom smooth adjustment curve shown. How the electronic device determines the first transition shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame can be referred to Figure 7D the description in the embodiment.

[0465] In a possible implementation, before the electronic device receives and responds to the first operation of the user for the camera application, the method further includes: the electronic device receives and responds to the second operation of turning on the camera application, and obtains the initial shooting parameter; the electronic device collects and displays the image frame based on the initial shooting parameter.

[0466] In this way, before the electronic device receives the user operation to change the shooting parameter, the electronic device collects and displays the image frame with the initial shooting parameter.

[0467] In a possible implementation, the electronic device determines the first transition shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame, specifically including: the electronic device determines whether the frame return time of the first image frame is earlier than the time corresponding to the target shooting parameter in the smooth adjustment curve; when the frame return time of the first image frame is earlier than the time corresponding to the target shooting parameter, the electronic device determines the first transition shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame.

[0468] In a possible implementation, the method further includes: when the frame return time of the first image frame is later than the time corresponding to the target shooting parameter, the electronic device collects the third image frame based on the target shooting parameter; the electronic device displays the third image frame in the camera application.

[0469] In this way, the electronic device can determine whether to determine the transition shooting parameter based on the frame return time of the image frame and the time corresponding to the target shooting parameter in the smooth adjustment curve. When the frame return time of the image frame is earlier than the time corresponding to the target shooting parameter in the smooth adjustment curve, the electronic device can determine one or more transition shooting parameters based on the frame return time of the image frame. When the frame return time of the image frame is later than the time corresponding to the target shooting parameter in the smooth adjustment curve, the electronic device does not need to determine other transition zoom parameters, and the zoom ends.

[0470] In a possible implementation, the electronic device includes an application framework layer and a hardware abstraction layer; the first image frame is the image frame sent by the hardware abstraction layer to the application framework layer after the electronic device receives the first operation, and the frame return time of the first image frame is the time when the hardware abstraction layer sends the first image frame to the application framework layer.

[0471] In a possible implementation, the electronic device determines a first transition shooting parameter from a smooth adjustment curve based on the frame return time of the first image frame. Specifically, the electronic device determines the first transition shooting parameter from the smooth adjustment curve through the application framework layer based on the frame return time of the first image frame.

[0472] In this way, first, the calculation process of the transition shooting parameter is completed at the application architecture layer, reducing the interaction steps between the application layer and the application architecture layer, saving the time for the application layer to send the transition shooting parameter to the application architecture layer. After the HAL layer returns the image frame, the application framework layer can promptly send the camera request carrying the transition shooting parameter to the HAL layer. Second, when the HAL layer returns the image frame to the application architecture layer, the application architecture layer can determine the transition shooting parameter in real time based on the frame return time of the image frame returned by the HAL layer, making the smooth adjustment curve corresponding to the image frame returned during the shooting parameter adjustment process conform to the variation law of the preset smooth adjustment curve, making the shooting parameter adjustment process smoother, without screen jitter or freezing, and improving the user's visual experience.

[0473] In a possible implementation, the electronic device further includes a camera module; before the electronic device acquires a second image frame based on the first transition shooting parameter, the method further includes: in response to the electronic device determining the first transition shooting parameter from the smooth adjustment curve through the application framework layer based on the frame return time of the first image frame, the electronic device sends a first request to the HAL layer through the application framework layer, and the first request carries the first transition shooting parameter; the electronic device sends the first request to the camera module through the HAL layer; the electronic device acquires the second image frame based on the first transition shooting parameter, specifically including: in response to the first request, the electronic device acquires the second image frame through the camera module based on the first transition shooting parameter.

[0474] In this way, the application framework layer, the HAL layer, and the hardware layer can cooperate with each other to complete the shooting parameter adjustment process.

[0475] In a possible implementation, the shooting parameter includes any one of the following: zoom ratio, exposure, aperture, white balance, sharpness, contrast, saturation.

[0476] The above are only some embodiments and implementation manners of the present application. The protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

[0477] It is understandable that the various user interfaces described in the embodiments of the present application are only example interfaces and do not limit the solution of the present application. In other embodiments, the user interface may adopt different interface layouts, may include more or fewer controls, and may add or reduce other function options. As long as it is based on the same inventive concept provided by the present application, it is within the protection scope of the present application.

[0478] It should be noted that, without contradiction or conflict, any feature in any embodiment of the present application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of the present application.

[0479] As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and 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.

Claims

1. A method for adjusting shooting parameters, characterized in that, the method includes: The electronic device receives and responds to a first operation of the user for the camera application, and obtains target shooting parameters, where the target shooting parameters are the shooting parameters set by the first operation; The electronic device obtains the frame return time of the first image frame, where the first image frame is an image frame collected based on the initial shooting parameters after the electronic device receives the first operation; The electronic device determines a first transitional shooting parameter based on the frame return time of the first image frame, the initial shooting parameters, and the target shooting parameters; The electronic device collects a second image frame based on the first transitional shooting parameter; The electronic device displays the second image frame within the camera application.

2. The method according to claim 1, characterized in that, The electronic device determines a first transitional shooting parameter based on the frame return time of the first image frame, the initial shooting parameters, and the target shooting parameters, specifically including: The electronic device obtains a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters, where the starting point of the smooth adjustment curve is the initial shooting parameters, and the end point of the smooth adjustment curve is the target shooting parameters; The electronic device determines the first transitional shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame.

3. The method according to claim 1 or 2, characterized in that, Before the electronic device receives and responds to the first operation of the user for the camera application, the method further includes: The electronic device receives and responds to a second operation to turn on the camera application, and obtains the initial shooting parameters; The electronic device collects and displays an image frame based on the initial shooting parameters.

4. The method according to claim 2, characterized in that, The electronic device determines the first transitional shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame, specifically including: The electronic device determines whether the frame return time of the first image frame is earlier than the time corresponding to the target shooting parameter in the smooth adjustment curve; When the frame return time of the first image frame is earlier than the time corresponding to the target shooting parameter, the electronic device determines the first transitional shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame.

5. The method according to claim 4, characterized in that, The method further includes: When the frame return time of the first image frame is later than the time corresponding to the target shooting parameter, the electronic device collects a third image frame based on the target shooting parameters; The electronic device displays the third image frame within the camera application.

6. The method according to any one of claims 1-5, characterized in that, When the initial shooting parameters are greater than the target shooting parameters, the first transitional shooting parameter is less than the initial shooting parameters and greater than the target shooting parameters; When the initial shooting parameters are less than the target shooting parameters, the first transitional shooting parameter is greater than the initial shooting parameters and less than the target shooting parameters.

7. The method according to any one of claims 2-6, wherein, the electronic device includes an application framework layer and a hardware abstraction layer; the first image frame is the image frame sent by the hardware abstraction layer to the application framework layer after the electronic device receives the first operation, and the frame return time of the first image frame is the time when the hardware abstraction layer sends the first image frame to the application framework layer.

8. The method according to claim 7, wherein, the electronic device determines the first transition shooting parameter from the smooth adjustment curve based on the frame return time of the first image frame, specifically including: the electronic device determines the first transition shooting parameter from the smooth adjustment curve through the application framework layer based on the frame return time of the first image frame.

9. The method according to claim 7 or 8, wherein, the electronic device further includes a camera module; before the electronic device acquires a second image frame based on the first transition shooting parameter, the method further includes: in response to the electronic device determining the first transition shooting parameter from the smooth adjustment curve through the application framework layer based on the frame return time of the first image frame, the electronic device sends a first request through the application framework layer to the HAL layer, and the first request carries the first transition shooting parameter; the electronic device sends the first request to the camera module through the HAL layer; the electronic device acquires a second image frame based on the first transition shooting parameter, specifically including: in response to the first request, the electronic device acquires the second image frame through the camera module based on the first transition shooting parameter.

10. The method according to any one of claims 1-9, wherein, the shooting parameter includes any one of the following: zoom ratio, exposure, aperture, white balance, sharpness, contrast, saturation.

11. An electronic device, wherein, the electronic device includes a memory and a processor; wherein, the memory and the processor are coupled, and the memory is used to store a computer program. When the processor executes and calls the computer program, the electronic device executes the method according to any one of claims 1-10.

12. A computer-readable storage medium, including instructions, wherein, when the instructions run on an electronic device, the electronic device executes the method according to any one of claims 1-10.