Photographing processing method, electronic device, and computer-readable storage medium

Through the segmented photo processing method, the post-processing algorithm is only executed when necessary, which solves the problems of equipment jamming and heating during the photo taking process of mobile phones and other electronic devices, improving photo taking performance and user experience, while ensuring image quality.

WO2024193222A1PCT designated stage expired Publication Date: 2024-09-26HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/073802
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-21
Filing Date
2024-01-24
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

Electronic devices such as mobile phones continuously execute complex post-processing algorithms during the photo-taking process, causing device freezes, heating, and degradation of photo-taking performance, affecting the user experience.

Method used

Adopting a segmented photo processing method, only a part of the post-processing algorithm is executed during the photo-taking process, and the remaining stages of post-processing are executed at the appropriate time to reduce the occupation of computing resources and memory resources. By converting the intermediate data post-processed by the algorithm from volatile Storage media is transferred to non-volatile storage media.

Benefits of technology

It alleviates device lagging and heating problems, improves camera performance and user experience, and ensures improved image quality and effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024073802_26092024_PF_FP
    Figure CN2024073802_26092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are a photographing processing method, an electronic device, and a computer-readable storage medium. The method comprises: starting a camera application; in response to a photographing operation, acquiring image data to be processed; when the camera application is running in the foreground, performing first-stage algorithm post-processing on said image data to obtain first image data, the first image data being image data which has not undergone complete algorithm post-processing; and when a target operation is detected, or the camera application is running in the background or shut down, performing remaining stages of algorithm post-processing on the first image data to obtain second image data, the second image data being image data which has undergone complete algorithm post-processing, the target operation being used for viewing, editing or sharing an image, and the remaining stages of algorithm post-processing comprising at least one stage of algorithm post-processing. The embodiments of the present application improve the photographing performance by means of staged photographing, thus improving the photographing experience of users.
Need to check novelty before this filing date? Find Prior Art

Description

Photo processing method, electronic device and computer-readable storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 21, 2023, with application number 202310318891.4 and application name “Photo processing method, electronic device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of image processing technology, and in particular to a photo processing method, an electronic device, and a computer-readable storage medium. Background Art

[0003] With the increasing popularity of electronic devices such as mobile phones, taking photos using the camera function of mobile phones and other electronic devices has gradually become a trend.

[0004] There is a significant gap between the camera hardware specifications of mobile phones and other electronic devices and those of professional photographic equipment. Therefore, after capturing images through cameras, mobile phones and other electronic devices often rely on powerful computing resources to run a series of complex post-processing algorithms to perform algorithmic post-processing on the images in order to improve image quality problems caused by suboptimal camera hardware specifications and thereby obtain higher quality images.

[0005] However, mobile phones and other electronic devices continuously run a series of complex post-processing algorithms during the camera process to obtain the processed images in real time. These complex post-processing algorithms require a large amount of computing and memory resources, which can overload the processor for extended periods of time. This can lead to poor camera performance, device lag, overheating, and other issues, negatively impacting the user's photography experience.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a photo processing method, an electronic device, and a computer-readable storage medium, which can solve the problem that all post-processing algorithms are continuously and uninterruptedly executed during the existing photo-taking process, resulting in low photo performance and a poor photo-taking experience.

[0008] In a first aspect, an embodiment of the present application provides a photo processing method, which is applied to an electronic device. The method includes: opening a camera application; in response to a photo operation, obtaining image data to be processed; when the camera application is running in the foreground, performing a first stage algorithm post-processing on the image data to be processed to obtain first image data, where the first image data is image data for which the algorithm post-processing has not been completed; if a target operation is detected, or the camera application is running in the background or closed, performing a remaining stage algorithm post-processing on the first image data to obtain second image data, where the second image data is image data for which the algorithm post-processing has been completed, and the target operation is used to view, edit, or share the image. The remaining stage algorithm post-processing includes at least one stage algorithm post-processing.

[0009] As can be seen from the above technical solution, the embodiment of the present application executes the first stage of algorithm post-processing when the camera application is running in the foreground, and executes the remaining stages of algorithm post-processing when the camera application is running in the background or closed, or when a target operation is detected. That is, only a part of the post-processing algorithm is executed during the photo-taking process, and the remaining part of the post-processing algorithm is executed when the photo is not being taken or when image manipulation is required. Compared to continuously and uninterruptedly executing all the post-processing algorithms during the photo-taking process, the embodiment of the present application only executes a part of the post-processing algorithm during the photo-taking process, which reduces the computing resources and memory resources occupied during the photo-taking process, thereby alleviating problems such as device freezing and device heating, improving photo-taking performance, and enhancing the user photo-taking experience.

[0010] In some possible implementations of the first aspect, the target operation is to view thumbnails, which are displayed on the viewfinder interface of a camera application. The thumbnails are thumbnails corresponding to the image data to be processed. In this implementation, when the camera is running in the foreground, if the user needs to view the image, the execution of the remaining stage algorithm post-processing algorithm can be triggered in a timely manner, and the image data after the algorithm post-processing is completed can be obtained in a timely manner, so that the user can view the image in a timely manner. When the user views the thumbnail, the electronic device will exit the shooting process and enter the image preview state. In the image preview state, there is no need to perform processing processes such as previewing the video stream, which can also reduce the computing resources and memory resources occupied during the shooting process, thereby improving the shooting performance and user shooting experience.

[0011] In some possible implementations of the first aspect, if a camera application is running in the background or is closed, the first image data is post-processed with the remaining stage algorithm to obtain second image data, including: if the camera application is running in the background or is closed, and a preset trigger condition is detected, the first image data is post-processed with the remaining stage algorithm to obtain second image data.

[0012] In some possible implementations of the first aspect, the preset trigger conditions include at least one of the following: an operation of opening an image access application, an operation of viewing an image, an operation of sharing an image, an operation of editing an image, the system being in idle state, the screen being off or stopped, the running memory being higher than a first threshold, the device temperature being lower than a first temperature threshold, and the processor load being lower than a second threshold.

[0013] In this implementation, when the camera application is running in the background or closed, it is further determined whether the preset trigger conditions are met. Only when the preset trigger conditions are met will the remaining stage algorithm post-processing be executed. In this way, when the user needs to view, edit or share the image data, the remaining stage algorithm post-processing can be performed in a timely manner, so that the user can view the final image in time. In addition, when the system status meets the conditions, that is, the system status such as running memory, device temperature and processor load meets the requirements, the execution of the remaining stage algorithm post-processing algorithm can be automatically triggered, which can further alleviate problems such as device freeze and device heating.

[0014] In some possible implementations of the first aspect, the first image data is post-processed with the remaining stage algorithm to obtain the second image data, including: monitoring system status data; determining a scheduling strategy based on the system status data; executing a target task in a task queue based on the scheduling strategy to perform the remaining stage algorithm post-processing on the first image data to obtain the second image data; wherein the target task is a task corresponding to the remaining stage algorithm post-processing process of the first image data, the task queue includes tasks corresponding to the remaining stage algorithm post-processing process of each image data, and the target task is generated based on the task identifier of the remaining stage algorithm post-processing process of the first image data.

[0015] In this implementation, by monitoring system status data and scheduling the tasks of the remaining stage algorithm post-processing based on the system status data, problems such as device freezing and device heating can be further alleviated.

[0016] In some possible implementations of the first aspect, before obtaining the second image data, a viewing operation on the first image data is detected, and in response to the viewing operation, a first target image is displayed, the first target image being the image corresponding to the first image data; after obtaining the second image data, the first target image is refreshed to the second target image, the second target image being the image corresponding to the second image data.

[0017] In this implementation, if the first-stage algorithm post-processing process is not completed but the user needs to view the image, the image data whose algorithm post-processing is not completed will be displayed first. Then, when the algorithm post-processing is completed, the image data whose algorithm post-processing is not completed will be refreshed to the image data whose algorithm post-processing is completed. In this way, the computing resources and memory resources occupied during the photo-taking process are reduced, and problems such as device freeze and device heating are alleviated, while ensuring that users can view the pictures in a timely manner.

[0018] In some possible implementations of the first aspect, after obtaining the image data to be processed, the method further includes: cutting the image data to be processed from a volatile storage medium to a non-volatile storage medium; performing first-stage algorithm post-processing on the image data to be processed to obtain first image data, including: reading the image data to be processed from the non-volatile storage medium, performing first-stage algorithm post-processing on the image data to be processed to obtain first image data, and storing the first image data in the non-volatile storage medium.

[0019] In this implementation, the intermediate data of algorithm post-processing and the image data to be processed are transferred from the volatile storage medium to the non-volatile storage medium, which can further reduce the running memory usage of the algorithm post-processing process, thereby further alleviating problems such as device lag.

[0020] In some possible implementations of the first aspect, before performing the first-stage algorithm post-processing on the image data to be processed to obtain the first image data, the method further includes: if it is determined that the conditions for entering segmented photography are met, then entering the step of performing the first-stage algorithm post-processing on the image data to be processed to obtain the first image data.

[0021] In some possible implementations of the first aspect, the conditions for entering segmented photo taking include at least one of the following: detecting a continuous shooting operation, the running memory is lower than a third threshold, the device temperature is higher than a second temperature threshold, and the post-processing algorithm takes longer than a preset time threshold.

[0022] In this implementation, when the system is in poor condition, the system actively enters segmented photography, which not only alleviates problems such as device freezing and heating, but also ensures real-time photography.

[0023] In a second aspect, an embodiment of the present application provides an electronic device, including an algorithm post-processing module and an image acquisition module;

[0024] The image acquisition module is used to: obtain image data to be processed in response to a photo-taking operation;

[0025] The algorithm post-processing module is configured to: when a camera application is running in the foreground, perform a first stage of algorithm post-processing on the image data to be processed, obtaining first image data. The first image data is image data that has not yet been processed by the algorithm post-processing. If a target operation is detected, or the camera application is running in the background or closed, perform the remaining stages of algorithm post-processing on the first image data to obtain second image data. The second image data is image data that has completed the algorithm post-processing. The target operation is to view, edit, or share the image. The remaining stages of algorithm post-processing include at least one stage of algorithm post-processing.

[0026] In some possible implementations of the second aspect, the target operation is an operation of viewing thumbnails, the thumbnails are displayed on a viewfinder interface of a camera application, and the thumbnails are thumbnails corresponding to the image data to be processed.

[0027] In some possible implementations of the second aspect, the algorithm post-processing module is specifically configured to:

[0028] If the camera application is running in the background or closed and a preset trigger condition is detected, the first image data is post-processed by the remaining stage algorithm to obtain the second image data.

[0029] In some possible implementations of the second aspect, the preset trigger conditions include at least one of the following: an operation of opening an image access application, an operation of viewing an image, an operation of sharing an image, an operation of editing an image, the system being in idle state, the screen being off or stopped, the running memory being higher than a first threshold, the device temperature being lower than a first temperature threshold, and the processor load being lower than a second threshold.

[0030] In some possible implementations of the second aspect, the algorithm post-processing module includes a system state perception submodule and a scheduling submodule;

[0031] The system status perception submodule is used to: monitor system status data;

[0032] The scheduling submodule is configured to determine a scheduling strategy based on the system status data; execute a target task in the task queue according to the scheduling strategy to perform a remaining stage algorithm post-processing on the first image data to obtain second image data;

[0033] Among them, the target task is the task corresponding to the remaining stage algorithm post-processing process of the first image data, the task queue includes the tasks corresponding to the remaining stage algorithm post-processing process of each image data, and the target task is generated according to the task identifier of the remaining stage algorithm post-processing process of the first image data.

[0034] In some possible implementations of the second aspect, a refresh module is further included, which is used to: detect a viewing operation on the first image data; display a first target image in response to the viewing operation, where the first target image is an image corresponding to the first image data; and after obtaining the second image data, refresh the first target image to a second target image, where the second target image is an image corresponding to the second image data.

[0035] In some possible implementations of the second aspect, a non-volatile storage medium is also included; the algorithm post-processing module is also used to: cut the image data to be processed from the volatile storage medium to the non-volatile storage medium; read the image data to be processed from the non-volatile storage medium, and perform the first stage algorithm post-processing on the image data to obtain first image data, and store the first image data in the non-volatile storage medium.

[0036] In some possible implementations of the second aspect, the electronic device also includes a segmented photo-taking trigger module, which is used to enter the step of performing first-stage algorithm post-processing on the image data to be processed to obtain first image data if it is determined that the conditions for entering segmented photo-taking are met.

[0037] In some possible implementations of the second aspect, the conditions for entering segmented photo taking include at least one of the following: detecting a continuous shooting operation, the running memory is lower than a third threshold, the device temperature is higher than a second temperature threshold, and the post-processing algorithm takes longer than a preset time threshold.

[0038] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any one of the first aspects above is implemented.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method of any one of the above-mentioned first aspects.

[0040] In a fifth aspect, embodiments of the present application provide a chip system, comprising a processor coupled to a memory, the processor executing a computer program stored in the memory to implement any of the methods described in the first aspect. The chip system can be a single chip or a chip module consisting of multiple chips.

[0041] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect above.

[0042] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] FIG1 is a schematic diagram of an image processing process provided in an embodiment of the present application;

[0044] FIG2A is a schematic diagram of a mobile phone photo-taking process according to an embodiment of the present application;

[0045] FIG2B is a schematic diagram of a photographing system framework provided in an embodiment of the present application;

[0046] FIG3 is a schematic diagram showing the division of the post-processing stages of the algorithm provided in an embodiment of the present application;

[0047] FIG4 is a schematic diagram of an image processing process provided in an embodiment of the present application;

[0048] FIG5 is a schematic diagram of the architecture of a segmented photographing system provided in an embodiment of the present application;

[0049] FIG6A is a schematic diagram of a first-stage algorithm post-processing process according to an embodiment of the present application;

[0050] FIG6B is a schematic block diagram of the system architecture provided in an embodiment of the present application;

[0051] FIG7A is a schematic diagram of viewing an image provided by an embodiment of the present application;

[0052] FIG7B is another schematic diagram of viewing an image provided by an embodiment of the present application;

[0053] FIG8 is a schematic block diagram of the process of triggering the second stage algorithm post-processing on demand according to an embodiment of the present application;

[0054] FIG9 is a schematic diagram of a process flow of automatically triggering the second stage algorithm post-processing provided by the system according to an embodiment of the present application;

[0055] FIG10 is a schematic diagram of a scheduling strategy for the second-stage algorithm post-processing according to an embodiment of the present application;

[0056] FIG11 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;

[0057] FIG12 is a schematic block diagram of a process of a photo processing method provided in an embodiment of the present application;

[0058] FIG13 is a schematic block diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] In the following description, for the purpose of illustration rather than limitation, specific details such as particular system structures and technologies are provided to facilitate a thorough understanding of the embodiments of the present application.

[0060] Algorithm post-processing may refer to the process of using a post-processing algorithm to enhance the image effect of image data output by camera hardware.

[0061] Post-processing algorithms are software algorithms used to improve image effects and quality. For example, these algorithms may include, but are not limited to, beautification algorithms, filter algorithms, rotation algorithms, watermarking algorithms, blurring algorithms, High Dynamic Range Imaging (HDR) algorithms, multi-frame processing algorithms, denoising algorithms, and detail enhancement algorithms.

[0062] During the algorithm post-processing process, one or more post-processing algorithms are executed. For example, referring to the image processing process schematic diagram shown in FIG1 , the image processing process may include an image acquisition phase and an algorithm post-processing phase.

[0063] During the image acquisition phase, after the image sensor captures image signal data, the image signal data is transmitted to an image signal processor (ISP). The image data output by the ISP is stored in a volatile storage medium, exemplified by a random access memory (RAM). In addition, a thumbnail can also be obtained based on the image data output by the ISP.

[0064] In the algorithm post-processing phase, post-processing algorithms 1, 2, and 3 are executed sequentially. Specifically, image data output by the ISP is read from the RAM and processed using post-processing algorithm 1 to obtain a first processing result, which is then stored in the RAM. The first processing result is read from the RAM and processed using post-processing algorithm 2 to obtain a second processing result, which is then stored in the RAM. The second processing result is read from the RAM and processed using post-processing algorithm 3 to obtain a third processing result, which is then stored in the RAM. The third processing result is read from the RAM, and the final image is obtained based on the third processing result. It will be appreciated that for ease of description, Figure 1 uses the algorithm post-processing phase as an example, including three post-processing algorithms.

[0065] In the related art, electronic devices continuously and uninterruptedly execute all post-processing algorithms in the algorithm post-processing stage during the photo-taking process. The following is an illustration of this process with reference to Figures 2A and 2B. Figure 2A is a schematic diagram of the mobile phone photo-taking process, and Figure 2B is a schematic diagram of the photo-taking system framework.

[0066] As shown in Figure 2A, the main interface of the mobile phone 11 displays applications such as settings, calendar, camera 111, and gallery. After the user clicks on the camera application 111, the mobile phone 11 responds to the click operation, opens the camera application 111, and displays the viewfinder interface 112 of the camera application 111. The viewfinder interface 112 includes a viewfinder and a photo control 113, and a preview video stream is displayed in the viewfinder. After the user clicks on the photo control 113, the mobile phone 11 responds to the click operation, executes the photo operation, obtains the image data to be processed, and performs algorithm post-processing on the image data to be processed in real time to obtain the final image, which is the image completed by the algorithm post-processing. During the period from obtaining the image data to be processed to obtaining the final image, the camera application 111 is running in the foreground, that is, all post-processing algorithms are continuously and uninterruptedly executed during the photo-taking process, so as to perform algorithm post-processing on the image data to be processed in real time and obtain the image completed by the algorithm post-processing in real time.

[0067] As shown in Figure 2B, the camera system framework of the mobile phone 11 includes: an application layer, an intermediate layer and a functional module layer. The application layer includes a camera application and an image access application. The image access application is, for example, a gallery application or an instant messaging application. The intermediate layer includes a camera service and a media library. The camera service includes a real-time camera sub-service. The real-time camera sub-service includes camera devices and camera streams. The real-time camera sub-service is used to implement the camera function. The media library includes a Media Store database interface and a Media Provider-DB (Media Provider database). The functional module layer includes an acquisition module, an algorithm post-processing module and a file system. The acquisition module is used to acquire image data. The algorithm post-processing module includes sub-modules such as an image buffer, algorithm processing and algorithm scheduling management, which are used to perform algorithm post-processing on the image data. The file system is used to store the final image, which is usually stored in a non-volatile storage medium, such as a read-only memory (ROM).

[0068] Based on the camera system framework shown in FIG2B , when a user presses the camera control 113 , the camera application on the mobile phone 11 initiates a photo request to the camera service. In response to the photo request, the camera service invokes the acquisition module to acquire image data to be processed, stores the image data in an image buffer, and performs algorithmic post-processing on the image data in real time. The image buffer is located in the RAM of the mobile phone 11 .

[0069] During the algorithm post-processing phase, the algorithm scheduling management submodule schedules and manages the various post-processing algorithms in the algorithm processing submodule, enabling the algorithm processing submodule to read the image data to be processed from the image buffer and sequentially execute multiple algorithm processes based on the image data to obtain the final image in real time. The final image is then returned to the camera application via the camera service. After the final image is obtained through real-time processing, it is also updated to the image library in real time. The image access application can access the final image in the file system through the media library.

[0070] During long-term research, the inventors found that continuously and uninterruptedly executing all post-processing algorithms during the photo-taking process to obtain the image completed by the algorithm post-processing in real time, although it can meet the real-time nature of photo-taking, it will reduce the photo-taking performance and affect the user's photo-taking experience.

[0071] Specifically, during the photo-taking process, the camera application running in the foreground, processing the preview video stream, and complex post-processing algorithms all require a significant amount of computing and memory resources. The processing of the preview video stream, the camera application running in the foreground, and image rendering already consume a significant amount of computing and memory resources. Continuously executing all post-processing algorithms during the photo-taking process increases the amount of computation required, increasing the computational load and memory usage, leading to excessive processor load and high memory usage. Furthermore, the camera application running in the foreground, processing the preview video stream, and the complex post-processing algorithms are all performed simultaneously, competing for computing and memory resources, further increasing system pressure.

[0072] If the processor load and running memory usage are too high, the photo shooting speed will be significantly reduced, and the photo shooting will be stuck. In some scenarios (such as rapid continuous shooting), the photo shooting will even become unresponsive and the photo shooting performance will be poor. In addition, if the processor runs at high load for a long time during the photo shooting process, it will cause significant heating problems of the device. If the device temperature is too high, it will trigger the temperature control strategy. The temperature control strategy reduces the temperature by limiting the use of the processor, for example, reducing the frequency and reducing the use time of the large core. These processor restriction measures reduce the processing power of the processor, which further reduces the photo shooting performance.

[0073] In response to the related issues mentioned above, the embodiments of the present application provide a segmented photo-taking solution, which reduces the processor load and running memory occupancy during the photo-taking process by executing the post-processing algorithm in a segmented manner, thereby alleviating problems such as lag and device heating, improving photo-taking performance, and enhancing the user's photo-taking experience.

[0074] Unlike continuously and uninterruptedly executing all post-processing algorithms during the photo-taking process to obtain image data that has been processed by the algorithm in real time, the segmented photo-taking solution of the embodiment of the present application divides the algorithm post-processing stage into at least two stages. The first stage of algorithm post-processing is executed during the photo-taking process to obtain image data that has not been processed by the algorithm post-processing. At the appropriate time, the image data that has not been processed by the algorithm post-processing is subjected to the remaining stages of algorithm post-processing to obtain image data that has been processed by the algorithm. In this way, there is no need to continuously and uninterruptedly execute all post-processing algorithms during the photo-taking process. The appropriate time may be, for example, when a user or application needs to access, view, share, or edit image data, the system is idle, or the camera application is closed or running in the background, and system status data (such as processor load, running memory, and device temperature, etc.) is lower than a preset value.

[0075] When the algorithm post-processing stage is divided into multiple stages, the position and number of segmentation points can be set according to actual needs. The number of segmentation points can determine the number of divided stages.

[0076] For example, referring to the schematic diagram of the algorithm post-processing stage division shown in FIG3 , the algorithm post-processing stage may include the following processes: a denoising module, a brightness and color module, a postprocessing module, and a compression module. Among them, the denoising module is used to remove noise and enhance image details, the brightness and color module is used to process the color and brightness of image data, and the postprocess module is used to enhance image details or beautify the skin. It is understandable that each module may include one or more post-processing algorithms, for example, the denoising module includes a denoising algorithm, and the postprocess module includes a beautification algorithm. The denoising module and the brightness and color module belong to RAW or RGB image processing, and the postprocess module and the compression module belong to YUV domain processing.

[0077] As shown in FIG3 , the input of the algorithm post-processing stage is a RAW image, and the output of the algorithm post-processing stage is a Joint Photographic Experts Group (JPEG) image, which is an image completed by the algorithm post-processing.

[0078] In the algorithm post-processing stage, segmentation can be performed on the original RAW image input, as shown by segmentation point 1 in Figure 3; or segmentation can be performed after partial post-algorithm processing on the RAW image, as shown by segmentation point 2 in Figure 3.

[0079] It can be understood that the position of the segmentation point is used to divide the algorithm post-processing process into each stage. For example, when the segmentation point is segmentation point 2 as shown in Figure 3, the first stage algorithm post-processing process can include a denoising module and a brightness and color module, and the second stage algorithm post-processing process can include a Postprocess module and a Compression module.

[0080] Typically, the completed algorithm post-processing stage can be divided into a first-stage algorithm post-processing process and a second-stage algorithm post-processing process. In practical applications, the algorithm post-processing stage can also be divided into three, four, or more stages, which are not limited here.

[0081] For example, referring to the schematic diagram of the image processing process shown in FIG4 , the image processing process may include an image acquisition phase and an algorithm post-processing phase. The algorithm post-processing phase includes a first-stage algorithm post-processing phase and a second-stage algorithm post-processing phase. In other words, the complete algorithm post-processing phase is divided into two phases. The first-stage algorithm post-processing is performed on the image data output by the ISP to obtain an image that is not yet fully processed. This image is then used as input for the second-stage algorithm post-processing phase.

[0082] It is understood that the first-stage algorithm post-processing and the second-stage algorithm post-processing can be further divided into multiple sub-stages. For example, the second-stage algorithm post-processing can be divided into the third-stage algorithm post-processing and the fourth-stage algorithm post-processing. For ease of description, the following description will use the first-stage algorithm post-processing and the second-stage algorithm post-processing as an example.

[0083] It should be noted that in addition to dividing the complete algorithm post-processing stage into the first and second stages, Figure 4 also stores the intermediate data of the post-processing algorithm in ROM. This can reduce the running memory usage during the photo-taking process and further alleviate the device lag problem.

[0084] Specifically, to ensure image quality, the post-processing algorithm often utilizes a multi-frame RAW domain algorithm. This requires caching multiple RAW image frames so that they can be synthesized to produce a single, higher-quality image. For example, a 12.5MB image requires six RAW frames, which consumes 150MB of RAM. Furthermore, the multi-frame RAW domain algorithm also consumes memory. At this point, if six photos are taken in succession, 1GB of RAM will accumulate, putting significant pressure on the system and causing noticeable device lag. Furthermore, excessive RAM usage can lead to process termination and photo loss. In other words, if the intermediate data from the post-processing algorithm is stored in the RAM buffer, this data will occupy a large amount of RAM, causing device lag and other issues.

[0085] The embodiment of the present application saves the intermediate data of the algorithm post-processing stage to the ROM flash. The capacity of the ROM flash is usually large, which can reach more than 128G or even 1T. Therefore, the ROM can store enough image data without causing RAM buff blocking, reducing the running memory usage during the photo shooting process and alleviating problems such as device freezing.

[0086] Specifically, as shown in Figure 4, the image output by the ISP is cached in RAM by default. If the segmented shooting mode is selected, the image data in RAM is cut and transferred to ROM. If the segmented shooting mode is not selected, the image data can be processed according to the process shown in Figure 1.

[0087] After entering the segmented photography, each post-processing algorithm in the first-stage algorithm post-processing process and the second-stage algorithm post-processing process obtains image data from the ROM, processes the image data, obtains intermediate data, and stores the intermediate data in the ROM.

[0088] It is understood that the algorithm post-processing process can obtain images with better image quality and effects by performing a series of post-processing algorithms on the image data. Therefore, the image after algorithm post-processing (i.e., the final image in Figure 4) is generally of better quality and effects than the image before algorithm post-processing. For example, suppose the image before algorithm post-processing has a basic quality score of 80, while the image after algorithm post-processing has a full quality score of 100.

[0089] To better illustrate the segmented photography solution provided by the present invention, the following uses the segmented photography system architecture diagram shown in Figure 5 as an example. As shown in Figure 5, the segmented photography system architecture includes an application layer, a framework and service layer, and a hardware abstraction layer (HAL).

[0090] The application layer includes the camera application and the image access application. The camera application can take photos and view images. The image access application can access images in the file system through the media library.

[0091] The framework and service layer includes a camera service and a media library. The camera service includes a real-time photo sub-service and a time-delayed photo sub-service. The time-delayed photo sub-service is a newly added module used to control the second-stage algorithm post-processing. Specifically, it can schedule tasks for the second-stage algorithm post-processing, determine a scheduling strategy based on the system status, and then execute the second-stage algorithm post-processing using the determined scheduling strategy. In addition to the database interface and database, the media library also includes an interception trigger module. This interception trigger module is used to detect trigger operations and, based on the trigger operation, trigger the time-delayed photo sub-service to schedule tasks for the second-stage algorithm post-processing to obtain a 100-point full-quality image. The trigger operation can be, for example, a user clicking a thumbnail or viewing an image. When the interception trigger module detects a user trigger operation, it triggers the time-delayed photo sub-service to prioritize the second-stage algorithm post-processing of the corresponding image to obtain a 100-point full-quality image corresponding to the image the user needs to view in a timely manner.

[0092] The HAL includes the camera HAL, post-processing services, and a file system. The camera HAL includes an acquisition module, which is used to acquire image data. The post-processing service includes submodules such as algorithm scheduling management, stage one algorithm processing, and stage two algorithm processing. Algorithm scheduling management is used to schedule and manage various post-processing algorithms. Stage one algorithm processing (i.e., stage one algorithm post-processing) and stage two algorithm processing (i.e., stage two algorithm post-processing) each include multiple algorithm processes (procs). The file system stores an 80-point basic quality map and a 100-point full quality map.

[0093] In the segmented camera system architecture shown in Figure 5, the algorithm post-processing phase is divided into two stages: Stage 1 algorithm processing and Stage 2 algorithm processing. Based on these two stages of algorithm post-processing, the image processing process is divided into Stage 1 and Stage 2. Stage 1 generates an 80-point base quality image, while Stage 2 generates a 100-point full quality image.

[0094] Based on the segmented photographing system architecture of FIG5 , the process of the first-stage algorithm post-processing is described in detail below in conjunction with the flowchart of the first-stage algorithm post-processing shown in FIG6A .

[0095] As shown in FIG6A , the process may include the following steps:

[0096] Step S601: The camera application sends a photo request to the camera HAL via the real-time photo sub-service.

[0097] For example, a user can trigger the camera application to generate a photo request by inputting a photo operation into the camera application. For example, referring to the photo scene shown in FIG2A , the user can input a photo operation by clicking the photo control 113. In response to the photo operation, the camera application sends a photo request to the real-time photo sub-service, which then transmits the photo request to the camera HAL.

[0098] Step S602: The camera HAL collects image data in response to the photo taking request to obtain image data to be processed.

[0099] It is understood that the camera HAL can respond to a photo request by calling the image sensor and ISP to collect image data and obtain the processed image data output by the ISP. In segmented photo taking, the processed image data output by the ISP is stored in the RAM buffer and then cut into the ROM.

[0100] The image data to be processed can be raw image data formed by RGB data signals or RYB data signals. During image data acquisition, in addition to the image data, camera metadata and auxiliary device information can also be obtained. Camera metadata includes, but is not limited to, 3A information (auto exposure control AE, auto focus control AF, auto white balance AWB), image information (such as image width and height), and exposure parameters (aperture size, shutter speed, and ISO value). Auxiliary device information includes, but is not limited to, laser information and spectral information. Camera metadata and auxiliary device information can be used in subsequent algorithm post-processing.

[0101] In some embodiments, after receiving a capture request or obtaining image data to be processed, the camera HAL may further determine whether to enter a segmented capture architecture. If it determines that the segmented capture architecture is to be entered, the subsequent segmented capture steps are performed. If it determines that the segmented capture architecture is not to be entered, the subsequent process may adopt the capture scheme shown in FIG2B , in which case the algorithm post-processing stage may not be divided into multiple stages. Of course, in other embodiments, the camera HAL may enter the segmented capture architecture by default.

[0102] For example, referring to the system architecture block diagram shown in Figure 6B, if the conditions for entering the segmented photography architecture are not met, real-time algorithm post-processing is performed. This means that all post-processing algorithms are continuously executed during the photography process, and the real-time image is updated to the image library. If the conditions for entering the segmented photography architecture are met, the data in the RAM buffer is cut into the ROM flash, segmented algorithm post-processing is performed, and the resulting image is updated to the image library.

[0103] In specific applications, the current system status can be used to determine whether to enter the segmented photography architecture. System status may include, but is not limited to, the amount of RAM buff data, device temperature, and post-processing algorithm duration. When the amount of RAM buff data exceeds a preset threshold, indicating excessive memory usage, the segmented photography architecture is considered viable. When the device temperature exceeds a preset temperature threshold, it is considered that the device is overheating and the system has restricted processor usage based on the temperature control strategy, thus allowing the segmented photography architecture to be entered. When the post-processing algorithm duration exceeds a preset time threshold, the segmented photography architecture is considered viable.

[0104] Step S603: The camera HAL obtains a quick thumbnail according to the image data to be processed.

[0105] Step S604: The camera HAL returns the quick thumbnail to the camera application. The camera application saves the quick thumbnail and inserts a thumbnail record into the media library.

[0106] Step S605: The post-processing service performs the first-stage algorithm post-processing on the image data to be processed, obtains an 80-point image, and saves the 80-point image.

[0107] It can be understood that the 80-point image refers to the result of the first-stage algorithm post-processing, which is the image data that has not been completed by the algorithm post-processing. The 80-point image is used here only for the convenience of description.

[0108] Step S606: The post-processing service returns the 80-point image and segment metadata to the camera application.

[0109] The segmented metadata may include the task identity document (ID) processed by the second-stage algorithm. In addition, the segmented metadata may also include all or part of the above-mentioned photographic metadata and auxiliary device information.

[0110] Step S607: The camera application saves the 80-part image and inserts the record and segment metadata of the 80-part image into the media library.

[0111] Step S608: The media library constructs a new task for post-processing of the second-stage algorithm based on the segmented metadata.

[0112] In step S609 , the media library notifies the delayed photography sub-service of the constructed new task, so that the delayed photography sub-service updates the task queue according to the new task.

[0113] It is understandable that the task queue includes one or more tasks. The task is the second-stage algorithm post-processing task corresponding to the 80-point image. By executing each task in the task queue, the second-stage algorithm post-processing of each 80-point image is executed. In specific applications, each task in the task queue can be processed in sequence in the order of first-in-first-out to execute the second-stage algorithm post-processing of each 80-point image in an orderly manner. Of course, it is also possible to prioritize the execution of a task in the task queue as needed to prioritize the execution of a second-stage algorithm post-processing. For example, when a user needs to view an image, but the task corresponding to the image has not yet been executed, the task corresponding to the image will be triggered to execute first, so as to obtain the image after the algorithm post-processing is completed in time.

[0114] Multiple tasks may exist simultaneously in the task queue. For example, when a user uses their phone to take photos and triggers five photo requests within a short period of time, the phone executes the steps in Figure 6A for each photo request, obtaining five images with a score of 80. At this point, assuming the second-stage algorithm post-processing has not yet been triggered, the task queue will simultaneously contain tasks for the second-stage algorithm post-processing corresponding to these five images with a score of 80.

[0115] It can be seen that in the segmented photography scheme, only the first stage algorithm post-processing is executed during the photography process, that is, only part of the post-processing algorithm is executed, rather than all of the post-processing algorithm, which reduces the amount of calculation in the photography process and thus reduces the processor load and running memory usage of the photography process.

[0116] The first stage of algorithm post-processing is performed during the photo capture process, during which the camera app is typically in the foreground. After the first stage of algorithm post-processing is completed, the user or the system automatically triggers the second stage of algorithm post-processing to obtain the processed image.

[0117] Users can trigger the execution of the second-stage algorithm post-processing process by viewing or sharing images.

[0118] For example, referring to FIG7A , a schematic diagram illustrating image viewing is shown. Based on the photo-taking scenario shown in FIG1 , mobile phone 11 responds to a user clicking on photo control 113 by executing the process shown in FIG6A , obtaining an 80-point image and a thumbnail. This thumbnail may be shown as thumbnail 114 in FIG7A . When the user clicks thumbnail 114 , mobile phone 11 deems that the user has viewed the image, triggering the second-stage algorithm post-processing process and displaying interface 115 , which displays image 116. Image 116 may be an 80-point image or a 100-point image (i.e., the image processed by the second-stage algorithm).

[0119] It should be pointed out that the execution of the second-stage algorithm post-processing takes a certain amount of time. Therefore, if the second-stage algorithm post-processing corresponding to the thumbnail 114 is not triggered in advance, then after the user clicks the thumbnail 114, the mobile phone 11 may not be able to obtain the 100-point image in time, that is, it cannot obtain the image completed by the algorithm post-processing in time. Therefore, the 80-point image (the result of the first-stage algorithm post-processing) can be displayed on the interface 115 first, and after the second-stage algorithm post-processing is completed, the 80-point image on the interface 115 can be refreshed to the 100-point image.

[0120] Of course, in other embodiments, after the user clicks thumbnail 114, mobile phone 11 does not immediately display the 80-minute image on interface 115, but waits until the second-stage algorithm post-processing is completed before displaying the 100-minute image on interface 115. In this case, after the user clicks thumbnail 114, it may take a while before the user sees image 116. In this case, image 116 is the 100-minute image.

[0121] In the scenario shown in FIG7A , when the user clicks thumbnail 114, mobile phone 11 exits the photo capture process and enters the image preview state. In the image preview state, no preview video stream processing or other processes are performed. Thus, when executing the second-stage algorithm post-processing process, the preview video stream processing or other processes are not performed simultaneously, thereby reducing processor load and memory usage.

[0122] As another example, referring to FIG7B , which shows another schematic diagram of viewing an image, based on the photo-taking scenario shown in FIG1 , the user taps the photo-taking control 113 to take a photo, and then exits the camera application 111. During this process, the mobile phone 11 responds to the user's tap on the photo-taking control 113 by executing the process shown in FIG6A above, obtaining an 80-point image and a thumbnail, i.e., performing the first-stage algorithm post-processing and obtaining the results of the first-stage algorithm post-processing.

[0123] After the user exits the camera application 111, they click on the gallery 117 to enter the gallery and view the taken pictures. In response to the click operation on the gallery 117, the mobile phone 11 displays the album interface 118; the user continues to click on the control 119 in the album interface 118, and the mobile phone responds to the click operation on the control 119 to display the photo page 121, which displays pictures 122, 123, 124, 125, 126 and 127. The user wants to view picture 125, and the mobile phone 11 responds to the click operation on picture 125 and displays interface 128. It can be understood that pictures 122 to 127 displayed on the photo page 121 can be the results of the post-processing of the first stage algorithm (i.e., 80-point pictures) or thumbnails.

[0124] At this time, when the mobile phone 11 detects a click operation on the image 125, it is considered that the user's image viewing operation is detected, and the second-stage algorithm post-processing corresponding to the image 125 is triggered. Similarly, after the user clicks the image 125, the mobile phone 11 can immediately display the 80-point image of the image 125 on the interface 128, and then refresh the 80-point image on the interface 128 to the 100-point image after the second-stage algorithm post-processing is completed. Of course, the mobile phone 11 can also not immediately display the 80-point image on the interface 128, but wait until the second-stage algorithm post-processing is completed before displaying the 100-point image on the interface 128.

[0125] In the scenario of FIG. 7B , the mobile phone 11 may also trigger the second-stage algorithm post-processing when detecting that the user exits the camera application or detects that the user clicks on the gallery 117 (ie, opens the image access application).

[0126] In the scenarios of Figures 7A and 7B , when a user clicks thumbnail 114 or picture 125, mobile phone 11 can prioritize scheduling and triggering the corresponding task, promptly executing the second-stage algorithm post-processing of thumbnail 114 or picture 125 and promptly obtaining the completed image. In other words, the segmented photography solution of the present embodiment can prioritize triggering the second-stage algorithm post-processing of a specific picture based on actual business needs. The following describes the process of prioritizing triggering the second-stage algorithm post-processing of a specific picture with reference to Figure 8 .

[0127] 8 shows a schematic block diagram of a process for triggering the second-stage algorithm post-processing on demand. The process may include the following steps:

[0128] Step S801: In response to a viewing operation on a target image, the image library application reads an 80-minute image of the target image from the file system, displays the 80-minute image immediately, and synchronously requests a 100-minute image of the target image from the media library.

[0129] For example, in the scenario shown in FIG7B , when the user clicks on picture 125, mobile phone 11 determines that a viewing operation has been detected for the target picture, which is picture 125. At this point, the gallery application reads the 80-degree image of picture 125 from the file system based on the relevant information of picture 125, and immediately displays the 80-degree image of picture 125 on interface 128. Furthermore, the gallery application also synchronously requests the 100-degree image from the media library based on the relevant information of picture 125.

[0130] It is understandable that the media library records relevant information of the target image. For example, referring to the first stage algorithm post-processing process shown in FIG6A , the camera application inserts 80 segment image records and segment metadata into the media library.

[0131] Step S802: The media library responds to the 100-point image request from the image library application, triggering the delayed photo taking sub-service to schedule and execute the second-stage algorithm post-processing task of the target image.

[0132] It's understandable that the gallery application's 100-minute image request carries information about the 80-minute image. The media library can use this information to find the segmented metadata corresponding to the 80-minute image and, based on this metadata, trigger the delayed photo sub-service to execute the second-stage algorithm post-processing task corresponding to the 80-minute image. For example, the segmented metadata includes a task ID, and the media library uses this task ID to trigger the delayed photo sub-service to execute the task corresponding to that task ID.

[0133] Step S803: The delayed photography sub-service triggers the post-processing service to prioritize the execution of the second-stage algorithm post-processing task for the target image based on the triggering of the media library.

[0134] It is understandable that when the user views the target image, if the second-stage algorithm post-processing of the target image has not been executed, the second-stage algorithm post-processing of the target image will be triggered first; if the second-stage algorithm post-processing task corresponding to the target image has been completed, the 100-point image of the target image can be directly read and the 100-point image can be displayed immediately.

[0135] For example, assuming that in the scenario of FIG7B , during the photo-taking process, the user successively took pictures 122, 123, 124, 125, and 126. After the photo-taking is completed, the user exits the camera application. During the photo-taking process, the mobile phone performs the first-stage algorithm post-processing for each picture, obtains 80 images of each picture, and constructs a task for the second-stage algorithm post-processing for each picture. At this time, the task queue contains tasks for the second-stage algorithm post-processing of pictures such as pictures 122, 123, 124, 125, and 126. Assuming that the order in which the pictures are taken is: picture 122, picture 123, picture 124, picture 125, picture 126, the order in which the tasks for the second-stage algorithm post-processing of each picture in the task queue are executed is: picture 122, picture 123, picture 124, picture 125, picture 126.

[0136] After the user exits the camera application, the mobile phone 11 automatically triggers the execution of each task in the task queue when it detects that the system is in an idle state at a certain time, or detects that the user opens the gallery application 117. Under normal circumstances, the tasks in the task queue are executed in a cyclic manner in a first-in-first-out order, that is, the task of the second-stage algorithm post-processing of image 122 is executed first, and the task of the second-stage algorithm post-processing of image 126 is executed last.

[0137] When mobile phone 11 completes the second-stage algorithm post-processing task for picture 123, it detects a user click operation on picture 125, that is, the user needs to browse picture 125 in large size at the current moment, so it triggers the second-stage algorithm post-processing task for picture 125 first, rather than triggering the second-stage algorithm processing task for picture 124 in sequence.

[0138] Of course, if the user clicks on picture 125 and mobile phone 11 has not yet triggered the execution of the second stage algorithm post-processing, mobile phone 11 will trigger the second stage algorithm post-processing and give priority to executing the second stage algorithm post-processing task of picture 125.

[0139] Step S804: The post-processing service preferentially executes the second-stage algorithm post-processing task of the target image to obtain a 100-point image of the target image.

[0140] Step S805: The post-processing service saves the 100-part image to the file system.

[0141] Step S806: The time-lapse photography sub-service replaces the 80-point image of the target image with a 100-point image.

[0142] After the post-processing service obtains the 100-point image, the time-lapse photography sub-service first queries the media library for the 80-point image file record. Based on the 80-point image file record, it replaces the 80-point image in the file system with the 100-point image and updates the 100-point image file record in the media library. This now stores the 100-point image file record in the media library, allowing the gallery application to read the 100-point image of the target image from the file system.

[0143] Step S807: The delayed photo taking sub-service notifies the gallery application to refresh the picture.

[0144] Step S808: The gallery application reads the 100-point image of the target image from the file system and updates the 80-point image to a 100-point image.

[0145] It's important to note that when a user accesses a specific image, the 80-point image is first displayed immediately. Then, based on the user's needs, the second-stage algorithm post-processing for the specified image is triggered first. After the second-stage algorithm post-processing is complete, the 80-point image is refreshed to a 100-point image. This segmented photography solution improves camera performance while still meeting the user's need for real-time image viewing, ensuring a superior user experience.

[0146] It can be understood that the scenario of Figure 7A also conforms to the on-demand access scenario, that is, when the user clicks on the thumbnail 114, the mobile phone 11 can also prioritize the scheduling of the task of triggering the second-stage algorithm post-processing corresponding to the thumbnail 114, and immediately display the 80-point picture. After obtaining the result of the second-stage algorithm post-processing, the 80-point picture will be refreshed to a 100-point picture.

[0147] In addition to triggering the second-stage algorithm post-processing through user-specific operations, the system can also automatically trigger the execution of the second-stage algorithm post-processing based on system status data.

[0148] For example, system status data includes the system's processor load, device temperature, and running memory. When the user exits the camera app and at least one of the following conditions is met: the processor load is below a preset load threshold, the device temperature is below a preset temperature threshold, and the running memory is above a preset value, the second-stage algorithm post-processing is automatically triggered, and each second-stage algorithm post-processing task in the task queue is executed in a loop.

[0149] For another example, when it is detected that the user exits the camera application or opens an image access application (such as clicking on the gallery application), the execution of the second stage algorithm post-processing is automatically triggered.

[0150] After triggering the second-stage algorithm post-processing, a scheduling strategy can be determined based on the system status data, and the tasks of the second-stage algorithm post-processing can be executed according to the scheduling strategy.

[0151] In this case, the segmented photography system can include a system perception module and a state control module. The system perception module can monitor the status of the image library, camera, AMS, battery consumption, and system resources, and determine the current state of the system based on the monitored data. The state control module can execute corresponding scheduling policies based on the current state of the system, thereby implementing different resource supply strategies in different states.

[0152] For example, referring to FIG9 , which shows a flow chart of the system automatically triggering the second-stage algorithm post-processing, the flow may include the following steps:

[0153] Step S901: The delayed photo taking sub-service registers system status monitoring with iAware.

[0154] It is understandable that iAware is a user-aware system status. In other embodiments, iAware may be replaced with other system awareness modules, which is not limited here.

[0155] Step S902: iAware sends a system status notification to the delayed photography sub-service.

[0156] System status notifications include system status data perceived by iAware. For example, iAware can perceive system status data including device temperature and central processing unit (CPU) load.

[0157] Step S903: The delayed photo taking sub-service determines a scheduling strategy based on the system status data.

[0158] It is understood that system status data may include not only iAware-perceived data but also system status data perceived by other system perception modules. For example, referring to the scheduling strategy diagram of the second-stage algorithm post-processing shown in Figure 10, system-perceived system status data may also include whether the gallery, camera, and AMS are running in the foreground, as well as screen on / off data.

[0159] The time-delayed photography sub-server may determine the system state according to the system state data, and determine the scheduling strategy according to the corresponding relationship between the system state and the scheduling strategy.

[0160] For example, the system states include high performance mode, balanced mode, low power mode, and emergency mode. The corresponding relationship between the system states and resource supply strategies (ie, scheduling strategies) can be shown in Tables 1 and 2 below.

[0161] Table 1

[0162] Table 2

[0163] In Tables 1 and 2 above, examples of scenarios and resource supply strategies corresponding to various modes are given. For example, when the gallery application is in the state of large-scale image browsing or image sharing, the resource supply strategy corresponding to the high-performance mode is adopted to execute the tasks of the second-stage algorithm post-processing. Similarly, after the camera application exits, the tasks of each second-stage algorithm post-processing can be tail-processed in the background, and the resource supply strategy corresponding to the balanced mode is adopted to execute each task. When a processing exception occurs, the second-stage algorithm post-processing may not be executed, but the result of the first-stage algorithm post-processing (i.e., the 80-point image) may be used for display. For example, if the RAW data is lost or the gallery access times out, the 80-point image will be displayed directly without executing the second-stage algorithm post-processing.

[0164] In low-power mode, the system predicts that a certain image will be viewed by the user after a certain period of time. The timeliness and rate requirements of the second-stage algorithm post-processing of the image are low. Therefore, a resource supply strategy aimed at saving power is adopted to execute the second-stage algorithm post-processing of the image.

[0165] It is understandable that the system perception module can monitor whether applications such as the gallery and camera are running in the foreground, whether they are closed, and whether they are in large-image browsing or sharing mode.

[0166] As shown in Figure 10, high-performance mode, low-power mode, and balanced mode can be switched between each other. For example, based on the system status data currently sensed by the system, the resource supply strategy corresponding to high-performance mode is determined to execute the task. If an exception occurs during high-performance execution, the system can switch from high-performance mode to 80-point emergency mode. Of course, it can also switch to balanced mode and low-power mode.

[0167] Step S904: The delayed photo taking sub-service processes the tasks in the task queue in a loop according to the scheduling strategy.

[0168] After the scheduling strategy is determined, each task in the task queue is processed using that scheduling strategy. For example, when the scheduling strategy is determined to be the resource supply strategy corresponding to high-performance mode, when executing tasks processed after the second stage of the algorithm, the CPU is in a state of locking the medium and large cores, boosting, and background protection. The NPU has a high priority, and the GPU has a medium priority.

[0169] As shown in Figure 9, for each task in the task queue, the following process is executed: the time-lapse photography subservice schedules the task, triggering the post-processing service to perform the second-stage algorithm post-processing to obtain a 100-point image. After obtaining the 100-point image, the post-processing service first queries the media library for the file record of the 80-point image. Based on the file record of the 80-point image, it replaces the 80-point image in the file system with the 100-point image and updates the file record of the 100-point image in the media library. During this process, resources are allocated according to the determined scheduling policy.

[0170] As described above, the system can automatically trigger the execution of the second-stage algorithm post-processing based on the perceived system state. For example, the system may trigger the execution of the second-stage algorithm post-processing when it detects that the user taps the gallery or exits the camera app, when it detects that the system is idle, or when it detects that the user exits the camera app and at least one of the CPU load, running memory, and device temperature meets a predetermined condition.

[0171] Furthermore, after determining that the execution of the second-stage algorithm post-processing has been triggered, the system can further determine a scheduling policy based on the system status data, and execute the second-stage algorithm post-processing tasks according to the determined scheduling policy. Of course, it is also possible to pre-define a resource supply policy instead of further determining the scheduling policy based on the system status data, and then use this pre-determined resource supply policy when the execution of the second-stage algorithm post-processing is triggered.

[0172] It is understandable that when the user triggers the execution of the second-stage algorithm post-processing by operations such as viewing or sharing pictures, the scheduling strategy can be further determined based on the system status data, and the second-stage algorithm post-processing tasks can be executed according to the scheduling strategy.

[0173] It is worth noting that determining the scheduling strategy for the second-stage algorithm post-processing based on the real-time system status can make the system more intelligent and the resource supply strategy more in line with user needs, while ensuring user experience and saving device power consumption as much as possible.

[0174] The segmented photography solution provided in the embodiment of the present application can reduce the processor load and running memory occupancy rate during the photography process, improve photography performance, and enhance the user photography experience.

[0175] Specifically, if single-stage photography is used, RAM usage will continue to increase as the number of photos is taken, until the system memory is exhausted or the specified usage limit is reached, causing the system to slow down. However, if segmented photography is used, because images in RAM are transferred to ROM, the system's RAM will not be exhausted as the number of photos continues to increase, effectively alleviating RAM pressure and improving photo performance. In other words, the segmented photography solution can effectively alleviate the problem of excessive RAM usage during photography, thereby alleviating problems such as device lag.

[0176] Segmented photography effectively alleviates memory pressure, so the system will not lag after using the camera; when the running memory is low, there will be no lag when taking photos using the camera application, effectively alleviating the device lag problem.

[0177] Typically, when using a camera to take photos continuously, the device generates a large amount of heat due to computation, causing the device temperature to continue to rise. Segmented photography effectively controls the amount of computation, extending the computation time, which in turn slows the device temperature rise and reduces the peak temperature. In other words, the segmented photography solution can effectively alleviate device overheating, reduce the amount of computation required during the photo-taking process, and lower the processor load during the photo-taking process.

[0178] In addition, the quality and effect of the pictures obtained through the segmented shooting scheme are better than those obtained through the single-segment shooting scheme.

[0179] In a single-stage photography solution, all post-processing algorithms are executed during the capture process. This concentrates the execution time of these algorithms and results in a high computational load. This in turn places the processor under high load for extended periods, making the device prone to overheating. In the event of device overheating, single-stage photography solutions typically employ thermal escape functions and abandon post-processing algorithms, directly using a single frame or simpler processing algorithms. This results in poor image quality and performance.

[0180] The segmented photography solution of the present embodiment only executes part of the post-processing algorithm during the photography process, reducing the computational complexity of the photography process. The first and second phases of algorithm post-processing are performed at different time intervals, which prevents the processor from being under high load for extended periods, alleviating the problem of device overheating. Furthermore, the segmented photography solution performs segmented algorithm post-processing on the image data when the device overheats, rather than abandoning the subsequent processing algorithm. This results in better image quality and effects.

[0181] The segmented photography solution provided in the embodiment of the present application can be applied to an electronic device, which can be, for example, a mobile phone or a tablet computer, and the type of electronic device is not limited here.

[0182] For example, referring to the structural diagram of electronic device 100 shown in FIG11 , electronic device 100 may include, but is not limited to, a processor 110 , a memory 120 , a sensor module 130 , a camera 140 , and a display screen 150 . Sensor module 130 may include, but is not limited to, a temperature sensor 131 and a touch sensor 132 .

[0183] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange the components differently. The illustrated components can be implemented in hardware, software, or a combination of software and hardware. For example, when the electronic device 100 is a mobile phone, the electronic device 100 may further include: a universal serial bus (USB) interface, a charging management module, a power management module, a battery, an antenna, a mobile communication module, a wireless communication module, an audio module, a speaker, a receiver, a microphone, a headphone jack, a button, a motor, an indicator, a subscriber identification module (SIM) card interface, a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, an ambient light sensor, and a bone conduction sensor, etc.

[0184] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor, a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

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

[0186] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and the like.

[0187] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 132, the camera 140, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 132 via the I2C interface, enabling communication between the processor 110 and the touch sensor 132 via the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0188] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 150 and the camera 140. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 140 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 150 communicate via the DSI interface to implement the display function of the electronic device 100.

[0189] The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 140, the display 150, the sensor module 130, etc. The GPIO interface can also be configured as an I2C interface or a MIPI interface, etc.

[0190] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0191] Electronic device 100 implements display functionality through a GPU, display screen 150, and an application processor. The GPU is a microprocessor for image processing that connects display screen 150 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

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

[0193] The electronic device 100 can implement a shooting function through an ISP, a camera 140, a video codec, a GPU, a display screen 150, and an application processor.

[0194] The ISP processes data fed back by camera 140. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 140.

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

[0196] The digital signal processor is used to process digital image signals.

[0197] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

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

[0199] In the segmented photography solution of the present embodiment, the image data output by the ISP can be first stored in RAM. When the segmented photography architecture is entered, the image data is cut from RAM to ROM. In addition, the intermediate results of the post-processing algorithm are all stored in ROM instead of RAM. This can reduce memory resource consumption in the algorithm post-processing stage, further alleviate problems such as lag and heat generation, and improve photography performance. In particular, for scenarios such as rapid continuous shooting where operating memory usage increases rapidly, storing the intermediate results of the algorithm post-processing stage in ROM can effectively alleviate the problem of rapid operating memory growth.

[0200] The temperature sensor 131 is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 131 to implement a temperature management strategy. For example, when the temperature reported by the temperature sensor 131 exceeds a threshold, the electronic device 100 may reduce the performance of a processor located near the temperature sensor 131 to reduce power consumption and implement thermal protection.

[0201] Touch sensor 132, also known as a "touch-sensitive device," can be mounted on display screen 150. Together, touch sensor 132 and display screen 150 form a touch screen, also known as a "touchscreen." Touch sensor 132 detects touch operations applied to or near the touch sensor. The touch sensor can communicate the detected touch operations to an application processor to determine the type of touch event. Display screen 150 can also provide visual output related to the touch operations.

[0202] After introducing the possible hardware architecture of the electronic device 100 according to the embodiment of the present application, the following describes the subsequent content by taking the electronic device 100 as an example.

[0203] Referring to FIG. 12 , a schematic flow chart of a photographing processing method is shown. The photographing processing method may include the following steps:

[0204] Step S1201: The electronic device 100 opens a camera application.

[0205] The camera application refers to an application with a camera function. Typically, the camera application is a camera application, but it can also be a third-party application with a camera function.

[0206] Step S1202: The electronic device 100 obtains image data to be processed in response to a photographing operation.

[0207] Specifically, when a camera application is running in the foreground, the electronic device 100 responds to a photo-taking operation and obtains image data to be processed through an image acquisition device, which may include an image sensor and an ISP.

[0208] For example, referring to the photo-taking scenario shown in FIG2A , when the mobile phone 11 detects that the user has clicked the camera application 111, the mobile phone 11 opens the camera application. When the camera application is in the foreground, the user clicks the photo control 113 to input a photo-taking operation. In response to the photo-taking operation, the mobile phone 11 collects image data.

[0209] The image data to be processed may refer to image data output by the ISP. For example, the image data to be processed may be raw image data. In addition to obtaining the image data to be processed, the image acquisition process may also obtain data such as auxiliary device information and camera metadata.

[0210] Step S1203: When the camera application is running in the foreground, the electronic device 100 performs a first-stage algorithm post-processing on the image data to be processed to obtain first image data, where the first image data is image data for which the algorithm post-processing has not been completed.

[0211] In some embodiments, before performing the first stage algorithm post-processing, the electronic device 100 may also first determine whether the conditions for entering segmented photography are met. If so, it enters segmented photography and performs the first stage algorithm post-processing on the image data to be processed; if not, it does not enter segmented photography. At this time, all post-processing algorithms can be executed continuously and uninterruptedly during the photography process to process the image data to be processed in real time.

[0212] Furthermore, the conditions for entering segmented photography can include at least one of the following: detecting a continuous shooting operation, running memory falling below a third threshold, device temperature exceeding a second temperature threshold, and the post-processing algorithm taking longer than a preset time threshold. The third threshold, second temperature threshold, and preset time threshold can all be set according to actual needs. Actively entering the segmented photography architecture when the system is in poor condition not only alleviates issues such as device lag and overheating, but also ensures real-time photography as much as possible. When the system is in good condition, algorithm post-processing can be performed in real time to ensure real-time photography.

[0213] For example, if a user captures multiple images consecutively, the data in the RAM buffer increases, indicating that the remaining capacity of the running memory is below the third threshold. If the segmented photography architecture is not used at this time, problems such as photo lag or unresponsiveness may occur. To alleviate the lag caused by excessive memory usage, segmented photography can be used to transfer image data from the RAM buffer to the ROM flash, alleviating memory pressure.

[0214] For example, if the phone is currently overheating, that is, the device temperature is higher than the second temperature threshold, the system has activated the temperature control strategy to limit CPU usage. At this time, in order to improve the camera performance, you can enter the segmented camera mode.

[0215] For example, if the current post-processing algorithm takes longer than expected, that is, the post-processing algorithm takes more than the preset time threshold, and both the memory and image processing time cannot meet the real-time performance of taking photos, you can enter segmented photo taking to relieve system pressure.

[0216] Normally, the image data to be processed output by the ISP is stored in the RAM buff. In order to solve the problem of rapid memory growth during the photo-taking process, in some embodiments, after entering the segmented photo-taking process, the electronic device 100 can cut the image data to be processed from the volatile storage medium to the non-volatile storage medium. At this time, when the electronic device executes the second-stage algorithm post-processing, it can first read the image data to be processed from the non-volatile storage medium, and then perform the first-stage algorithm post-processing on the image data to obtain the first image data, and finally store the first image data in the non-volatile storage medium. In this way, transferring the intermediate data of the algorithm post-processing and the image data to be processed from the volatile storage medium to the non-volatile storage medium can further reduce the running memory usage of the algorithm post-processing process, thereby further alleviating problems such as device freezes. Similarly, in the process of the remaining stages of algorithm post-processing, the intermediate data and the final image can also be stored in the ROM to relieve memory pressure.

[0217] In some embodiments, the electronic device 100 may also directly read the image data to be processed from the RAM buff, perform the first-stage algorithm post-processing on the image data to be processed, and then store the results of the first-stage algorithm post-processing and other intermediate data in the ROM. The remaining stages of algorithm post-processing then read the results of the first-stage algorithm post-processing from the ROM to perform subsequent post-processing algorithms. In this case, it is not necessary to transfer the data in the RAM buff to the ROM. Instead, the first-stage algorithm post-processing is performed based on the data in the RAM buff, and then the results of the first-stage algorithm post-processing and related data are stored in the ROM.

[0218] It can be understood that the first image data is the output image after the first stage algorithm post-processing, and the quality and effect of the image are relatively poor, for example, it can be the 80-point image mentioned above.

[0219] When a camera application is running in the foreground, it can be considered to be in the process of taking a picture. Different from the continuous and uninterrupted execution of all post-processing algorithms during the picture-taking process, the embodiment of the present application only executes part of the post-processing algorithms during the picture-taking process, and executes the remaining post-processing algorithms at the appropriate time. The computational amount of some post-processing algorithms is less than that of all post-processing algorithms, so the computational amount of the segmented picture-taking solution during the picture-taking process is less than that of the single-segment picture-taking solution during the picture-taking process, that is, the segmented picture-taking solution can reduce the computational amount during the picture-taking process, thereby reducing the processor load and running memory usage during the picture-taking process, alleviating problems such as device freezes and device heating; in addition, it can also reduce the time that the processor is in a high-load state during the picture-taking process, thereby alleviating the problem of device heating.

[0220] After executing the first-stage algorithm post-processing, the electronic device 100 may save the first image data to a file system, generate a task ID for the remaining stages of the algorithm post-processing, and construct a task for the remaining stages of the algorithm post-processing based on the task ID. The task for executing the remaining stages of the algorithm post-processing may be triggered at a later appropriate time to execute the remaining stages of the algorithm post-processing.

[0221] Step S1204: If the electronic device 100 detects a target operation, or a camera application is running in the background or closed, the remaining stage algorithm post-processing is performed on the first image data to obtain second image data. The second image data is image data after the algorithm post-processing. The target operation is used to view, edit or share the image. The remaining stage algorithm post-processing includes at least one stage algorithm post-processing.

[0222] In some embodiments, the target operation is an operation of viewing thumbnails, which are displayed on a viewfinder interface of a camera application. The thumbnails are thumbnails corresponding to the image data to be processed.

[0223] For example, referring to the scenario shown in FIG7A , the target operation is the user clicking on the thumbnail 114. For another example, referring to the scenario shown in FIG7B , the target operation is the user clicking on the picture 125.

[0224] It should be noted that when a camera app is in the foreground, if the user needs to view an image, the second stage of algorithm post-processing for the specified image can be triggered in a timely manner to obtain the image data after the algorithm post-processing is completed. In this case, after the second stage of algorithm post-processing for the specified image is triggered, the second stage of algorithm post-processing for other images currently in progress can be scheduled to execute the second stage of algorithm post-processing for the specified image first.

[0225] Of course, when the target operation is detected, the second stage algorithm post-processing may not be triggered, but may be triggered after the camera application is closed or the camera application is running in the background. In this case, the electronic device 100 displays the first image data to the user in response to the target operation, that is, displays the image output by the first stage algorithm post-processing to the user.

[0226] It is worth noting that when the electronic device 100 detects the target operation, it usually exits the photo-taking process, that is, closes or runs the camera application in the background. For example, when the target operation is to view thumbnails, when the camera application is in the foreground, the electronic device 100 responds to the user clicking the thumbnail, exits the photo-taking process, and enters the preview state. After entering the preview state, the electronic device 100 does not need to process the preview video stream, etc. Compared with executing algorithm post-processing at the same time during the photo-taking process, this case can also reduce the processor load and memory usage of the photo-taking process, thereby improving the photo-taking performance and photo-taking experience.

[0227] Normally, when a target operation is detected, it indicates that the user or application needs to operate on the image. At this time, it is usually necessary to trigger and execute the remaining stages of the algorithm post-processing as soon as possible to obtain the image after the algorithm post-processing is completed in time, so as to ensure that the user or application can operate on the image in time. Therefore, when the electronic device 100 detects the target operation, it can prioritize the execution of the remaining stages of the algorithm post-processing of the corresponding image, and use the high-performance mode to execute the post-processing algorithm to obtain the image after the algorithm post-processing is completed as soon as possible.

[0228] In some embodiments, the electronic device 100 can directly trigger the remaining algorithm post-processing when the camera application is running in the background or closed. However, in this case, although the camera application is running in the background or closed, the processor load or device temperature may be high. If the remaining algorithm post-processing is directly triggered, it may increase the pressure on the system processor and memory.

[0229] In other embodiments, when the camera application is running in the background or closed, a further determination is made as to whether a preset trigger condition is satisfied. If so, the remaining stage algorithm post-processing is triggered to perform the remaining stage algorithm post-processing on the first image data to obtain the second image data. Of course, the electronic device 100 may also trigger the remaining stage algorithm post-processing after detecting that the user has exited the camera application.

[0230] Exemplarily, the preset trigger conditions include at least one of the following: opening an image access application, viewing an image, turning off or turning off the screen, sharing an image, editing an image, the system being idle, running memory exceeding a first threshold, device temperature falling below a first temperature threshold, and processor load falling below a second threshold. The first threshold, first temperature threshold, and second threshold can be set as needed and are not limited here.

[0231] Typically, after exiting a camera application, when the system status meets certain conditions (for example, the CPU load, device temperature, etc. are lower than a preset value), the remaining stage algorithm post-processing is triggered.

[0232] An example of an operation to open an image access application is a user clicking on a gallery application. An example of an operation to view an image is a user clicking on an image in an image application. It should be noted that image viewing, image editing, and image sharing operations can be user-initiated, such as a user clicking on an image or sharing it, or application-initiated, such as a third-party instant messaging application actively viewing or sharing an image.

[0233] The operations of viewing, editing, and sharing images can be performed on the first image data, on the image data to be processed, or on other image data. Other image data refers to image data that is not the first image data or the image data to be processed. If the operations are not performed on the first image data or the image data to be processed, the tasks for executing the remaining stage algorithm post-processing corresponding to the first image data can be triggered and scheduled first; if the operations are not performed on the first image data or the image data to be processed, the tasks can be processed in the first-in-first-out order of the task queue. When the tasks for executing the remaining stage algorithm post-processing corresponding to the first image data are processed, the remaining stage algorithm post-processing can be performed on the first image data.

[0234] It should be noted that when the camera application is closed or running in the background and the preset trigger conditions are met, it can be a task that triggers the second stage algorithm post-processing in the entire task queue, or it can be a task that triggers a specified task. For example, when it is detected that the user opens an image access application, the system is in an idle state, or the running memory is higher than the first threshold, the device temperature is lower than the first temperature threshold, and the processor load is lower than the second threshold, the electronic device 100 triggers the second stage algorithm post-processing task in the entire task queue. At this time, each task in the task queue is executed in sequence according to the first-in-first-out order of the task queue. In the process of executing tasks in the task queue in sequence, if it is further detected that the user views or shares an image, the task of triggering the second stage algorithm post-processing of the specified image can be scheduled as a priority.

[0235] For another example, when a user's operation of viewing or sharing an image is detected, the electronic device 100 can prioritize scheduling the task that triggers the second-stage algorithm post-processing of the specified image, regardless of whether it is currently in the state of executing each task in the task queue sequentially or in the state of not triggering task processing of the entire task queue.

[0236] The remaining stage algorithm post-processing can include at least one stage algorithm post-processing process. For example, the remaining stage algorithm post-processing can be the second stage algorithm post-processing, i.e., there is only one stage; or the remaining stage algorithm post-processing can include the second stage algorithm post-processing and the third stage algorithm post-processing, i.e., there are two stages. Each stage algorithm post-processing in the remaining stage algorithm post-processing can be triggered to execute by certain trigger conditions. The trigger conditions for each stage algorithm post-processing can refer to the predetermined trigger conditions and other related content mentioned above and are not limited here.

[0237] When executing the remaining algorithm post-processing, each stage of the algorithm post-processing can be performed on the client side or on the cloud side. For example, the remaining algorithm post-processing includes the second stage of algorithm post-processing and the third stage of algorithm post-processing. The client side executes the second stage of algorithm post-processing, obtains the results of the second stage of algorithm post-processing, and sends the results and related data to the cloud side. The cloud side then executes the third stage of algorithm post-processing and returns the results of the third stage of algorithm post-processing to the client side.

[0238] In addition, when executing the remaining stage algorithm post-processing, it can also be executed intelligently according to the current state of the system. For example, the remaining stage algorithm post-processing process is the second stage algorithm post-processing. At a certain moment, the electronic device 100 detects that the system is in an idle state, and triggers the execution of the second stage algorithm post-processing; however, when the execution is halfway through, it detects that the processor load and memory usage of the current system are too high, then the execution of the second stage algorithm post-processing can be stopped, and the intermediate results in the current state can be recorded; at the next moment, if it is detected that the system is idle, the remaining process of the second stage algorithm post-processing can continue to be executed according to the recorded intermediate results.

[0239] Typically, when the camera application is closed or in the background, and the user does not need to view the image immediately, the electronic device 100 can "slowly" trigger and execute the remaining stages of the algorithm post-processing. The purpose of "slowly" executing and triggering is to reduce device functionality as much as possible. For example, the remaining stages of the algorithm post-processing can be triggered when the system is completely idle or the screen is off.

[0240] In an embodiment of the present application, when a camera application is running in the background or closed, it is further determined whether a preset trigger condition is met. Only when the preset trigger condition is met will the remaining stage algorithm post-processing be executed. In this way, when the user needs to operate the image data, the remaining stage algorithm post-processing can be performed in a timely manner, so that the user can view the final image in a timely manner; in addition, the remaining stage algorithm post-processing algorithm can be executed only when the system status meets certain conditions, that is, the system status such as running memory, device temperature and processor load meets the requirements, which can further alleviate problems such as device freeze and device heating.

[0241] After triggering the residual algorithm post-processing, the residual algorithm post-processing task can be executed according to a pre-set scheduling strategy, or the scheduling strategy can be determined according to the system status data, and the residual algorithm post-processing task can be executed according to the determined scheduling strategy. At this time, the electronic device 100 first monitors the system status data, and then determines the scheduling strategy according to the system status data. Finally, according to the scheduling strategy, it executes the target task in the task queue to perform residual algorithm post-processing on the first image data to obtain the second image data. Among them, the target task is the task corresponding to the residual algorithm post-processing process of the first image data, and the task queue includes the tasks corresponding to the residual algorithm post-processing process of each image data. The target task is generated according to the task identifier of the residual algorithm post-processing process of the first image data. By monitoring the system status data and scheduling the execution of the residual algorithm post-processing task according to the system status data, problems such as device freezing and device heating can be further alleviated.

[0242] It is understandable that when executing tasks in the task queue, they can be executed in a first-in-first-out order, or a task can be triggered to execute first as needed.

[0243] As can be seen from the above, compared with continuously and uninterruptedly executing all post-processing algorithms during the photo-taking process, the embodiment of the present application only executes a part of the post-processing algorithm during the photo-taking process, and executes the remaining post-processing algorithms at a subsequent appropriate time. This can reduce the computing resources and memory resources occupied during the photo-taking process, thereby alleviating problems such as device freezing and device heating, improving photo-taking performance, and improving the user's photo-taking experience.

[0244] In some embodiments, before obtaining the second image data, the electronic device 100 detects a viewing operation on the first image data and, in response to the viewing operation, displays the first target image, where the first target image is the image corresponding to the first image data. After obtaining the second image data, the electronic device 100 updates the first target image to the second target image, where the second target image is the image corresponding to the second image data.

[0245] In other words, when a user wants to view a picture, they can immediately display the output image of the first-stage algorithm post-processing, and then trigger the remaining stage of the algorithm post-processing in real time. After the remaining stage of the algorithm post-processing is completed, the output image of the first-stage algorithm post-processing is refreshed as the output image of the second-stage algorithm post-processing. This reduces the computing and memory resources used during the shooting process, thereby alleviating problems such as device lag and overheating, while also ensuring that users can view pictures in real time.

[0246] For example, referring to the scenario shown in FIG. 7A or FIG. 7B , when the user clicks on the thumbnail 114 or clicks on the picture 125 , the mobile phone 11 can first instantly display the 80-minute image (i.e., the first target image), and after obtaining the 100-minute image (i.e., the second target image), refresh the 80-minute image to the 100-minute image.

[0247] 13 shows a schematic block diagram of the electronic device, which may include an image acquisition module 1301 and an algorithm post-processing module 1302. The image acquisition module 1301 is configured to obtain image data to be processed in response to a photographing operation.

[0248] The algorithm post-processing module 1302 is used to: when the camera application is running in the foreground, perform the first stage of algorithm post-processing on the image data to be processed to obtain first image data, and the first image data is the image data for which the algorithm post-processing has not been completed; if a target operation is detected, or the camera application is running in the background or is closed, perform the remaining stage of algorithm post-processing on the first image data to obtain second image data, and the second image data is the image data for which the algorithm post-processing has been completed, and the target operation is used to view, edit or share the image.

[0249] In some possible implementations, the target operation is an operation of viewing thumbnails, and the thumbnails are displayed on a viewfinder interface of a camera application, and the thumbnails are thumbnails corresponding to the image data to be processed.

[0250] In some possible implementations, the algorithm post-processing module 1302 is specifically used to: if the camera application is running in the background or closed, and a preset trigger condition is detected, perform the remaining stage algorithm post-processing on the first image data to obtain the second image data.

[0251] In some possible implementations, the preset trigger conditions include at least one of the following: an operation of opening an image access application, an operation of viewing an image, an operation of sharing an image, an operation of editing an image, the system being in idle state, the running memory being higher than a first threshold, the device temperature being lower than a first temperature threshold, and the processor load being lower than a second threshold.

[0252] In some possible implementations, the algorithm post-processing module 1302 includes a system state perception submodule 1303 and a scheduling submodule 1304. The system state perception submodule 1303 is used to monitor system state data.

[0253] The scheduling submodule 1304 is used to determine the scheduling strategy based on the system status data; according to the scheduling strategy, execute the target task in the task queue to perform the remaining stage algorithm post-processing on the first image data to obtain the second image data; wherein, the target task is the task corresponding to the remaining stage algorithm post-processing process of the first image data, and the task queue includes the tasks corresponding to the remaining stage algorithm post-processing process of each image data, and the target task is generated according to the task identifier of the remaining stage algorithm post-processing process of the first image data.

[0254] In some possible implementations, the electronic device also includes a refresh module, which is used to: detect a viewing operation on the first image data; display a first target image in response to the viewing operation, where the first target image is an image corresponding to the first image data; and after obtaining the second image data, refresh the first target image to a second target image, where the second target image is an image corresponding to the second image data.

[0255] In some possible implementations, the electronic device also includes a non-volatile storage medium; the algorithm post-processing module 1302 is also used to: cut the image data to be processed from the volatile storage medium to the non-volatile storage medium; read the image data to be processed from the non-volatile storage medium, and perform the first stage algorithm post-processing on the image data to obtain first image data, and store the first image data to the non-volatile storage medium.

[0256] In some possible implementations, the electronic device further includes a segmented photographing trigger module for, if it is determined that the conditions for entering segmented photographing are met, entering the step of performing first-stage algorithm post-processing on the image data to be processed to obtain first image data.

[0257] In some possible implementations, the conditions for entering segmented photography include at least one of the following: detecting a continuous shooting operation, the running memory is lower than a third threshold, the device temperature is higher than a second temperature threshold, and the post-processing algorithm takes longer than a preset time threshold.

[0258] The above-mentioned electronic device has the function of implementing the above-mentioned photo processing method. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions. The modules can be software and / or hardware. It should be noted that the information interaction, execution process, etc. between the modules of the above-mentioned electronic device are based on the same concept as the embodiment of the method of this application. Its specific functions and the technical effects brought about can be specifically referred to in the method embodiment section and will not be repeated here.

[0259] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0260] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process of the above-mentioned method embodiment by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, mobile hard drive, magnetic disk, or optical disk. In some jurisdictions, based on legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunication signals.

[0261] Those skilled in the art will appreciate that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. In the embodiments provided in this application, it should be understood that the disclosed devices, electronic devices, and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical functional division. 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 implemented. In addition, the coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, and can be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0262] The electronic device provided in the embodiment of the present application may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a method as in any one of the above-mentioned embodiments of the photographic processing method is implemented. The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor, the steps in the above-mentioned embodiments of the photographic processing method are implemented. The embodiment of the present application provides a computer program product. When the computer program product is executed on an electronic device, the electronic device can implement the steps in the above-mentioned embodiments of the photographic processing method when the computer program product is executed. The embodiment of the present application also provides a chip system, which includes a processor, the processor is coupled to a memory, and the processor executes the computer program stored in the memory to implement the methods as in the above-mentioned embodiments of the photographic processing method. The chip system can be a single chip, or a chip module composed of multiple chips.

[0263] In the above embodiments, the descriptions of each embodiment have different emphases. For portions not described or described in detail in a particular embodiment, reference should be made to the relevant descriptions of other embodiments. It should be understood that the sequence numbers of the steps in the above embodiments do not necessarily indicate a sequential order of execution. The order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation of the embodiments of the present application. Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc. are used solely to distinguish descriptions and should not be construed as indicating or implying relative importance. References to "one embodiment" or "some embodiments" in this application description mean that one or more embodiments of the present application include the specific features, structures, or characteristics described in conjunction with that embodiment. Therefore, phrases such as "in one embodiment," "some embodiments," "in other embodiments," and "in other embodiments" appearing in different places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. Finally, it should be noted that the above descriptions are merely specific embodiments of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application are intended to be covered by the scope of protection of this application. Therefore, the protection scope of this application should be based on the protection scope of the claims.

Claims

1. A photo processing method, characterized in that: Applied to electronic equipment, the method comprises: Open the camera app; In response to a photographing operation, acquiring image data to be processed; When the camera application is running in the foreground, performing a first-stage algorithm post-processing on the image data to be processed to obtain first image data, where the first image data is image data for which the algorithm post-processing has not been completed; If a target operation is detected, or the camera application is running in the background or closed, the first image data is subjected to the remaining stage algorithm post-processing to obtain second image data, where the second image data is image data after the algorithm post-processing. The target operation is used to view, edit or share the image, and the remaining stage algorithm post-processing includes at least one stage algorithm post-processing.

2. The method according to claim 1, characterized in that The target operation is an operation of viewing thumbnails, the thumbnails are displayed on a viewfinder interface of the camera application, and the thumbnails are thumbnails corresponding to the image data to be processed.

3. The method according to claim 1, characterized in that If the camera application is running in the background or is closed, performing a remaining stage algorithm post-processing on the first image data to obtain second image data includes: If the camera application is running in the background or is closed and a preset trigger condition is detected, the first image data is post-processed by the remaining stage algorithm to obtain the second image data.

4. The method according to claim 3, characterized in that The preset trigger condition includes at least one of the following: an operation of opening an image access application, an operation of viewing an image, an operation of sharing an image, an operation of editing an image, the system being in idle state, the screen being off or stopped, the running memory being higher than a first threshold, the device temperature being lower than a first temperature threshold, and the processor load being lower than a second threshold.

5. The method according to any one of claims 1 to 4, characterized in that: Performing a remaining stage algorithm post-processing on the first image data to obtain second image data includes: Monitoring system status data; Determining a scheduling strategy according to the system status data; According to the scheduling strategy, executing the target task in the task queue to perform the remaining stage algorithm post-processing on the first image data to obtain the second image data; Among them, the target task is the task corresponding to the remaining stage algorithm post-processing process of the first image data, the task queue includes the tasks corresponding to the remaining stage algorithm post-processing processes of each image data, and the target task is generated according to the task identifier of the remaining stage algorithm post-processing process of the first image data.

6. The method according to claim 1, characterized in that Before obtaining the second image data, the method further includes: detecting a viewing operation on the first image data; In response to the viewing operation, displaying a first target image, where the first target image is an image corresponding to the first image data; After obtaining the second image data, the method further includes: The first target image is refreshed to a second target image, where the second target image is an image corresponding to the second image data.

7. The method according to claim 1, characterized in that After obtaining the image data to be processed, the method further includes: Cutting the to-be-processed image data from a volatile storage medium to a non-volatile storage medium; Performing a first-stage algorithm post-processing on the image data to be processed to obtain first image data includes: The image data to be processed is read from the non-volatile storage medium, and the image data to be processed is post-processed by a first-stage algorithm to obtain first image data, and the first image data is stored in the non-volatile storage medium.

8. The method according to claim 1, characterized in that: Before performing the first-stage algorithm post-processing on the image data to be processed to obtain the first image data, the method further includes: If it is determined that the conditions for entering segmented photography are met, the step of performing first-stage algorithm post-processing on the image data to be processed to obtain first image data is entered.

9. The method according to claim 8, characterized in that The condition for entering segmented photography includes at least one of the following: a continuous shooting operation is detected, the running memory is lower than a third threshold, the device temperature is higher than a second temperature threshold, and the post-processing algorithm takes longer than a preset time threshold.

10. An electronic device, characterized in that: Including algorithm post-processing module and image acquisition module; The image acquisition module is used to: obtain image data to be processed in response to a photographing operation; The algorithm post-processing module is used to: when the camera application is running in the foreground, perform the first stage algorithm post-processing on the image data to be processed to obtain the first image data, where the first image data is the image data that has not been processed by the algorithm post-processing; If a target operation is detected, or the camera application is running in the background or closed, the first image data is subjected to the remaining stage algorithm post-processing to obtain second image data, where the second image data is image data after the algorithm post-processing. The target operation is used to view, edit or share the image, and the remaining stage algorithm post-processing includes at least one stage algorithm post-processing.

11. The electronic device according to claim 10, characterized in that: The target operation is an operation of viewing thumbnails, the thumbnails are displayed on a viewfinder interface of the camera application, and the thumbnails are thumbnails corresponding to the image data to be processed.

12. The electronic device according to claim 10, characterized in that: The algorithm post-processing module is specifically used for: If the camera application is running in the background or is closed and a preset trigger condition is detected, the first image data is post-processed by the remaining stage algorithm to obtain the second image data.

13. The electronic device according to claim 12, characterized in that: The preset trigger condition includes at least one of the following: opening an image access application, viewing an image, sharing an image, editing an image, the system being in idle state, the screen being off or stopped, the running memory being higher than a first threshold, the device temperature being lower than a first temperature threshold, and the processor load being lower than a second threshold.

14. The electronic device according to any one of claims 10 to 13, characterized in that: The algorithm post-processing module includes a system state perception submodule and a scheduling submodule; The system status perception submodule is used to: monitor system status data; The scheduling submodule is used to determine a scheduling strategy according to the system status data; and execute a target task in a task queue according to the scheduling strategy to perform the remaining stage algorithm post-processing on the first image data to obtain the second image data; Among them, the target task is the task corresponding to the remaining stage algorithm post-processing process of the first image data, the task queue includes the tasks corresponding to the remaining stage algorithm post-processing processes of each image data, and the target task is generated according to the task identifier of the remaining stage algorithm post-processing process of the first image data.

15. The electronic device according to claim 10, characterized in that: It also includes a refresh module, which is used to: detect a viewing operation on the first image data; display a first target image in response to the viewing operation, the first target image being an image corresponding to the first image data; and after obtaining the second image data, refresh the first target image to a second target image, the second target image being an image corresponding to the second image data.

16. The electronic device according to claim 10, characterized in that: Also includes a non-volatile storage medium; the algorithm post-processing module is also used for: Cutting the to-be-processed image data from the volatile storage medium to the non-volatile storage medium; The image data to be processed is read from the non-volatile storage medium, and the image data to be processed is post-processed by a first-stage algorithm to obtain first image data, and the first image data is stored in the non-volatile storage medium.

17. The electronic device according to claim 10, characterized in that: It also includes a segmented photography trigger module, which is used to: if it is determined that the conditions for entering the segmented photography are met, enter the step of performing the first stage algorithm post-processing on the image data to be processed to obtain the first image data.

18. The electronic device according to claim 17, characterized in that: The condition for entering segmented photography includes at least one of the following: a continuous shooting operation is detected, the running memory is lower than a third threshold, the device temperature is higher than a second temperature threshold, and the post-processing algorithm takes longer than a preset time threshold.

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.

20. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Method for battery management of a battery with a charge state compensation system and battery management system

    CN106164815A

  • Photo processing method and device and computer readable storage medium

    CN110022396A

  • Image processor, image processing method, shooting device and electronic equipment

    CN111491101A

  • Shooting method and device and electronic equipment

    CN113873161A

  • Electronic camera

    JP2014049838A