Photographing processing method, electronic equipment and computer readable storage medium

Through the segmented photo-taking processing method, only part of the post-processing algorithm is executed during the photo-taking process, which solves the problems of equipment jamming and heating during the photo-taking process of mobile phones and other electronic devices, and improves photo-taking performance and user experience.

CN118695076AActive Publication Date: 2024-09-24HUAWEI TECH CO LTD

Patent Information

Application Number
CN202310318891.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-21
Publication Date
2024-09-24
Estimated Expiration
2043-03-21

AI Technical Summary

Technical Problem

Mobile phones and other electronic devices continuously execute complex post-processing algorithms during the photo-taking process, resulting in degradation of photo-taking performance and problems such as device freezes and heating, affecting the user experience.

Method used

Only a part of the post-processing algorithm is executed during the photo-taking process. After the image processing is completed, the algorithm post-processing of the remaining stages is performed. Through the segmented photo-taking processing method, the occupation of computing resources and memory resources is reduced, and the remaining stage algorithm is triggered at the appropriate time. deal with.

Benefits of technology

It alleviates device lagging and heating problems, improves camera performance and user experience, and ensures the timeliness and quality of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118695076A
    Figure CN118695076A
Patent Text Reader

Abstract

The embodiment of the invention discloses a photographing processing method, electronic equipment and a computer readable storage medium. The method comprises the following steps: starting a camera application; obtaining to-be-processed image data in response to the photographing operation; when the camera application runs in a foreground, first-stage algorithm post-processing is carried out on the to-be-processed image data to obtain first image data, and the first image data is image data which is not subjected to algorithm post-processing; if a target operation is detected, or the camera application runs in the background or is closed, residual-stage algorithm post-processing is carried out on the first image data to obtain second image data, the second image data are image data after algorithm post-processing, and the target operation is used for checking, editing or sharing images. The residual stage algorithm post-processing comprises at least one stage algorithm post-processing. According to the embodiment of the invention, the photographing performance is improved through sectional photographing, and the photographing experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] 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.

[0003] There is a large gap between the camera hardware specifications of mobile phones and other electronic devices and those of professional photographic equipment. Therefore, after mobile phones and other electronic devices obtain images through camera capture, they 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 unsatisfactory camera hardware specifications, thereby obtaining higher quality images.

[0004] However, mobile phones and other electronic devices continuously run a series of complex post-processing algorithms during the photo-taking process to obtain the post-processed images in real time. Complex post-processing algorithms require a large amount of computing resources and memory resources, which causes the processor to be overloaded for a long time, resulting in reduced photo performance, device freezes, and device heating, affecting the user's photo-taking experience. Summary of the invention

[0005] 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 poor photo taking experience.

[0006] In a first aspect, an embodiment of the present application provides a photo processing method, which is applied to an electronic device, and the method includes:

[0007] Open the camera app;

[0008] In response to a photographing operation, acquiring image data to be processed;

[0009] When the camera application is running in the foreground, the image data to be processed is subjected to the first-stage algorithm post-processing 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;

[0010] If the 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 the second image data, the second image data is the image data after the algorithm post-processing, 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.

[0011] It can be seen from the above technical solution that the embodiment of the present application executes the first stage algorithm post-processing when the camera application is running in the foreground, and executes the remaining stage algorithm post-processing when the camera application is running in the background or closed, or when the 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 no photo is taken or when the image needs to be operated. Compared with the continuous and uninterrupted execution of 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, which reduces the computing resources and memory resources occupied during the photo-taking process, thereby alleviating problems such as device freezes and device heating, improving photo performance, and improving user photo-taking experience.

[0012] In some possible implementations of the first aspect, the target operation is an operation of viewing thumbnails, and the thumbnails are displayed in the viewfinder interface of the camera application, and the thumbnails are thumbnails corresponding to the image data to be processed. In this implementation, when the camera is 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 time, and the image data after the algorithm post-processing is obtained in time, so that the user can view the image in time. Among them, 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.

[0013] In some possible implementations of the first aspect, 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 the second image data includes:

[0014] 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.

[0015] In some possible implementations of the first aspect, 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 is in idle state, the screen is off or the screen is off, the running memory is higher than a first threshold, the device temperature is lower than a first temperature threshold, and the processor load is lower than a second threshold.

[0016] 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, the remaining stage algorithm post-processing is 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 time, 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.

[0017] In some possible implementations of the first aspect, performing residual stage algorithm post-processing on the first image data to obtain the second image data includes:

[0018] Monitoring system status data;

[0019] Determine the scheduling strategy based on system status data;

[0020] 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;

[0021] 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.

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

[0023] 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, where the first target image is an image corresponding to the first image data;

[0024] After the second image data is obtained, the first target image is refreshed to the second target image, and the second target image is the image corresponding to the second image data.

[0025] 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, and 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, the problems of device freeze and device heating are alleviated, and the timeliness of users viewing pictures can be guaranteed.

[0026] In some possible implementations of the first aspect, after obtaining the image data to be processed, the method further includes:

[0027] Cutting the image data to be processed from the volatile storage medium to the non-volatile storage medium;

[0028] Performing a first-stage algorithm post-processing on the image data to be processed to obtain first image data includes:

[0029] 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 the first-stage algorithm to obtain first image data, and the first image data is stored in the non-volatile storage medium.

[0030] 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 freezing.

[0031] In some possible implementations of the first aspect, before performing first-stage algorithm post-processing on the image data to be processed to obtain the first image data, the method further includes:

[0032] If it is determined that the conditions for entering the segmented photography are met, the step of performing the first-stage algorithm post-processing on the image data to be processed to obtain the first image data is entered.

[0033] 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.

[0034] In this implementation, actively entering segmented photography when the system is in poor condition can not only alleviate problems such as device freezing and heating, but also ensure the real-time nature of photography.

[0035] 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;

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

[0037] The algorithm post-processing module 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 the first image data, which is the image data that has not been completed 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 stage of algorithm post-processing on the first image data to obtain the second image data, which is the image data that has been completed by the algorithm post-processing, and the target operation is used to view, edit or share the image. The remaining stage of algorithm post-processing includes at least one stage of algorithm post-processing.

[0038] 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.

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

[0040] 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.

[0041] In some possible implementations of the second aspect, 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 is in idle state, the screen is off or the screen is off, the running memory is higher than a first threshold, the device temperature is lower than a first temperature threshold, and the processor load is lower than a second threshold.

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

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

[0044] The scheduling submodule is used to determine the scheduling strategy according to 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;

[0045] 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.

[0046] In some possible implementations of the second aspect, a refresh module is also included, which is used to: detect a viewing operation on the first image data; in response to the viewing operation, display a first target image, the first target image being an image corresponding to the first image data; 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.

[0047] In some possible implementations of the second aspect, a non-volatile storage medium is also included; and the algorithm post-processing module is further used to:

[0048] Cutting the image data to be processed from the volatile storage medium to the non-volatile storage medium;

[0049] 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 the first-stage algorithm to obtain first image data, and the first image data is stored in the non-volatile storage medium.

[0050] 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.

[0051] 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.

[0052] 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 the processor implements a method as described in any one of the first aspects above when executing the computer program.

[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method of any one of the above-mentioned first aspects is implemented.

[0054] In a fifth aspect, an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement any method as described in any one of the first aspects above. The chip system can be a single chip, or a chip module composed of multiple chips.

[0055] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the method described in the first aspect above.

[0056] 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

[0057] Figure 1 A schematic diagram of the image processing process provided in an embodiment of the present application;

[0058] Figure 2A A schematic diagram of a mobile phone photo taking process provided in an embodiment of the present application;

[0059] Figure 2B A schematic diagram of the photographing system framework provided in an embodiment of the present application;

[0060] Figure 3 A schematic diagram of the division of the post-processing stages of the algorithm provided in the embodiment of the present application;

[0061] Figure 4 A schematic diagram of the image processing process provided in an embodiment of the present application;

[0062] Figure 5 A schematic diagram of the architecture of a segmented photographing system provided in an embodiment of the present application;

[0063] Fig. 6A A schematic diagram of the first-stage algorithm post-processing process provided in an embodiment of the present application;

[0064] Figure 6B A schematic block diagram of the system architecture provided in an embodiment of the present application;

[0065] Fig. 7A A schematic diagram of viewing an image provided in an embodiment of the present application;

[0066] Figure 7B Another schematic diagram of viewing an image provided in an embodiment of the present application;

[0067] Figure 8 A schematic block diagram of the process of triggering the second-stage algorithm post-processing on demand provided in an embodiment of the present application;

[0068] Fig. 9 A schematic diagram of a process flow of automatically triggering the second-stage algorithm post-processing provided by the system in an embodiment of the present application;

[0069] Fig.10 A schematic diagram of a scheduling strategy for post-processing of the second-stage algorithm provided in an embodiment of the present application;

[0070] Fig.11 A schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application;

[0071] Fig.12A schematic flowchart of a method for photographing provided in an embodiment of the present application;

[0072] Fig.13 A schematic block diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0074] 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.

[0075] The post-processing algorithm is a software algorithm used to improve image effects and image quality. Exemplarily, the post-processing algorithm may include but is not limited to: beauty processing algorithm, filter processing algorithm, rotation processing algorithm, watermark processing algorithm, blur processing algorithm, High Dynamic Range Imaging (HDR) processing algorithm, multi-frame processing algorithm, denoising algorithm, and detail enhancement algorithm.

[0076] During the algorithm post-processing process, one or more post-processing algorithms are executed. For example, see Figure 1 The image processing process is shown in the figure. The image processing process may include an image acquisition stage and an algorithm post-processing stage.

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

[0078] In the algorithm post-processing stage, post-processing algorithm 1, post-processing algorithm 2 and post-processing algorithm 3 are executed in sequence. Specifically, the image data output by the ISP is read from the RAM, and the image data output by the ISP is processed using the post-processing algorithm 1 to obtain a first processing result, which is stored in the RAM; the first processing result is read from the RAM, and the first processing result is processed using the post-processing algorithm 2 to obtain a second processing result, which is stored in the RAM; the second processing result is read from the RAM, and the second processing result is processed using the post-processing algorithm 3 to obtain a third processing result, which is 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 can be understood that for ease of description, Figure 1 Take the algorithm post-processing stage including three post-processing algorithms as an example.

[0079] In the related art, during the photo-taking process, the electronic device will continuously and uninterruptedly execute all post-processing algorithms in the algorithm post-processing stage. Figure 2A and Figure 2B Provide an introduction and explanation. Figure 2A Schematic diagram of the process of taking photos with a mobile phone. Figure 2B This is a schematic diagram of the camera system framework.

[0080] like Figure 2A As shown, 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, performs a 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 after 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 in the foreground, that is, all post-processing algorithms are continuously and uninterruptedly executed during the photo shooting process, so as to perform algorithm post-processing on the image data to be processed in real time and obtain the image after the algorithm post-processing in real time.

[0081] like Figure 2BAs shown, 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, and 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, and the real-time camera sub-service includes a camera device and a camera stream. 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, an algorithm processing and an 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, and the final image is usually stored in a non-volatile storage medium, such as a read-only memory (ROM).

[0082] based on Figure 2B In the photo system framework shown, when the user presses the photo control 113, the camera application of the mobile phone 11 initiates a photo request to the camera service. The camera service responds to the photo request, calls the acquisition module to acquire images, obtains the image data to be processed, and stores the image data to be processed in the image buffer (image buff), and performs algorithm post-processing on the image data to be processed in real time. The image buffer is in the RAM of the mobile phone 11.

[0083] In the algorithm post-processing stage, the algorithm scheduling management submodule schedules and manages each post-processing algorithm in the algorithm processing submodule, so that the algorithm processing module reads the image data to be processed from the image buffer, and executes multiple algorithm processes (process, pro) in sequence based on the image data to be processed, so as to obtain the final image in real time, and return the final image to the camera application through the camera service. After the final image is obtained by real-time processing, the final image is also updated to the gallery in real time. The image access application can access the final image in the file system through the media library.

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

[0085] Specifically, during the photo-taking process, the camera application runs in the foreground, the preview video stream is processed, and the complex post-processing algorithms all require a large amount of computing resources and memory resources. The preview video stream is processed, the camera application runs in the foreground, and the image rendering process has already occupied a large amount of computing resources and memory resources. At this time, if all the post-processing algorithms are still executed continuously during the photo-taking process, the amount of calculation during the photo-taking process will be increased, and the computing resources and memory resources occupied during the photo-taking process will be increased, which will lead to excessive processor load and excessive running memory occupancy during the photo-taking process. In addition, the camera application runs in the foreground, the preview video stream is processed, and the complex post-processing algorithms are carried out simultaneously. In this process, computing resources and memory resources will be occupied, which will further increase the pressure on the system.

[0086] If the processor load and running memory usage are too high, the photo shooting speed will drop significantly, and the photo shooting will be stuck. In some scenarios (such as fast continuous shooting), the photo shooting will even be unresponsive and the photo shooting performance will be poor. In addition, the long-term high-load operation of the processor during the photo shooting process will cause significant heating problems in 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.

[0087] 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 segments, thereby alleviating problems such as lag and device heating, improving photo-taking performance, and improving the user's photo-taking experience.

[0088] Different from continuously and uninterruptedly executing all post-processing algorithms during the photographing process to obtain image data completed by algorithm post-processing in real time, the segmented photographing solution of the embodiment of the present application divides the algorithm post-processing stage into at least two stages, executes the first stage of algorithm post-processing during the photographing process to obtain image data that has not been completed by algorithm post-processing, and performs the remaining stages of algorithm post-processing on the image data that has not been completed by algorithm post-processing at an appropriate time to obtain image data that has been completed by algorithm post-processing. In this way, it is not necessary to continuously and uninterruptedly execute all post-processing algorithms during the photographing process. The appropriate time may be, for example, when a user or application needs to access image data, view, share or edit image data, the system is idle, or the camera application is closed or running in the background, and the system status data (such as processor load, running memory and device temperature, etc.) is lower than a preset value.

[0089] 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.

[0090] For example, see Figure 3 The schematic diagram of the division of the algorithm post-processing stage is shown, and the algorithm post-processing stage can include the following processes: denoising module, brightness and color module, Postprocess module and 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 can be understood that each module can 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.

[0091] like Figure 3 As shown, 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.

[0092] In the post-processing stage of the algorithm, segmentation can be performed on the original RAW image input, such as Figure 3 As shown in the segmentation point 1 in the figure; the RAW image can also be segmented after some post-processing algorithm, such as Figure 3 As shown in segmentation point 2.

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

[0094] Generally, 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.

[0095] For example, see Figure 4The image processing process schematic diagram shown in the figure may include an image acquisition stage and an algorithm post-processing stage. The algorithm post-processing stage includes a first-stage algorithm post-processing and a second-stage algorithm post-processing, that is, the complete algorithm post-processing stage is divided into two stages. The image data output by the ISP is subjected to the first-stage algorithm post-processing to obtain an image that is not completed by the algorithm post-processing. The image that is not completed by the algorithm post-processing is used as the input of the second-stage algorithm post-processing.

[0096] It is understandable 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 is divided into the third-stage algorithm post-processing and the fourth-stage algorithm post-processing. For the convenience of description, the following description is made by taking the division into the first-stage algorithm post-processing and the second-stage algorithm post-processing as an example.

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

[0098] Specifically, in order to ensure image quality, the algorithm post-processing stage often uses a multi-frame RAW domain algorithm. The multi-frame RAW domain algorithm needs to cache multiple frames of Raw images to synthesize multiple frames of Raw images to obtain a higher-quality image. For example, a 12.5M image requires six frames of Raw images, which occupies 150M Byte of running memory, and the multi-frame RAW domain algorithm will also occupy memory; at this time, if 6 photos are taken in succession, 1G of running memory will be accumulated, the system pressure will be very high, and the user's device will be obviously stuck. In addition, if the running memory usage rate is too high, problems such as process killing and photo loss will occur. In other words, if the intermediate data of the post-processing algorithm is stored in the RAM buff, the intermediate data will occupy a large amount of running memory, which will cause problems such as device stuck.

[0099] 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, thereby reducing the running memory occupancy rate during the photo-taking process and alleviating problems such as device freezing.

[0100] Specific to Figure 4 In the default mode, the image output by ISP is cached in RAM. If you enter the segmented shooting mode, the image data in RAM will be cut to ROM, that is, the image data in RAM will be transferred to ROM; if you do not enter the segmented shooting mode, you can follow Figure 1 Process as shown.

[0101] 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.

[0102] It is understandable that the algorithm post-processing process can obtain an image with better image quality and image effect by performing a series of post-processing algorithm processing on the image data. Figure 4 The final image in the algorithm is usually better than the image that has not been processed by the algorithm. For example, if the image that has not been processed by the algorithm is an 80-point basic quality image, the image that has been processed by the algorithm is a 100-point full quality image.

[0103] In order to better introduce the segmented photographing solution provided by the embodiment of the present application, Figure 5 The schematic diagram of the segmented photographing system architecture shown is used as an example for introduction and explanation.

[0104] like Figure 5 As shown, the segmented camera system architecture includes an application layer, a framework and service layer, and a hardware abstract layer (HAL).

[0105] The application layer includes camera applications and image access applications. The camera application can realize the photo taking function and image viewing. The image access application can access images in the file system through the media library.

[0106] The framework and service layer include a camera service and a media library. The camera service includes a real-time photo sub-service and a time-delay photo sub-service. The time-delay photo sub-service is a newly added module for controlling the second-stage algorithm post-processing. Specifically, the second-stage algorithm post-processing can be task-scheduled, and after determining the scheduling strategy according to the system state, the second-stage algorithm post-processing is executed using the determined scheduling strategy. In addition to the database interface and the database, the media library also includes an interception trigger module, which is used to detect the trigger operation, and according to the trigger operation, trigger the time-delay photo sub-service to schedule the second-stage algorithm post-processing to obtain a 100-point full-quality image. The trigger operation can be, for example, a user clicking on a thumbnail or a user viewing an image. When the interception trigger module detects a user trigger operation, the time-delay photo sub-service is triggered to prioritize the scheduling of the second-stage algorithm post-processing of the corresponding image for processing, so as to obtain the 100-point full-quality image corresponding to the image that the user needs to view in time.

[0107] HAL includes camera HAL, post-processing service and file system. Camera HAL includes acquisition module, which is used to acquire image data. Post-processing service includes sub-modules 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., first stage algorithm post-processing) and stage two algorithm processing (second stage algorithm post-processing) both include multiple algorithm processes (proc). The file system stores 80-point basic quality map and 100-point full quality map.

[0108] Figure 5 In the segmented camera system architecture shown, the algorithm post-processing stage is divided into two stages for processing, namely, stage one algorithm processing and stage two algorithm processing. And according to the two-stage algorithm post-processing process, the image processing process is divided into stage one and stage two. In stage one, an 80-point basic quality image is generated, and in stage two, a 100-point full quality image is generated.

[0109] based on Figure 5 The segmented camera system architecture is combined with Fig. 6A The flowchart of the first-stage algorithm post-processing is shown in FIG. 1 , and the flowchart of the first-stage algorithm post-processing is introduced in detail.

[0110] like Fig. 6A As shown, the process may include the following steps:

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

[0112] For example, the user may input a photo-taking operation into the camera application to trigger the camera application to generate a photo-taking request. Figure 2A In the photo scene shown, 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, and the real-time photo sub-service transmits the photo request to the camera HAL.

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

[0114] It is understandable that the camera HAL can respond to the photo request, call the image sensor and ISP to collect image data, and obtain the image data to be processed output by the ISP. In segmented photo taking, after the image data to be processed output by the ISP is stored in the RAM buff, the image data to be processed in the RAM buff is cut into the ROM.

[0115] The image data to be processed may be Raw image data formed by RGB data signals or RYB data signals. When acquiring image data, in addition to image data, photographing metadata and auxiliary equipment information may also be obtained. Photographing metadata includes but is not limited to: 3A (automatic exposure control AE, automatic focus control AF, automatic white balance AWB) information, picture information (such as image width and height), and exposure parameters (aperture size, shutter speed, and sensitivity aperture value). Auxiliary equipment information includes but is not limited to: laser information and spectral information. Photographing metadata and auxiliary equipment information may be used in subsequent algorithm post-processing processes.

[0116] In some embodiments, after receiving a photo request or obtaining the image data to be processed, the camera HAL may further determine whether to enter the segmented photo architecture. If it is determined to enter the segmented photo architecture, the subsequent segmented photo steps are entered. If it is determined not to enter the segmented photo architecture, the subsequent process may adopt the following steps: Figure 2B In the photographing scheme shown, at this time, the algorithm post-processing stage may not be divided into multiple stages. Of course, in other embodiments, the camera HAL may also enter the segmented photographing architecture by default.

[0117] For example, see Figure 6B The schematic block diagram of the system architecture shown in the figure shows that when the conditions for entering the segmented photography architecture are not met, the real-time algorithm post-processing is performed, that is, all post-processing algorithms are continuously and uninterruptedly executed during the photography process, and the real-time acquired pictures are updated to the gallery. When the conditions for entering the segmented photography architecture are met, the data in the RAM buff is cut to the ROM flash, and the segmented algorithm post-processing is performed, and the acquired pictures are updated to the gallery.

[0118] In specific applications, it can be determined whether to enter the segmented photography architecture based on the current system status. The system status may include but is not limited to: the amount of data in the RAM buff, the device temperature, and the time consumed by the post-processing algorithm. When the amount of data in the RAM buff is greater than the preset threshold, that is, the occupancy rate of the running memory is too high, it is considered that the segmented photography architecture can be entered; when the device temperature is greater than the preset temperature threshold, it is considered that the current device is seriously overheated, and the system has limited the use of the processor according to the temperature control strategy, and it is considered that the segmented photography architecture can be entered. When the time consumed by the post-processing algorithm is greater than the preset time threshold, it is considered that the segmented photography architecture can be entered.

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

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

[0121] 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.

[0122] 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.

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

[0124] 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 photographing metadata and auxiliary device information.

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

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

[0127] 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.

[0128] It is understandable that the task queue includes one or more tasks. The task is the task of the second-stage algorithm post-processing corresponding to the 80-point image. The second-stage algorithm post-processing of each 80-point image is performed by executing each task in the task queue. In a specific application, each task in the task queue can be processed in sequence in the order of first-in-first-out to orderly execute the second-stage algorithm post-processing of each 80-point image. Of course, it is also possible to prioritize the execution of a task in the task queue as required 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 is triggered to execute first, so as to obtain the image completed by the algorithm post-processing in time.

[0129] There may be multiple tasks in the task queue at the same time. For example, when a user uses a mobile phone to take a photo, and triggers 5 photo requests in a short period of time, the mobile phone executes Fig. 6A, 5 images with a score of 80 are obtained. At this point, assuming that the second-stage algorithm post-processing has not yet been triggered, the task queue contains the tasks for the second-stage algorithm post-processing corresponding to the five images with a score of 80.

[0130] It can be seen that in the segmented photo-taking scheme, only the first-stage algorithm post-processing is executed during the photo-taking 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 photo-taking process, thereby reducing the processor load and running memory occupancy rate of the photo-taking process.

[0131] The first stage of algorithm post-processing is performed during the photo-taking process, during which the camera application is usually in the foreground. After the first stage of algorithm post-processing is completed, the user triggers or the system automatically triggers the second stage of algorithm post-processing to obtain an image after the algorithm post-processing.

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

[0133] For example, see Fig. 7A A schematic diagram of viewing an image is shown, based on Figure 1 In the photo shooting scene shown in the figure, the mobile phone 11 responds to the user's click operation on the photo shooting control 113 by executing the above Fig. 6A The process shown in the figure obtains an 80-point image and a thumbnail, which can be Fig. 7A When the user clicks on the thumbnail 114, the mobile phone 11 considers that the user's operation of viewing the image is detected, and triggers the second-stage algorithm post-processing process, and displays the interface 115, on which the picture 116 is displayed. The picture 116 can be an 80-point picture or a 100-point picture (i.e., the image obtained by the second-stage algorithm processing).

[0134] 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 on the thumbnail 114, the mobile phone 11 may not be able to obtain the 100-point image in time, that is, it is not possible to 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.

[0135] Of course, in other embodiments, after the user clicks on the thumbnail 114, the mobile phone 11 does not immediately display the 80-point image on the interface 115, but waits until the second-stage algorithm post-processing is completed before displaying the 100-point image on the interface 115. In this case, after the user clicks on the thumbnail 114, it may take a certain amount of time before the image 116 can be seen. At this time, the image 116 is a 100-point image.

[0136] exist Fig. 7A In the scenario shown, when the user clicks on the thumbnail 114, the mobile phone 11 will exit the photo-taking process and enter the image preview state. In the image preview state, there is no need to perform the preview video stream processing and other processes, so when executing the second stage algorithm post-processing process, the preview video stream processing and other processes are not performed at the same time, thereby reducing the processor load and memory usage.

[0137] Also illustratively, see Figure 7B Another schematic diagram of viewing an image is shown, based on Figure 1 In the photo shooting scene shown in FIG. 1 , the user performs a photo shooting operation by clicking the photo shooting control 113, and then exits the camera application 111. In this process, the mobile phone 11 responds to the user's click operation on the photo shooting control 113 by executing the above Fig. 6A In the process shown, an 80-point image and a thumbnail are obtained, that is, the post-processing of the first-stage algorithm is performed, and the result of the post-processing of the first-stage algorithm is obtained.

[0138] After the user exits the camera application 111, he clicks on the gallery 117 to enter the gallery to 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 to display the interface 128. It can be understood that the 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.

[0139] At this time, when the mobile phone 11 detects a click operation on the image 125, it is considered that the user's operation of viewing the image is detected, and the second-stage algorithm post-processing corresponding to the image 125 is triggered. Similarly, after the user clicks on the image 125, the mobile phone 11 can immediately display the 80-point image of the image 125 on the interface 128, and after the second-stage algorithm post-processing is completed, the 80-point image on the interface 128 is refreshed to a 100-point image. Of course, the mobile phone 11 may 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.

[0140] exist Figure 7B In the scenario, when the mobile phone 11 detects that the user exits the camera application, or detects that the user clicks on the gallery 117 (i.e., opens the image access application), the second stage algorithm post-processing can also be triggered.

[0141] exist Fig. 7A and Figure 7B In the scenario, when the user clicks on the thumbnail 114 or the picture 125, the mobile phone 11 can prioritize the scheduling and triggering of the corresponding task, so as to timely execute the second-stage algorithm post-processing of the thumbnail 114 or the picture 125, and obtain the image after the algorithm post-processing in time. That is to say, the segmented photography solution of the embodiment of the present application can prioritize the second-stage algorithm post-processing of the specified picture according to the actual business needs. Figure 8 The relevant process of the second-stage algorithm post-processing that preferentially triggers the specified image is introduced and explained.

[0142] See also Figure 8 The schematic block diagram of the process of triggering the second stage algorithm post-processing on demand is shown, and the process may include the following steps:

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

[0144] For example, in Figure 7B In the scenario shown, when the user clicks on picture 125, the mobile phone 11 considers that a viewing operation for the target picture is detected, and the target picture is picture 125. At this time, the gallery application reads the 80-point picture of picture 125 from the file system according to the relevant information of picture 125, and immediately displays the 80-point picture of picture 125 on the interface 128. In addition, the gallery application also synchronously requests the 100-point picture from the media library according to the relevant information of picture 125.

[0145] It is understandable that the media library records relevant information about the target image. Fig. 6AIn the first phase of the algorithm post-processing shown, the camera application inserts 80-point image records and segment metadata into the media library.

[0146] Step S802: The media library responds to the 100-point image request of 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.

[0147] It is understandable that the 100-point image request of the gallery application carries relevant information of the 80-point image. The media library can find the segmented metadata corresponding to the 80-point image based on the relevant information of the 80-point image, and then trigger the delayed photo sub-service to perform the second-stage algorithm post-processing task corresponding to the 80-point image based on the segmented metadata. For example, the segmented metadata includes a task ID, and the media library triggers the delayed photo sub-service to perform the task corresponding to the task ID based on the task ID.

[0148] Step S803: The delayed photography sub-service triggers the post-processing service to preferentially execute the second-stage algorithm post-processing task of the target image based on the trigger of the media library.

[0149] 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 displayed immediately.

[0150] For example, suppose in Figure 7B In the scenario, during the photo-taking process, the user continuously 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 pictures of each picture, and constructs the second-stage algorithm post-processing task for each picture. At this time, the task queue contains the second-stage algorithm post-processing tasks of pictures 122, 123, 124, 125, and 126. Assuming that the order of picture shooting at this time is: picture 122, picture 123, picture 124, picture 125, picture 126, the execution order of the second-stage algorithm post-processing tasks of each picture in the task queue is: picture 122, picture 123, picture 124, picture 125, picture 126.

[0151] After the user exits the camera application, the mobile phone 11 detects that the system is in an idle state at a certain time, or detects that the user opens the gallery application 117, and then automatically triggers the execution of each task in the task queue. Usually, each task in the task queue is executed cyclically in the order of first-in-first-out, that is, the task of the second-stage algorithm post-processing of the picture 122 is executed first, and the task of the second-stage algorithm post-processing of the picture 126 is executed last.

[0152] When mobile phone 11 completes the second-stage algorithm post-processing task for picture 123, it detects a user click on picture 125, i.e., the user needs to browse picture 125 in large size at the current moment. Therefore, it prioritizes triggering the second-stage algorithm post-processing task for picture 125, rather than triggering the second-stage algorithm processing task for picture 124 in sequence.

[0153] 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.

[0154] 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.

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

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

[0157] After the post-processing service obtains the 100-point image, the time-lapse photography sub-service first queries the file record of the 80-point image recorded in the media library, and replaces the 80-point image in the file system with the 100-point image based on the file record of the 80-point image, and updates the file record of the 100-point image to the media library. In this way, the media library records the file record of the 100-point image, and based on the file record of the 100-point image, the gallery application can read the 100-point image of the target image from the file system.

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

[0159] Step S808: The gallery application reads the 100-point image of the target image from the file system, and refreshes the 80-point image to the 100-point image.

[0160] It should be pointed out that when a user needs to access a specified image, the 80-point image is displayed immediately first, and then the second-stage algorithm post-processing of the specified image is triggered first according to the user's needs. After the second-stage algorithm post-processing is completed, the 80-point image is refreshed to a 100-point image. In this way, the segmented photography solution can improve the photography performance while still meeting the user's needs to view images in real time, ensuring the user experience.

[0161] Understandably, Fig. 7A The scenario also meets the on-demand access scenario, that is, when the user clicks on the thumbnail 114, the mobile phone 11 can also give priority to scheduling the task of triggering the second-stage algorithm post-processing corresponding to the thumbnail 114, and instantly display the 80-point picture. After obtaining the result of the second-stage algorithm post-processing, the 80-point picture is refreshed to a 100-point picture.

[0162] 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.

[0163] For example, the system status data includes the system's processor load, device temperature, and running memory, etc. When it is detected that the user exits the camera application and at least one of the following is met: the processor load is lower than a preset load threshold, the device temperature is lower than a preset temperature threshold, and the running memory is higher than a preset value, the execution of the second-stage algorithm post-processing is automatically triggered, and each second-stage algorithm post-processing task in the task queue is executed cyclically.

[0164] 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.

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

[0166] At this time, the segmented photography system may include a system perception module and a state control module. The system perception module may be used to monitor the conditions of the gallery, camera, AMS, battery power consumption, and system resources, and determine the current state of the system based on the monitored data. The state control module may execute the corresponding scheduling strategy based on the current state of the system to implement different resource supply strategies in different states.

[0167] For example, see Fig. 9 The system shown automatically triggers the second stage algorithm post-processing process, which may include the following steps:

[0168] Step S901: The delayed-photographing sub-service registers system status monitoring with iAware.

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

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

[0171] The system status notification includes system status data perceived by iAware. For example, the system status data perceived by iAware includes: the temperature of the device and the central processing unit (CPU) load.

[0172] Step S903: The delayed-photographing sub-service determines a scheduling strategy according to the system status data.

[0173] It is understandable that the system status data may include not only the data perceived by iAware, but also the system status data perceived by other system perception modules. Fig.10 The schematic diagram of the scheduling strategy for the second-stage algorithm post-processing is shown. The system status data perceived by the system may also include whether the gallery, camera, and AMS are running in the foreground, as well as screen on / off data.

[0174] The time-delay photography sub-server can 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.

[0175] Exemplarily, the system state includes a high performance mode, a balanced mode, a low power consumption mode and an emergency mode. The corresponding relationship between the system state and the resource supply strategy (ie, the scheduling strategy) may be shown in Table 1 and Table 2 below.

[0176] Table 1

[0177]

[0178] Table 2

[0179]

[0180] 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-image browsing or picture 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 tailed in the background, and each task can be executed using the resource supply strategy corresponding to the balanced mode. 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., 80-point image) is used for display. For example, if the RAW data is lost or the gallery access times out, the 80-point image is displayed directly without executing the second-stage algorithm post-processing.

[0181] 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 for the purpose of saving power is adopted to execute the second-stage algorithm post-processing of the image.

[0182] 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.

[0183] like Fig.10 As shown in the figure, high-performance mode, low-power mode and balanced mode can be switched to each other. For example, according to the system status data perceived by the current system, determine to use the resource supply strategy corresponding to the high-performance mode to execute the task; during the high-performance execution process, if an abnormality occurs, it can be switched from the high-performance mode to the 80-point emergency mode, and of course, it can also be switched to the balanced mode and low-power mode.

[0184] Step S904, the time-lapse photography sub-service processes the tasks in the task queue in a loop according to the scheduling strategy. After determining the scheduling strategy, each task in the task queue is processed using the scheduling strategy. For example, when it is determined that the scheduling strategy is the resource supply strategy corresponding to the high-performance mode, when executing the tasks processed by the second-stage algorithm, the CPU is in a state of locking the medium and large cores + boost + background protection, the NPU has a high priority, and the GPU has a medium priority.

[0185] like Fig. 9As shown, for each task in the task queue, the following process is executed: the time-lapse photography sub-service triggers the post-processing service to perform the second-stage algorithm post-processing through scheduling tasks to obtain a 100-point image; after the post-processing service obtains the 100-point image, it first queries the file record of the 80-point image recorded in the media library, and replaces the 80-point image in the file system with the 100-point image based on the file record of the 80-point image, and updates the file record of the 100-point image to the media library. In this process, resources are supplied according to the determined scheduling strategy.

[0186] As described above, the system can automatically trigger the execution of the second-stage algorithm post-processing based on the perceived system status. For example, when it is detected that the user clicks on the gallery or exits the camera application, when it is detected that the system is in an idle state, or when it is detected that the user exits the camera application and at least one of the CPU load, running memory, and device temperature meets the predetermined conditions, the execution of the second-stage algorithm post-processing is triggered.

[0187] Furthermore, after determining that the execution of the second-stage algorithm post-processing is triggered, the system can further determine the scheduling strategy based on the system status data, and execute the second-stage algorithm post-processing tasks according to the determined scheduling strategy. Of course, it is also possible not to further determine the scheduling strategy based on the system status data, but to pre-set a resource supply strategy, and when the execution of the second-stage algorithm post-processing is triggered, the pre-set resource supply strategy is used for execution.

[0188] 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.

[0189] It is worth pointing out 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.

[0190] The segmented photo-taking solution provided in the embodiment of the present application can reduce the processor load and running memory occupancy rate during the photo-taking process, improve the photo-taking performance, and enhance the user's photo-taking experience.

[0191] Specifically, if single-stage photography is used, the operating memory will continue to increase with the number of photos taken, until the system memory is exhausted or reaches the upper limit of the prescribed usage, and the system slows down. If segmented photography is used, since the images in RAM are transferred to ROM, the system's operating memory will not be exhausted as the number of photos continues to increase, which can effectively alleviate the operating memory pressure and effectively improve the photography performance. In other words, the segmented photography solution can effectively alleviate the problem of excessive memory usage during the operation of photography, thereby alleviating problems such as device freezes.

[0192] Segmented photography can effectively alleviate memory pressure, so that the system will not lag after using the camera; when the running memory is low, there will be no lag when taking pictures with the camera application, which effectively alleviates the device lag problem.

[0193] Normally, when using a camera to take photos continuously, the device temperature will generate a lot of heat due to calculations, causing the device temperature to continue to rise. Segmented photography can effectively control the amount of calculations and extend the calculation time, thereby making the device temperature rise more slowly and the maximum temperature lower. In other words, the segmented photography solution can effectively alleviate the problem of device heating, reduce the amount of calculations during the photography process, and reduce the processor load during the photography process.

[0194] 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.

[0195] Among them, in the single-stage photography solution, all post-processing algorithms are executed during the photography process. The running time of the post-processing algorithms is concentrated, and the amount of calculation in the photography process is large, which causes the processor to be in a high-load state for a long time, which is prone to device overheating. In the case of device overheating, the single-stage photography solution usually uses the thermal escape function and abandons the post-processing algorithm, directly using a single frame image or simple algorithm processing, which will make the quality and effect of the pictures obtained by the single-stage photography solution poor.

[0196] The segmented photography solution of the embodiment of the present application only executes part of the post-processing algorithm during the photography process, which reduces the amount of calculation in the photography process, and executes the first-stage algorithm post-processing and the second-stage algorithm post-processing in different time periods, so that the processor will not be in a high-load state for a long time, alleviating the problem of overheating of the device. In addition, when the device is overheated, the segmented photography solution executes segmented algorithm post-processing on the image data, and does not abandon the post-processing algorithm, so the quality and effect of the obtained picture are better.

[0197] 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 the electronic device is not limited here.

[0198] For example, see Fig.11 The electronic device 100 is shown as a structural diagram, and the 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, etc. The sensor module 130 may include but is not limited to: a temperature sensor 131 and a touch sensor 132.

[0199] It is to be 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 may 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 also 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 interface, 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.

[0200] 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), etc. Different processing units may be independent devices or integrated into one or more processors.

[0201] 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.

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

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

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

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

[0206] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic 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 in the above embodiments, or a combination of multiple interface connection methods.

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

[0208] 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), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 150, where N is a positive integer greater than 1.

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

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

[0211] 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 optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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.

[0212] The digital signal processor is used to process the digital image signal.

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

[0214] The memory 120 can be used to store computer executable program codes, which include 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.

[0215] In the segmented photography scheme of the embodiment of the present application, the image data output by the ISP can be stored in the RAM first, and when entering the segmented photography architecture, the image data is cut from the RAM to the ROM. In addition, the intermediate results of the post-processing algorithm are stored in the ROM instead of the RAM, which can reduce the memory resource consumption in the algorithm post-processing stage, further alleviate the problems of freezing and heating, and improve the photography performance. In particular, for scenes where the running memory increases rapidly, such as fast continuous shooting, the intermediate results of the algorithm post-processing stage are stored in the ROM, which can effectively alleviate the problem of rapid growth of the running memory.

[0216] 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 execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 131 exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 131 to reduce power consumption and implement thermal protection.

[0217] The touch sensor 132 is also called a "touch control device". The touch sensor 132 can be set on the display screen 150. The touch sensor 132 and the display screen 150 form a touch screen, also called a "touch control screen". The touch sensor 132 is used to detect a touch operation acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 150.

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

[0219] See also Fig.12 A schematic flowchart of a photograph processing method is shown, and the photograph processing method may include the following steps:

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

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

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

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

[0224] For example, see Figure 2A In the photo-taking scene shown, when the mobile phone 11 detects that the user clicks the camera application 111, the camera application is started. When the camera application is in the foreground, the user clicks the photo-taking control 113 to input a photo-taking operation. In response to the photo-taking operation, the mobile phone 11 collects image data.

[0225] The above-mentioned image data to be processed may refer to image data output by the ISP. For example, the image data to be processed is Raw image data. In addition to the image data to be processed, the image acquisition process may also obtain data such as auxiliary device information and photographing metadata.

[0226] 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.

[0227] In some embodiments, before performing the first stage algorithm post-processing, the electronic device 100 may first determine whether the conditions for entering segmented photo taking are met. If so, the segmented photo taking is entered and the first stage algorithm post-processing is performed on the image data to be processed. If not, the segmented photo taking is not entered. In this case, all post-processing algorithms can be executed continuously and uninterruptedly during the photo taking process to process the image data to be processed in real time.

[0228] Furthermore, the conditions for entering the segmented photography may include 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. The third threshold, the second temperature threshold, and the preset time threshold can all be set according to actual needs. Actively entering the segmented photography architecture when the system is in poor condition can not only alleviate problems such as device freezes and heating, but also ensure the real-time nature of photography as much as possible. When the system is in good condition, algorithm post-processing can be performed in real time to meet the real-time nature of photography.

[0229] For example, when a user takes multiple images in succession, the data in the RAM buff increases, that is, the remaining capacity of the running memory is lower than the third threshold. If you do not enter the segmented photography architecture at this time, problems such as photography freezes or unresponsiveness may occur. In order to alleviate the freeze problem caused by a large amount of memory occupied, you can enter the segmented photography to transfer the image data in the RAM buff to the ROM flash to relieve memory pressure.

[0230] For example, the current mobile phone is seriously heated, that is, the device temperature is higher than the second temperature threshold, and the system has started the temperature control strategy to limit the use of the CPU. At this time, in order to improve the photo performance, you can enter the segmented photo.

[0231] For another 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 photography requirements, you can enter segmented photography to relieve system pressure.

[0232] 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, the intermediate data of the 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 jamming. 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.

[0233] 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 stage algorithm post-processing then reads the results of the first stage algorithm post-processing from the ROM to execute subsequent post-processing algorithms. In this case, the data in the RAM buff does not need to be transferred to the ROM, but the first stage algorithm post-processing is first 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.

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

[0235] When the camera application is running in the foreground, it can be considered to be in the process of taking pictures. Different from the continuous and uninterrupted execution of all post-processing algorithms during the process of taking pictures, the embodiment of the present application only executes part of the post-processing algorithms during the process of taking pictures, 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 photographing solution during the photographing process is less than that of the single-segment photographing solution during the photographing process, that is, the segmented photographing solution can reduce the computational amount during the photographing process, thereby reducing the processor load and running memory usage during the photographing process, and alleviating problems such as device jamming and device heating; in addition, it can also reduce the time that the processor is in a high-load state during the photographing process, thereby alleviating the problem of device heating.

[0236] After executing the first stage algorithm post-processing, the electronic device 100 can save the first image data to the file system, generate a task ID for the remaining stage algorithm post-processing, and construct a task for the remaining stage algorithm post-processing according to the task ID. The task for executing the remaining stage algorithm post-processing is triggered at a suitable time in the future to execute the remaining stage algorithm post-processing.

[0237] Step S1204: If the electronic device 100 detects a target operation, or a camera application is running in the background or is closed, the remaining stage algorithm post-processing is performed on the first image data 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.

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

[0239] For example, see Fig. 7A In the scenario shown in FIG. 1 , the target operation is the operation of the user clicking on the thumbnail 114. Figure 7B In the scenario shown, the target operation is the user clicking on the picture 125 .

[0240] It should be noted that when the camera application is in the foreground, if the user needs to view the picture, the second-stage algorithm post-processing of the specified picture can be triggered in time to obtain the image data completed by the algorithm post-processing in time. At this time, after the second-stage algorithm post-processing of the specified picture is triggered, the second-stage algorithm post-processing task of other pictures is currently being executed, and the second-stage algorithm post-processing task of the specified picture can be scheduled to execute first.

[0241] 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. At this time, 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.

[0242] It is worth pointing out 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 perform processes such as preview video stream processing. 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 occupancy of the photo-taking process, and improve the photo-taking performance and photo-taking experience.

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

[0244] In some embodiments, the electronic device 100 can directly trigger the remaining stage 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 stage algorithm post-processing is directly triggered, the pressure on the system processor and memory may be increased.

[0245] In other embodiments, when the camera application is running in the background or closed, it is further determined whether a preset trigger condition is met. If the preset trigger condition is met, 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 can also trigger the remaining stage algorithm post-processing after detecting the user's operation of exiting the camera application.

[0246] Exemplarily, 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, turning off or stopping the screen, an operation of sharing an image, an operation of editing an image, the system being in an 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. The first threshold, the first temperature threshold, and the second threshold can all be set according to actual needs and are not limited here.

[0247] 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.

[0248] The operation of opening an image access application may be, for example, an operation of a user clicking on a gallery application. The operation of viewing an image may be, for example, an operation of clicking on an image in an image application. It should be noted that the operation of viewing an image, the operation of editing an image, and the operation of sharing an image may be an operation initiated by a user, such as an operation of a user clicking on an image or a user sharing an image, etc.; or an operation initiated by an application, such as an operation of a third-party instant messaging application actively viewing an image or sharing an image, etc.

[0249] The operations of viewing images, editing images, and sharing images may be for the first image data, for the image data to be processed, or not for 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 it is not for the first image data or the image data to be processed, the task of post-processing of the remaining stage algorithm corresponding to the first image data may be triggered and scheduled to be executed first; if it is not for the first image data or the image data to be processed, it may be processed in the first-in-first-out order of the task queue. When the task of post-processing of the remaining stage algorithm corresponding to the first image data is processed, the first image data may be post-processed with the remaining stage algorithm.

[0250] 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 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 preferentially.

[0251] 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 a state of executing each task in the task queue sequentially or in a state of not triggering task processing of the entire task queue.

[0252] The remaining stage algorithm post-processing may include at least one stage algorithm post-processing process. For example, the remaining stage algorithm post-processing may be the second stage algorithm post-processing, that is, there is only one stage; or, the remaining stage algorithm post-processing may include the second stage algorithm post-processing and the third stage algorithm post-processing, that is, there are two stages. Each stage algorithm post-processing in the remaining stage algorithm post-processing may be triggered to execute by a certain trigger condition. The triggering conditions of each stage algorithm post-processing may refer to the predetermined triggering conditions and other related contents mentioned above, and are not limited here.

[0253] When executing the remaining stage algorithm post-processing, the algorithm post-processing process of each stage can be executed on the terminal side or on the cloud side. For example, the remaining stage algorithm post-processing process includes the second stage algorithm post-processing and the third stage algorithm post-processing. The second stage algorithm post-processing process is executed on the terminal side, the result of the second stage algorithm post-processing is obtained, and the result and related data of the second stage algorithm post-processing are sent to the cloud side. The cloud side executes the third stage algorithm post-processing and returns the result of the third stage algorithm post-processing to the terminal side.

[0254] 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 then triggers the execution of the second stage algorithm post-processing; but when the execution is halfway through, it detects that the processor load and memory occupancy rate 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 the system is detected to be idle, the remaining process of the second stage algorithm post-processing can continue to be executed according to the recorded intermediate results.

[0255] 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 stage algorithm post-processing. The purpose of "slowly" executing and triggering is to reduce the device function as much as possible. For example, the remaining stage algorithm post-processing can be triggered when the system is completely idle or the screen is off.

[0256] 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, the remaining stage algorithm post-processing is 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 time; 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.

[0257] After triggering the remaining stage algorithm post-processing, the remaining stage algorithm post-processing tasks 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 remaining stage algorithm post-processing tasks 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, the target task in the task queue is executed 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, 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. By monitoring the system status data and scheduling the execution of the remaining stage algorithm post-processing tasks according to the system status data, problems such as device freezing and device heating can be further alleviated.

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

[0259] 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 suitable time later, which 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.

[0260] In some embodiments, before obtaining the second image data, the electronic device 100 detects a viewing operation for the first image data, and in response to the viewing operation, displays the first target image, which is the image corresponding to the first image data. After obtaining the second image data, the electronic device 100 refreshes the first target image to the second target image, which is the image corresponding to the second image data.

[0261] That is to say, when a user needs to view a certain picture, the output image of the first-stage algorithm post-processing can be displayed immediately, and the remaining stage algorithm post-processing can be triggered in real time. After the remaining stage 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. In this way, the computing resources and memory resources occupied during the photo-taking process are reduced, thereby alleviating problems such as device freezes and device heating, while ensuring that users can view pictures in real time.

[0262] For example, see Fig. 7A or Figure 7B In the scenario shown, when the user clicks on the thumbnail 114 or clicks on the picture 125, the mobile phone 11 can first instantly display the 80-point image (i.e., the first target image), and after obtaining the 100-point image (i.e., the second target image), refresh the 80-point image to the 100-point image.

[0263] See also Fig.13 The electronic device shown is a schematic block diagram of the structure of the electronic device, which may include an image acquisition module 1301 and an algorithm post-processing module 1302.

[0264] The image acquisition module 1301 is used to obtain image data to be processed in response to a photographing operation.

[0265] 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 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 image data for which the algorithm post-processing has been completed, and the target operation is used to view, edit or share the image.

[0266] In some possible implementations, 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.

[0267] 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.

[0268] In some possible implementations, 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 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.

[0269] In some possible implementations, the algorithm post-processing module 1302 includes a system state perception submodule 1303 and a scheduling submodule 1304 .

[0270] Among them, the system status perception submodule 1303 is used to monitor system status data.

[0271] The scheduling submodule 1304 is used to determine a scheduling strategy according to 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;

[0272] 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.

[0273] 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; in response to the viewing operation, display a first target image, the first target image being an image corresponding to the first image data; 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.

[0274] 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 be processed, obtain the first image data, and store the first image data to the non-volatile storage medium.

[0275] In some possible implementations, the electronic device also includes a segmented photography 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 photography are met.

[0276] 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.

[0277] The above-mentioned electronic device has the function of implementing the above-mentioned photo processing method, which 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 function, and the module can be software and / or hardware.

[0278] 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 method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0279] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be 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 in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in 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, which will not be repeated here.

[0280] If the integrated unit is implemented in the form of 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 processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code 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 that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0281] It will be appreciated by those skilled in the art that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in 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. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be 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 schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0282] 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 photographing 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 photographing processing method can be implemented. The embodiment of the present application provides a computer program product, which enables the electronic device to implement the steps in the above-mentioned embodiments of the photographing processing method when the computer program product is executed on the electronic device. The embodiment of the present application also provides a chip system, which includes a processor, the processor is coupled to the memory, and the processor executes the computer program stored in the memory to implement the methods as in the above-mentioned embodiments of the photographing processing method. The chip system can be a single chip, or a chip module composed of multiple chips.

[0283] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described or recorded in detail in a certain embodiment, please refer to the relevant description of other embodiments. It should be understood that the size of the sequence number of each step in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. In addition, in the description of the present application specification and the attached claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance. The reference to "one embodiment" or "some embodiments" described in the present application specification means that one or more embodiments of the present application include specific features, structures or characteristics described in combination with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. Finally, it should be noted that the above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be covered within the scope of protection of the present application. Therefore, the protection scope of the present 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 device

    CN110062161A

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

    CN111491101A

  • Shooting method and device and electronic equipment

    CN113873161A

Cited By

  • Image processing method, electronic device, chip system and storage medium

    WO2026065518A1