Image processing method and electronic equipment
Patent Information
- Application Number
- CN202380055161.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-08-29
- Filing Date
- 2023-04-26
- Publication Date
- 2025-03-18
AI Technical Summary
Electronic devices consume a lot of power when taking and processing photos, resulting in shortened battery life. Especially using the camera to take photos when the battery is low will further reduce battery life and affect the user experience.
Provide an image processing method that determines whether to perform image post-processing based on the power of the electronic device and the user's habit information. When the power is low, the unprocessed image is directly saved to extend the battery life, and image post-processing is performed when the power is sufficient or the user needs it.
Effectively save power consumption, extend the battery life of electronic devices, improve user experience, and meet users' image processing needs.
Smart Images

Figure CN119654873A_ABST
Abstract
Description
Image processing method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 29, 2022, with application number 202211043255.7 and application name “Image Processing Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of electronic technology, and in particular to an image processing method and electronic equipment. Background Art
[0003] Cameras have become a common feature of electronic devices today. However, the process of taking and processing photos with a camera consumes a lot of power, which affects the battery life of electronic devices. Especially when the battery of an electronic device is low, using a camera to take photos will further shorten the battery life and reduce the user experience.
[0004] Summary of the Invention
[0005] The present application provides an image processing method, device, electronic device, chip, computer-readable storage medium, and computer program product, which can extend the battery life of electronic devices and improve user experience.
[0006] In a first aspect, the present application provides an image processing method, which is executed by an electronic device, and the method includes: obtaining a first image in response to a first operation of a user; the first image is an image that has not undergone image post-processing; obtaining the power level of the electronic device; when a preset condition is met, saving the first image, generating a first thumbnail, and establishing a correspondence between the first thumbnail and the first image; the preset condition includes at least: the power level of the electronic device is less than a first preset power threshold.
[0007] Optionally, when the preset condition is not met, the first image is processed to obtain a second image, a second thumbnail is generated, and a correspondence between the second thumbnail and the second image is established.
[0008] The first operation may be a photo-taking operation. The first image, also known as the initial image, may be an original image captured by a camera of an electronic device and generated by preliminary processing such as registration and decoding by an image signal processor. The first image has not undergone image post-processing. The second image is an image that has undergone image post-processing, also known as a finished image.
[0009] Optionally, the first thumbnail may be a thumbnail generated based on the first image. The second thumbnail may be a thumbnail generated based on the second image. The first preset power threshold may be, for example, 20% of the total power of the electronic device. If the power of the electronic device is less than the first preset power threshold, it indicates that the power of the electronic device is low.
[0010] The image processing method provided in the first aspect above, in response to a first user operation, after acquiring a first image, directly saves the first image without performing image post-processing when the battery level of the electronic device is less than a first preset battery level threshold, i.e., when the battery level of the electronic device is low. This can save power consumption, extend the battery life of the electronic device, and improve the user experience.
[0011] In one possible implementation, before saving the first image, generating the first thumbnail, and establishing a correspondence between the first thumbnail and the first image, the method further includes: determining user habit information, where the user habit information is used to indicate whether the user is accustomed to viewing the acquired image within a preset time after the shooting is completed; the preset condition also includes: the user habit information is the first information; the first information is used to indicate that the user is not accustomed to viewing the acquired image within the preset time after the shooting is completed.
[0012] The first information is also the second user habit information in the specific implementation manner.
[0013] Optionally, if the electronic device's battery level is less than a preset battery threshold, but the user habit information is the second information, the first image is processed to obtain a second image, a second thumbnail is generated, and a correspondence between the second thumbnail and the second image is established. The second information is used to indicate that the user is accustomed to viewing the captured image within a preset time period after shooting. The second information is also the first user habit information in the specific embodiment.
[0014] In this implementation, after acquiring the first image in response to the user's first operation, if the electronic device's battery level is less than a first preset battery level threshold and the user's habit information is the first information, i.e., if the electronic device's battery level is low and the user is not accustomed to viewing the captured image immediately after taking the image, the first image is directly saved without performing image post-processing. In this way, while considering power conservation and extending the battery life of the electronic device, the user's usage habits are further taken into account, thereby further improving the user experience.
[0015] In one possible implementation, determining user habit information includes: dividing a preset historical time period into n sub-time periods, where n is an integer greater than 1; determining the number of target time periods in the n sub-time periods; wherein the ratio of a first number corresponding to the target time period to a second number corresponding to the target time period is greater than a first preset ratio, the first number corresponding to the target time period refers to the number of images whose shooting time is within the target time period and the time interval between the first viewing time and the shooting time is less than a preset time length, and the second number corresponding to the target time period refers to the total number of images whose shooting time is within the target time period; if the ratio of the number of target time periods to n is less than or equal to the second preset ratio, determining the user habit information as the first information; if the ratio of the number of target time periods to n is greater than the second preset ratio, determining the user habit information as the second information; the second information is used to characterize the user's habit of viewing the acquired images within a preset time length after the shooting is completed.
[0016] The first number is the number of immediately viewed images in the specific implementation, the second number is the total number of photos taken in the specific implementation, the first preset ratio is the preset ratio in the specific implementation, and the second preset ratio is equivalent to the preset proportion in the specific implementation.
[0017] In this implementation, the ratio of the first number of target time periods to the second number of target time periods is greater than a first preset ratio. The target time period is also the time period during which the user is more likely to view the captured image immediately after shooting. A ratio of the number of target time periods to n is greater than the second preset ratio, indicating that the user is accustomed to viewing captured images immediately after shooting. Therefore, the ratio of the number of target time periods to n can accurately determine user habits, thereby more accurately aligning image processing with user habits and further improving the user experience.
[0018] In one possible implementation, determining the number of target time periods in n sub-time periods includes: performing a first processing on each sub-time period to obtain a processing result corresponding to each sub-time period, the processing result including whether the sub-time period is a target time period or not a target time period; and obtaining the number of target time periods in n sub-time periods based on the processing results corresponding to each sub-time period; the first processing includes: counting the total number of images whose shooting time is within a first sub-time period to obtain a second number corresponding to the first sub-time period; the first sub-time period is any one of the n sub-time periods; obtaining the first viewing time of each image whose shooting time is within the first sub-time period; determining the number of images whose shooting time is within the first sub-time period and the time interval between the first viewing time and the shooting time is less than a preset time length among all images whose shooting time is within the first sub-time period to obtain a first number corresponding to the first sub-time period; and if the ratio of the first number corresponding to the first sub-time period to the second number corresponding to the first sub-time period is greater than a first preset ratio, determining the first sub-time period to be the target time period.
[0019] In one possible implementation, after saving the first image, generating the first thumbnail, and establishing a correspondence between the first thumbnail and the first image, the method further includes: receiving a second operation of the user on the first image; if the type of the second operation is one of the preset types, performing image post-processing on the first image to obtain a second image, and processing the second image according to the type of the second operation; if the type of the second operation is not any of the preset types, processing the first image according to the type of the second operation.
[0020] In a possible implementation, the preset type includes at least one of a viewing operation, a sharing operation, a moving operation, a copy operation, and an editing operation.
[0021] Correspondingly, the second image is processed according to the type of the second operation, including: if the preset type is a viewing operation, the second image is displayed; if the preset type is a sharing operation, the second image is transmitted to the target device or uploaded to the network through the transmission method selected by the user; if the preset type is a move operation, the second image is moved from the current storage location to another storage location; if the preset type is a copy operation, the second image is copied and the copied second image is saved to the target storage location; if the preset type is an editing operation, the second image is edited, including but not limited to splicing, synthesis, adding content to the image or changing the content in the image, etc.
[0022] Optionally, if the type of the second operation is a delete operation, the first image is directly deleted.
[0023] In other words, in this implementation, if a user performs a preset operation on an original image that hasn't undergone post-processing, the original image is first post-processed, and then the corresponding processing is performed based on the resulting image. Otherwise, the corresponding processing is performed directly based on the original image. A preset operation can be understood as an operation that the user requires to use the image.
[0024] In this implementation, when the user has a need to use the first image, the image is post-processed and then processed accordingly, which can improve the processing effect of the image, meet the user's use needs, and improve the user experience.
[0025] In a possible implementation, the method further includes: during the process of performing image post-processing on the second image, displaying third information, where the third information is used to indicate that image post-processing is being performed on the first image.
[0026] The third information can be either an image or text. For example, the third information could be a text message like "Processing, please wait" or a dynamically displayed processing progress bar. In other words, the third information indicates that the first image is undergoing post-processing. This third information can alert the user that the image is currently being processed, enhancing user interaction and ultimately improving the user experience.
[0027] In a possible implementation, receiving the second operation of the user on the first image includes: displaying the first thumbnail; and receiving the second operation of the user on the first thumbnail.
[0028] In a possible implementation, after performing image post-processing on the first image to obtain the second image, the method further includes: saving the second image, generating a second thumbnail, and establishing a correspondence between the second thumbnail and the second image.
[0029] In this implementation, after the first image is post-processed, the generated second image is saved, a second thumbnail is generated, and a correspondence is established between the second thumbnail and the second image. This facilitates subsequent users to use the post-processed second image through the second thumbnail, thereby improving user experience.
[0030] In one possible implementation, after saving the second image, generating the second thumbnail, and establishing a correspondence between the second thumbnail and the second image, the method includes deleting the first image and the first thumbnail. This can conserve electronic device memory, prevent user confusion when using images, and improve user experience.
[0031] In one possible implementation, after saving the first image, generating the first thumbnail, and establishing a correspondence between the first thumbnail and the first image, the method further includes: upon detecting that the electronic device starts charging, or the power level of the electronic device is greater than a second preset power threshold, or the electronic device is in a charging state and the power level of the electronic device is greater than a third preset power threshold, performing image post-processing on the first image to obtain a second image.
[0032] Optionally, the second preset power threshold may be the same as or different from the third preset power threshold.
[0033] In this implementation, upon detecting that the electronic device has begun charging or that the electronic device's battery level exceeds a second preset battery level threshold, image post-processing of the first image is initiated to generate the second image. In other words, image post-processing of the first image is performed promptly after the electronic device begins charging or when the electronic device's battery level is sufficiently high. This ensures that the image quality is maintained when the user uses the image, improving the user experience.
[0034] When the electronic device is in a charging state and the power level of the electronic device is greater than a third preset power threshold, image post-processing of the first image is initiated to generate a second image. Thus, if the electronic device is low on power but the user's charging conditions are limited and cannot fully charge it, post-processing of the first image is not initiated, thereby saving power, extending the battery life of the electronic device, and improving the user experience.
[0035] In a second aspect, the present application provides a device, which is included in an electronic device and has the function of implementing the electronic device behavior described in the first aspect and possible implementations of the first aspect. The function can be implemented through hardware or through hardware executing corresponding software implementations. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a receiving module or unit, a processing module or unit, etc.
[0036] In a third aspect, the present application provides an electronic device, which includes: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the first aspect.
[0037] In a fourth aspect, the present application provides a chip including a processor, wherein the processor is configured to read and execute a computer program stored in a memory to perform the method of the first aspect and any possible implementation thereof.
[0038] Optionally, the chip also includes a memory, and the memory is connected to the processor via circuits or wires.
[0039] Further optionally, the chip also includes a communication interface.
[0040] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution of the first aspect.
[0041] In a sixth aspect, the present application provides a computer program product, which includes: a computer program code, which, when the computer program code runs on an electronic device, enables the electronic device to execute any one of the methods in the technical solution of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] FIG1 is a schematic diagram of a process of taking and processing photos provided in an embodiment of the present application;
[0043] FIG2 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;
[0044] FIG3 is a software structure block diagram of an electronic device 100 provided in an embodiment of the present application;
[0045] FIG4 is a flow chart of an image processing method according to an embodiment of the present application;
[0046] FIG5 is a flow chart of another image processing method provided in an embodiment of the present application;
[0047] FIG6 is a schematic diagram of interface changes during a photo-taking process provided by an embodiment of the present application;
[0048] FIG7 is a flowchart of another image processing method provided in an embodiment of the present application;
[0049] FIG8 is a schematic diagram of an interface for performing a viewing operation on an image provided by an embodiment of the present application;
[0050] FIG9 is a schematic diagram of another example interface for performing a viewing operation on an image provided by an embodiment of the present application;
[0051] FIG10 is a schematic diagram of an interface for performing a viewing operation on an image according to another embodiment of the present application;
[0052] FIG11 is a schematic diagram of an interface for performing a move operation on an image provided by an embodiment of the present application;
[0053] FIG12 is a flowchart of another image processing method provided in an embodiment of the present application;
[0054] FIG13 is a flowchart of another image processing method provided in an embodiment of the present application;
[0055] FIG14 is a flowchart of another image processing method provided in an embodiment of the present application;
[0056] FIG15 is a flowchart of another image processing method provided in an embodiment of the present application;
[0057] FIG16 is a schematic diagram of a process for obtaining user habit information provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or. For example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0059] In the following, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features indicated. Therefore, a feature specified as "first," "second," or "third" may explicitly or implicitly include one or more of the features.
[0060] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of the present application include a particular feature, structure, or characteristic described in conjunction with that embodiment. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in different places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0061] Before describing in detail the image processing method provided in the embodiments of the present application, the application scenarios of the method are first described.
[0062] Generally, the process of taking photos (i.e., images) and processing photos by a camera of an electronic device is shown in Figure 1, including: the camera takes a photo to generate an initial image (also called an image source file or source file image, etc.), then the image post-processing module performs image post-processing on the initial image to generate a finished image; finally, the finished image is saved in an album.
[0063] During the above process, the power consumption of the electronic device for post-processing an initial image is approximately 1.25 mA·h. This high power consumption affects the battery life of the electronic device, especially when the battery is low, further shortening the battery life and affecting the user experience.
[0064] To this end, an embodiment of the present application provides an image processing method that delays the image post-processing process when the power of an electronic device is low, so as to save power consumption, increase the battery life of the electronic device, and improve the user experience.
[0065] The image processing method provided in the embodiments of the present application can be applied to electronic 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, personal digital assistants (PDAs), etc., which can install camera applications (APPs). Alternatively, the image processing method provided in the embodiments of the present application can also be applied to electronic devices such as digital cameras for taking pictures. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0066] For example, FIG2 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 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, an air 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.
[0067] It should be understood that the structures illustrated in the embodiments of the present application do 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 may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0068] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0069] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0070] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0071] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0072] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C busses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.
[0073] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0074] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0075] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through a Bluetooth headset.
[0076] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0077] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0078] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0079] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0080] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0081] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0082] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0083] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. The structures of Antenna 1 and Antenna 2 in Figure 2 are merely examples. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, Antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0084] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0085] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0086] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0087] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with a network and other devices via wireless communication technology. Wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).
[0088] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0089] Display screen 194 is used to display images, videos, and the like. Display screen 194 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0090] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0091] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0092] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0093] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0094] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0095] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0096] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0097] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can 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 can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 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.
[0098] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0099] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0100] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0101] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0102] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0103] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0104] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, an instruction to create a new short message is executed.
[0105] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0106] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0107] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.
[0108] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.
[0109] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
[0110] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0111] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.
[0112] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0113] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.
[0114] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.
[0115] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bones of the human body's vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse the vibration signals of the vibrating bones of the vocal cords acquired by the bone conduction sensor 180M to obtain voice signals and implement voice functions. The application processor can parse heart rate information based on the blood pressure signals acquired by the bone conduction sensor 180M to implement heart rate detection functions.
[0116] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0117] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0118] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0119] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and disconnected from the electronic device 100 by inserting or removing it from the SIM card interface 195. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than one. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0120] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0121] As shown in Figure 3, a software system using a layered architecture is divided into several layers, each with distinct roles and divisions of labor. Layers communicate with each other via software interfaces. In some embodiments, the software system can be divided into five layers: from top to bottom, application layer 210, application framework layer 220, hardware abstraction layer 230, driver layer 240, and hardware layer 250.
[0122] The application layer 210 may include a camera APP and a gallery APP, and may also include calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other APPs (not shown in the figure).
[0123] The application framework layer 220 provides an application access interface and a programming framework for the applications of the application layer 210 .
[0124] For example, the application framework layer 220 includes a camera access interface, which is used to provide camera shooting services through camera management and camera devices.
[0125] The camera management in the application framework layer 220 is used to manage the camera. The camera management can obtain the parameters of the camera, such as determining the working status of the camera.
[0126] The camera device in the application framework layer 220 is used to provide a data access interface between different camera devices and camera management.
[0127] In addition, the application framework layer may also include charging management services, power management services, and gallery management services.
[0128] The charging management service, as a service module of the charging management module, can manage and provide services for the charging process of the electronic device. In a specific embodiment, the charging management service can provide charging-related information to other modules in the software architecture, such as information on whether the electronic device has started charging.
[0129] The power management service is used to monitor and manage the power of the electronic device. In one embodiment, the power management service can monitor the power of the electronic device through a power meter.
[0130] The gallery management service is a service module of the gallery APP, which is used to receive calls from the gallery APP and implement the processing of images saved in the electronic device, including management, viewing, moving, copying, editing and deletion. In an embodiment of the present application, the gallery management service may include a first judgment module, a basic service module and a data management module. The first judgment module is used to determine whether to call the image post-processing module to perform image post-processing on the image based on the type of image and the type of operation on the image. The basic service module is used to manage, view, move, copy, edit and delete images in response to user operations. The data management module is used to record and manage historical image data, and determine user habit information based on historical image data analysis. Among them, user habit information is used to characterize whether the user is accustomed to viewing the acquired image immediately (within a preset time period) after taking the photo. Historical image data may include data such as the shooting time of the historical image and the time it was first viewed. Historical images refer to images acquired before the current moment.
[0131] The hardware abstraction layer 230 is used to abstract hardware. For example, the hardware abstraction layer 230 may include a camera hardware abstraction layer and hardware device abstraction layers for other devices (not shown). The camera hardware abstraction layer may include camera device 1, camera device 2, and so on. The camera hardware abstraction layer may be connected to a camera algorithm library, allowing the camera hardware abstraction layer to call algorithms in the camera algorithm library.
[0132] Optionally, in an embodiment of the present application, the camera algorithm library may include a second judgment module, a third judgment module, and an image post-processing module. The second judgment module is configured to determine whether to call the image post-processing module to perform image post-processing on the initial image based on the power level provided by the power management service, or based on the power level provided by the power management service and the user habit information provided by the gallery management service. The third judgment module is configured to determine whether to call the image post-processing module to perform image post-processing on the initial image based on at least one of the charging-related information provided by the charging management service and the power level provided by the power management service.
[0133] The image post-processing module is used to receive calls from the first judgment module, the second judgment module, or the third judgment module, and perform image post-processing on the initial image. Image post-processing may include image enhancement processing, image scaling processing, etc. Image enhancement processing includes but is not limited to image noise reduction processing, saturation processing, etc. It should be noted that image post-processing may include default processing of the initial image, and may also include processing of the initial image according to the camera mode selected by the user. The embodiments of the present application do not impose any restrictions on the specific content of image post-processing.
[0134] It should be noted that the above-mentioned first judgment module, second judgment module and third judgment module all perform the judgment of whether to perform image post-processing, but the judgment of the second judgment module is performed during the photo-taking stage. At this time, the initial image can be saved in the cache but not in the memory; while the judgment of the first judgment module and the third judgment module is after the initial image is saved in the memory, and is used to judge whether to start image post-processing of the initial image saved in the memory.
[0135] The driver layer 240 is used to provide drivers for different hardware devices. For example, the driver layer may include a camera device driver.
[0136] The hardware layer 250 may include a camera, an image signal processor, and other hardware devices.
[0137] The following describes the workflow of the software system of the electronic device 100 in conjunction with a photo-taking scenario:
[0138] When touch sensor 180K receives a user touch operation, for example, a single-touch operation, where the corresponding control is a photo-taking control in the camera app, the camera app is awakened by the single-touch operation. The camera app invokes the various camera devices in the camera hardware abstraction layer through the camera access interface of the application framework layer. For example, after determining the current zoom factor, the camera hardware abstraction layer can issue a command to the camera device driver to invoke the camera.
[0139] When the hardware-layer camera is called, it captures the raw image and sends it to the image signal processor for preliminary processing, such as registration and decoding, to generate the initial image. The image signal processor returns the processed initial image data to the hardware abstraction layer via the camera device driver. At this point, the second determination module in the camera algorithm library determines whether to invoke the image post-processing module to perform image post-processing on the initial image based on at least one of the power level provided by the power management service and the user behavior information provided by the image library management service.
[0140] Specifically, if at least one of the battery level and user habit information meets a corresponding preset condition, the second judgment module invokes the image post-processing module to perform image post-processing on the initial image to obtain a final image. The image post-processing module sends the final image back to the camera app via the camera hardware abstraction layer and the camera access interface for storage. The camera app stores the final image in a preset storage location, such as an album in a preset storage path (hereinafter referred to as the first preset album).
[0141] If neither the battery level nor the user's habit information satisfies the corresponding preset conditions, the initial image is sent back to the camera app via the camera hardware abstraction layer and the camera access interface for storage. The camera app stores the initial image in a second preset album, which can be the same as or different from the first preset album.
[0142] The following describes the workflow of the software system of the electronic device 100 in conjunction with an image viewing scenario:
[0143] When the touch sensor 180K receives a touch operation from the user, take the case where the touch operation is a single-click operation, and the object of the single-click operation is a thumbnail of an image in the interface of the gallery APP as an example. In response to the user's single-click operation on the thumbnail, the gallery APP determines whether the image corresponding to the thumbnail is the initial image through the first judgment module in the gallery management service of the application framework layer. If the image corresponding to the thumbnail is the initial image, the first judgment module calls the image post-processing module in the camera algorithm library of the hardware abstraction layer to perform image post-processing on the initial image to obtain a finished image. The image post-processing module returns the finished image to the basic service module in the gallery management service, and the basic service module displays the finished image and saves the obtained finished image in the first preset album. If the image corresponding to the thumbnail is a finished image, the basic service module directly displays the finished image.
[0144] Additionally, the third determination module may determine whether to invoke the image post-processing module to perform image post-processing on the initial image stored in the second preset album based on at least one of the charging-related information provided by the charging management service and the power level provided by the power management service. Specifically, if at least one of the charging-related information and the power level meets a corresponding preset condition, the third determination module invokes the image post-processing module to perform image post-processing on the initial image stored in the second preset album to generate a final image, and save the final image in the first preset album.
[0145] Optionally, the third judgment module can periodically obtain charging-related information and power from the charging management service and the power management service, and determine whether to call the image post-processing module to perform image post-processing on the saved initial image. Optionally, the third judgment module can also subscribe to charging-related information and power from the charging management service and the power management service. When the charging status or power situation, power mode, etc. change, the charging management service and the power management service will actively send the changed status and information to the third judgment module. This embodiment of the application does not impose any restrictions on this.
[0146] For ease of understanding, the following embodiments of this application will take an electronic device having the structure shown in Figures 2 and 3 as an example, and combine the accompanying drawings and application scenarios to specifically explain the image processing method provided in the embodiments of this application.
[0147] Example 1:
[0148] FIG4 and FIG5 are flowcharts of an image processing method according to an embodiment of the present application. As shown in FIG4 and FIG5 , the method includes:
[0149] S101. The camera APP obtains an initial image in response to a user's photo-taking operation and calls a second judgment module in a camera algorithm library.
[0150] Optionally, the user's photo-taking operation can be, for example, the user clicking the photo-taking control in the preview interface of the camera APP in the above embodiment, or the user inputting the photo-taking command by voice, or the user inputting a preset gesture, or capturing the user's preset expression, etc. The embodiment of the present application does not impose any limitation on the specific form of the photo-taking operation. When the camera APP detects the user's photo-taking operation, it finally calls the camera to take a photo through the camera access interface, the various camera devices of the camera hardware abstraction layer, and the camera device driver, and obtains the initial image after preliminary processing such as alignment and decoding by the image signal processor. For details, please refer to the above embodiment and will not be repeated here. For the sake of convenience of description, in this embodiment, the execution subject of the above-mentioned photo-taking process is summarized as the camera APP.
[0151] Optionally, the initial image can be in .raw format.
[0152] It is understood that each initial image may have a unique name or number to distinguish it from other initial images. In a specific embodiment, the initial images may be distinguished by name, and each initial image may be named based on the capture time and image format. For example, the name of the initial image may be IMG_20220801_080119.raw.
[0153] S102. The second judgment module in the camera algorithm library determines whether the power level of the electronic device is greater than the first preset power threshold in response to the call of the camera APP; if so, execute step S103 (see Figure 4); if not, execute step S106 (see Figure 5).
[0154] Specifically, the second determination module may obtain the power level of the electronic device from the power management service, and compare the power level of the electronic device with the first preset power threshold.
[0155] Optionally, the first preset power threshold may be, for example, 20% of the total power of the electronic device.
[0156] S103: The second judgment module sends a post-processing instruction message to the image post-processing module. The post-processing instruction message is used to instruct to perform image post-processing on the initial image.
[0157] Optionally, the post-processing indication message may carry information such as the name of the initial image to be processed.
[0158] S104 . The image post-processing module obtains an initial image from the camera APP in response to the post-processing instruction message, performs image post-processing on the initial image to obtain a finished image, and sends the finished image to the camera APP.
[0159] That is to say, when the power level of the electronic device is greater than the first preset power threshold, the initial image is directly post-processed to obtain a completed image.
[0160] Optionally, the completed image may be in .jpg format or .png format, etc.
[0161] It is understood that each image in a sheet can have a unique name or number to distinguish it from other images in a sheet. In a specific embodiment, the images in a sheet can be distinguished by name. Each image in a sheet can be named based on the capture time of the corresponding initial image and the format of the image in the sheet. For example, the name of the image in a sheet can be IMG_20220801_080119.jpg or IMG_20220801_080119.png, etc.
[0162] S105. The camera APP saves the completed image in a first preset album, generates a thumbnail of the completed image, and establishes a corresponding relationship between the thumbnail and the completed image.
[0163] Specifically, the finished image obtained by image post-processing can be saved in the first preset album according to the first preset storage path. Optionally, the thumbnail of the finished image can be generated based on the finished image or the initial image corresponding to the finished image, including part or all of the contents of the finished image or the initial image. The embodiment of the present application does not impose any restrictions on the specific content, generation method, etc. of the thumbnail of the finished image. After the thumbnail is generated, when the user opens the interface of the first preset album through the gallery app, the preset number of thumbnails of the images are displayed in the interface.
[0164] It is understood that each thumbnail can have a unique name or number. Optionally, the name or number of the thumbnail can be used to establish a correspondence with the name or number of the complete image. For example, if the thumbnail is named A and the complete image is named IMG_20220805_110707.jpg, a correspondence between A and IMG_20220805_110707.jpg can be established, thereby establishing a correspondence between the thumbnail and the complete image.
[0165] S106. The second judgment module sends a save instruction message to the camera APP, where the save instruction message is used to instruct to save the initial image.
[0166] Specifically, the save instruction message may carry information such as the name of the initial image.
[0167] S107 . The camera APP saves the initial image in a second preset album, generates a thumbnail of the initial image, and establishes a corresponding relationship between the thumbnail and the initial image.
[0168] As mentioned above, the second preset album may be the same as or different from the first preset album.
[0169] That is, when the battery level of the electronic device is less than or equal to the first preset battery threshold, the initial image is temporarily not post-processed, but directly saved in the second preset album, and a thumbnail of the initial image is generated, establishing a correspondence between the thumbnail and the initial image. Optionally, the thumbnail of the initial image can be generated based on the initial image, including part or all of the content in the initial image.
[0170] Optionally, a correspondence can be established between the name or number of the thumbnail and the name or number of the original image. For example, if the thumbnail is named B and the finished image is named IMG_20220805_110707.raw, a correspondence between B and IMG_20220805_110707.raw can be established to establish a correspondence between the thumbnail and the original image.
[0171] The user interface of the above process is described below with reference to the accompanying drawings.
[0172] For example, Figure 6 is a schematic diagram of interface changes during a photo-taking process provided by an embodiment of the present application. Taking a mobile phone as an example, as shown in Figure 6 (a), a user clicks the camera icon on the desktop. In response to the user's operation, the electronic device opens the camera app and displays a preview interface, as shown in Figure 6 (b). When the user clicks the photo control in the preview interface, the electronic device captures a photo through the camera. If the electronic device's battery level is greater than a first preset battery threshold, a finished image is generated and saved to a first preset album. If the electronic device's battery level is less than or equal to the first preset battery threshold, the initial image is saved to a second preset album. Regardless of the battery level, thumbnails corresponding to the images are generated. In a specific embodiment, the thumbnail corresponding to the most recent image is shown as 601 in Figure 6 (c). Furthermore, taking the example of the first preset album and the second preset album being the same, if the user opens the album through the gallery app, the album interface also displays thumbnails corresponding to the finished image and the initial image, as shown in Figure 6 (d).
[0173] In this embodiment, when the electronic device's battery level is less than or equal to a first preset battery level threshold, the captured initial image is not processed and is directly saved in a second preset album. This avoids image post-processing, saving power, extending the electronic device's battery life, and improving the user experience.
[0174] For the initial image saved in the second preset album when the electronic device's battery level is less than or equal to the first preset battery level threshold in the above process, the electronic device may initiate image post-processing of the initial image in the following situations:
[0175] 1) It is detected that the user performs preset operations such as viewing, sharing, moving, copying and editing on the initial image.
[0176] When the electronic device detects that the user performs a preset type of operation such as viewing, sharing, copying and editing on the initial image, the post-processing of the initial image is started.
[0177] For example, FIG7 is a flowchart of another image processing method provided in an embodiment of the present application. As shown in FIG7 , the method includes:
[0178] S201: The gallery APP receives a target operation on a target image by a user.
[0179] The target image refers to the image selected by the user. The target operation refers to the operation performed by the user. Optionally, the user can perform the target operation on the target image in the gallery app or in a third-party app (such as ) to perform the target operation on the target image.
[0180] The following explains the operations of the preset types:
[0181] A view action is used to open and display an image. Optionally, the view action can be clicking a thumbnail. The thumbnail can be a thumbnail in the camera preview interface or a thumbnail in the album interface of the camera app. Optionally, the view action can be swiping left or right after opening an image.
[0182] The sharing operation is used to instruct the image to be transmitted to the target device or uploaded to the network through the transmission method selected by the user. The transmission method includes, for example, Bluetooth transmission, WLAN direct transmission, and communication APP (such as Uploading to the Internet includes, for example, uploading to a cloud disk, saving to QQ collection, etc.
[0183] The move operation is used to indicate moving an image from its current storage location to another storage location. For example, moving an image from album A to album B. It is understood that the move operation is essentially a cut operation.
[0184] The copy operation is used to copy an image and save the copied image to a specific storage location. For example, copying an image in album A and saving the copied image in album B.
[0185] Editing operations are used to indicate image editing, including but not limited to splicing, compositing, adding content to an image, or changing the content in an image.
[0186] It is understood that the aforementioned preset operations all have certain requirements for image display quality. Therefore, when a user performs these preset operations, the electronic device responding to the operation based on the finished image, rather than the initial image, can improve the image display quality and user experience. For example, when a user performs a "view" operation, the electronic device opens and displays the finished image, which, compared to opening and displaying the initial image, results in better display quality and a higher user experience.
[0187] S202: In response to the target operation, the gallery APP calls a first judgment module in the gallery management service.
[0188] S203. The first judgment module responds to the call of the gallery APP and determines whether to post-process the target image according to the type of the target image and the type of the target operation; if so, execute step S204; if not, execute step S208.
[0189] Optionally, the target image type includes an initial image and a finished image. The target operation type includes view, share, move, copy, edit, and delete.
[0190] Optionally, when the gallery APP calls the first judgment module, it may carry information such as the name of the target image, the type of target operation, etc. As in the above embodiment, the name of the target image may be named according to the shooting time and image format of the image.
[0191] Specifically, the first judgment module can determine whether the type of the target operation belongs to one of the above-mentioned preset types. If the type of the target operation does not belong to one of the above-mentioned preset types, it is determined that the target image will not be post-processed; if the type of the target operation belongs to one of the above-mentioned preset types, the first judgment module determines whether the target image is the initial image; if the target image is not the initial image (that is, the target image is a complete image), it is determined that the target image will not be post-processed; if the target image is the initial image, it is determined that the target image will be post-processed.
[0192] As a possible implementation, the first determination module may determine whether the target image is an initial image based on the name of the target image. If the target image name includes an image format of .daw, the target image is determined to be an initial image; if the target image name includes an image format of .jpg or .png, the target image is determined to be a completed image.
[0193] As another possible implementation, when the first preset album and the second preset album are different, the first determination module and the second determination module may also determine whether the target image is the initial image based on the album (i.e., storage location) where the target image is located. If the album where the target image is located is the first preset album, the target image is determined to be a completed image; if the album where the target image is located is the second preset album, the target image is determined to be the initial image.
[0194] Of course, it is also possible to determine whether the target image is the initial image in other ways, such as a preset mark, etc. The embodiment of the present application does not impose any limitation on this, and can be designed according to actual needs.
[0195] S204. The first judgment module sends a post-processing instruction message to the image post-processing module in the camera algorithm library. The post-processing instruction message is used to instruct to perform image post-processing on the initial image.
[0196] S205 . The image post-processing module performs image post-processing on the target image in response to the post-processing instruction message to obtain a finished image, and sends the finished image to the basic service module in the image library management service.
[0197] Optionally, while the image post-processing module is performing image post-processing on the target image, information indicating that the image is being processed may be displayed on the interface of the electronic device to prompt the user that the image is currently being processed, thereby improving user interaction and thereby enhancing the user experience. For example, during image post-processing, the interface may display the text "Processing, Please Wait" or a processing progress bar may be dynamically displayed on the interface, etc., although this embodiment of the present application does not impose any limitation on this.
[0198] S206: The basic service module performs corresponding processing on the completed image according to the target operation.
[0199] Specifically, if the target operation is a view operation, the basic service module displays the finished image. If the target operation is a share operation, the basic service module sends the finished image to the target device or uploads it to the network via the transmission method selected by the user. If the target operation is a copy operation, the basic service module copies the finished image and saves the copied finished image to the target album. If the target operation is a move operation, the basic service module cuts the finished image from the album and saves the finished image to the target album. If the target operation is an edit operation, the basic service module performs editing based on the finished image.
[0200] S207: The basic service module saves the completed image, generates a thumbnail of the completed image, and establishes a corresponding relationship between the thumbnail and the completed image.
[0201] Optionally, the thumbnail of the completed image here may be the same as or different from the thumbnail of the initial image corresponding to the completed image.
[0202] It can be understood that for operations such as move operations and copy operations that already include a saving step, it is not necessary to repeat the saving operation of the completed image.
[0203] In this step, after the initial image is post-processed, the resulting finished image is saved, a thumbnail of the finished image is generated, and a correspondence between the thumbnail and the finished image is established. This makes it easier for subsequent users to use the finished image through the thumbnail, improving the user experience.
[0204] Optionally, after saving the finished image, the original image and its thumbnail may be deleted.
[0205] S208: The basic service module performs corresponding processing on the target image according to the target operation.
[0206] Specifically, if the target image is a completed image, the completed image is directly processed accordingly; if the target image is an initial image, but the target operation is not an operation of the preset type, the initial image is directly processed accordingly. For example, if the target image is an initial image and the target operation is a deletion operation, the initial image is directly deleted.
[0207] In this embodiment, when the target image is an initial image and the user's operation on the target image is a preset type of operation, that is, the user has a need to use the initial image, the electronic device performs image post-processing on the initial image to generate a finished image, and responds to the target operation based on the finished image and performs corresponding processing. This can improve the processing effect of the image, meet the user's usage needs, and improve the user experience.
[0208] The following describes the display interface of the electronic device when performing the above-mentioned preset types of operations in conjunction with the accompanying drawings.
[0209] For example, FIG8 is a schematic diagram of an interface for performing a viewing operation on an image provided by an embodiment of the present application. As shown in FIG8 (a), in the camera preview interface, the user clicks on a thumbnail, that is, the user performs a viewing operation on the image corresponding to the thumbnail, and the electronic device determines whether the image corresponding to the thumbnail (target image) is the initial image in response to the user's operation. If the image corresponding to the thumbnail shown in FIG8 (a) is the initial image, the initial image is post-processed. During the image post-processing process, the interface of the electronic device may be as shown in FIG8 (b). After the image post-processing is completed, a film image is generated and the film image is displayed, as shown in FIG8 (c). In addition, taking the example that the thumbnail of the film image is different from the thumbnail of the initial image, the electronic device saves the film image, replaces the thumbnail of the original initial image with the thumbnail of the film image, and establishes a correspondence between the thumbnail of the film image and the film image. After the user performs the viewing operation and returns to the camera preview interface, the thumbnail in the interface is replaced with the thumbnail corresponding to the finished image, as shown in Figure 8 (d). For ease of distinction, in this embodiment of the application, the thumbnail with a pattern fill represents the thumbnail of the initial image, and the thumbnail without a pattern fill represents the thumbnail of the finished image.
[0210] If, in the camera preview interface, the image corresponding to the thumbnail clicked by the user is a finished image, the electronic device directly opens and displays the finished image in response to the user's viewing operation, as shown in Figure 8 (c).
[0211] For example, Figure 9 is a schematic diagram of another interface for performing an image viewing operation provided by an embodiment of the present application. As shown in Figure 9 (a), the user clicks on the Gallery app to enter the Gallery app interface, as shown in Figure 9 (b). The user then clicks on the card of a photo album, as shown in Figure 9 (b), to enter the album interface, which displays multiple thumbnails, as shown in Figure 9 (c). The user then clicks on a thumbnail, indicating that the user has performed a viewing operation on the image corresponding to the thumbnail (the target image). In response to the user's operation, the electronic device determines whether the image corresponding to the thumbnail is the initial image. If the image corresponding to the thumbnail clicked by the user is the initial image, for example, if the user clicks on thumbnail 901 in Figure 9 (b), the electronic device performs image post-processing on the initial image corresponding to thumbnail 901. During the image post-processing process, the interface of the electronic device may be as shown in Figure 9 (d). After the image post-processing is completed, a final image is generated and displayed, as shown in Figure 9 (e). In addition, the electronic device saves the finished image, replaces the original initial image thumbnail 901 with the finished image thumbnail, and establishes a correspondence between the finished image thumbnail and the finished image. After the user performs a viewing operation and returns to the album interface, the thumbnail in the interface is replaced with the thumbnail corresponding to the finished image, as shown in Figure 9 (f).
[0212] If the image corresponding to the thumbnail is a complete image, the complete image is directly opened and displayed, as shown in Figure 9 (e), and no further details are given here.
[0213] For example, FIG10 is another example of an interface diagram for performing a viewing operation on an image provided by an embodiment of the present application. Continuing from FIG9 (e), as shown in FIG10 (a), after the electronic device displays the image corresponding to thumbnail 901, a left swipe operation is performed on the display interface of the image. This operation is an image viewing operation, which is used to view the image corresponding to thumbnail 902 in FIG9 (c). In response to the user's left swipe operation, the electronic device determines that the image corresponding to thumbnail 902 is the initial image and performs image post-processing on the initial image. During the image post-processing process, the interface of the electronic device may be as shown in FIG10 (b). After the image post-processing is completed, a finished image is generated and displayed, as shown in FIG10 (c). In addition, the electronic device saves the finished image, replaces the thumbnail 902 of the original initial image with the thumbnail of the finished image, and establishes a correspondence between the thumbnail of the finished image and the finished image. Afterwards, the user returns to the album interface, and the thumbnails in the interface are replaced with thumbnails corresponding to the completed images, as shown in FIG10 (d).
[0214] For example, Figure 11 is a schematic diagram of an interface for performing an image move operation provided by an embodiment of the present application. As shown in Figure 11 (a), multiple thumbnails are displayed in the album interface. When the user long presses thumbnail 901, the thumbnail is selected and the interface shown in Figure 11 (b) is entered. Then, the user clicks the "More" control in the interface shown in Figure 10 (b), and the interface shown in Figure 11 (c) is displayed. If the user clicks the "Move to Album" option, the interface shown in Figure 11 (d) is entered. After the user selects the target album (for example, a screenshot or screen recording album), if the electronic device determines that the image corresponding to the thumbnail selected by the user is the initial image, the initial image is post-processed. During the image post-processing process, the interface of the electronic device may be as shown in Figure 11 (e). After the image post-processing is completed, a finished image is generated, the finished image is cut and saved to the target album, a thumbnail of the finished image is generated, and a correspondence between the thumbnail and the finished image is established. Then, an interface as shown in FIG11( f ) is displayed.
[0215] In operations such as sharing, copying, and editing, the interface for image post-processing of the target image is similar to the above interface and will not be described in detail.
[0216] 2) Detect that the electronic device starts charging.
[0217] For example, FIG12 is a flowchart of another image processing method provided in an embodiment of the present application. As shown in FIG12 , the method includes:
[0218] S301: The charging management service detects that the electronic device starts charging.
[0219] Optionally, when the electronic device is plugged into a charger, or the electronic device is close to a wireless charging transmitter, the charging management service detects that the electronic device starts charging.
[0220] S302: The charging management service sends charging start information to the third judgment module of the camera algorithm library. The charging start information is used to indicate that the electronic device starts charging.
[0221] S303: The third determination module sends a post-processing instruction message to the image post-processing module in response to the charging start information. The post-processing instruction message is used to instruct to perform image post-processing on the initial image.
[0222] S304. The image post-processing module obtains the initial image in response to the post-processing instruction message, performs image post-processing on the initial image to obtain a finished image, and sends the finished image to the basic service module in the image library management service.
[0223] S305: The basic service module saves the completed image, generates a thumbnail of the completed image, and establishes a corresponding relationship between the thumbnail and the completed image.
[0224] In this embodiment, when it is detected that the electronic device has started charging, image post-processing of the initial image is started to generate a finished image. In this way, after the electronic device starts charging, the image post-processing of the initial image is performed promptly, ensuring the image quality when the user uses the image, thereby improving the user experience.
[0225] 3) Detecting that the power level of the electronic device exceeds a second preset power level threshold.
[0226] For example, FIG13 is a flowchart of another image processing method provided in an embodiment of the present application. As shown in FIG13 , the method includes:
[0227] S401: The power management service detects that the power level of the electronic device exceeds a second preset power level threshold.
[0228] Optionally, the second preset power threshold may be greater than the first power threshold, for example, may be 30%.
[0229] S402: The power management service sends power increase information to the third judgment module of the camera algorithm library. The power increase information is used to indicate that the power of the electronic device exceeds a second preset power threshold.
[0230] S403: The third judgment module sends a post-processing instruction message to the image post-processing module in response to the power increase information. The post-processing instruction message is used to instruct to perform image post-processing on the initial image.
[0231] S404: The image post-processing module responds to the post-processing instruction message, obtains the initial image, performs image post-processing on the initial image, obtains a finished image, and sends the finished image to the basic service module in the image library management service.
[0232] S405: The basic service module saves the completed image, generates a thumbnail of the completed image, and establishes a corresponding relationship between the thumbnail and the completed image.
[0233] In this embodiment, upon detecting that the electronic device's battery level has exceeded a second preset battery threshold, image post-processing is initiated on the initial image to generate a finished image. This allows for timely image post-processing of the initial image after the electronic device's battery level is sufficiently high, without affecting the device's battery life. Furthermore, the image display quality is maintained when the user uses the image, improving the user experience.
[0234] It is understandable that in some embodiments, image post-processing of the initial image can also be started when the charging condition and power condition of the electronic device meet certain conditions. For example, if it is detected that the electronic device is charging and the power level exceeds the third preset power threshold, the image post-processing of the initial image is started. In this way, in a scenario where the electronic device has low power but the user's charging conditions are limited and cannot be charged to a sufficiently high level, the post-processing of the initial image is not started, thereby saving power, extending the battery life of the electronic device, and improving the user experience. This application does not impose any restrictions on the triggering conditions for the electronic device to start the image post-processing of the initial image, and can be set according to actual conditions.
[0235] Example 2
[0236] FIG14 and FIG15 are flowcharts of another image processing method provided in an embodiment of the present application. As shown in FIG14 and FIG15 , the method includes:
[0237] S501. The camera APP obtains an initial image in response to a user's photo-taking operation and calls a second judgment module in a camera algorithm library.
[0238] S502. The second judgment module in the camera algorithm library determines whether the power level of the electronic device is greater than a first preset power threshold in response to the call of the camera APP; if not, execute step S503; if so, execute step S505.
[0239] S503: The second judgment module obtains user habit information from the data management module of the gallery management service.
[0240] The user habit information is used to indicate whether the user is accustomed to viewing the acquired images immediately after taking a photo, that is, whether the user is accustomed to viewing the taken photos immediately after taking a photo.
[0241] Specifically, the data management module can obtain user habit information based on historical image data analysis. Historical image data includes information such as the image acquisition time and the time when the historical image was first viewed. A historical image refers to an image acquired before the current moment. The image acquisition time of a historical image is also the time when the historical image was captured. The time when the historical image was first viewed is also the time when the historical image was first viewed by the user. It is understood that the data management module can obtain user habit information based on historical image data analysis within a preset historical time period. For example, the historical image data within a preset historical time period is historical image data within a period of 7 days with the current moment as the end moment, that is, historical image data within 7 days before the current moment.
[0242] In a specific embodiment, referring to FIG16 , the data management module analyzes and obtains user habit information according to the following process.
[0243] S531. Divide the preset historical time period into n sub-time periods, where n is an integer greater than 1.
[0244] S532: For each sub-time period (hereinafter, the first sub-time period is taken as an example, and the first sub-time period is any one of the n sub-time periods), perform the following steps to determine whether the sub-time period is a target time period:
[0245] S5321: Count the number of images captured within the first sub-time period based on the capture time of the images to obtain a total number of images captured in the first sub-time period.
[0246] S5322. Obtain the first viewing time of each image whose shooting time is within the first sub-time period;
[0247] S5323. Determine the number of images whose shooting time is within the first sub-time period and whose time interval between the first viewing time and the shooting time is less than a preset time length, and obtain the number of immediately viewed images in the first sub-time period; optionally, the preset time length can be, for example, 5 minutes.
[0248] S5324. Determine whether the ratio of the number of immediately viewed images to the total number of images captured in the first sub-time period is greater than a preset ratio; if so, execute step S5325; optionally, the preset ratio is, for example, 1:2.
[0249] S5325. Determine the first sub-time period as the target time period.
[0250] S533: Determine whether the proportion of the target time period in the n sub-time periods is greater than a preset proportion; if so, obtain first user habit information, the first user habit information being used to indicate that the user is accustomed to reviewing photos immediately after taking them; if not, obtain second user habit information, the second user habit information being used to indicate that the user is not accustomed to reviewing photos immediately after taking them. Optionally, the preset proportion is, for example, 60%.
[0251] Optionally, the first user habit information may be expressed in text form, in the form of an assignment, or in other ways, and the embodiments of the present application do not impose any limitation on this.
[0252] S504. The second judgment module determines whether to perform image post-processing based on the acquired user habit information; if so, execute step S505 (as shown in FIG14 ); if not, execute step S508 (as shown in FIG15 ).
[0253] Specifically, if the user habit information is the first habit information, it is determined to perform image post-processing; if the user habit information is the second habit information, it is determined not to perform image post-processing.
[0254] S505: The second judgment module sends a post-processing instruction message to the image post-processing module. The post-processing instruction message is used to instruct to perform image post-processing on the initial image.
[0255] S506 , the image post-processing module obtains the initial image from the camera APP in response to the post-processing instruction message, performs image post-processing on the initial image to obtain a finished image, and sends the finished image to the camera APP.
[0256] S507. The camera APP saves the finished image in a first preset album, generates a thumbnail of the finished image, and establishes a corresponding relationship between the thumbnail and the finished image.
[0257] S508. The second judgment module sends a save instruction message to the camera APP, where the save instruction message is used to instruct to save the initial image.
[0258] S509 , the camera APP saves the initial image in a second preset album, generates a thumbnail of the initial image, and establishes a correspondence between the thumbnail and the initial image.
[0259] It can be seen that the difference between the above process and the first embodiment lies in the different judgment conditions of the second judgment module. The judgment conditions in this embodiment include not only the power level, but also the user habit information. When the power level of the electronic device is less than or equal to the first preset power threshold, the user habit information is further obtained to determine whether the user is accustomed to viewing the taken photos immediately after taking the photos. If the user is accustomed to viewing the taken photos immediately, the initial image is directly post-processed; if the user is not accustomed to viewing the photos immediately after taking the photos, the image post-processing of the initial image is delayed. In this way, while considering saving power consumption and extending the battery life of the electronic device, the user's usage habits are further taken into consideration, thereby further improving the user experience.
[0260] In the above process, if the ratio of the number of immediately viewed images corresponding to the target time period to the total number of images captured during the target time period is greater than a preset ratio, the target time period is the time period during which the user is more likely to view the captured images immediately after taking a photo. If the proportion of the target time period within the n sub-time periods is greater than the preset proportion, it indicates that the user is accustomed to viewing the captured images immediately after taking a photo. Therefore, the proportion of the target time period within the n sub-time periods can accurately determine user habits, allowing image processing to better align with user habits and further improve the user experience.
[0261] It can be understood that after the initial image is saved according to the process of the second embodiment, the triggering timing of the subsequent image post-processing of the initial image can be the same as that in the first embodiment, and will not be repeated here.
[0262] The above describes in detail an example of the image processing method provided by the embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0263] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above-mentioned 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 embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0264] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0265] The electronic device provided in this embodiment is used to execute the above-mentioned image processing method, and thus can achieve the same effect as the above-mentioned implementation method.
[0266] When integrated, the electronic device may also include a processing module, a storage module, and a communication module. The processing module may be used to control and manage the operation of the electronic device. The storage module may be used to support the execution of program code and data stored in the electronic device. The communication module may be used to support communication between the electronic device and other devices.
[0267] The processing module may be a processor or a controller. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, or a Wi-Fi chip.
[0268] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a device having the structure shown in FIG. 2 .
[0269] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the image processing method of any of the above embodiments.
[0270] An embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the image processing method in the above-mentioned embodiment.
[0271] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the image processing method in the above-mentioned method embodiments.
[0272] 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 methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0273] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0274] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as 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 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.
[0275] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0276] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0277] 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 readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0278] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An image processing method, the method being executed by an electronic device, characterized in that: The method comprises: In response to a first operation of a user, a first image is acquired; the first image is an image that has not been subjected to image post-processing; obtaining the power level of the electronic device; When a preset condition is met, the first image is saved, a first thumbnail is generated, and a correspondence between the first thumbnail and the first image is established; the preset condition at least includes: the power level of the electronic device is less than a first preset power threshold.
2. The method according to claim 1, characterized in that Before saving the first image, generating a first thumbnail, and establishing a correspondence between the first thumbnail and the first image, the method further includes: Determining user habit information, where the user habit information is used to indicate whether the user is accustomed to viewing the acquired image within a preset time period after shooting is completed; The preset condition also includes: the user habit information is first information; the first information is used to represent that the user is not accustomed to viewing the acquired image within the preset time period after shooting is completed.
3. The method according to claim 2, characterized in that Determining user habit information includes: Divide the preset historical time period into n sub-time periods, where n is an integer greater than 1; Determining the number of target time periods in the n sub-time periods; wherein a ratio of a first number corresponding to the target time period to a second number corresponding to the target time period is greater than a first preset ratio, the first number corresponding to the target time period refers to the number of images whose shooting time falls within the target time period and whose time interval between a first viewing time and a shooting time is less than a preset time length, and the second number corresponding to the target time period refers to the total number of images whose shooting time falls within the target time period; If the ratio of the number of the target time periods to n is less than or equal to a second preset ratio, determining the user habit information as the first information; If the ratio of the number of the target time periods to n is greater than the second preset ratio, the user habit information is determined to be the second information; the second information is used to represent that the user is accustomed to viewing the acquired images within the preset time after shooting is completed.
4. The method according to claim 3, characterized in that The determining the number of target time periods in the n sub-time periods includes: Performing a first process on each of the sub-time periods to obtain a processing result corresponding to each of the sub-time periods, the processing result including whether the sub-time period is the target time period or whether the sub-time period is not the target time period; Obtaining the number of the target time periods in the n sub-time periods by counting the processing results corresponding to the sub-time periods; The first process includes: Counting the total number of images captured within a first sub-time period to obtain a second number corresponding to the first sub-time period; the first sub-time period is any one of the n sub-time periods; Obtaining the first viewing time of each image whose shooting time is within the first sub-time period; Determine the number of images whose shooting times are within the first sub-time period and whose time interval between the first viewing time and the shooting time is less than the preset time length, to obtain a first number corresponding to the first sub-time period; If a ratio of a first number corresponding to the first sub-time period to a second number corresponding to the first sub-time period is greater than the first preset ratio, the first sub-time period is determined to be the target time period.
5. The method according to any one of claims 1 to 4, characterized in that After saving the first image, generating a first thumbnail, and establishing a correspondence between the first thumbnail and the first image, the method further includes: receiving a second operation of the user on the first image; If the type of the second operation is one of the preset types, performing the image post-processing on the first image to obtain a second image, and processing the second image according to the type of the second operation; If the type of the second operation is not any of the preset types, processing the first image according to the type of the second operation.
6. The method according to claim 5, characterized in that The method further comprises: During the process of performing the image post-processing on the second image, third information is displayed, where the third information is used to indicate that the image post-processing is being performed on the first image.
7. The method according to claim 5 or 6, characterized in that The preset type includes at least one of a viewing operation, a sharing operation, a moving operation, a copy operation, and an editing operation.
8. The method according to any one of claims 5 to 7, characterized in that The receiving a second operation of the user on the first image includes: displaying the first thumbnail; The second operation performed by the user on the first thumbnail is received.
9. The method according to any one of claims 5 to 8, characterized in that After performing the image post-processing on the first image to obtain the second image, the method further includes: The second image is saved, a second thumbnail is generated, and a correspondence between the second thumbnail and the second image is established.
10. The method according to any one of claims 1 to 4, characterized in that After saving the first image, generating a first thumbnail, and establishing a correspondence between the first thumbnail and the first image, the method further includes: When it is detected that the electronic device starts charging, or the power level of the electronic device is greater than a second preset power threshold, or the electronic device is in a charging state and the power level of the electronic device is greater than a third preset power threshold, the first image is post-processed to obtain a second image.
11. An electronic device, characterized in that: include: processors, memory, and interfaces; The processor, the memory, and the interface cooperate with each other so that the electronic device executes the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 10.