Photographing method and device, electronic equipment and storage medium
By dynamically adjusting the image processing method in the HDR mode of the mobile device, the image processing process is optimized according to the memory pressure state, the problem of lag caused by insufficient memory is solved and the user experience is improved.
Patent Information
- Application Number
- CN202410196194.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-21
- Publication Date
- 2025-08-22
AI Technical Summary
When performing fast shooting in HDR mode of mobile devices, insufficient memory leads to a sharp drop in performance, resulting in lag in photography or abnormal exit, and poor user experience.
By acquiring the operating memory usage of the device, determining the memory pressure state, and dynamically adjusting the image processing method, including the first image processing method and the second image processing method, avoiding task accumulation and ensuring the smooth progress of the fast photography process.
It effectively avoids the stuttering and abnormal exit of fast photography in HDR mode, improving the user experience.
Smart Images

Figure CN120529192A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a photographing method, apparatus, electronic device, and storage medium. Background Art
[0002] Currently, cameras in mobile devices have various shooting functions, such as normal shooting function, time-lapse shooting function, quick shooting function, high-speed shooting function (requiring frequent clicks of the shooting button), etc., so that users can take pictures according to their needs.
[0003] Among them, some photo functions require higher memory to process image data. For example, the fast shooting function in HDR (high-dynamic range) mode needs to generate multiple (such as 50) identical image data at the same time and store them in the album. Therefore, processing the photo process one by one requires repeatedly applying for memory for data transmission and processing. If the terminal device has low memory or insufficient memory due to aging, it will cause the terminal device performance to drop sharply and the temperature to rise, which will lead to the accumulation of the number of tasks to be processed, resulting in photo lag or abnormal exit, and a poor user experience. Summary of the Invention
[0004] The present disclosure provides a photographing method, apparatus, electronic device, and storage medium to at least solve the technical problem of poor user experience when performing rapid photographing in HDR mode in the related art.
[0005] According to one aspect of the present disclosure, a photographing method is provided, the method comprising:
[0006] When the device is in HDR mode, in response to a user operation triggering a quick photo event, obtaining the running memory usage of the device;
[0007] Determining a memory pressure state of the device based on the running memory usage;
[0008] An image processing method is determined based on the memory pressure state, and a target image is obtained based on the image processing method to complete rapid photography.
[0009] Optionally, the running memory usage includes memory usage, and obtaining the running memory usage of the device includes: obtaining the memory usage of the device by calling an interface.
[0010] Optionally, determining the memory pressure state of the device based on the running memory usage includes:
[0011] Determining a memory pressure value of the device based on the running memory usage, wherein the memory pressure value is a percentage of the running memory usage to the total running memory;
[0012] If the memory pressure value is greater than a preset pressure value, determining that the device is in a high memory pressure state;
[0013] If the memory pressure value is less than or equal to the preset pressure value, it is determined that the device is in a low memory pressure state.
[0014] Optionally, determining an image processing method based on the memory pressure state, and obtaining a target image based on the image processing method to complete rapid photography, includes:
[0015] If the memory pressure state is a low memory pressure state, obtaining a first image by a first image processing method;
[0016] If the memory pressure state is a high memory pressure state, determining a second image processing method based on the number of tasks accumulated in the current image processing flow in the rapid photo shooting event, and obtaining a second image by using the second image processing method;
[0017] The target image obtained by format conversion of the first image or the second image is stored in the photo album, and the above steps are repeated until the target image corresponding to each photo in the quick photo event is stored in the photo album, thereby completing the quick photo event.
[0018] Optionally, the determining the second image processing method based on the number of tasks accumulated in the current image processing flow in the rapid photo shooting event includes:
[0019] Determine whether the number of tasks accumulated in the current image processing flow in the rapid photo shooting event is greater than a preset threshold;
[0020] If the task accumulation number is greater than a preset threshold, determining the second image processing method to be the third image processing method;
[0021] If the task accumulation number is equal to a preset threshold, the second image processing method is determined to be the first image processing method.
[0022] Optionally, when it is determined that the second image processing method is a third image processing method, obtaining the second image by using the second image processing method includes obtaining the second image by using the third image processing method;
[0023] The obtaining of the second image by the third image processing method includes:
[0024] Change the link indicator value in the link configuration file to a non-HDR mode indicator value;
[0025] reconfiguring the link based on the link indication value in the link configuration file;
[0026] In response to a successful configuration, acquiring the first format image obtained by the image processor, and performing format conversion on the first format image to obtain a second format image;
[0027] The second format image is determined as a second image.
[0028] According to another aspect of the present disclosure, a photographing device is provided, the device comprising:
[0029] an acquisition module, configured to acquire, when the device is in HDR mode, a running memory usage of the device in response to a quick photo event triggered by a user operation;
[0030] a determination module, configured to determine a memory pressure state of the device based on the running memory usage;
[0031] The processing module is used to determine an image processing method based on the memory pressure state, and obtain a target image based on the image processing method to complete rapid photography.
[0032] Optionally, the processing module is specifically configured to:
[0033] If the memory pressure state is a low memory pressure state, obtaining a first image by a first image processing method;
[0034] If the memory pressure state is a high memory pressure state, determining a second image processing method based on the number of tasks accumulated in the current image processing flow in the rapid photo shooting event, and obtaining a second image by using the second image processing method;
[0035] The target image obtained by format conversion of the first image or the second image is stored in the photo album, and the above steps are repeated until the target image corresponding to each photo in the quick photo event is stored in the photo album, thereby completing the quick photo event.
[0036] Optionally, the processing module is further configured to:
[0037] Determine whether the number of tasks accumulated in the current image processing flow in the rapid photo shooting event is greater than a preset threshold;
[0038] If the task accumulation number is greater than a preset threshold, determining the second image processing method to be the third image processing method;
[0039] If the task accumulation number is equal to a preset threshold, the second image processing method is determined to be the first image processing method.
[0040] Optionally, the processing module is further configured to:
[0041] Change the link indicator value in the link configuration file to a non-HDR mode indicator value;
[0042] reconfiguring the link based on the link indication value in the link configuration file;
[0043] In response to a successful configuration, acquiring the first format image obtained by the image processor, and performing format conversion on the first format image to obtain a second format image;
[0044] The second format image is determined as a second image.
[0045] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0046] at least one processor; and
[0047] a memory communicatively connected to the at least one processor; wherein,
[0048] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods described in the above aspect.
[0049] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods described in the aforementioned aspect.
[0050] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of the aforementioned aspects.
[0051] In one or more embodiments of the present disclosure, when a device is in HDR mode, a quick capture event is triggered in response to a user operation, the device's runtime memory usage is obtained, and based on the runtime memory usage, the device's memory pressure state is determined. An image processing method is then determined based on the memory pressure state, and a target image is obtained based on the image processing method to complete the quick capture. Thus, the present disclosure uses a dynamic capture strategy to determine an image processing method that is appropriate for the current memory pressure state, thereby avoiding freezes or abnormal exits in quick capture in HDR mode and improving the user experience.
[0052] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0054] Figure 1 A schematic diagram showing a flow chart of a photographing method provided by one embodiment of the present disclosure is shown;
[0055] Figure 2 A schematic diagram showing a flow chart of a photographing method provided by one embodiment of the present disclosure is shown;
[0056] Figure 3 A schematic diagram showing a flow chart of a photographing method provided by another embodiment of the present disclosure;
[0057] Figure 4 A schematic diagram showing a flow chart of a photographing method provided by another embodiment of the present disclosure;
[0058] Figure 5 A schematic structural diagram of a photographing device provided by an embodiment of the present disclosure is shown;
[0059] Figure 6 It is a block diagram of an electronic device used to implement the photographing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0060] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0061] Existing technologies improve the user experience by reserving and locking memory for photo capture calls, optimizing the photo capture process, improving input and output formats, or displaying intermediate images as fake images. However, these methods all require memory processing and cannot effectively handle the lag or abnormal exit that may occur when using the fast capture function in HDR mode on low-memory devices or aging devices.
[0062] Specifically, when executing fast photography in HDR mode in the prior art, it may be necessary to generate multiple identical HDR image data and store them in the album at the same time. Processing the image processing flow one by one will result in multiple requests for the memory for loading the image data, resulting in high memory load (i.e., high memory pressure). Combined with insufficient memory under the aging performance of the terminal device or the low memory of the terminal device, the performance of the terminal device will drop sharply and the temperature will rise, thereby actively limiting the GPU / CPU frequency, affecting the processing speed of the terminal device, causing the pending tasks to begin to accumulate, and thus actively killing the camera process, which will cause the fast photography to become stuck or exit abnormally.
[0063] Figure 1 FIG. 1 is a flow chart of a photographing method proposed in an embodiment of the present disclosure. Figure 1 The photographing method includes:
[0064] S101, when the device is in HDR mode, in response to a user operation triggering a quick photo event, obtaining the device's running memory usage.
[0065] It should be noted that the execution subject of the photographing method of this embodiment is a photographing device, which can be implemented by software and / or hardware. The device can be configured in a terminal device, which can be a mobile phone, tablet, etc.
[0066] In some embodiments, the aforementioned rapid photo event can be used to indicate that a terminal device needs to generate multiple images simultaneously. In some embodiments, the number of images to be generated in a rapid photo event can be pre-set, for example, 50 images need to be generated after the rapid photo event is triggered. In some embodiments, after the rapid photo event is triggered, multiple images can be generated according to user needs.
[0067] In some embodiments, a user can trigger a quick photo event by pressing a camera button or another button designated for quick photos (e.g., a volume button). That is, the device can monitor the button to determine whether a quick photo event has occurred. For example, a user can trigger a quick photo event by opening the camera and sliding the shutter to the left or right.
[0068] In some embodiments, when the device is in HDR mode, it is necessary to capture high dynamic range photos by fusing multiple frames of images. At this time, if a user operation triggers a quick photo event, multiple HDR images need to be generated simultaneously.
[0069] In some embodiments, after a quick photo event is triggered by a user operation, the device's runtime memory usage can be obtained to determine the device's current runtime memory usage. In some embodiments, the device's runtime memory usage can be obtained by calling an interface. For example, the terminal device's runtime memory usage can be obtained by calling the GetMemPrecssure interface.
[0070] S102: Determine a memory pressure state of the device based on the running memory usage.
[0071] In some embodiments, after obtaining the current running memory usage of the device through the above steps, the memory pressure state of the device can be determined based on the running memory usage. Specifically, in some embodiments, the method for determining the memory pressure state of the device based on the running memory usage may include the following steps:
[0072] S1021: Determine a memory pressure value of the device based on the running memory usage.
[0073] In some embodiments, the memory pressure value is a percentage of the running memory usage to the total running memory, that is, the memory pressure value = (running memory usage / total running memory) × 100%.
[0074] S1022: If the memory pressure value is greater than the preset pressure value, it is determined that the device is in a high memory pressure state.
[0075] S1023: If the memory pressure value is less than or equal to the preset pressure value, it is determined that the device is in a low memory pressure state.
[0076] In some embodiments, if the memory pressure value is greater than the preset pressure value, it means that there is less memory space left at this time, and the device is determined to be in a high memory pressure state; if the memory pressure value is less than or equal to the preset pressure value, it means that there is more memory space left at this time, and the device is determined to be in a low memory pressure state.
[0077] In some embodiments, the preset pressure value may be set according to the image processing capability of the device or the total memory space of the device. For example, in some embodiments, the preset pressure value may be 20%.
[0078] S103, determining an image processing method based on the memory pressure state, and obtaining a target image based on the image processing method to complete rapid photographing.
[0079] In some embodiments, after determining the memory pressure state through the above steps, the image processing method corresponding to the rapid photography behavior in the HDR mode can be determined based on the obtained memory pressure state, and the target image can be obtained based on the determined image processing method to complete the rapid photography.
[0080] Specifically, in some embodiments, the above-mentioned method of determining an image processing method based on a memory pressure state, and obtaining a target image based on the image processing method to complete a quick photo may include: if the memory pressure state is a low memory pressure state, obtaining a first image through a first image processing method; if the memory pressure state is a high memory pressure state, determining a second image processing method based on the number of tasks accumulated in the current image processing flow in the quick photo event, and obtaining a second image through the second image processing method; storing the target image obtained by format conversion of the first image or the second image into an album, repeating the above steps until the target image corresponding to each photo in the quick photo event is stored into the album, and completing the quick photo. This part of the content will be described in detail in subsequent embodiments, and the embodiments of the present disclosure will not be elaborated on here.
[0081] In some embodiments, when the device is in HDR mode for fast photography, it is necessary to make multi-frame image processing requests to generate multiple HDR images at the same time. Based on this, the above steps need to be performed when generating each image to determine the image processing method for each image according to the current memory pressure value, so that the corresponding image processing method can be executed according to the dynamic changes in the memory pressure state, and the problem of freeze or abnormal exit caused by excessive memory pressure is effectively solved through the dynamic photography strategy, providing users with a better experience.
[0082] In some embodiments, the image processing method is determined by the current memory pressure state of the device, so that the determined image processing method is applicable to the current memory situation of the device. That is, when the device is a low-end model with small memory (such as 8G running memory and below) or the device is aging and consumes a certain amount of running memory, fast photo taking can be completed by an image processing method applicable to the memory pressure state of the device to ensure that there is no task accumulation, thereby avoiding the situation of fast photo taking in HDR mode being stuck or abnormally exiting, thereby improving the user experience.
[0083] In one or more embodiments of the present disclosure, when a device is in HDR mode, a quick capture event is triggered in response to a user operation, the device's runtime memory usage is obtained, and based on the runtime memory usage, the device's memory pressure state is determined. An image processing method is then determined based on the memory pressure state, and a target image is obtained based on the image processing method to complete the quick capture. Thus, the present disclosure uses a dynamic capture strategy to determine an image processing method that is appropriate for the current memory pressure state, thereby avoiding freezes or abnormal exits in quick capture in HDR mode and improving the user experience.
[0084] Figure 2 FIG. 1 is a flow chart of a photographing method proposed in an embodiment of the present disclosure. Figure 2 As shown, the photographing method may include:
[0085] S201, when the device is in HDR mode, in response to a user operation triggering a quick photo event, obtaining the device's running memory usage.
[0086] S202: Determine a memory pressure state of the device based on the running memory usage.
[0087] The description of S201 - S202 can be specifically referred to the above embodiment and will not be repeated here.
[0088] S203: If the memory pressure state is a low memory pressure state, obtain a first image using a first image processing method.
[0089] In some embodiments, if the device is in a low memory pressure state, it means that the remaining memory space of the device can handle the fast photo taking behavior in HDR mode. Based on this, the first image can be obtained by the first image processing method.
[0090] In some embodiments, the method for obtaining the first image by using the first image processing method may include the following steps:
[0091] Step a: Acquire an image in a first format obtained by an image processor.
[0092] Step b: separating the first format image into multiple frames of images according to different exposure amounts, and performing format conversion on the multiple frames of images to obtain multiple frames of second format images.
[0093] Step c: synthesizing the multiple frames of the second format image through a synthesis algorithm to obtain a first image.
[0094] In some embodiments, a Bayer format image obtained by an image processor is obtained, and the Bayer format image is separated into multiple frames according to different exposure levels. The multiple frames are format-converted to obtain multiple YUV format images, and then the multiple YUV format images are synthesized using an HDR synthesis algorithm to obtain a first image. In some embodiments, the above method is the same as the existing HDR photography process. For a detailed description of the above method, please refer to the existing technology and will not be repeated in detail in the present disclosure.
[0095] S204: If the memory pressure state is a high memory pressure state, determine a second image processing method based on the number of tasks accumulated in the current image processing flow in the rapid photo shooting event, and obtain a second image using the second image processing method.
[0096] In some embodiments, if the device is in a high memory pressure state, it means that the remaining memory space of the device may not be able to process the quick photo taking behavior in HDR mode through the first image processing method. Based on this, it is also necessary to determine the second image processing method based on the number of tasks accumulated in the current image processing process in the device's quick photo taking event, and obtain the second image through the second image processing method.
[0097] In some embodiments, the above-mentioned determination of the second image processing method based on the number of tasks accumulated in the current image processing process in the device's quick photo event may include: judging whether the number of tasks accumulated in the current image processing process in the quick photo event is greater than a preset threshold; if the number of tasks accumulated is greater than the preset threshold, it means that there is already a task accumulation at this time, and the device cannot perform image processing through the above-mentioned first image processing method, then the second image processing method is determined to be the third image processing method; if the number of tasks accumulated is equal to the preset threshold, it means that there is no task accumulation at this time, and the device can still perform image processing through the above-mentioned first image processing method, then the second image processing method is determined to be the first image processing method.
[0098] In some embodiments, the preset threshold value can be set as needed. For example, the preset threshold value can be 0.
[0099] In some embodiments, when the second image processing method is determined to be the third image processing method, the second image is obtained by the third image processing method. This part will be described in detail in subsequent embodiments and will not be repeated in this embodiment of the present disclosure.
[0100] In some embodiments, the image processing method is determined through the above steps under the dual judgment conditions of the memory pressure value and the number of accumulated tasks, effectively ensuring that in harsh environments with high memory pressure and temperature increase limiting frequency, the image processing method suitable for the current memory pressure value is determined through the corresponding dynamic photography strategy, effectively solving the problem of freezes or abnormal exits caused by excessive memory pressure, and providing users with a better experience.
[0101] S205: Store the target image obtained by format conversion of the first image or the second image into the album, and repeat the above steps until the target image corresponding to each photo in the quick photo event is stored into the album, thus completing the quick photo event.
[0102] In some embodiments, after obtaining the first image or the second image based on the image processing method determined in the above steps, the first image or the second image can be processed by VTCamera to convert the format to obtain a target image in Jpeg format, and the obtained target image can be stored in an album.
[0103] In some embodiments, when the device is in HDR mode and taking quick photos, each target image can be obtained through the above steps, which can effectively ensure that the first image and / or the second image exist in this quick photo event, thereby effectively solving the problem of photo freeze or abnormal exit caused by excessive memory pressure, and making the obtained target image consistent, meeting the user's initial expectations.
[0104] In one or more embodiments of the present disclosure, when a device is in HDR mode, a quick capture event is triggered in response to a user operation, the device's runtime memory usage is obtained, and based on the runtime memory usage, the device's memory pressure state is determined. An image processing method is then determined based on the memory pressure state, and a target image is obtained based on the image processing method to complete the quick capture. Thus, the present disclosure uses a dynamic capture strategy to determine an image processing method that is appropriate for the current memory pressure state, thereby avoiding freezes or abnormal exits in quick capture in HDR mode and improving the user experience.
[0105] Figure 3 FIG. 1 is a flow chart of a photographing method proposed in an embodiment of the present disclosure. Figure 3 As shown, the photographing method may include:
[0106] S301, when the device is in HDR mode, in response to a user operation triggering a quick photo event, obtaining the device's running memory usage.
[0107] S302: Determine a memory pressure state of the device based on the running memory usage.
[0108] S303: If the memory pressure state is a low memory pressure state, obtain a first image using a first image processing method.
[0109] S304: If the memory pressure state is a high memory pressure state, determine whether the number of tasks accumulated in the current image processing flow in the rapid photo shooting event is greater than a preset threshold.
[0110] S305: If the number of accumulated tasks is equal to the preset threshold, the second image processing method is determined to be the first image processing method, and the second image is obtained by the first image processing method.
[0111] The description of S301 - S305 can be found in the above embodiment and will not be repeated here.
[0112] S306: If the number of accumulated tasks is greater than a preset threshold, the second image processing method is determined to be the third image processing method, and the second image is obtained by the third image processing method.
[0113] In some embodiments, the method of obtaining the second image by using the third image processing method may include the following steps:
[0114] Step 1: Change the link indicator value in the link configuration file to a non-HDR mode indicator value.
[0115] In some embodiments, the terminal device performs link configuration according to the link configuration file each time a photo is taken. In some embodiments, the link configuration file may include multiple link interfaces and a link indicator value, so that the terminal device can perform link configuration according to the link interface indicated by the link indicator value.
[0116] Specifically, in some embodiments, when the terminal device is in HDR mode, the default value in the link profile is the HDR mode indication value, but when the terminal device is in HDR mode and it is determined that the second image is obtained through the third image processing method, there is no need to perform link configuration through the HDR link interface. Based on this, the link indication value in the link profile is changed to a non-HDR mode indication value.
[0117] For example, assuming that the mode corresponding to the second image obtained by the third image processing method is B2Y, and the link configuration file includes link interfaces in both B2Y and HDR modes, when the number of task accumulations is greater than the preset threshold, the link indication value is changed from the current 0x1000 (HDR mode) to 0x1001 (B2Y mode).
[0118] Step 2: reconfigure the link based on the link indication value in the link configuration file;
[0119] In some embodiments, each time a photo is taken, the terminal device performs an OR operation based on the link indication value in the link configuration file and a preset value to obtain a target indication value, and configures the link based on the target indication value.
[0120] For example, when the link is reconfigured based on the link indication value in the link configuration file, the link indication value is read, and the last bit in the link indication value is ORed with the preset value 1. When the result is 0, the HDR mode link operation is performed; when the result is 1, the HDR mode link operation is disconnected and the B2Y mode link operation is performed.
[0121] Step 3: In response to the configuration being successful, obtaining the first format image obtained by the image processor, and performing format conversion on the first format image to obtain a second format image;
[0122] Step 4: Determine the second format image as the second image.
[0123] In some embodiments, a Bayer format image obtained by an image processor is acquired, and the Bayer format is converted into a second format image to obtain a YUV format image, and the YUV format image is determined as the second image.
[0124] In some embodiments, the second image is obtained by a third image processing method, and there is no need to synthesize it through an HDR algorithm. The YUV format image obtained by format conversion is determined as the second image. Thus, by adopting a method of exchanging time for space, it is ensured that there is no accumulated tasks and memory pressure, and the problem of photo-taking freeze or abnormal exit caused by excessive memory pressure is solved, so that the photo-taking experience is better.
[0125] S307: Store the target image obtained by format conversion of the first image or the second image into the album. Repeat the above steps until the target image corresponding to each photo in the quick photo event is stored into the album, completing the quick photo event.
[0126] In one or more embodiments of the present disclosure, when a device is in HDR mode, a quick capture event is triggered in response to a user operation, the device's runtime memory usage is obtained, and based on the runtime memory usage, the device's memory pressure state is determined. An image processing method is then determined based on the memory pressure state, and a target image is obtained based on the image processing method to complete the quick capture. Thus, the present disclosure uses a dynamic capture strategy to determine an image processing method that is appropriate for the current memory pressure state, thereby avoiding freezes or abnormal exits in quick capture in HDR mode and improving the user experience.
[0127] Based on the above content, the photographing method in the embodiment is described with examples.
[0128] Figure 4: is a schematic diagram of the process of taking pictures in an embodiment of the present invention, which process includes: when the terminal device is in HDR mode, a quick picture taking event is triggered in response to a user operation, and the running memory usage of the terminal device is obtained; based on the running memory usage, it is determined whether the terminal device is in a high memory pressure state; if the current memory pressure state of the terminal device is not in a high memory pressure state, that is, the current memory pressure state is a low memory pressure state, the Bayer format image obtained by the sensor can be obtained, the Bayer format image can be separated into multiple frames according to different exposure amounts, and the multiple frames of Bayer format image are format-converted through Bayer2YUV to obtain multiple frames of YVU format image, and the multiple frames of YVU format image are synthesized through the HDR synthesis algorithm to obtain a first image; if the current memory pressure state of the terminal device is In a high memory pressure state, it can be determined whether the number of task accumulations in the current image processing process in a quick photo shooting event is greater than a preset threshold; after determining that the number of task accumulations is greater than the preset threshold, the link indication value in the link configuration file is changed to a non-HDR mode indication value, and the link is reconfigured based on the link indication value in the link configuration file. In response to a successful configuration, the Bayer format image obtained by the sensor is obtained, and the Bayer format image is format-converted to obtain a YVU format image, and the YVU format image is determined as the second image; after determining that the number of task accumulations is equal to the preset threshold, the first image can be obtained by the above-mentioned method for obtaining the first image; the first image or the second image is processed by VTCamera and the target image in JPEG format obtained by format conversion is stored in the album.
[0129] The following are embodiments of the apparatus disclosed herein, which can be used to implement the method embodiments disclosed herein. For details not disclosed in the apparatus embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0130] See Figure 5 , which shows a schematic diagram of the structure of a photographing device provided by an embodiment of the present disclosure. The photographing device can be applied to a terminal device. The photographing device 500 includes an acquisition module 501, a determination module 502, and a processing module 503, wherein:
[0131] An acquisition module 501 is configured to acquire the running memory usage of the device in response to a quick photo event triggered by a user operation when the device is in HDR mode;
[0132] A determination module 502 is configured to determine a memory pressure state of the device based on the running memory usage;
[0133] The processing module 503 is configured to determine an image processing method based on the memory pressure state, and obtain a target image based on the image processing method to complete rapid photographing.
[0134] Optionally, the above-mentioned running memory usage includes the running memory usage; the above-mentioned acquisition module 501 is specifically used to: acquire the running memory usage of the device by calling an interface.
[0135] Optionally, the determining module 502 is specifically configured to:
[0136] Determine a memory pressure value of the device based on the running memory usage, where the memory pressure value is the percentage of the running memory usage to the total running memory;
[0137] If the memory pressure value is greater than the preset pressure value, it is determined that the device is in a high memory pressure state;
[0138] If the memory pressure value is less than or equal to the preset pressure value, it is determined that the device is in a low memory pressure state.
[0139] Optionally, the processing module 503 is specifically configured to:
[0140] If the memory pressure state is a low memory pressure state, obtaining a first image by a first image processing method;
[0141] If the memory pressure state is a high memory pressure state, determining a second image processing method based on the number of tasks accumulated in the current image processing flow in the rapid photo capture event, and obtaining a second image by using the second image processing method;
[0142] The target image obtained by format conversion of the first image or the second image is stored in the album, and the above steps are repeated until the target image corresponding to each photo in the quick photo event is stored in the album, and the quick photo event is completed.
[0143] Optionally, the processing module 503 is further configured to:
[0144] Determine whether the number of tasks accumulated in the current image processing process in the rapid photo shooting event is greater than a preset threshold;
[0145] If the number of accumulated tasks is greater than a preset threshold, determining the second image processing method to be the third image processing method;
[0146] If the number of accumulated tasks is equal to the preset threshold, the second image processing method is determined to be the first image processing method.
[0147] Optionally, the processing module 503 is further configured to:
[0148] Change the link indicator value in the link configuration file to a non-HDR mode indicator value;
[0149] reconfiguring the link based on the link indication value in the link configuration file;
[0150] In response to a successful configuration, acquiring the first format image obtained by the image processor, and performing format conversion on the first format image to obtain a second format image;
[0151] The second format image is determined as the second image.
[0152] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0153] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device and a readable storage medium.
[0154] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable electronic devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0155] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0156] Multiple components in the electronic device 600 are connected to the I / O interface 605, including an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other electronic devices via a computer network such as the Internet and / or various telecommunication networks.
[0157] The computing unit 601 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the photographing method. For example, in some embodiments, the photographing method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the photographing method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the photographing method by any other suitable means (e.g., via firmware).
[0158] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0159] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0160] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device, or electronic device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or electronic device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage electronic device, a magnetic storage electronic device, or any suitable combination of the foregoing.
[0161] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0162] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0163] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0164] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0165] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A photographing method, characterized in that: The method comprises: When the device is in HDR mode, in response to a user operation triggering a quick photo event, obtaining the running memory usage of the device; Determining a memory pressure state of the device based on the running memory usage; An image processing method is determined based on the memory pressure state, and a target image is obtained based on the image processing method to complete rapid photography.
2. The method according to claim 1, wherein The running memory usage includes the running memory usage; and obtaining the running memory usage of the device includes: obtaining the running memory usage of the device by calling an interface.
3. The method according to claim 1, wherein The determining, based on the running memory usage, a memory pressure state of the device includes: Determining a memory pressure value of the device based on the running memory usage, wherein the memory pressure value is a percentage of the running memory usage to the total running memory; If the memory pressure value is greater than a preset pressure value, determining that the device is in a high memory pressure state; If the memory pressure value is less than or equal to the preset pressure value, it is determined that the device is in a low memory pressure state.
4. The method according to claim 1, wherein The determining of an image processing method based on the memory pressure state, and obtaining a target image based on the image processing method to complete rapid photographing, includes: If the memory pressure state is a low memory pressure state, obtaining a first image by a first image processing method; If the memory pressure state is a high memory pressure state, determining a second image processing method based on the number of tasks accumulated in the current image processing flow in the rapid photo shooting event, and obtaining a second image by using the second image processing method; The target image obtained by format conversion of the first image or the second image is stored in the photo album, and the above steps are repeated until the target image corresponding to each photo in the quick photo event is stored in the photo album, thereby completing the quick photo event.
5. The method according to claim 4, wherein The determining of the second image processing method based on the number of tasks accumulated in the current image processing flow in the rapid photographing event includes: Determine whether the number of tasks accumulated in the current image processing flow in the rapid photo shooting event is greater than a preset threshold; If the task accumulation number is greater than a preset threshold, determining the second image processing method to be the third image processing method; If the task accumulation number is equal to a preset threshold, the second image processing method is determined to be the first image processing method.
6. The method according to claim 5, wherein When it is determined that the second image processing method is the third image processing method, obtaining the second image by using the second image processing method includes obtaining the second image by using the third image processing method; The obtaining of the second image by the third image processing method includes: Change the link indicator value in the link configuration file to a non-HDR mode indicator value; reconfiguring the link based on the link indication value in the link configuration file; In response to a successful configuration, acquiring the first format image obtained by the image processor, and performing format conversion on the first format image to obtain a second format image; The second format image is determined as a second image.
7. A photographing device, characterized in that: The device comprises: an acquisition module, configured to acquire, when the device is in HDR mode, a running memory usage of the device in response to a quick photo event triggered by a user operation; a determination module, configured to determine a memory pressure state of the device based on the running memory usage; The processing module is used to determine an image processing method based on the memory pressure state, and obtain a target image based on the image processing method to complete rapid photography.
8. The device according to claim 7, wherein The processing module is specifically used to: If the memory pressure state is a low memory pressure state, obtaining a first image by a first image processing method; If the memory pressure state is a high memory pressure state, determining a second image processing method based on the number of tasks accumulated in the current image processing flow in the rapid photo shooting event, and obtaining a second image by using the second image processing method; The target image obtained by format conversion of the first image or the second image is stored in the photo album, and the above steps are repeated until the target image corresponding to each photo in the quick photo event is stored in the photo album, thereby completing the quick photo event.
9. The device according to claim 8, wherein The processing module is further configured to: Determine whether the number of tasks accumulated in the current image processing flow in the rapid photo shooting event is greater than a preset threshold; If the task accumulation number is greater than a preset threshold, determining the second image processing method to be the third image processing method; If the task accumulation number is equal to a preset threshold, the second image processing method is determined to be the first image processing method.
10. The device according to claim 8, wherein The processing module is further configured to: Change the link indicator value in the link configuration file to a non-HDR mode indicator value; reconfiguring the link based on the link indication value in the link configuration file; In response to a successful configuration, acquiring the first format image obtained by the image processor, and performing format conversion on the first format image to obtain a second format image; The second format image is determined as a second image.
11. An electronic device, characterized in that: include: at least one processor; as well as a memory in communicative connection with the at least one processor, wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
12. A computer storage medium, characterized in that The computer storage medium stores computer-executable instructions; after the computer-executable instructions are executed by the processor, the method according to any one of claims 1 to 6 can be implemented.