Image processing method, processing device and electronic equipment

By transferring the image corresponding to the photo-taking command to a second storage unit instead of processing it immediately, the problem of lag in the preview interface was solved, resulting in smooth display and a user-friendly photo-taking experience.

CN121644975APending Publication Date: 2026-03-10LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, image processing during photo taking by electronic devices causes the preview interface to lag, affecting the user experience.

Method used

By transferring the captured image corresponding to the photo-taking command from the first storage unit to the second storage unit, instead of processing it immediately based on the target algorithm, the photo-taking command and image processing are decoupled, thus avoiding resource contention.

Benefits of technology

Ensure smooth preview interface display to meet users' needs for instant viewing and continuous shooting, optimize resource utilization, and balance image output speed and power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644975A_ABST
    Figure CN121644975A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method, an image processing device and electronic equipment. The method comprises the steps that in response to a starting instruction of a first application capable of calling a camera, a first collection image is obtained through the camera and cached in a first storage unit, and the first collection image is at least used for achieving shooting preview of the first application; in response to the photographing instruction, a second collected image corresponding to the photographing instruction is transferred from the first storage unit to the second storage unit, and the processing flow indicated by the photographing instruction comprises the step of processing the collected image corresponding to the photographing instruction based on a target algorithm to generate a photo; obtaining an input operation of a user; and determining whether to execute target algorithm-based processing for the second acquired image based on the input operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image processing method, processing device and electronic device. Background Technology

[0002] With the rapid development of electronic products, photography has become an indispensable function of electronic devices. Image processing is an important means of improving photo quality, and common image processing techniques include noise reduction, high dynamic range compositing, portrait blurring, beautification optimization, and intelligent enhancement.

[0003] In conventional technology, in response to a launch command from the first application capable of accessing the camera, such as a camera app, the electronic device begins capturing an image and displays it in a preview interface. In response to a capture command, the electronic device processes the image corresponding to the capture command based on image processing algorithms, obtaining a photo and saving it. Image processing typically requires significant software and / or hardware resources within the electronic device, causing lag in the preview interface and negatively impacting the user experience. Summary of the Invention

[0004] This application provides an image processing method, processing device, and electronic device that can improve the display smoothness of the preview interface and enhance the user experience.

[0005] The technical solution of this application embodiment is implemented as follows: This application provides an image processing method, comprising: in response to a launch command of a first application capable of calling a camera, acquiring a first captured image through the camera and caching it in a first storage unit, the first captured image being used at least to implement a shooting preview of the first application; in response to a shooting command, transferring a second captured image corresponding to the shooting command from the first storage unit to a second storage unit, the processing flow indicated by the shooting command including generating a photo based on a target algorithm processing the captured image corresponding to the shooting command; obtaining user input operations; and determining whether to perform processing of the second captured image based on the target algorithm based on the input operations.

[0006] In this application, in response to a photo-taking command, the captured image corresponding to the command is transferred from the first storage unit to the second storage unit, instead of immediately processing the captured image based on the target algorithm. Therefore, there is no issue of resource contention, and the synthesis and display of the preview interface are not affected, thus improving the smoothness of the preview interface and enhancing the user experience.

[0007] In some embodiments, determining whether to perform processing of the second acquired image based on the target algorithm based on the input operation includes: if the input operation satisfies a first condition, reading the second acquired image from the second storage unit to the first storage unit, and processing the second acquired image based on the target algorithm to generate a photo; wherein, the input operation satisfying the first condition indicates that the input operation is to call the photo album application to display the photo.

[0008] In this embodiment, the input operation satisfies the first condition, indicating that the user wants to view the captured photo immediately. In this case, the second captured image corresponding to the photo-taking command can be processed immediately based on the target algorithm to generate a photo, thereby satisfying the user's need to view it immediately.

[0009] In some embodiments, determining whether to perform processing based on the target algorithm for the second acquired image based on the input operation includes: if the input operation satisfies a second condition, not performing processing based on the target algorithm for the second acquired image; wherein, the input operation satisfying the second condition indicates that the input operation triggers a photo-taking command response and the photo-taking command triggered by the input operation is the (N+1)th photo-taking command; N is an integer greater than or equal to 1.

[0010] In this embodiment, the input operation satisfies the second condition, indicating that the user is in continuous shooting mode, i.e., currently in a burst shooting scenario. In this case, processing based on the target algorithm for the second captured image can be omitted. This effectively alleviates the problem of high-load processing task accumulation and intense resource contention in burst shooting scenarios. It not only ensures the smooth display of the preview interface but also meets the user's burst shooting needs.

[0011] In some embodiments, the method further includes: in response to a photographing command triggered by an input operation, transferring a third captured image corresponding to the photographing command triggered by the input operation from the first storage unit to the second storage unit; wherein the second captured image and the third captured image are stored sequentially in the second storage unit.

[0012] In this embodiment, the electronic device sequentially transfers the captured images corresponding to each shooting command to the second storage unit, without immediately performing processing based on the target algorithm on the second captured image. This effectively alleviates the problem of high-load processing task accumulation and intense resource contention in continuous shooting scenarios.

[0013] In some embodiments, if the photo capture command triggered by the input operation is the (N+1)th photo capture command, it is determined whether to perform processing based on the target algorithm for the third captured image based on the (N+1)th input operation.

[0014] In this embodiment, the electronic device will transfer the captured image corresponding to each photo-taking command from the first storage unit to the second storage unit, and determine whether to process the captured image based on the user's input operation after the photo-taking command.

[0015] In some embodiments, determining whether to perform processing of the second acquired image based on the target algorithm based on the input operation includes: if the input operation satisfies a third condition, reading the second acquired image from the second storage unit to the first storage unit, and processing the second acquired image based on the target algorithm to generate a photograph; wherein, the input operation satisfying the third condition indicates that the input operation is the display of the interactive interface for exiting the first application on the screen.

[0016] In this embodiment, the input operation satisfies the third condition, instructing the user to end the shooting. Since the preview interface has been exited, the captured image corresponding to the shooting command stored in the second storage unit can be processed to obtain a photo, thus satisfying the user's shooting needs.

[0017] In some embodiments, the input operation satisfies a third condition, and the computational resources provided for processing the second acquired image based on the target algorithm are less than the computational resources provided for processing the second acquired image based on the target algorithm when the input operation satisfies a first condition, so that the input operation satisfies the third condition and the speed at which the second acquired image is processed by the target algorithm to generate a photo is lower than the speed at which the second acquired image is processed by the target algorithm to generate a photo when the input operation satisfies the first condition.

[0018] In this embodiment, when the input operation satisfies a first condition, indicating that the user wants to view the captured photo immediately, first computing resources are provided to the target algorithm to expedite image processing. When the input operation satisfies a third condition, indicating that the user has stopped taking the photo and no longer needs to view it immediately, second computing resources are provided to the target algorithm to balance power consumption and performance. The first computing resources are higher / larger than the second. The purpose of this is to ensure that the image processing speed is faster when the input operation satisfies the first condition than when it satisfies the third condition. In this way, image processing speed and resource consumption can be balanced, maximizing resource utilization efficiency.

[0019] In some embodiments, generating a photograph based on the target algorithm processing of the acquired image corresponding to the photographing command includes: obtaining parameter values ​​for characterizing the temperature of the electronic device; if the parameter values ​​meet a threshold, performing target algorithm processing on the acquired image corresponding to the photographing command according to a first processing method; if the parameter values ​​do not meet the threshold, performing target algorithm processing on the acquired image corresponding to the photographing command according to a second processing method; the first processing method and the second processing method are different.

[0020] In this embodiment, when generating a photo based on the target algorithm processing of the captured image corresponding to the photo-taking command, a parameter value for characterizing the temperature of the electronic device can also be obtained. Based on this parameter value, the target algorithm processing of the captured image corresponding to the photo-taking command is performed according to different processing methods.

[0021] In some embodiments, if the captured image corresponding to the photo-taking command is a multi-frame image, performing target algorithm-based processing on the captured image corresponding to the photo-taking command according to the second processing method includes: performing target algorithm-based processing on one frame of the multi-frame image corresponding to the photo-taking command according to the second processing method to generate a photo.

[0022] In this embodiment, the image captured corresponding to the photo-taking command is a multi-frame image. To improve processing speed, achieve rapid image output, and reduce energy consumption, if the parameter value does not meet the threshold, the second processing method can be used to execute target algorithm processing to generate a photo from one frame of the multi-frame image corresponding to the photo-taking command. In this way, usable photos can still be generated while saving power consumption, meeting the user's basic needs and achieving a balance between resources and quality.

[0023] This application provides a processing apparatus, including: The acquisition unit is used to respond to the launch command of the first application that can call the camera, acquire a first acquired image through the camera and cache it in the first storage unit. The first acquired image is used at least to realize the shooting preview of the first application. The processing engine, in response to a photo-taking command, transfers the second captured image corresponding to the photo-taking command from the first storage unit to the second storage unit. The processing flow indicated by the photo-taking command includes generating a photo based on the captured image corresponding to the photo-taking command using a target algorithm; obtaining user input; and determining whether to perform processing on the second captured image based on the target algorithm based on the input.

[0024] This application provides an electronic device, including: A camera is used to capture images; The processor is configured to, in response to a launch command of a first application capable of accessing the camera, acquire a first captured image through the camera and cache it in a first storage unit, the first captured image being used at least to implement a shooting preview of the first application; in response to a shooting command, transfer a second captured image corresponding to the shooting command from the first storage unit to the second storage unit, the processing flow indicated by the shooting command including generating a photo based on a target algorithm processing the captured image corresponding to the shooting command; obtaining user input operations; and determining whether to perform processing of the second captured image based on the target algorithm based on the input operations.

[0025] The first storage unit is used to cache the first acquired image; The second storage unit is used to store the captured image corresponding to the photo-taking command.

[0026] The embodiments of this application have the following beneficial effects: decoupling the photo-taking command from image processing ensures the smooth display of the preview interface. Attached Figure Description

[0027] Figure 1 This is one of the flowcharts illustrating an image processing method provided in an embodiment of this application; Figure 2 This is a second schematic flowchart of an image processing method provided in an embodiment of this application; Figure 3 This is a third schematic flowchart of an image processing method provided in an embodiment of this application; Figure 4 This is the fourth flowchart illustrating an image processing method provided in this application embodiment; Figure 5 This is the fifth flowchart illustrating an image processing method provided in this application embodiment; Figure 6 This is a schematic flowchart of a photo generation process provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application; Figure 8 This is a schematic diagram of an image processing method provided in an embodiment of this application. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

[0030] With the rapid development of electronic products, photography has become an indispensable function of electronic devices. Image processing is an important means of improving photo quality. Common image processing techniques include noise reduction, high dynamic range compositing, portrait blurring, beautification optimization, and intelligent enhancement. Image processing is usually performed according to a preset, fixed workflow, aiming to convert the raw captured image into a high-quality photograph.

[0031] In conventional technology, in response to a launch command from the first application capable of accessing the camera, such as a camera app, the electronic device captures an image through the camera and caches the image in a storage unit. This storage unit can be, for example, a first-in, first-out (FIFO) circular buffer. Simultaneously, the electronic device reads the image from this storage unit, performs image compositing and rendering to obtain a preview interface, which is then displayed. This allows users to view the captured content in real time through the preview interface. In response to a photo-taking command, the electronic device processes the image corresponding to the command using image processing algorithms, obtains a photo, and saves it. Image processing typically requires significant resources from the electronic device, which can cause the preview interface to lag, impacting the user experience.

[0032] In some related technologies, a synchronous real-time processing mode is used to process images. Specifically, in response to a photo-taking command, the electronic device disables the interactive functions of the preview interface to block user operation. For example, it stops responding to user input in the preview interface and may display a "processing" message. Simultaneously, the electronic device processes the image corresponding to the photo-taking command based on image processing algorithms. Only after image processing is complete does the preview interface return to normal and interactive functions are restored.

[0033] In other related technologies, a simple background asynchronous processing mode is used to process images. Specifically, in response to a photo-taking command, the electronic device does not disable the interactive functions of the preview interface, but instead runs the image processing task in the background. However, performing image processing tasks requires a large amount of resources, causing resources used for compositing and rendering the preview interface to be preempted, resulting in frame drops, stuttering, and unsmooth display in the preview interface.

[0034] Based on this, embodiments of this application provide an image processing method, processing apparatus, and electronic device. In these embodiments, the electronic device is one with a camera function, including but not limited to smart terminals such as mobile phones and tablets, camera equipment, wearable devices such as smartwatches, and other smart devices integrating image acquisition modules such as drones and IoT devices. In these embodiments, in response to a launch command from a first application capable of calling the camera, such as a camera application, the electronic device acquires an image and stores it in a first storage unit to support preview display. In response to a photo-taking command, the electronic device transfers the image corresponding to the photo-taking command from the first storage unit to a second storage unit. That is, in response to a photo-taking command, the electronic device does not immediately process the image corresponding to the photo-taking command based on an image processing algorithm, but instead transfers the image corresponding to the photo-taking command. Since no image processing is performed based on resources, it does not preempt resources used for compositing and rendering the preview interface, and does not affect the display of the preview interface, ensuring smooth and lag-free preview display.

[0035] The following description, in conjunction with the accompanying drawings and embodiments, introduces an image processing method, processing device, and electronic device provided in this application. Figure 1 This is one of the schematic flowcharts of an image processing method provided in an embodiment of this application, such as... Figure 1 As shown, the method may include: S101, in response to the start command of the first application that can call the camera, the first captured image is obtained through the camera and cached in the first storage unit.

[0036] In this embodiment, the first application is an application capable of accessing a camera. In other words, the first application can interact with the camera through a preset interface, such as triggering the camera to capture images and obtaining the images captured by the camera. The first application can be, for example, a camera application, an instant messaging application, a social application, a shopping application, etc. This embodiment does not specifically limit it in this way.

[0037] In this embodiment, the startup command of the first application is used to trigger the camera to capture images. This startup command can be any one or more of the following: voice control command, touch command, gesture command, and physical button press command.

[0038] In this embodiment, in response to a launch command from a first application, a first captured image is acquired via a camera and cached in a first storage unit. The first captured image is used at least to implement a preview of the first application's image capture. That is, the first captured image is used at least to synthesize and display a preview interface. For example, in response to a launch command from the first application, the camera continuously acquires the first captured image and caches it in the first storage unit. Simultaneously, the electronic device continuously reads the first captured image from the first storage unit, uses it to synthesize and display a preview interface, allowing the user to view the captured content in real time through the preview interface.

[0039] The first storage unit is used to cache the first acquired image to support preview display. In other words, the function of the first storage unit is to cache the first acquired image. The first storage unit can be, for example, random access memory (RAM). Alternatively, the first storage unit can be, for example, a preview buffer within RAM, where the preview buffer is a preset area within RAM used to cache the first acquired image.

[0040] S102, in response to the photo capture command, the second captured image corresponding to the photo capture command is transferred from the first storage unit to the second storage unit.

[0041] In this embodiment, in response to a photo-taking command, the electronic device retrieves a second captured image corresponding to the photo-taking command from the first storage unit and transfers the second captured image from the first storage unit to the second storage unit. The second captured image corresponding to the photo-taking command is a cropped portion of the first captured image corresponding to the moment the photo-taking command is received. For example, as discussed above, in response to a startup command of a first application, the electronic device continuously captures first captured images through a camera and continuously caches these first captured images in the first storage unit. In response to the photo-taking command, the electronic device crops one or more frames of the first captured images from the first storage unit as the second captured image. That is, the second captured image is a portion of the first captured image cropped by the electronic device in response to the photo-taking command.

[0042] The second storage unit is used to store the captured images corresponding to the photo-taking command, such as the second captured image and the third captured image. The third captured image will be described below and will not be repeated here. It can be seen that the first storage unit and the second storage unit have different functions.

[0043] In some embodiments, the second storage unit and the first storage unit may be different storage units. For example, the first storage unit may be RAM, and the second storage unit may be read-only memory (ROM). Another example is that the first storage unit may be RAM, and the second storage unit may be universal flash storage (UFS). In other embodiments, the second storage unit and the first storage unit may be different storage areas within the same storage unit. For example, the first storage unit may be a preview buffer in RAM. The second storage unit may be an image storage area in RAM, wherein the image storage area is a preset area in RAM used to store the captured image corresponding to the photo-taking command.

[0044] In this embodiment, the processing flow corresponding to the start command includes calling the camera to obtain and display a preview interface for the first captured image synthesis. The processing flow corresponding to the photo-taking command includes processing the captured image based on the target algorithm to generate a photo. In other words, in this embodiment, different commands correspond to different processing flows. Specifically, the processing flow corresponding to the start command includes calling the camera to obtain and display a preview interface for the first captured image synthesis, and the processing flow corresponding to the photo-taking command includes processing the captured image based on the target algorithm to generate a photo. The target algorithm is an image processing algorithm, which includes, but is not limited to, noise reduction, high dynamic range synthesis, portrait blurring, beautification optimization, and intelligent enhancement.

[0045] In this embodiment, in response to a photo-taking command, the electronic device does not immediately process the second captured image based on the target algorithm. Instead, it transfers the second captured image from the first storage unit to the second storage unit. Since the image is not processed based on the target algorithm, there is no resource contention, thus not affecting the synthesis and display of the preview interface, ensuring smooth display of the preview interface. Furthermore, the electronic device can process the second captured image at an appropriate time to obtain a photo, satisfying the user's photo-taking needs. For example, the electronic device can continue to execute S103 and S104.

[0046] S103, obtain user input.

[0047] In this embodiment, after responding to the photo-taking command, the electronic device can continue to acquire user input operations. User input operations include a series of input operations such as voice input, touch input, gesture input, and physical button press input. For example, a user input operation may be at least one of the following: clicking a thumbnail in the preview interface, clicking the shutter control, exiting the preview interface, exiting the first application, or opening the photo album application. After acquiring the user input operation, the electronic device can execute S104.

[0048] S104, determine whether to perform processing based on the target algorithm for the second acquired image based on the input operation.

[0049] After receiving user input, the electronic device can determine whether to process the second captured image stored in the second storage unit based on the user's input. The user's input can represent the user's intent. For example, clicking a thumbnail in the preview interface or opening the photo album application indicates that the user wants to immediately view the captured photos. Alternatively, clicking the shutter control indicates that the user wants to capture a snapshot, i.e., continuous shooting. Another example is exiting the preview interface or exiting the first application, indicating that the user has ended the shooting process. In this embodiment, the electronic device can continue to acquire user input after each response to a shooting command and determine whether to process the captured image corresponding to the shooting command based on the user's input. In other words, in this application, the electronic device can determine whether to process the captured image corresponding to the shooting command based on the user's intent.

[0050] As can be seen, the image processing method provided in this application decouples the shooting command from image processing. In response to the shooting command, the electronic device does not immediately process the captured image corresponding to the shooting command based on the target algorithm, but instead transfers the captured image corresponding to the shooting command to the second storage unit. Since no image is processed based on resources, there is no resource contention issue, thus not affecting the synthesis and display of the preview interface, ensuring smooth and lag-free preview display.

[0051] In some embodiments, after receiving user input, and if it is determined based on the user input that the user wants to immediately view the captured photo, the electronic device can process a second captured image to obtain a photo to satisfy the user's need for immediate viewing. For example, Figure 2 This is a second schematic flowchart of an image processing method provided in an embodiment of this application, as shown below. Figure 2 As shown, after S103, the method may include S201.

[0052] S201, if the input operation satisfies the first condition, read the second acquired image from the second storage unit to the first storage unit, and process the second acquired image based on the target algorithm to generate a photo.

[0053] For example, after receiving user input, the electronic device can determine whether the input operation satisfies a first condition. The first condition could be, for example, that the input operation indicates the user's intention to view the captured photo. If the input operation satisfies the first condition, the electronic device reads the second captured image from the second storage unit to the first storage unit and processes the second captured image based on a target algorithm to generate a photo. Here, the input operation satisfying the first condition indicates that the user wants to view the captured photo immediately. Specifically, the input operation satisfying the first condition signifies that the input operation is an operation that invokes a photo album application to display the captured photo.

[0054] In some embodiments, after a photograph is generated, the electronic device may store the photograph in a third storage unit. The third storage unit is used to store the photograph, and may be, for example, a ROM.

[0055] exist Figure 2 In the illustrated embodiment, after the electronic device transfers the second captured image to the second storage unit, upon receiving an input operation that satisfies the first condition, the electronic device can read the second captured image from the second storage unit to the first storage unit and process the second captured image based on the target algorithm to obtain a photo, thereby satisfying the user's need to view the photo immediately.

[0056] In other embodiments, after receiving user input, and if it is determined based on the user's input that the user wants to take continuous photos, the electronic device may not process the second captured image immediately to ensure the smoothness of the preview interface and meet the user's continuous shooting needs. For example, Figure 3 This is a third schematic flowchart of an image processing method provided in this application embodiment, as shown below. Figure 3 As shown, after S103, the method may include S301.

[0057] S301, if the input operation meets the second condition, do not perform processing based on the target algorithm for the second acquired image.

[0058] After receiving user input, the electronic device can determine whether the input operation satisfies a second condition. The second condition could be, for example, a preset operation indicating that the user's intention is to take continuous photos. If the input operation satisfies the second condition, the electronic device does not perform processing on the second captured image based on the target algorithm. In other words, if the input operation satisfies the second condition, the electronic device does not process the second captured image based on the target algorithm.

[0059] In some embodiments, the input operation satisfying the second condition indicates that the user wants to take continuous photos, that is, that the user is currently in a burst shooting scenario. A burst shooting scenario refers to a scenario in which a photo-taking command is received continuously. For example, a scenario where the user clicks the shutter button multiple times in succession while taking a snapshot.

[0060] For example, the input operation satisfying the second condition indicates that the input operation triggers a photo-taking command response again. In the case of a re-triggered photo-taking command response, the electronic device does not perform processing based on the target algorithm for the captured image corresponding to the previous photo-taking command. That is, after receiving a photo-taking command, based on the re-received photo-taking command, the electronic device determines not to process the captured image corresponding to the previous photo-taking command based on the target algorithm.

[0061] For example, the input operation satisfying the second condition indicates that the input operation triggers a photo-taking command response, and the photo-taking command triggered by the input operation is the (N+1)th photo-taking command; N is an integer greater than or equal to 1. In other words, the operation data satisfying the second condition indicates that the user's operation data not only triggered a new photo-taking command, but the triggered photo-taking command is also the (N+1)th photo-taking command in the continuous shooting process.

[0062] In this embodiment, the electronic device records the number of times a photo-taking command is received. For example, starting from the first received photo-taking command, the electronic device begins counting. When the electronic device detects an interruption operation used to exit burst mode, the counting ends and resets. The interruption operation includes, but is not limited to, clicking the thumbnail control or exiting the preview interface. After receiving another input operation triggering a photo-taking command, the electronic device can restart the counting to begin a new round of counting. The first photo-taking command can be, for example, the first photo-taking command received after the preview interface is displayed in response to the launch command of the first application. In this embodiment, after receiving the first photo-taking command, based on the (N+1)th received photo-taking command, the electronic device determines not to process the captured image corresponding to the first photo-taking command based on the target algorithm.

[0063] In this embodiment, after the electronic device transfers the second captured image to the second storage unit, it does not process the second captured image corresponding to the photo-taking command when it receives an input operation that meets the second condition.

[0064] In some embodiments, the electronic device may also transfer a third captured image corresponding to a photographing command triggered by an input operation from the first storage unit to the second storage unit. For example... Figure 3 As shown, the above method may also include S302.

[0065] S302, in response to the photo capture command triggered by the input operation, the third captured image corresponding to the photo capture command triggered by the input operation is transferred from the first storage unit to the second storage unit.

[0066] In response to a photographing command triggered by an input operation, the electronic device can transfer a third captured image corresponding to the photographing command from the first storage unit to the second storage unit. The third captured image corresponding to the photographing command is a portion of the first captured image extracted by the electronic device from the first captured image in response to the photographing command.

[0067] For example, in response to a launch command from a first application, the electronic device displays a preview interface. Next, in response to a photo-taking command, the electronic device transfers a second captured image corresponding to the photo-taking command from the first storage unit to the second storage unit. Then, the electronic device acquires a first user input operation; if the first input operation satisfies a second condition, the electronic device does not process the second captured image. Simultaneously, in response to a photo-taking command triggered by the first input operation, a third captured image corresponding to the photo-taking command triggered by the first input operation is transferred from the first storage unit to the second storage unit. Next, the electronic device acquires a second user input operation; if the second input operation satisfies the second condition, the electronic device does not process the third captured image. Simultaneously, in response to a photo-taking command triggered by the second input operation, the third captured image corresponding to the photo-taking command triggered by the second input operation is transferred from the first storage unit to the second storage unit, and a third input operation is acquired, and this process is repeated.

[0068] The electronic device sequentially stores the images corresponding to each photo-taking command in the second storage unit. For example, the second and third captured images are stored sequentially in the second storage unit. The order can be, for example, the order in which the photo-taking commands are received, such as storing the image corresponding to the first received photo-taking command first, and storing the image corresponding to the later received photo-taking command last.

[0069] In burst shooting scenarios, the conventional approach is to process the corresponding captured image based on the target algorithm immediately upon receiving a shooting command. This leads to a backlog of multiple high-load image processing tasks competing fiercely for limited resources such as central processing unit (CPU) resources, memory, and input / output (I / O) resources. This drastically increases the processing time of each image processing task and reduces overall throughput. The intense resource competition prevents the preview interface from acquiring resources in a timely manner, causing severe lag and failing to meet the user's burst shooting needs. In this embodiment, the electronic device, in response to each shooting command, saves the captured image corresponding to each command instead of immediately processing it based on the target algorithm. This avoids the intense competition for resources among multiple high-load image processing tasks in burst shooting scenarios, fundamentally eliminating the lag problem in the preview interface and ensuring a smooth experience during continuous shooting.

[0070] In some embodiments, after transferring the captured image corresponding to each photo-taking command, the electronic device can further determine whether to process the captured image corresponding to the photo-taking command based on the user's input operation after each photo-taking command. For example, the above method may further include S303.

[0071] S303, if the photo capture command triggered by the input operation is the N+1th photo capture command, determine whether to perform processing based on the target algorithm for the third captured image based on the N+1th input operation.

[0072] In this embodiment, in response to a photo-taking command, the electronic device executes an image processing method provided in this embodiment. Specifically, upon receiving a photo-taking command, the electronic device transfers the captured image corresponding to the command from the first storage unit to the second storage unit, and determines whether to process the captured image based on the target algorithm based on the user's input operation after the photo-taking command.

[0073] For example, in response to a first photo-taking command, the electronic device transfers the second captured image corresponding to the first photo-taking command from the first storage unit to the second storage unit. Next, the electronic device acquires the user's first input operation and determines, based on the first input operation, whether to perform image processing on the second captured image corresponding to the first photo-taking command using a target algorithm. If the first input operation satisfies a first condition, the electronic device processes the second captured image corresponding to the first photo-taking command using the target algorithm. If the first input operation satisfies a second condition, the electronic device does not process the second captured image corresponding to the first photo-taking command using the target algorithm, and simultaneously, the electronic device transfers the third captured image corresponding to the second photo-taking command triggered by the first input operation from the first storage unit to the second storage unit. Next, the electronic device acquires the user's second input operation and determines, based on the second input operation, whether to perform image processing on the third captured image corresponding to the second photo-taking command using the target algorithm. If the second input operation satisfies the first condition, the electronic device processes the third captured image corresponding to the second photo-taking command using the target algorithm. If the second input operation satisfies the second condition, the electronic device does not process the captured image corresponding to the photo-taking command (such as the first and second photo-taking commands) stored in the second storage unit based on the target algorithm. Simultaneously, the electronic device transfers the third captured image corresponding to the third photo-taking command triggered by the second input operation from the first storage unit to the second storage unit; ...; and so on. That is, if the photo-taking command triggered by the input operation is the (N+1)th photo-taking command, it determines whether to perform processing of the third captured image based on the target algorithm based on the (N+1)th input operation.

[0074] In other embodiments, after receiving user input, and if it is determined based on the user's input that the user wants to end the shooting, the electronic device can process the second captured image to obtain a photo, thus satisfying the user's basic photography needs. Figure 4 This is another schematic flowchart of an image processing method provided in an embodiment of this application, such as... Figure 4 As shown, after S103, the method may include S401.

[0075] S401, if the input operation satisfies the third condition, read the second acquired image from the second storage unit to the first storage unit, and process the second acquired image based on the target algorithm to generate a photo.

[0076] After receiving user input, the electronic device can determine whether the input operation satisfies a third condition. The third condition could be, for example, a preset operation indicating that the user's intention is to end the shooting. If the input operation satisfies the third condition, the electronic device reads the second captured image from the second storage unit to the first storage unit and processes the second captured image based on the target algorithm to generate a photo. Here, the input operation satisfying the third condition indicates that the user wants to end the shooting. For example, the input operation satisfying the third condition indicates that the input operation is the display of the interactive interface for exiting the first application on the screen. The interactive interface of the first application could be, for example, the preview interface of the first application. That is, the input operation satisfying the third condition indicates that the user has exited the preview interface. In this case, since there is no need to display the preview interface, the electronic device can process the second captured image to obtain a photo in order to meet the user's photography needs.

[0077] In some embodiments, when the input operation satisfies the third condition, the electronic device processes the captured images stored in the second storage unit, such as the second captured image and the third captured image, in reverse order according to the target algorithm to obtain photos. For example, after receiving three consecutive photo-taking commands, and then receiving an input operation that satisfies the third condition, the electronic device processes the captured images corresponding to these three photo-taking commands in reverse order according to the target algorithm to obtain three photos. The reverse order can be, for example, the order in which the photo-taking commands are received is the reverse of the chronological order, such as processing the captured image corresponding to the first received photo-taking command later and processing the captured image corresponding to the later received photo-taking command first.

[0078] In some embodiments, after receiving an input operation that satisfies a third condition, the electronic device executes... Figure 4 The method shown generates a photo. In other embodiments, after the electronic device receives an input operation that meets a third condition, it can execute [the command] at a preset time. Figure 4 The method shown generates a photo. The preset time could be, for example, after 11 PM. In other embodiments, after receiving an input operation that meets a third condition, the electronic device can execute [the necessary actions] if the preset condition is detected. Figure 4 The method shown generates a photo. The preset condition could be, for example, that the electronic device is in a preset state, such as an idle state and / or a charging state.

[0079] Figure 4 In the illustrated embodiment, after storing the second captured image in the second storage unit, upon receiving an input operation that satisfies the third condition, the electronic device can read the captured image corresponding to the photo-taking command stored in the second storage unit from the second storage unit to the first storage unit, and process the captured image based on the target algorithm to obtain a photo, thereby meeting the user's basic photo-taking needs.

[0080] Combined with the preceding text Figure 2 , Figure 3 and Figure 4 Three processing flows corresponding to user input operations are introduced respectively. A specific example is given below.

[0081] In response to a photo-taking command, the electronic device transfers the captured image corresponding to the command from the first storage unit to the second storage unit. Next, the electronic device acquires user input and determines, based on the input, whether to perform image processing on the captured image corresponding to the photo-taking command using a target algorithm. This captured image can be either a second or a third captured image.

[0082] Specifically, when the input operation meets the first condition, the electronic device processes the captured image corresponding to the photo-taking command based on the target algorithm. When the input operation meets the third condition, the electronic device processes the captured image corresponding to the photo-taking command based on the target algorithm. When the input operation meets the second condition, the electronic device does not process the captured image corresponding to the photo-taking command based on the target algorithm. Since the input operation meets the second condition, it means that the electronic device has received a photo-taking command again, and the electronic device can execute the above processing procedure again. It should be understood that the electronic device can execute the above processing procedure every time a photo-taking command is received. In other words, the above processing procedure is executed whenever a photo-taking command is received.

[0083] It should be understood that in this embodiment of the application, the user input operation obtained can only satisfy one of the first, second, and third conditions. That is, in response to a photo-taking command, the electronic device executes... Figure 2 , Figure 3 and Figure 4 One of the processing flows.

[0084] In some embodiments, although the electronic device processes the captured image corresponding to the photo-taking command in both cases where the input operation satisfies the first condition and the third condition, satisfying the first condition indicates that the user wants to view the captured photo immediately, while satisfying the third condition indicates that the user wants to end the shooting process. Therefore, when the input operation satisfies the first condition, the electronic device provides higher / larger computing resources for processing the captured image corresponding to the photo-taking command based on the target algorithm to meet the user's immediate viewing needs as quickly as possible. When the input operation satisfies the third condition, to balance energy consumption and performance, the electronic device provides relatively lower / smaller computing resources for processing the captured image corresponding to the photo-taking command based on the target algorithm. The purpose of this is to ensure that the speed at which the captured image corresponding to the photo-taking command is processed and generated based on the target algorithm when the input operation satisfies the third condition is lower than the speed at which the captured image corresponding to the photo-taking command is processed and generated based on the target algorithm when the input operation satisfies the first condition.

[0085] The computing resources may include, for example, the processor's operating frequency, memory bandwidth, input / output throughput, and the scheduling priority of algorithm threads. For instance, when the input operation meets the first condition, the electronic device can allocate a high scheduling priority to the target algorithm's algorithm threads to facilitate rapid image processing. When the input operation meets the third condition, the electronic device can allocate a low scheduling priority to the target algorithm's algorithm threads to balance power consumption and performance. The processor may be, for example, at least one of a CPU, a graphics processing unit (GPU), and a neural processing unit (NPU). An algorithm thread is a thread that performs processing on the captured image corresponding to the photo-taking command based on the target algorithm. This allocation ensures that the image processing speed is faster when the input operation meets the first condition than when the input operation meets the third condition. In other words, the image processing speed is faster when the user wants to view the captured photo immediately than when the user has finished taking the photo.

[0086] In some embodiments, before processing the captured image corresponding to the photo-taking command, the electronic device may acquire a parameter value characterizing the temperature of the electronic device and determine the processing method for the captured image corresponding to the photo-taking command based on the parameter value. This parameter value may be, for example, the overall device temperature, processor core temperature, battery temperature, or camera module temperature. If the parameter value meets a threshold, indicating that the temperature of the electronic device is good (e.g., within a suitable range), then the captured image corresponding to the photo-taking command is processed according to a first processing method based on a target algorithm. If the parameter value does not meet the threshold, indicating that the temperature of the electronic device is high, then the captured image corresponding to the photo-taking command is processed according to a second processing method based on a target algorithm.

[0087] Taking the overall device temperature as an example, and the threshold temperature as a value such as 42℃, the electronic device acquires the overall device temperature when the input operation meets the first condition. The overall device temperature is compared with the temperature threshold. If the overall device temperature is less than 42℃, the first processing method is used to execute the target algorithm-based processing of the captured image corresponding to the photo-taking command. If the overall device temperature is greater than or equal to 42℃, the second processing method is used to execute the target algorithm-based processing of the captured image corresponding to the photo-taking command.

[0088] For example, when the input operation meets the third condition, the electronic device acquires the overall temperature. The overall temperature is compared with a threshold. If the overall temperature is less than 42°C, a first processing method is used to execute the target algorithm-based processing of the captured image corresponding to the photo-taking command. If the overall temperature is greater than or equal to 42°C, a second processing method is used to execute the target algorithm-based processing of the captured image corresponding to the photo-taking command.

[0089] The first and second processing methods differ. For example, the first processing method uses a high processor operating frequency, while the second uses a low processor operating frequency. A high processor operating frequency could be, for example, the operating frequency of a performance core (P-Core). A low processor operating frequency could be, for example, the operating frequency of an energy-efficient core (E-Core). That is, when the electronic device's temperature is within acceptable limits, a high processor operating frequency is used to execute the target algorithm-based processing of the captured image corresponding to the photographing command; when the electronic device's temperature is high, a low processor operating frequency is used to execute the target algorithm-based processing of the captured image corresponding to the photographing command. This allows for improved image processing speed while ensuring the safe and stable operation of the electronic device, achieving a dynamic balance between performance and thermal management.

[0090] As mentioned earlier, the captured images corresponding to the photo-taking command, such as the second and third captured images, are one or more frames. When the captured images corresponding to the photo-taking command are multiple frames, a photo is typically generated by processing these multiple frames based on a target algorithm. If the parameter values ​​do not meet the threshold, the electronic device's temperature will be high. To avoid overheating and subsequent crashes, the electronic device can use a second processing method to process one frame from the multiple frames corresponding to the photo-taking command to generate a photo.

[0091] For example, if the input operation satisfies the first condition and the overall device temperature does not meet the threshold, the second processing method is used to execute target algorithm processing to generate a photo from one frame of the multi-frame images corresponding to the photo-taking command. As another example, if the input operation satisfies the third condition and the overall device temperature does not meet the threshold, the second processing method is used to execute target algorithm processing to generate a photo from one frame of the multi-frame images corresponding to the photo-taking command.

[0092] The following example uses a camera application as the first application, RAM as the first storage unit, and ROM as the second storage unit. Figure 5 This application provides an image processing method according to an embodiment, the method comprising: S501, in response to the command to launch the camera application, launches the camera application.

[0093] S502 acquires a first captured image through a camera and caches the first captured image in RAM.

[0094] S503 displays a preview interface for the camera application.

[0095] S504, confirm whether a photo-taking command has been received.

[0096] S505, upon receiving a photo-taking command, counts and transfers the second captured image corresponding to the photo-taking command to the ROM.

[0097] Optionally, the preview interface can continue to be displayed if no photo-taking command is received.

[0098] S506, obtains user input.

[0099] After executing S506, the electronic device can execute one of S507, S512, or S517.

[0100] S507 determines whether to exit the camera application based on user input.

[0101] S508, obtain the overall system temperature.

[0102] Optionally, the electronic device can determine whether the ROM contains a captured image corresponding to the photo-taking command. If the ROM contains a captured image corresponding to the photo-taking command, S508 is executed; if the ROM does not contain a captured image corresponding to the photo-taking command, the process ends.

[0103] S509, determine whether the temperature rise status is good.

[0104] If the overall system temperature meets the threshold, the temperature rise is considered good. If the overall system temperature does not meet the threshold, the temperature rise is considered poor, such as a high temperature rise.

[0105] The S510, under good temperature rise conditions, uses high CPU and NPU operating frequencies and low algorithm thread scheduling priority to process the acquired images in ROM in reverse order.

[0106] When the temperature rise is not good, the S511 uses low CPU and NPU operating frequencies and low algorithm thread scheduling priority to process the acquired images in ROM in reverse order.

[0107] In other words, based on user input, once the camera application is exited, the electronic device can process the captured image stored in ROM corresponding to the photo-taking command using a target algorithm, without displaying a preview interface, to obtain a photo, thus meeting the user's basic photo-taking needs. Simultaneously, the electronic device can employ different processing methods based on the overall device temperature to balance temperature rise and foreground smoothness.

[0108] S512 determines which photo to view based on the user's input.

[0109] S513, obtain the overall system temperature.

[0110] S514, determine whether the temperature rise status is good.

[0111] Under good temperature rise conditions, the S515 uses high CPU and NPU operating frequencies and high algorithm thread scheduling priority to process the captured image in ROM corresponding to the current photo capture command.

[0112] When the temperature rise is not ideal, the S516 uses low CPU and NPU operating frequencies and high algorithm thread scheduling priority to process the captured image in ROM corresponding to the current photo capture command.

[0113] In other words, based on user input, once the user decides to view a photo, the electronic device processes the captured image stored in ROM corresponding to the current photo-taking command using a target algorithm to quickly generate the image and meet the user's viewing needs. It should be understood that if the ROM also stores other captured images besides the one corresponding to the current photo-taking command, the electronic device will process those images using the target algorithm upon receiving an input that meets the third condition, thus generating the final photo. Simultaneously, the electronic device can employ different processing methods based on the overall device temperature to ensure playback speed, improve the playback experience, and balance temperature rise.

[0114] In other embodiments, since users may view not only recently taken photos but also photos taken in previous moments, to meet the user's need to view multiple photos, the electronic device can process the captured images stored in the ROM corresponding to the photo-taking command in reverse order, based on a target algorithm, to obtain photos. For example, S515 can be replaced by: under good temperature rise conditions, using high CPU and NPU operating frequencies and high algorithm thread scheduling priority to process the captured images in the ROM in reverse order. S516 can be replaced by: under poor temperature rise conditions, using high CPU and NPU operating frequencies and high algorithm thread scheduling priority to process the captured images in the ROM in reverse order. Furthermore, when processing the captured images in the ROM in reverse order, the electronic device can process a portion of the captured images within the time period most recent to the current moment in reverse order.

[0115] S517 determines that a photo-taking command has been received based on the user's input.

[0116] In some embodiments, upon determining that a photo-taking command has been received, the electronic device can count and transfer the captured image corresponding to the photo-taking command to a ROM. In other embodiments, upon determining that a photo-taking command has been received, the electronic device can execute different processing flows based on the number of times the photo-taking command has been received. Exemplarily, the above method may also include S518-S519.

[0117] S518 counts and determines whether the number of times a photo-taking command is received is less than or equal to a preset value.

[0118] S519: If the number of times a photo-taking command is received is less than or equal to a preset value, the captured image corresponding to the photo-taking command is transferred to the ROM. If the number of times a photo-taking command is received exceeds the preset value, S513-S516 are executed.

[0119] The preset value could be, for example, 40 or 50 shots. The purpose of this is that if the user takes more than or equal to the preset number of shots, they might need to view the photos. Therefore, generating photos in advance allows for a quick response to the user's viewing needs, ensuring a timely response when the user requests to view the photos.

[0120] Figure 5 S504-S519 in the diagram illustrate the processing flow of an electronic device in response to a single photographing command. It should be understood that the electronic device can perform the following actions in response to each photographing command: Figure 5 The processing flow is shown in S504-S519.

[0121] Figure 6 This is a schematic diagram of an image processing method provided in an embodiment of this application. For example... Figure 6 As shown, the electronic device includes a first application and a processing engine (RAM+ROM Engine). The image processing method provided in this application embodiment can be divided into two parts: front-end processing and back-end processing. The front-end processing includes real-time image acquisition and image storage, while the back-end processing includes offline photo synthesis. In this application embodiment, the processing engine can be integrated into the first application, i.e., the processing engine can be a functional module within the first application. Alternatively, the processing engine can be independent of the first application. Figure 6 This explanation uses the example of integrating the processing engine into the first application.

[0122] like Figure 6 As shown, in response to the launch command of the first application, the acquisition unit in the first application acquires the first captured image from the camera through the Real Time Capture Thread, using the Android Camera2 framework and the Android standard camera AIDL interface based on the Camera Realtime HAL, and stores the first captured image in the first storage unit to support preview display. The first storage unit is RAM, and the second storage unit is ROM.

[0123] In response to a photo-taking command, the processing engine retrieves the captured image corresponding to the command from the first storage unit and transfers the captured image to the second storage unit. For example... Figure 6 As shown, the processing engine sequentially transfers the captured images corresponding to the photo-taking command. Next, the processing engine receives user input and executes the actions described above based on that input. Figures 2-4 ,or Figure 5The image processing method is illustrated below. Specifically, when the user's input operation satisfies a first condition, the processing engine reads the captured image corresponding to the photo-taking command from the second storage unit in reverse order and transfers it to the first storage unit. It then processes the captured image based on the target algorithm to generate a photo. When the user's input operation satisfies a third condition, the processing engine reads the captured image corresponding to the photo-taking command from the second storage unit in reverse order and transfers it to the first storage unit. It then processes the captured image based on the target algorithm to generate a photo. For example, the processing engine reads the already stored captured image corresponding to the photo-taking command from the second storage unit in reverse order and passes it to the offline capture thread running in the first storage unit. The offline capture thread calls the camera's offline hardware abstraction layer through the offline interface (OfflineAIDL) and processes the captured image based on the target algorithm to generate a photo.

[0124] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, the electronic device 700 includes a camera 710, a processor 720, a first storage unit 730, and a second storage unit 740.

[0125] Camera 710 is used to capture the first image.

[0126] The first storage unit 730 is used to cache the first acquired image to support preview display.

[0127] The second storage unit 740 is used to store the captured images corresponding to the photo capture command, such as the second captured image and the third captured image.

[0128] The processor 720 is configured to respond to a launch command of a first application capable of accessing the camera, acquire a first captured image through the camera and cache it in a first storage unit, the first captured image being used at least to implement a shooting preview of the first application; in response to a shooting command, transfer a second captured image corresponding to the shooting command from the first storage unit to the second storage unit, the processing flow indicated by the shooting command including generating a photo based on a target algorithm processing the captured image corresponding to the shooting command; and obtain user input operations and determine whether to perform processing of the second captured image based on the target algorithm based on the input operations.

[0129] In some embodiments, the processor 720 is further configured to read a second acquired image from a second storage unit to a first storage unit if the input operation satisfies a first condition, and process the second acquired image based on a target algorithm to generate a photo; wherein, the input operation satisfying the first condition indicates that the input operation is to call a photo album application to display a photo.

[0130] In some embodiments, the processor 720 is further configured to not perform processing based on the target algorithm for the second acquired image if the input operation satisfies the second condition. Wherein, the input operation satisfying the second condition indicates that the input operation triggers a photo-taking command response and the photo-taking command triggered by the input operation is the (N+1)th photo-taking command; N is an integer greater than or equal to 1.

[0131] In some embodiments, the processor 720 is further configured to, in response to a photographing instruction triggered by an input operation, transfer a third captured image corresponding to the photographing instruction triggered by the input operation from the first storage unit to the second storage unit; wherein the second captured image and the third captured image are stored sequentially in the second storage unit.

[0132] In some embodiments, the processor 720 is further configured to determine, based on the N+1th input operation, whether to perform processing of the third acquired image based on the target algorithm if the image capture command triggered by the input operation is the N+1th image capture command.

[0133] In some embodiments, the processor 720 is further configured to read the second acquired image from the second storage unit to the first storage unit if the input operation satisfies the third condition, and process the second acquired image based on the target algorithm to generate a photograph; wherein, the input operation satisfying the third condition indicates that the input operation is the display of the interactive interface for exiting the first application on the screen.

[0134] In some embodiments, the processor 720 is further configured to obtain parameter values ​​for characterizing the temperature of the electronic device; if the parameter values ​​meet a threshold, perform target algorithm-based processing on the captured image corresponding to the photo-taking command according to a first processing method; if the parameter values ​​do not meet the threshold, perform target algorithm-based processing on the captured image corresponding to the photo-taking command according to a second processing method; the first processing method is different from the second processing method.

[0135] In some embodiments, where the captured image corresponding to the photo-taking command is a multi-frame image, the processor 720 is further configured to perform target algorithm-based processing to generate a photo from one frame of the multi-frame image corresponding to the photo-taking command according to the second processing method.

[0136] The following describes an image processing method provided by an embodiment of this application, using a specific application scenario as an example. Currently, in camera applications of electronic devices, image processing typically follows a fixed, preset pipeline. Once a user presses the shutter button, the electronic device initiates a relatively fixed processing flow, sending the image to a series of algorithm modules for processing, ultimately generating and saving the final photo. This can lead to lag in the preview interface and a poor user experience.

[0137] To this end, this application achieves precise matching between resource scheduling and user intent and system status by dynamically and intelligently deciding the execution timing and resource allocation of image processing tasks after each photo-taking command through real-time monitoring and analysis of user behavior data. Specifically, processing timing determines whether to process the photo immediately during the photo-taking process or delay it until the electronic device is idle, such as when exiting the first application. Resource allocation refers to allocating the amount of computing resources to support the image processing tasks.

[0138] The innovations of this application are: 1. Multi-dimensional perception fusion, integrating user intent perception and system load perception. User intent perception involves real-time monitoring of user input. Based on user input, the application accurately determines the user's real-time intent, which may be one of immediate viewing, continuous shooting, or ending shooting. System load perception comprehensively assesses the system's current computing power by collecting data such as processor utilization, available memory capacity, battery temperature, body temperature, current, power limit status, and performance modes (e.g., power-saving mode). 2. Intelligent image processing based on the processing engine. For example, based on user intent perception, the application determines the execution timing of image processing tasks, and based on system load perception, it allocates computing resources and processing methods for these tasks. This includes determining whether to use high-performance or energy-efficient cores, whether to enable hardware acceleration, and limiting the priority of processing threads. The application dynamically adjusts the number of frames processed by the target algorithm to achieve the optimal balance between image quality and processing speed.

[0139] The advantages of this application are: 1. Avoiding lag in the preview interface, providing an extremely smooth user experience. Especially in continuous shooting scenarios, users will hardly feel any lag. The electronic device will prioritize the smoothness of shooting, cleverly postponing image processing tasks. When the user stops to view images, the most recently captured photos will be processed first to meet the user's viewing needs. 2. Highly efficient resource utilization. Combining the current resource usage of the electronic device and the user's intent, computing resources are dynamically allocated to image processing tasks, and the processing method, such as the first processing method and the second processing method, is determined. This avoids resource contention and performance bottlenecks under high load and high temperature. The computing power is intelligently allocated according to priority, maximizing system throughput and preventing processing time fluctuations caused by overheating and frequency reduction. 3. Enhanced system stability. By sensing temperature rise, the processing task load is proactively reduced, effectively avoiding the risks of application crashes, camera processes being "killed" by the system, or forced shutdown due to overheating, ensuring the final completion of image processing tasks. 4. Adaptive energy efficiency management. While ensuring a good user experience, tasks are scheduled for times and execution units with higher energy efficiency as much as possible to reduce heat generation and extend the device's battery life.

[0140] Figure 8 This application provides an image processing method, which may include: Step 1: In response to the launch command of the first application that can call the camera, the first captured image is obtained through the camera and cached in the first storage unit.

[0141] Step 2: In response to the photo capture command, transfer the captured image corresponding to the photo capture command from the first storage unit to the second storage unit, and obtain the resource usage status of the device.

[0142] Step 3: Obtain user input.

[0143] Step 4: Determine the strategy based on the user's input.

[0144] For example, if the user's input operation meets the first condition, the strategy is determined to be the first execution strategy. The first execution strategy is: to read the captured image corresponding to the photo-taking command from the second storage unit to the first storage unit, and to use the first computing resources to process the captured image corresponding to the photo-taking command based on the target algorithm to obtain a photograph.

[0145] For example, if the user's input operation satisfies the second condition, the execution strategy is determined to be the second execution strategy. The second execution strategy is: not to perform processing based on the target algorithm for the captured image corresponding to the photo-taking command.

[0146] For example, if the user's input operation satisfies the third condition, the execution strategy is determined to be the third execution strategy. The third execution strategy is as follows: read the captured image corresponding to the photo-taking command from the second storage unit to the first storage unit, and use the second computing resources to process the captured image corresponding to the photo-taking command based on the target algorithm to obtain a photo. The second computing resources are lower than or less than the first computing resources.

[0147] In some embodiments, if no photo-taking command is received, a fourth execution strategy is executed. The fourth execution strategy is: not to transfer the first captured image from the first storage unit to the second storage unit, in order to support preview display.

[0148] Step 5: Execute based on the determined strategy.

[0149] While executing the first and third execution strategies, the electronic device can also acquire parameter values ​​characterizing its temperature and, based on these parameter values, determine the processing method for the captured image corresponding to the photographing command. If the parameter value meets a threshold, the first and third execution strategies are executed according to the first processing method. If the parameter value does not meet the threshold, the first and third execution strategies are executed according to the second processing method.

[0150] As can be seen, in this embodiment, in response to a photo-taking command, the electronic device does not immediately process the image corresponding to the command based on image processing algorithms. Instead, it transfers the image corresponding to the command to storage. Since resources are not immediately used to process the image, resources used for compositing and rendering the preview interface are not preempted, and the display of the preview interface is not affected, ensuring smooth and lag-free preview display. Furthermore, the captured image can be processed at different times to obtain a photo based on the user's wishes, satisfying the user's needs while reasonably balancing resources.

[0151] This application provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the methods described in any of the above embodiments.

[0152] It should be noted that the descriptions of the computer-readable storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the computer-readable storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0153] The aforementioned processor can be at least one of the following: application-specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field-programmable gate array (FPGA), central processing unit (CPU), controller, microcontroller, and microprocessor. It is understood that other electronic devices can also implement the functions of the aforementioned processor, and this application does not specifically limit the specific implementation.

[0154] The aforementioned computer-readable storage medium / memory can be a read-only memory, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD ROM), etc.

[0155] This application provides a computer program including computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device executes some or all of the steps in the above-described method.

[0156] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer-readable storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0157] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0158] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0159] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0160] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0161] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0162] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0163] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an in-vehicle terminal (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0164] The above are merely embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

[0165] The above embodiments are merely preferred embodiments provided to fully illustrate this application, and the scope of protection of this application is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on this application are all within the scope of protection of this application.

Claims

1. An image processing method, the method comprising: in response to a start instruction of a first application capable of invoking a camera, obtaining a first captured image by the camera and caching the first captured image in a first storage unit, the first captured image being used at least for realizing a shooting preview of the first application; in response to a shooting instruction, transferring a second captured image corresponding to the shooting instruction from the first storage unit to a second storage unit, a processing flow indicated by the shooting instruction comprising processing a captured image corresponding to the shooting instruction based on a target algorithm to generate a photo; obtaining an input operation of a user; determining whether to perform the processing based on the target algorithm for the second captured image based on the input operation.

2. The method of claim 1, wherein the determining whether to perform the processing based on the target algorithm for the second captured image based on the input operation comprises: if the input operation satisfies a first condition, reading the second captured image from the second storage unit to the first storage unit, and processing the second captured image based on the target algorithm to generate a photo; wherein the input operation satisfying the first condition represents that the input operation is to invoke a photo album application to display the photo.

3. The method of claim 1, wherein the determining whether to perform the processing based on the target algorithm for the second captured image based on the input operation comprises: if the input operation satisfies a second condition, not performing the processing based on the target algorithm for the second captured image; wherein the input operation satisfying the second condition represents that the input operation triggers a shooting instruction response and the shooting instruction triggered by the input operation is an N+1th shooting instruction; N is an integer greater than or equal to 1.

4. The method of claim 3, further comprising: in response to the shooting instruction triggered by the input operation, transferring a third captured image corresponding to the shooting instruction triggered by the input operation from the first storage unit to the second storage unit; wherein the second captured image and the third captured image are sequentially stored in the second storage unit.

5. The method of claim 3, further comprising: if the shooting instruction triggered by the input operation is the N+1th shooting instruction, determining whether to perform the processing based on the target algorithm for a third captured image based on an N+1th input operation.

6. The method of any one of claims 1 to 5, wherein the determining whether to perform the processing based on the target algorithm for the second captured image based on the input operation comprises: if the input operation satisfies a third condition, reading the second captured image from the second storage unit to the first storage unit, and processing the second captured image based on the target algorithm to generate a photo; wherein the input operation satisfying the third condition represents that the input operation is to exit an interactive interface of the first application from a display screen.

7. The method of any one of claims 1-5, wherein the input operation satisfies a third condition in which less computing resources are provided for processing the second captured image based on the target algorithm than when the input operation satisfies the first condition, such that the speed at which the second captured image is processed based on the target algorithm to generate the photo is lower when the input operation satisfies the third condition than when the input operation satisfies the first condition.

8. The method of any one of claims 1-5, wherein the processing based on the target algorithm to generate the photo based on the captured image corresponding to the photographing instruction comprises: obtaining a parameter value that characterizes a temperature of the electronic device; if the parameter value satisfies a threshold, performing the processing based on the target algorithm to the captured image corresponding to the photographing instruction according to a first processing manner; if the parameter value does not satisfy the threshold, performing the processing based on the target algorithm to the captured image corresponding to the photographing instruction according to a second processing manner; and the first processing manner is different from the second processing manner. In some embodiments, the captured image corresponding to the photographing instruction is a plurality of images, and the processing based on the target algorithm to generate the photo based on the plurality of images corresponding to the photographing instruction according to the second processing manner comprises: processing one image of the plurality of images corresponding to the photographing instruction based on the target algorithm to generate the photo according to the second processing manner.

9. A processing apparatus comprising: a capturing unit configured to, in response to a start instruction of a first application capable of invoking a camera, obtain a first captured image via the camera and store the first captured image in a first storage unit, the first captured image being used at least for implementing a photograph preview of the first application; a processing engine configured to, in response to a photographing instruction, transfer a second captured image corresponding to the photographing instruction from the first storage unit to a second storage unit, a processing flow indicated by the photographing instruction comprising processing the second captured image corresponding to the photographing instruction based on a target algorithm to generate a photo; obtain an input operation of a user; and determine whether to perform the processing based on the target algorithm to the second captured image based on the input operation.

10. An electronic device comprising: a camera configured to capture images; a processor configured to, in response to a start instruction of a first application capable of invoking the camera, obtain a first captured image via the camera and store the first captured image in a first storage unit, the first captured image being used at least for implementing a photograph preview of the first application; in response to a photographing instruction, transfer a second captured image corresponding to the photographing instruction from the first storage unit to a second storage unit, a processing flow indicated by the photographing instruction comprising processing the second captured image corresponding to the photographing instruction based on a target algorithm to generate a photo; obtain an input operation of a user; and determine whether to perform the processing based on the target algorithm to the second captured image based on the input operation. the first storage unit configured to store the first captured image; and the second storage unit configured to store the captured image corresponding to the photographing instruction. ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​