Image Processing Method, Electronic Device, and Computer-Readable Storage Medium

By monitoring and compressing the data amount of cached images in real time, the shooting failure caused by full load of cache areas during continuous shooting is solved, and the user's continuous shooting experience and image processing efficiency are improved.

CN118450240BActive Publication Date: 2025-08-01HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311237561.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-21
Publication Date
2025-08-01
Estimated Expiration
2043-09-21

AI Technical Summary

Technical Problem

During the continuous shooting process, when the intermediate images in the cache area accumulate to a certain level, it affects the post-processing efficiency and the success rate of image production, resulting in the camera application being unable to respond to the user's continuous shooting operation, and the user is unable to continue shooting, which affects the continuous shooting experience.

Method used

By monitoring the data amount of cached images in real time, when the preset threshold is reached or exceeded, the terminal device compresses the cached images to free up memory space, avoiding the situation of being unable to shoot, and improving the continuous shooting experience.

Benefits of technology

Effectively reduce the amount of data stored in memory, avoiding the situation where you can't shoot during continuous shooting, and improving the user's continuous shooting experience and image processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118450240B_ABST
    Figure CN118450240B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing technology, and provides an image processing method, an electronic device, and a computer-readable storage medium. The method includes: displaying a shooting interface of a camera application; receiving a target shooting operation performed by a user on the shooting interface; in response to the target shooting operation, obtaining the data amounts of a plurality of cached images generated by the camera application, the plurality of cached images being images exposed by an image signal processor (ISP) in response to multiple shooting operations, and the target shooting operation being the last shooting operation among the multiple shooting operations; if the data amounts of the plurality of cached images are greater than or equal to a preset threshold, compressing the plurality of cached images to obtain a plurality of compressed images, the data amounts of the plurality of compressed images being smaller than the data amounts of the plurality of cached images. The above method can improve the continuous shooting experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Generally, when users encounter an interesting scene, they often use the camera application of the terminal device they carry with them to take continuous shots to record. For example, when users watch a game or a performance, they can continuously click the shooting control in the shooting interface to continuously capture multiple images.

[0003] During the continuous shooting process, every time the user clicks the shooting control, the data sensed by the terminal device through the camera is input to the ISP for an exposure to generate an image. Among them, the image obtained by the ISP exposure is an intermediate image, and complex post-processing is required to be able to be normally displayed in the photo library. Then, during the continuous shooting process, if the user continuously clicks the shooting control, the ISP will correspondingly continuously generate multiple intermediate images. When the number of intermediate images is relatively large, they need to be stored in a buffer area (such as a high-speed random access memory) and queued for post-processing.

[0004] When the intermediate images in the buffer area accumulate to a certain extent, the camera application believes that if intermediate images continue to accumulate in the buffer area, it will affect the efficiency of post-processing and the success rate of image generation. At this time, when the user continues to click the shooting control, the camera application will no longer respond to the user's continuous shooting operation, that is, the situation of being unable to shoot occurs. The user cannot continue to shoot, and the continuous shooting experience is affected. Summary of the Invention

[0005] This application provides an image processing method, device, chip, electronic device, computer-readable storage medium, and computer program product, which can improve the user's continuous shooting experience.

[0006] In a first aspect, an image processing method is provided, including: displaying a shooting interface of a camera application; receiving a target shooting operation performed by a user on the shooting interface; in response to the target shooting operation, obtaining the data volume of a plurality of cached images generated by the camera application, the plurality of cached images being images exposed by an image signal processor (ISP) in response to multiple shooting operations, and the target shooting operation being the last shooting operation among the multiple shooting operations; if the data volume of the plurality of cached images is greater than or equal to a preset threshold, compressing the plurality of cached images to obtain a plurality of compressed images, the data volume of the plurality of compressed images being smaller than the data volume of the plurality of cached images. If the data volume of the plurality of cached images is less than the preset threshold, there is no need to compress the cached images.

[0007] When a user takes a picture using a terminal device, the camera application is usually opened for shooting. At this time, the camera application displays a shooting interface. The shooting interface includes an image preview frame located in the lower left corner, which is used to display the thumbnail of the successfully captured image; the main window of the shooting interface is used to display the preview screen that the camera can capture. The shooting interface may also include various function controls, such as a flash switch control, a focal length adjustment control, a shooting mode switching control, and a setting control, etc., which will not be listed one by one here.

[0008] When the user needs to take a picture, they can click on the shooting control on the shooting interface in the photo-taking mode to complete a shooting operation and take a picture. The operation of clicking on the shooting control can be recorded as a shooting operation. During continuous shooting, the user will continuously click on the shooting control. The terminal device can respond to each shooting operation performed by the user and count the data volume of the cached images generated by the camera application in the current state. Here, the terminal device needs to count not only the cached images generated by the current shooting operation, but also the cached images that were triggered and generated by the shooting operations before the current target shooting operation and are waiting for post-processing in the cache area, that is, the cached images waiting for post-processing in the cache queue. The terminal device can count the size of the data volume of these cached images.

[0009] If the data volume of multiple cached images in the cache queue is greater than or equal to a preset threshold, it means that there are too many cached images, which may affect the image output and cause the situation of being unable to shoot. Therefore, the terminal device can compress the cached images to generate compressed images with a small data volume, thereby releasing some space in the cache area to facilitate subsequent shooting and prevent the situation of being unable to shoot.

[0010] If the data volume of multiple cached images in the cache queue is less than the preset threshold, it means that there are not many cached images, which will not affect the image output and will not cause the situation of being unable to shoot. Therefore, the terminal device does not need to compress the cached images and can directly add the cached images to the cache queue to wait for post-processing.

[0011] In the above method, the terminal device can, during the user's shooting process, in response to the user's shooting operation, obtain the data volume of multiple cached images in the memory in real time. When the data volume of the cached images is greater than or equal to the preset threshold, the terminal device compresses the cached images, thereby releasing some memory space and being able to store more cached images. This method effectively reduces the amount of data stored in the memory, avoids the situation of being unable to shoot during continuous shooting, and improves the user's continuous shooting experience.

[0012] Optionally, in response to the target shooting operation, display the first thumbnail of the picture taken by the target shooting operation.

[0013] If the data volume of multiple cached images in the cache queue is greater than or equal to a preset threshold, when the cached images are compressed, the space in the cache area is released to a certain extent, and the situation of being unable to take pictures will not occur. The camera application can respond to the user's target shooting operation and normally shoot images. Optionally, while normally shooting images, a first thumbnail of the currently shot image is also displayed in the image preview frame of the shooting interface to indicate successful shooting.

[0014] If the data volume of multiple cached images in the cache queue is less than the preset threshold, then the terminal device can normally respond to the user's shooting operation, successfully shoot images, and can also display a first thumbnail of the currently shot image in the image preview area of the shooting interface to indicate successful shooting.

[0015] Optionally, the data volume of the cached images represents the number of cached images, and the preset threshold is M times a natural number greater than or equal to three and less than or equal to five, where M is the number of cached images generated by a single shooting operation, and M is a positive integer.

[0016] Generally, the number of cached images is related to the number of shooting times and the number of cached images generated by a single shooting. For example, when the user clicks the shooting control once, multiple cached images may be cached, and these multiple cached images are fused to generate the final image. It should be noted that the higher the resolution of the generated image, the more cached images are cached per shooting, and the more cache space is occupied; the lower the resolution of the generated image, the fewer cached images are cached per shooting, and the less cache space is occupied. When the resolution is determined, the number of cached images cached per shooting is a fixed value. Taking caching five cached images per shooting as an example, when the user shoots continuously three times, the number of cached images is 15. If these 15 cached images cause too high memory occupancy, compression is required. At this time, the preset threshold can be set to 15, indicating that continuous shooting three times by the user will cause too high memory occupancy. When the number of cached images in the cache queue is greater than or equal to the preset threshold, for example, the number of cached images in the cache queue is greater than or equal to M times three, where M is the number of cached images generated by a single shooting operation, and M is a positive integer, it can be determined that the number of 3M cached images generated by three shootings is greater than or equal to the preset threshold, that is, the data volume of the cached images is greater than or equal to the preset threshold. If the number of cached images in the cache queue is less than the preset threshold, for example, less than 3M, it can be determined that the data volume of multiple cached images is less than the preset threshold.

[0017] Optionally, the data volume of the cached images represents the proportion of the memory occupied by the cached images, and the preset threshold is a value greater than or equal to 20% and less than or equal to 30%.

[0018] Optionally, the method for determining the data volume of the cached image can also be based on the size of the memory occupied by the cached image. Then the preset threshold can be a quantity threshold in megabytes (MB) or gigabytes (GB). Generally, the size of the preset threshold is related to the total memory capacity of the terminal device. If the memory is large, the preset threshold can be relatively large; if the memory is small, the preset threshold can be relatively small. Different memory sizes correspond to their respective memory waterlines. The memory waterline is usually used to describe the size of the free area to ensure the high-speed operation state of the memory. Taking 8GB of memory as an example, the memory waterline is usually 2.8GB. That is to say, for 8GB of memory, if the memory occupancy exceeds 2.8GB, the processing efficiency will be affected. On this basis, the preset threshold can be set to a value less than the memory waterline to ensure a certain margin. For example, when the total memory capacity is 8GB, the preset threshold can be 2.4GB. [[ID=~1]] [[ID=~2]]

[0019] Optionally, for different memory sizes, the preset threshold can also be in the form of a percentage. For example, it is a positive number greater than or equal to 20% and less than or equal to 30%. This numerical range can ensure that the memory occupancy rate will not be too high and the operation will be smooth. Taking the memory size of 16GB and the preset threshold of 30% as an example, 30% of 16GB is 4.8GB. Then the preset threshold is 4.8GB. If the data volume of the cached image reaches or exceeds 4.8GB, the cached image waiting for post-processing in the cache queue can be compressed to save memory space. [[ID=~4]] [[ID=~5]]

[0020] It should be noted that if the preset threshold is too large, the number of cached images in the cache queue will be relatively large, so too much memory will be occupied, thus affecting the data processing efficiency. If the preset threshold is too small, it may be very easy to reach the compression condition, and the number and frequency of cached images that need to be compressed will increase accordingly. In the case of relatively idle memory, it will instead increase the extra data processing process due to frequent compression operations, resulting in a waste of resources. When determining whether to compress the cached image based on the number of cached images, a natural number such as three, four, or five is used as the preset threshold; or when determining whether to compress the cached image based on the size of the memory occupied by the cached image, a memory occupancy ratio greater than or equal to 20% and less than or equal to 30% is used as the preset threshold, both of which can reasonably balance the data processing efficiency and resource utilization rate. [[ID=~7]] [[ID=~8]]

[0021] Optionally, before compressing multiple cached images, the multiple cached images are arranged in the cache queue in order from the earliest generation time to the latest. Compressing multiple cached images includes: compressing partial images of the cached image, where the partial images are the i-th to the N-th images in the cache queue, the number of multiple cached images is N, and i is a natural number less than N and greater than 1. Optionally, i is 2. [[ID=~10]] [[ID=~11]]

[0022] When the terminal device compresses the cached images, it can compress the latter part of the cached images that have not been post-processed in the cache queue. Assume that there are N cached images stored in the memory, and these N cached images are arranged in the cache queue in the order of generation time from front to back. The terminal device can then compress the cached images starting from the i-th cached image to the last (i.e., the N-th) cached image in the cache queue to obtain compressed images. Here, i is a natural number less than N. For example, when N is 30, i can be 10. In this method, it is not necessary to compress all the cached images that have not been post-processed, but only compress some cached images with a longer queuing time, which can ensure that the number and frequency of compressed cached images are reduced while still supporting continuous shooting. Since the data processing flow for compression is reduced, resources are saved.

[0023] When the terminal device compresses the cached images, it can also compress all the cached images that have not been post-processed in the cache queue. That is, except for the first cached image that is being post-processed or about to enter post-processing, all the cached images from the second cached image to the last cached image are compressed, that is, i is equal to 2. This method can compress all the cached images that do not need to be post-processed temporarily, saving the memory space to the greatest extent, so as to support more continuous shooting times and improve the user's continuous shooting experience.

[0024] Optionally, compressing multiple cached images to obtain multiple compressed images includes: separately compressing each image in a part of the images to obtain multiple compressed images, and the multiple compressed images correspond one by one to the images in the part of the images.

[0025] When the terminal device compresses the cached images, each cached image can be compressed into a compressed image. Compressing the cached images one by one and obtaining the compressed images corresponding one by one to the cached images is convenient for image management. When decompressing later, it can be decompressed one by one according to needs, which is convenient for the management of compressed images.

[0026] Optionally, compressing multiple cached images to obtain multiple compressed images includes: compressing each image in a part of the images to obtain at least one compressed package, and each compressed package includes at least two compressed images.

[0027] When the terminal device compresses the cached images, it can also compress multiple cached images into a single compressed package, obtaining at least one compressed package. Each compressed package can include multiple compressed images. For example, when the terminal device needs to compress thirty cached images, it can choose to compress two consecutive cached images in the cache queue to obtain a compressed package. In this way, thirty cached images can be compressed into fifteen compressed packages. Each compressed package includes two compressed images. Optionally, the terminal device can also compress three, four, or more cached images into the same compressed package. In this method, the way the terminal device compresses at least two cached images into a single compressed package can reduce the number of compressions and save compression efficiency.

[0028] Optionally, the method further includes: obtaining a post-processing completion message for the current cached image, where the post-processing completion message is used to indicate that the current cached image has completed the post-processing operation; in response to the post-processing completion message, decompressing a target compressed image among the multiple compressed images to obtain a target decompressed image, where the target compressed image is one or more of the multiple compressed images.

[0029] After the post-processing of the current cached image is completed, the generated data can enter the image decoding module for decoding and image output. At this time, the post-processing algorithm module can output a post-processing completion instruction. This post-processing completion instruction can instruct the compressed image to be decompressed to obtain a decompressed image. The decompressed image then continues to enter the post-processing algorithm module for post-processing, and then is decoded and output through the image decoding module. The post-processing completion instruction can also be output by the image decoding module. For example, when the image decoding module receives an image that needs to be decoded and output, it means that the post-processing algorithm module has successfully processed a cached image and can continue to process other cached images. Therefore, the image decoding module outputs a post-processing completion instruction to instruct the compressed image to be decompressed.

[0030] It should be noted that when the post-processing of the cached image is completed, a post-processing completion instruction can be output to indicate decompression, without waiting for the decoding and image output to be completed. This method can obtain the decompressed image before the decoding and image output is completed, without having to wait for the decompression process after the decoding and image output, achieving coordinated processing and improving the efficiency of image processing.

[0031] Optionally, the method further includes: adding the target decompressed image to the end of the cache queue.

[0032] When the terminal device decompresses the compressed image and obtains the target decompressed image, it can directly input the target decompressed image into the post-processing algorithm module for post-processing when the post-processing algorithm module is idle. If there are other buffered images waiting for post-processing in the buffer queue, the target decompressed image obtained by decompression can be added to the end of the buffer queue to wait for post-processing and subsequent processes, ensuring the orderly progress of the image processing process.

[0033] Optionally, the method further includes: releasing the buffer space occupied by the current buffered image.

[0034] In response to the post-processing completion instruction, the buffer space occupied by the current buffered image can be released in a timely manner for storing newly generated buffered images, ensuring the experience of continuous shooting.

[0035] In a second aspect, there is provided an image processing apparatus, including units composed of software and / or hardware, and the units are used to execute any one of the methods in the technical solutions described in the first aspect.

[0036] In a third aspect, an embodiment of the present application provides a chip, including a processor; the processor is used to read and execute a computer program stored in a memory to execute any one of the methods in the technical solutions described in the first aspect.

[0037] Optionally, the chip further includes a memory, and the memory is connected to the processor through a circuit or a wire.

[0038] Further optionally, the chip further includes a communication interface.

[0039] In a fourth aspect, there is provided an electronic device, and the electronic device includes: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other to enable the electronic device to execute any one of the methods in the technical solutions described in the first aspect.

[0040] In a fifth aspect, there is provided an electronic device, and the electronic device includes any one of the chips in the technical solutions described in the third aspect.

[0041] In a sixth aspect, there is provided a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the processor is enabled to execute any one of the methods in the technical solutions described in the first aspect.

[0042] In a seventh aspect, there is provided a computer program product, and the computer program product includes: computer program code. When the computer program code runs on an electronic device, the electronic device is enabled to execute any one of the methods in the technical solutions described in the first aspect. Description of the Drawings

[0043] Figure 1 It is a schematic structural diagram of a terminal device 100 provided by an embodiment of the present application;

[0044] Figure 2 It is a software structural block diagram of the terminal device 100 provided by an embodiment of the present application;

[0045] Figure 3 It is a schematic diagram of a shooting interface provided by an embodiment of the present application;

[0046] Figure 4 It is a flowchart of an image processing method provided by an embodiment of the present application;

[0047] Figure 5 It is a flowchart of an image processing method in a traditional continuous shooting process;

[0048] Figure 6 It is a flowchart of an image processing method in a continuous shooting process provided by an embodiment of the present application;

[0049] Figure 7 It is a curve comparison diagram of the memory increase amount in a traditional continuous shooting process and the continuous shooting process of an embodiment of the present application;

[0050] Figure 8 It is a schematic structural diagram of an image processing device provided by an embodiment of the present application. Detailed implementation manners

[0051] Next, the technical solutions in the embodiments of the present application will be described in conjunction with the accompanying drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; herein, "and / or" is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.

[0052] Hereinafter, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first", "second", and "third" may explicitly or implicitly include one or more of such features.

[0053] The image processing method provided by the embodiments of this application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). The embodiments of this application do not impose any restrictions on the specific types of terminal devices.

[0054] Exemplarily, Figure 1 FIG. 5 is a schematic structural diagram of a terminal device 100 provided by an embodiment of this application. The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0055] It can be understood that the structure schematically shown in the embodiments of this application does not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

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

[0057] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the image sensor of the camera. The light signal is converted into an electrical signal, and the image sensor of the camera transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image through algorithms. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193. The image data obtained by the ISP processing can continue to enter the post-processing algorithm module for post-processing to generate a finally displayable image.

[0058] The camera 193 is used to capture still images or videos. An object generates an optical image through the lens and projects it onto the image sensor. The image sensor can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The image sensor converts the light signal into an electrical signal and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in standard RGB, YUV, etc. formats. In some embodiments, the terminal device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0059] The software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the terminal device 100.

[0060] Figure 2 It is the software structure block diagram of the terminal device 100 in the embodiments of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime and the system libraries, and the kernel layer. The application layer may include a series of application packages.

[0061] As Figure 2 shown, the application packages may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0062] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0063] As Figure 2 shown, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, etc.

[0064] The window manager is used to manage window programs.

[0065] The content provider is used to store and obtain data and make this data accessible to applications.

[0066] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc.

[0067] The telephone manager is used to provide the communication function of the terminal device 100.

[0068] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.

[0069] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages, which can automatically disappear after a short stay without user interaction.

[0070] Android runtime includes a core library and a virtual machine.

[0071] The system library may include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc. It may also include a post-processing algorithm module and an image decoding module. The post-processing algorithm module is used to post-process the image data output by the ISP. The post-processed image data can enter the image decoding module (Jpeg encode) for decoding and image generation, thereby generating the final image to be displayed, which can also be called a true image, such as generating a Jpeg format picture. The system library is also called the hardware abstraction layer.

[0072] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0073] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc.

[0074] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0075] The 2D graphics engine is a drawing engine for 2D drawing.

[0076] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0077] For the sake of easy understanding, in the following embodiments of the present application, a terminal device having the Figure 1 and Figure 2 shown structure will be taken as an example, and in combination with the accompanying drawings and application scenarios, the image processing method provided by the embodiments of the present application will be specifically described.

[0078] Generally, when a user encounters an interesting scene, the user often uses the camera application of the terminal device to take continuous shots to record. For example, when the user is watching a game or a performance, the user can continuously click the shooting control in the shooting interface as shown in Figure 3 to continuously take multiple images. Each time the user clicks the shooting control, the data sensed by the camera of the terminal device will be input to the ISP for an exposure to generate an image. Among them, the image obtained by the ISP exposure is an intermediate image, and complex post-processing is required to be able to be normally displayed in the photo gallery. Then, during the continuous shooting process, if the user continuously clicks the shooting control, the ISP will correspondingly continuously generate multiple intermediate images. When the number of intermediate images is relatively large, it may be too late to perform post-processing. The intermediate images that have not been processed in time are usually stored in a cache area (such as a high-speed random access memory) and queued for post-processing. In the present application, the intermediate image obtained by the ISP exposure can be called a cached image, such as a raw image or a yuv image. The terminal device will allocate a corresponding cache space (buffer) for the cached image to store it.

[0079] When the cached images in the cache area accumulate to a certain extent, the camera application believes that if the cached images continue to accumulate in the cache area, it will affect the efficiency of post-processing and the success rate of image output. At this time, the camera application will no longer respond to the user's subsequent shooting operations, so as to avoid image output failure. That is to say, when the user continues to click the shooting control, in the Figure 3 shown shooting interface, the shooting control will not show the dynamic effect of successful pressing, that is, the situation of not being able to press. Therefore, the user cannot continue to shoot, and the continuous shooting experience is affected.

[0080] In the solution provided by the embodiments of the present application, when the number of cached images reaches a certain level and may affect the success rate of image output, the terminal device can compress the already generated cached images to obtain compressed images that occupy less storage space. This can save space and make the available space in the cache area larger. This method can effectively reduce the amount of data stored in the cache area, avoid the situation of being unable to take pictures during continuous shooting, and improve the user's continuous shooting experience.

[0081] Figure 4 It is a schematic flowchart of an image processing method provided by an embodiment of the present application. The method may include:

[0082] S401. Display the shooting interface of the camera application.

[0083] When the user uses the terminal device to take pictures, the camera application is usually opened for shooting. At this time, the camera application displays a shooting interface as shown in Figure 3 . The shooting interface includes an image preview frame at the lower left corner for displaying thumbnails of successfully taken images; the main window of the shooting interface is used to display the preview image that the camera can capture. The shooting interface may also include various function controls, such as a flash switch control, a focal length adjustment control, a shooting mode switching control, and a setting control, etc., which will not be listed one by one here.

[0084] S402. Receive the target shooting operation performed by the user on the shooting interface.

[0085] S403. In response to the target shooting operation, obtain the data volume of multiple cached images generated by the camera application. The multiple cached images are images exposed by the image signal processor (ISP) in response to multiple shooting operations, and the target shooting operation is the last shooting operation among the multiple shooting operations.

[0086] When the user needs to take pictures, they can click the shooting control on the shooting interface in the photo-taking mode to complete a shooting operation and take a picture. The operation of clicking the shooting control can be recorded as a shooting operation. During continuous shooting, the user will continuously click the shooting control. The terminal device can, in response to each shooting operation performed by the user, count the data volume of the cached images generated by the camera application in the current state. Here, the terminal device needs to count not only the cached images generated by the current shooting operation, but also the cached images that are triggered and generated by the shooting operations before the current target shooting operation and are waiting for post-processing in the cache area, that is, the cached images waiting for post-processing in the cache queue. The terminal device can count the size of the data volume of these cached images.

[0087] S404A. If the data volume of multiple cached images is greater than or equal to a preset threshold, compress the multiple cached images to obtain multiple compressed images, where the data volume of the multiple compressed images is smaller than that of the multiple cached images.

[0088] If the data volume of multiple cached images in the cache queue is greater than or equal to the preset threshold, it indicates that there are too many cached images, which may affect image output and cause the situation of being unable to take pictures. Therefore, the terminal device can compress the cached images to generate compressed images with a small data volume, thereby releasing some space in the cache area for subsequent shooting to prevent the situation of being unable to take pictures.

[0089] S404B. If the data volume of multiple cached images is less than the preset threshold, there is no need to compress the cached images.

[0090] If the data volume of multiple cached images in the cache queue is less than the preset threshold, it indicates that there are not many cached images, which will not affect image output and will not cause the situation of being unable to take pictures. Therefore, the terminal device does not need to compress the cached images and can directly add the cached images to the cache queue for subsequent processing.

[0091] Optionally, the method for determining the data volume of the cached images can be based on the number of cached images. Usually, the number of cached images is related to the number of shooting times and the number of cached images generated per single shooting. For example, when the user clicks the shooting control once, multiple cached images may be cached, and these multiple cached images are fused to generate the final image. It should be noted that the higher the resolution of the generated image, the more cached images are cached per shooting, and the more cache space is occupied; the lower the resolution of the generated image, the fewer cached images are cached per shooting, and the less cache space is occupied. When the resolution is determined, the number of cached images cached per shooting is a fixed value. Taking caching five cached images per shooting as an example, when the user shoots continuously three times, the number of cached images is 15. If these 15 cached images cause too high memory occupancy, compression is required. At this time, the preset threshold can be set to 15, indicating that the user shooting three times continuously will cause too high memory occupancy. When the number of cached images in the cache queue is greater than or equal to the preset threshold, for example, the number of cached images in the cache queue is greater than or equal to M times of three, where M is the number of cached images generated by a single shooting operation and M is a positive integer, it can be determined that the number of 3M cached images generated by three shootings is greater than or equal to the preset threshold, that is, the data volume of the cached images is greater than or equal to the preset threshold. If the number of cached images in the cache queue is less than the preset threshold, for example, less than 3M, it can be determined that the data volume of the multiple cached images is less than the preset threshold.

[0092] Generally, memory can be used as a cache area. Unless otherwise specified, the memory mentioned in this embodiment and the following embodiments refers to a high-speed random access memory that can be used as a cache area and cache data.

[0093] Optionally, the method for determining the data volume of the cached image can also be based on the size of the memory occupied by the cached image. Then the preset threshold can be a quantity threshold in megabytes (MB) or gigabytes (GB). Generally, the size of the preset threshold is related to the total memory capacity of the terminal device. If the memory is large, the preset threshold can be relatively large; if the memory is small, the preset threshold can be relatively small. Different sizes of memory each correspond to their own memory waterlines. The memory waterline is usually used to describe the size of the free area to ensure the high-speed operation state of the memory. Taking 8GB of memory as an example, the memory waterline is usually 2.8GB. That is to say, for 8GB of memory, if the memory occupancy exceeds 2.8GB, the processing efficiency will be affected. On this basis, the preset threshold can be set to a value less than the memory waterline to ensure a certain margin. For example, when the total memory capacity is 8GB, the preset threshold can be 2.4GB.

[0094] Optionally, for different memory sizes, the preset threshold can also be in the form of a percentage. For example, it is a positive number greater than or equal to twenty percent and less than or equal to thirty percent. This numerical range can ensure that the memory occupancy rate is not too high and the operation is smooth. Taking the memory size of 16GB and the preset threshold of thirty percent as an example, thirty percent of 16GB is 4.8GB. Then the preset threshold is 4.8GB. If the data volume of the cached image reaches or exceeds 4.8GB, the cached image waiting for post-processing in the cache queue can be compressed to save memory space.

[0095] It should be noted that if the preset threshold is too large, the number of cached images in the cache queue will be relatively large, so too much memory will be occupied, thus affecting the data processing efficiency. If the preset threshold is too small, it may be very easy to reach the compression condition, and the number and frequency of cached images that need to be compressed will increase accordingly. In the case of relatively idle memory, on the contrary, due to frequent compression operations, additional data processing processes will be increased, resulting in waste of resources. When determining whether to compress the cached image based on the number of cached images, a natural number such as three, four, or five is used as the preset threshold; or when determining whether to compress the cached image based on the size of the memory occupied by the cached image, a memory occupancy ratio greater than or equal to twenty percent and less than or equal to thirty percent is used as the preset threshold, both of which can reasonably balance the data processing efficiency and resource utilization rate.

[0096] Optionally, when the terminal device compresses the cached images, it can compress the latter part of the cached images that have not been post-processed in the cache queue. Suppose there are N cached images stored in the memory, and these N cached images are arranged in the cache queue in the order of generation time from the front to the back. The terminal device can then compress the cached images starting from the i-th cached image to the last (i.e., the N-th) cached image in the cache queue to obtain compressed images. Here, i is a natural number less than N. For example, when N is 30, i can be 10. In this method, it is not necessary to compress all the cached images that have not been post-processed, but only compress some of the cached images with a longer queuing time, which can ensure that continuous shooting is still supported while reducing the number and frequency of compressed cached images. Since the data processing flow of compression is reduced, resources are saved.

[0097] Optionally, when the terminal device compresses the cached images, it can also compress all the cached images that have not been post-processed in the cache queue. That is, except for the first cached image that is being post-processed or about to enter post-processing, all the cached images from the second cached image to the last cached image are compressed, that is, i is equal to 2. This method can compress all the cached images that do not need to be post-processed temporarily, saving the memory space to the greatest extent, so as to support more continuous shooting times and improve the user's continuous shooting experience.

[0098] Optionally, when the terminal device compresses the cached images, each cached image can be compressed into a compressed image. Compressing the cached images one by one and obtaining the compressed images corresponding to the cached images one by one is convenient for image management. When decompressing later, it can be decompressed one by one according to needs, which is convenient for the management of compressed images.

[0099] Optionally, when the terminal device compresses the cached images, it can also compress multiple cached images into a compressed package to obtain at least one compressed package. Each compressed package can include multiple compressed images. For example, when the terminal device needs to compress thirty cached images, it can choose to compress two consecutive cached images in the cache queue to obtain a compressed package. In this way, thirty cached images can be compressed into fifteen compressed packages. Each compressed package includes two compressed images. Optionally, the terminal device can also compress three, four or more cached images into the same compressed package. In this method, the terminal device compresses at least two cached images into a compressed package, which can reduce the compression times and save the compression efficiency.

[0100] Optionally, the post-processing is for the cached images, such as optimizing the color, brightness, contrast, noise reduction, landscape and portrait of the raw image or yuv image, so that the image effect meets the user's viewing requirements.

[0101] S405. Display a first thumbnail image captured by the target shooting operation.

[0102] If the data volume of multiple cached images in the cache queue is greater than or equal to a preset threshold, when the cached images are compressed, the space in the cache area is released to a certain extent, and the situation of being unable to take pictures will not occur. The camera application can respond to the user's target shooting operation and capture images normally. Optionally, while capturing images normally, a first thumbnail image of the currently captured image is also displayed in the image preview frame of the shooting interface to indicate successful shooting.

[0103] If the data volume of multiple cached images in the cache queue is less than the preset threshold, then the terminal device can normally respond to the user's shooting operation, successfully capture images, and can also display a first thumbnail image of the currently captured image in the image preview area of the shooting interface.

[0104] The above Figure 4 In the above-described embodiments, the terminal device can, during the user's shooting process, in response to the user's shooting operation, obtain in real time the data volume of multiple cached images in the memory. When the data volume of the cached images is greater than or equal to the preset threshold, the terminal device compresses the cached images, thereby releasing some memory space and enabling more cached images to be stored. This method effectively reduces the amount of data stored in the memory, avoids the situation of being unable to take pictures during continuous shooting, and improves the user's continuous shooting experience.

[0105] It should be noted that the ratio of the size of the image before compression to the size of the image after compression is the compression ratio. In the embodiments of the present application, the specific form of the compression algorithm (also referred to as the coding method) used for compressing the cached images is not limited. For example, it can be coding methods such as Huffman coding and predictive coding, or other coding methods. Different compression algorithms result in different compression ratios, and the specific size of the compression ratio is related to the image itself. The compression ratio corresponding to the compression algorithm adopted in the present application can generally be maintained between 2 and 5.

[0106] Based on the above embodiments, after the post-processing of the current cached image is completed, the generated data can enter the image decoding module for decoding and image output. At this time, the post-processing algorithm module can output a post-processing completion instruction. This post-processing completion instruction can instruct the compressed image to be decompressed to obtain a decompressed image. The decompressed image then continues to enter the post-processing algorithm module for post-processing, and then is decoded and output through the image decoding module. Optionally, the post-processing completion instruction can also be output by the image decoding module. For example, when the image decoding module receives an image that needs to be decoded and output, it indicates that the post-processing algorithm module has successfully processed a cached image and can continue to process other cached images. Therefore, the image decoding module outputs a post-processing completion instruction to instruct the compressed image to be decompressed. In response to the post-processing completion instruction, the cache space occupied by the current cached image can be released in a timely manner for storing newly generated cached images, ensuring the experience of continuous shooting.

[0107] It should be noted that after the post-processing of the cached image is completed, a post-processing completion instruction can be output to instruct decompression without waiting for the decoding and image output to be completed. Since it usually takes 300 - 400 milliseconds for the image decoding module to decode and output an image obtained by post-processing (such as in jpeg format), while the time for decompressing a compressed image is approximately 50 milliseconds. Therefore, after the post-processing of the cached image is completed, the next compressed image is decompressed, and the decompressed image can be obtained before the decoding and image output are completed, without waiting for the decompression process after the decoding and image output, achieving coordinated processing and improving the efficiency of image processing.

[0108] It should be noted that when there are multiple compressed images in the memory, the post-processing completion instruction can instruct the decompression of the target compressed image among the multiple compressed images. The target compressed image can be the compressed image with the earliest compression time. Generally, the earlier the compression time of the compressed image, the earlier the generation time of the cached image corresponding to the compressed image. Therefore, preferentially decompressing the compressed image with the earliest compression time can ensure that the order of image output matches the order of user shooting.

[0109] Optionally, when multiple compressed images are in a compressed package, after the post-processing algorithm module or the image decoding module outputs a post-processing completion instruction, it instructs the decompression of the target compressed package in at least one compressed package to obtain the target decompressed images corresponding to the compressed images in the target compressed package. The target decompressed images here are multiple. The target compressed package can be the compressed package with the earliest compression time. Generally, the earlier the compression time, the earlier the generation time of the cached images corresponding to the compressed images in the compressed package. Therefore, preferentially decompressing the compressed package with the earliest compression time can ensure that the order of image output matches the order of user shooting.

[0110] When the terminal device decompresses the compressed image to obtain the target decompressed image, it can directly input the target decompressed image into the post-processing algorithm module for post-processing when the post-processing algorithm module is idle. If there are other buffered images waiting for post-processing in the buffer queue, the target decompressed image obtained by decompression can be added to the end of the buffer queue to wait for post-processing and subsequent processes, ensuring the orderly progress of the image processing process.

[0111] To describe in detail the improvements brought by the technical solution of the embodiments of the present application, the following will be described in conjunction with Figure 5 and Figure 6 the processes shown.

[0112] See Figure 5 shown. The user has taken four consecutive shots. When the user then, a specific embodiment will be used to illustrate the process when the user takes consecutive shots. For example, the user executes four consecutive shots, that is, the user consecutively executes the first shooting operation, the second shooting operation, the third shooting operation, and the fourth shooting operation.

[0113] When the user executes the first shooting operation, the camera captures the picture (startCapture1), and inputs the sensed raw data 1 into the ISP for exposure and image output to obtain the buffered image 1. At the same time, the terminal device also generates the first thumbnail (Thumbnail1) of this shooting and displays the first thumbnail on the interface of the camera application. The terminal device allocates the corresponding buffer space 1 (buffer1) to the buffered image 1 and inputs the buffered image 1 into the post-processing algorithm module for the first post-processing operation.

[0114] When the user executes the second shooting operation, the camera captures the picture (startCapture2), and inputs the sensed raw data 2 into the ISP for exposure and image output to obtain the buffered image 2. At the same time, the terminal device also generates the second thumbnail (Thumbnail2) of this shooting and displays the second thumbnail on the interface of the camera application. The terminal device allocates the corresponding buffer space 2 (buffer2) to the buffered image 2 and inputs the buffered image 2 into the post-processing algorithm module for the second post-processing operation.

[0115] When the user sequentially performs the third shooting operation and the fourth shooting operation, the camera sequentially captures images (startCapture3 and startCapture4), and inputs the sensed raw data 3 and raw data 4 into the ISP for exposure imaging to obtain buffer image 3 and buffer image 4. At the same time, the terminal device also generates a third thumbnail (Thumbnail3) and a fourth thumbnail (Thumbnail4) for these two shootings, and displays the third thumbnail and the fourth thumbnail on the interface of the camera application. The terminal device allocates corresponding buffer spaces 3 (buffer3) and buffer4 for buffer image 3 and buffer image 4 respectively, and inputs buffer image 3 and buffer image 4 into the post-processing algorithm module to perform a third post-processing operation and a fourth post-processing operation (not shown in the figure). After the post-processing of the buffer image is completed, the corresponding buffer space can be released. When the data volume of the buffer images in the buffer queue does not exceed the preset threshold, the above process can be repeated, Figure 5 and the shooting processes that can be executed more times are represented by ellipsis.

[0116] The image data output after post-processing is input into the image decoding module for decoding and imaging, for example, an image in JPEG format is obtained.

[0117] Figure 5 In the illustrated embodiment, when the user continuously shoots four times, each time the user shoots, the terminal device will count the data volume of the buffer images. If the data volume of the buffer images does not exceed the preset threshold, the terminal device can continue to respond to the user's shooting operation to shoot and successfully generate the captured images. However, if the data volume of the buffer images exceeds the preset threshold, the terminal device can compress the buffer images to save space. When the user performs the third shooting operation, the shooting process can refer to Figure 5 the relevant description in. When the user sequentially performs the fourth shooting operation, the fifth shooting operation, the sixth shooting operation and subsequent more shooting operations, the processing process of the terminal device can refer to Figure 6As shown. Specifically, the camera of the terminal device captures pictures in sequence in response to these consecutive shooting operations. After each picture is captured, under the trigger of the corresponding shooting operation, the sensed raw data 4, raw data 5, raw data 6, etc. are input into the ISP for exposure imaging to obtain cached images such as cached image 4, cached image 5, and cached image 6. Optionally, the terminal device also generates thumbnails such as the fourth thumbnail, fifth thumbnail, and sixth thumbnail of these several shootings, and displays the fourth thumbnail, fifth thumbnail, sixth thumbnail, etc. on the interface of the camera application (for example, displayed in the image preview box in the lower left corner). The terminal device needs to allocate corresponding cache spaces 4, cache spaces 5, cache spaces 6, etc. for the cached images such as cached image 4, cached image 5, and cached image 6. When, after a user's shooting by the terminal device, the data volume of the obtained cached image exceeds the preset threshold, the cached images such as cached image 4, cached image 5, and cached image 6 are compressed to obtain multiple compressed images. After the post-processing of cached image 3 is completed, the post-processing algorithm module or the image decoding module can output a post-processing completion instruction to instruct the compressed image to be decompressed. Specifically, it can be to instruct the compressed image or compressed package corresponding to cached image 4 to be decompressed. At the same time, the cache space occupied by cached image 3 is released. When the decompressed image 4 is obtained after decompressing cached image 4, the decompressed image 4 can enter the post-processing algorithm module and the image decoding module for processing to obtain the corresponding true Figure 4 . Optionally, the post-processing completion instruction can also be to instruct two or three compressed images or compressed packages to be decompressed at one time to obtain multiple decompressed images, and add these decompressed images to the cache queue in sequence to wait for post-processing. When the decompressed images to be processed in the cache queue have been or are about to be processed, the post-processing completion instruction can be continuously output to decompress other compressed images. Figure 6 The implementation principle and beneficial effects of the embodiments shown can be referred to the foregoing description, and will not be elaborated here.

[0118] To accurately describe the technical effects of the technical solutions of this application, experiments show that when the compression ratio is 2-5, adopting the technical solutions of this application can greatly reduce the memory occupancy rate during continuous shooting and improve the performance of continuous shooting.

[0119] When adopting the solution provided by the embodiments of this application, the change in memory occupancy brought by this case can be intuitively viewed in the following two ways:

[0120] Method 1: Use software that reads memory logs to view the log process during continuous shooting. During continuous shooting, each time an image is captured, the incremental memory occupancy can be read from the log process. In the initial period of continuous shooting, the incremental memory occupancy for each shot is approximately 4 MB. When the number of continuous shots reaches a certain amount, it can be seen from the log process that the incremental memory occupancy for each shot becomes about 1 MB, and the incremental for a single shot decreases significantly. This phenomenon indicates that when the memory occupancy ratio reaches the preset threshold, compression is started in the background of the terminal device, thereby saving memory and ensuring the continuous shooting experience.

[0121] Method 2: Use software that reads memory (such as software for dumping memory) to view the size of the memory space (buffer size) allocated for each shot during continuous shooting. If, after multiple shots, the buffer size allocated each time becomes smaller, it can be known that the technical solution of the embodiments of the present application is used. Figure 7 It is a comparison graph of the situation of using software for dumping memory to read memory. Figure 7 In Figure a, it is a curve graph of memory occupancy during traditional continuous shooting. Among them, the curve of image occupancy represents the size of the memory occupancy caused by continuous shooting, the curve of other occupancy represents the size of the memory occupancy caused by other non - continuous - shooting factors, and the curve of total occupancy represents the sum of the memory occupancy rate caused by continuous shooting and the memory occupancy rate caused by non - continuous - shooting. Figure 7 In Figure b, it is a curve graph of memory occupancy during continuous shooting after adopting the technical solution of the present application. In Figure 7 In Figure b, the curve of image occupancy represents the size of the memory occupancy caused by continuous shooting, the curve of other occupancy represents the size of the memory occupancy caused by other non - continuous - shooting factors, and the curve of total occupancy represents the sum of the memory occupancy rate caused by continuous shooting and the memory occupancy rate caused by non - continuous - shooting. By comparison, it can be seen that after adopting the technical solution of the present application, about 300 MB of space can be released from the memory, enabling more continuous shots.

[0122] The above text details examples of the methods provided by the present application. It can be understood that for the corresponding device to achieve the above functions, it includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0123] The present application can divide the functional modules of the image processing device according to the above method examples. For example, each function can be divided into respective functional modules, or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the present application is illustrative, merely a logical function division, and there may be other division methods in actual implementation.

[0124] Figure 8 The structural schematic diagram of an image processing device provided by the present application is shown. Device 800 includes:

[0125] A display module 801, configured to display the shooting interface of the camera application.

[0126] A receiving module 802, configured to receive the target shooting operation performed by the user on the shooting interface.

[0127] An obtaining module 803, configured to, in response to the target shooting operation, obtain the data amounts of a plurality of cached images generated by the camera application, where the plurality of cached images are images exposed by an image signal processor (ISP) in response to multiple shooting operations, and the target shooting operation is the last shooting operation among the multiple shooting operations.

[0128] A compression module 804, configured to, if the data amounts of the plurality of cached images are greater than or equal to a preset threshold, compress the plurality of cached images to obtain a plurality of compressed images, and the data amounts of the plurality of compressed images are smaller than the data amounts of the plurality of cached images.

[0129] In some embodiments, the display module 801 is further configured to, in response to the target shooting operation, display the first thumbnail captured by the target shooting operation.

[0130] In some embodiments, the data amount of the cached image represents the number of images of the cached image, the preset threshold is M times a natural number greater than or equal to three and less than or equal to five, M is the number of cached images generated by a single shooting operation, and M is a positive integer;

[0131] In some embodiments, the data amount of the cached image represents the proportion of the memory occupied by the cached image, then the preset threshold is a value greater than or equal to twenty percent and less than or equal to thirty percent.

[0132] In some embodiments, the plurality of cached images are arranged in the cache queue in order of generation time from front to back. The compression module 804 is specifically configured to compress some images of the cached images, and the some images are the i-th to the N-th images in the cache queue, the number of the plurality of cached images is N, and i is a natural number less than N and greater than 1.

[0133] In some embodiments, i is 2.

[0134] In some embodiments, the compression module 804 is specifically configured to compress each image in a partial image separately to obtain a plurality of compressed images, and the plurality of compressed images correspond to the images in the partial image one by one.

[0135] In some embodiments, the compression module 804 is specifically configured to compress each image in a partial image to obtain at least one compressed package, and each compressed package includes at least two compressed images.

[0136] In some embodiments, the apparatus 800 further includes a decompression module, configured to obtain a post-processing completion message of the current cached image, and in response to the post-processing completion message, decompress a target compressed image among the plurality of compressed images to obtain a target decompressed image. The post-processing completion message is used to indicate that the current cached image has completed the post-processing operation, and the target compressed image is one or more of the plurality of compressed images.

[0137] In some embodiments, the apparatus 800 further includes a processing module, configured to add the target decompressed image to the end of the cache queue.

[0138] In some embodiments, the processing module is further configured to release the cache space occupied by the current cached image.

[0139] The specific manner in which the apparatus 800 executes the image processing method and the beneficial effects produced can be referred to the relevant descriptions in the method embodiments, which will not be elaborated here.

[0140] The embodiments of the present application further provide an electronic device, including the above-mentioned processor. The electronic device provided in this embodiment may be Figure 1 the terminal device 100 shown in the figure, and is configured to execute the above-mentioned image processing method. In the case of adopting an integrated unit, the terminal device may include a processing module, a storage module, and a communication module. Among them, the processing module may be used to control and manage the actions of the terminal device. For example, it may be used to support the terminal device to execute the steps performed by the display unit, the detection unit, and the processing unit. The storage module may be used to support the terminal device to execute storing program codes and data, etc. The communication module may be used to support the communication between the terminal device and other devices.

[0141] Among them, the processing module may be a processor or a controller. It may implement or execute various exemplary logic blocks, modules, and circuits described in combination with the disclosure of the present application. The processor may also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor (DSP) and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a device for interacting with other terminal devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0142] In one embodiment, when the processing module is a processor and the storage module is a memory, the terminal device involved in this embodiment can be a device with Figure 1 the structure shown.

[0143] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor is caused to execute the image processing method described in any of the above embodiments.

[0144] The embodiment of the present application also provides a computer program product. When the computer program product runs on a computer, the computer is caused to execute the above-related steps to implement the image processing method in the above embodiment.

[0145] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.

[0146] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces, indirect coupling or communication connection of the device or unit. The replaced unit may or may not be physically separated. The components displayed as units can be one physical unit or multiple physical units, that is, they can be located in one place, or can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0147] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0148] When 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 readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0149] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An image processing method, characterized in that, including: displaying a shooting interface of a camera application; receiving multiple shooting operations performed by a user on the shooting interface, where the multiple shooting operations include a target shooting operation; in response to the target shooting operation, obtaining the data amounts of multiple cached images generated by the camera application, where the multiple cached images are images exposed by an image signal processor (ISP) in response to multiple shooting operations, and the target shooting operation is the last shooting operation among the multiple shooting operations; if the data amounts of the multiple cached images are greater than or equal to a preset threshold, compressing some of the images ranked behind in the cache queue among the multiple cached images to obtain multiple compressed images, so as to release the space of a part of the cache area, and the data amounts of the multiple compressed images are smaller than the data amounts of the multiple cached images; the method further includes: obtaining a post - processing completion message of the current cached image, where the post - processing completion message is used to indicate that the current cached image has completed the post - processing operation; in response to the post - processing completion message, decompressing a target compressed image among the multiple compressed images to obtain a target decompressed image, where the target compressed image is one or more of the multiple compressed images; adding the target decompressed image to the end of the cache queue to wait for post - processing.

2. The method according to claim 1, characterized in that, the method further includes: in response to the target shooting operation, displaying a first thumbnail of the shot taken by the target shooting operation.

3. The method according to claim 1, characterized in that The data amount of the cached image represents the number of images of the cached image, and the preset threshold is M times a natural number greater than or equal to 3 and less than or equal to 5, where M is the number of cached images generated by a single shooting operation, and M is a positive integer.

4. The method according to claim 1, wherein If the data amount of the cached image represents the proportion of the memory occupied by the cached image, then the preset threshold is a value greater than or equal to 20% and less than or equal to 30%.

5. The method according to any one of claims 1 to 4, characterized in that, Compressing the multiple cached images includes: compressing some of the multiple cached images, where the some images are the i - th to N - th images in the cache queue, the number of the multiple cached images is N, i is less than N and is 2.

6. The method according to claim 5, characterized in that, Compressing the multiple cached images to obtain multiple compressed images includes: compressing each image in the some images respectively to obtain the multiple compressed images, and the multiple compressed images correspond one - to - one with the images in the some images.

7. The method according to claim 5, characterized in that, Compressing the multiple cached images to obtain multiple compressed images includes: compressing each image in the some images to obtain at least one compression package, and each compression package includes at least two of the compressed images.

8. The method according to claim 1, characterized in that, the method further includes: releasing the cache space occupied by the current cached image.

9. An electronic device, characterized in that, including: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other to enable the electronic device to execute the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer - readable storage medium, and when the computer program is executed by the processor, the processor executes any one of claims 1 to 8.

Citation Information

Patent Citations

  • Continuous shooting image processing method and device, electronic equipment and storage medium

    CN115686359A

  • Digital camera, storage medium and image processing device

    CN1925563A

  • Imaging device, control method thereof, program, and recording medium

    JP2021044705A

  • Image capturing apparatus, control method of image capturing apparatus and non-transitory computer readable storage medium

    US20150334264A1