Image processing method and device, electronic equipment and readable storage medium

The generation of intermediate data through lightweight algorithms and combined with full-scale algorithms to process it, the problems of resource waste and non-smooth picture in traditional image processing are solved, and the effect of resource conservation and smooth display is achieved.

CN120547433APending Publication Date: 2025-08-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510695907.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

Traditional image processing methods consume a lot of resources on equipment, and redundant processing leads to waste of resources and unsmooth screen display.

Method used

The reference image data is initially processed by a lightweight algorithm, intermediate data and preview image data are generated, and then combined processing of lightweight algorithm and full-scale algorithm is performed based on the intermediate data, target image data is generated, and preview image data is replaced with target image data.

Benefits of technology

Reduce the consumption of equipment resources, avoid redundant calculations, ensure the alignment of preview image data and target image data, and achieve smooth and natural display of the picture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120547433A_ABST
    Figure CN120547433A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device, electronic equipment and a readable storage medium. The method comprises the steps of obtaining an initial image data set in response to a shooting instruction; determining reference image data from the initial image data set; processing the reference image data by adopting a first target algorithm to obtain intermediate data and preview image data; processing the reference image data and the initial image data set based on the intermediate data by adopting a second target algorithm to obtain target image data; the processing amount of the algorithm in the first target algorithm is lower than the processing amount of the corresponding algorithm in the second target algorithm; and replacing the preview image data with the target image data. By adopting the method, the consumption of equipment resources can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the continuous development of photography technology, people's demand for photography is also increasing. When shooting, the camera application and shooting components installed on the electronic device can obtain the scene to be photographed and display it to the user through the device's display screen. When the user sees the content of the picture that satisfies the user, he can press the shutter button or other triggering operation to capture the picture and obtain the captured image.

[0003] Traditionally, after triggering a capture operation, the electronic device typically performs simple processing on the image data captured by the camera, generating a preliminary image for the user to preview. Complex algorithms then perform further processing on the captured image data, ultimately resulting in the captured image being saved in the photo album. This traditional image processing method involves redundant processing and consumes significant device resources. Summary of the Invention

[0004] The embodiments of the present application provide an image processing method, apparatus, electronic device, and computer-readable storage medium, which can reduce the consumption of device resources.

[0005] In a first aspect, the present application provides an image processing method, comprising:

[0006] In response to a shooting instruction, acquiring an initial image data set;

[0007] determining reference image data from the initial image data set;

[0008] Processing the reference image data using a first target algorithm to obtain intermediate data and preview image data;

[0009] Using a second target algorithm, processing the reference image data and the initial image data set based on the intermediate data to obtain target image data; the processing amount of the algorithm in the first target algorithm is lower than the processing amount of the corresponding algorithm in the second target algorithm;

[0010] The preview image data is replaced with the target image data.

[0011] In a second aspect, the present application further provides an image processing device, comprising:

[0012] An image data acquisition module, configured to acquire an initial image data set in response to a shooting instruction;

[0013] a reference image determination module, configured to determine reference image data from the initial image data set;

[0014] a first processing module, configured to process the reference image data using a first target algorithm to obtain intermediate data and preview image data;

[0015] a second processing module, configured to process the reference image data and the initial image data set based on the intermediate data using a second target algorithm to obtain target image data; wherein the processing amount of the algorithm in the first target algorithm is lower than the processing amount of the corresponding algorithm in the second target algorithm;

[0016] An image data replacement module is used to replace the preview image data with the target image data.

[0017] In a third aspect, the present application further provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the image processing method provided in the first aspect when executing the computer program.

[0018] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the image processing method provided in the first aspect.

[0019] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the image processing method provided in the first aspect.

[0020] The above-mentioned image processing method, device, electronic device, computer-readable storage medium and computer program product obtain an initial image data set in response to a shooting instruction, determine the baseline image data from the initial image data set, use a first target algorithm to process the baseline image data to obtain intermediate data and preview image data, use a second target algorithm to process the baseline image data and the initial image data set based on the intermediate data to obtain target image data, and replace the preview image data with the target image data. This can realize that based on the intermediate data generated in the process of obtaining the preview image data, the second target algorithm is used to process the baseline image data and the initial image data, avoiding the need to recalculate the intermediate data during the processing by the second target algorithm, thereby wasting device memory computing resources and storage resources, and reducing device resource consumption. In addition, because the preview image data and the target image data are both obtained by processing based on the intermediate data, the alignment of the preview image data and the target image data can be ensured, avoiding the occurrence of screen jumps when switching from the preview image data to the target image data, achieving a smooth and natural display of the screen, and improving the screen display experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0022] Figure 1 A diagram showing an application environment of an image processing method in some embodiments;

[0023] Figure 2 is a flowchart of an image processing method in some other embodiments;

[0024] Figure 3 is a schematic diagram of previewing image data in some embodiments;

[0025] Figure 4 is a schematic diagram of target image data in some embodiments;

[0026] Figure 5 is a structural block diagram of an image processing device in some embodiments;

[0027] Figure 6 1 is a diagram of the internal structure of an electronic device in some embodiments. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0029] The image processing method provided in the embodiments of the present application can be applied to electronic devices equipped with camera applications. The electronic devices may include, but are not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, smart car devices, and projectors. Portable wearable devices may include smart watches, smart bracelets, head-mounted devices, and the like. Head-mounted devices may include virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, and the like. It should be noted that the electronic device may be a terminal or a server.

[0030] In some exemplary embodiments, Figure 1 As shown, an image processing method is provided, including the following steps 102 to 110. In which:

[0031] Step 102: In response to a shooting instruction, an initial image data set is acquired.

[0032] The shooting instruction refers to an instruction for instructing an electronic device to capture an image. For example, the shooting instruction can be pressing a shutter button, clicking a shooting control on a camera application interface, or a video recording control. It is easy to understand that the shooting instruction can be used to instruct an electronic device to capture a photo or a video.

[0033] The initial image dataset includes at least one frame of initial image data. For example, the initial image dataset may include 1, 2, 3, 4, 5, or 8 frames of initial image data. The initial image data may be in the raw domain or the YUV domain. The raw domain refers to the raw data directly captured by the image sensor, without any image processing, and retains the original brightness information. The YUV domain is a color encoding method that separates luminance (Y) from chrominance (U and V).

[0034] In some exemplary embodiments, when taking a picture in response to a shooting instruction, the image sensor typically reads a corresponding amount of raw image data at a certain readout rate. The electronic device may select at least one frame of the raw image data read out by the image sensor to form an initial image data set.

[0035] Step 104 : determining reference image data from the initial image data set.

[0036] The reference image data may be any frame of initial image data in the initial image dataset. For example, the reference image data may be determined from the initial image dataset based on clarity or exposure. The reference image data may be the initial image data with the highest clarity or best exposure in the initial image dataset. Alternatively, the reference image data may be determined from the initial image dataset based on actual processing requirements. For example, when processing facial images, the initial image data with the highest clarity may be selected as the reference image data.

[0037] Step 106 : Process the reference image data using a first target algorithm to obtain intermediate data and preview image data.

[0038] The "first target algorithm" refers to a set of algorithms used to represent image preview display processing. Different shooting scenarios may require different first target algorithms. For example, the first target algorithm may include a brightening algorithm, a noise reduction algorithm, a face detection algorithm, a background segmentation algorithm, or a filter rendering algorithm.

[0039] The preview image data refers to image data obtained by processing the reference image data using the first target algorithm. The preview image data can be quickly previewed and displayed after responding to the shooting instruction, that is, the user can quickly view the preview image data.

[0040] Intermediate data represents intermediate results generated during the processing of the reference image data by the first target algorithm. For example, if the reference image is processed by the face detection algorithm within the first target algorithm to obtain facial feature point coordinates, or if the reference image is processed by the background segmentation algorithm within the first target algorithm to obtain background segmentation results, the corresponding facial feature points or background segmentation results constitute intermediate data. Intermediate data may include at least one of image segmentation masks, key feature point coordinates, noise reduction parameters, alignment parameters, semantic labels, and exposure parameters. The image segmentation mask may, for example, be a binary mask generated using a lightweight neural network (such as MobileNet-SSD) that identifies the areas of a portrait, background, or specific objects. Alternatively, the image segmentation mask may be a portrait segmentation mask or a portrait / background binary map. Key feature point coordinates may, for example, be facial key points (68 or 106 points) or gesture joint coordinates. Noise reduction parameters may, for example, be noise distribution maps or spatial filter coefficients. Alignment parameters may, for example, be multi-frame motion vectors or geometric transformation matrices. Semantic tags are, for example, scene classification tags, such as night scene, portrait, landscape, etc. Exposure parameters are, for example, local brightness histograms, which can guide the full-scale algorithm to achieve dynamic range enhancement.

[0041] Exemplarily, the intermediate data obtained by processing the reference image data using the first target algorithm can be stored, for example, the intermediate data can be stored in the memory, disk or cloud of the electronic device. In actual application scenarios, the memory status of the electronic device can be identified. If the remaining memory space of the electronic device is greater than a threshold, the intermediate data can be stored in the memory. If the remaining memory space of the electronic device is not greater than the threshold, the intermediate data can be stored on the disk or in the cloud. In some application scenarios, the intermediate data can also be encrypted to obtain encrypted intermediate data, and then the encrypted intermediate data can be stored. Among them, the encrypted intermediate data can be partial intermediate data or all intermediate data, which can be specifically determined based on the type or importance of the intermediate data. The obtained preview image data can be displayed at a preset preview position, or directly saved in the corresponding album position in the electronic device.

[0042] Step 108 , using a second target algorithm to process the reference image data and the initial image data set based on the intermediate data to obtain target image data; wherein the processing amount of the algorithm in the first target algorithm is lower than the processing amount of the corresponding algorithm in the second target algorithm.

[0043] The second target algorithm is a set of algorithms used to characterize the processing of target image data. The target image data refers to the captured image that is ultimately presented to the user in response to the capture instruction.

[0044] Exemplarily, the first target algorithm includes at least one of a first-class brightening algorithm, a first-class noise reduction algorithm, a first-class face detection algorithm, a first-class background segmentation algorithm, or a first-class filter rendering algorithm; the second target algorithm includes at least one of a second-class brightening algorithm, a second-class noise reduction algorithm, a second-class face detection algorithm, a second-class background segmentation algorithm, or a second-class filter rendering algorithm. The first target algorithm is a lightweight algorithm, and the second target algorithm is a full-scale algorithm. The processing capacity of the algorithm in the first target algorithm is lower than the processing capacity of the corresponding algorithm in the second target algorithm. In other words, the processing capacity of the first-class brightening algorithm is lower than that of the second-class brightening algorithm, the processing capacity of the first-class noise reduction algorithm is lower than that of the second-class noise reduction algorithm, the processing capacity of the first-class face detection algorithm is lower than that of the second-class face detection algorithm, and so on for other algorithms.

[0045] In an exemplary embodiment, the reference image data, the intermediate data, and the initial image data set may be used as inputs to a second target algorithm to obtain target image data. The second target algorithm may be used to process the intermediate data, the reference image data, and at least one frame of initial image data from the initial image data set to obtain the target image data.

[0046] In an exemplary embodiment, the electronic device responds to a target processing instruction and uses a second target algorithm to process the reference image data and the initial image data based on the intermediate data to obtain the target image data. The target processing instruction refers to a processing instruction for generating the target image data, and the target processing instruction can be generated when the electronic device is idle or when the user is viewing an album. When the electronic device is idle, it indicates that the memory occupancy rate of the electronic device is lower than the occupancy rate threshold. Using the second target algorithm for processing can even out the memory occupancy of the electronic device, avoid using the second target algorithm for processing when the memory occupancy rate of the electronic device is high, and thus reduce the processing speed of the second target algorithm.

[0047] In an exemplary embodiment, after the target image data is obtained, the stored intermediate data is deleted.

[0048] Step 110: Replace the preview image data with the target image data.

[0049] In actual application scenarios, when a user triggers a command to view target image data, if the target image data has not yet been obtained, the electronic device may first display the preview image data. After the target image data is obtained, the preview image data is overlaid with the target image data. If the target image data has already been obtained when the user triggers a command to view target image data, the target image data is directly displayed.

[0050] In the above-mentioned image processing method, by responding to a shooting instruction, an initial image data set is obtained, and reference image data is determined from the initial image data set. A first target algorithm is used to process the reference image data to obtain intermediate data and preview image data. A second target algorithm is used to process the reference data and the initial image data based on the intermediate data to obtain target image data. The preview image data is replaced with the target image data. This method can achieve the goal of obtaining target image data by processing the reference image data and the initial image data set using the second target algorithm based on the intermediate data generated in the process of generating the preview image data, thereby avoiding recalculating the intermediate data during the processing by the second target algorithm, thereby wasting device memory computing resources and storage resources, and reducing device resource consumption. In addition, since both the preview image data and the target image data are obtained by processing based on the intermediate data, the alignment of the preview image data and the target image data can be ensured, avoiding the situation where the image screen jumps when switching from the preview image data to the target image data, achieving a smooth and natural display of the screen, and improving the screen display experience.

[0051] In some embodiments, the step 106 of processing the reference image data using the first target algorithm to obtain the intermediate data includes:

[0052] Identify the shooting scene type corresponding to the shooting instruction; and process the reference image data using a first target algorithm to obtain intermediate data corresponding to the shooting scene type.

[0053] The shooting scene type refers to the type of shooting scene corresponding to the shooting instruction. Examples of shooting scene types include portrait shooting scenes, landscape shooting scenes, and night shooting scenes. Portrait shooting scenes may also include portrait blur scenes and face beautification scenes. It will be readily understood that in actual applications, shooting scene types and corresponding intermediate data can be defined based on actual needs.

[0054] Different shooting scene types correspond to different intermediate data obtained by processing the reference image data using the first target algorithm. The intermediate data obtained by processing the reference image data using the first target algorithm corresponds to the shooting scene type.

[0055] In an exemplary embodiment, the shooting scene type includes a portrait blur scene, and the intermediate data includes a portrait segmentation mask and background blur parameters; or, the shooting scene type includes a night scene noise reduction scene, and the intermediate data includes a noise distribution map and a scene segmentation result; or, the shooting scene type includes a face optimization scene, and the intermediate data includes the coordinates of facial feature points.

[0056] In other words, if the shooting scene type includes a portrait blur scene, the intermediate data corresponding to the portrait blur scene may include a portrait segmentation mask and background blur parameters; if the shooting scene type includes a night noise reduction scene, the intermediate data corresponding to the night noise reduction scene may include a noise distribution map and a scene segmentation result; if the shooting scene type includes a face optimization scene, the intermediate data corresponding to the face optimization scene may include facial feature point coordinates.

[0057] The Portrait Blur scene keeps the subject in focus while gently blurring the background. The Face Optimization scene beautifies the subject. The Night Noise Reduction scene reduces noise from objects in night scenes.

[0058] In an exemplary embodiment, if the shooting scene type corresponding to the shooting instruction is identified as a portrait blur scene, the first target algorithm is used to process the reference image data to obtain intermediate data corresponding to the portrait blur scene. The intermediate data, for example, includes a portrait segmentation mask and background blur parameters. The first target algorithm may include, for example, a background segmentation algorithm. If the shooting scene type corresponding to the shooting instruction is identified as a nighttime noise reduction scene, the first target algorithm is used to process the reference image data to obtain intermediate data corresponding to the nighttime noise reduction scene. The intermediate data, for example, includes a noise distribution map and scene segmentation results. The first target algorithm may include, for example, a noise reduction algorithm and a background segmentation algorithm. If the shooting scene type corresponding to the shooting instruction is identified as a face optimization scene, the first target algorithm is used to process the reference image data to obtain intermediate data corresponding to the face optimization scene. The intermediate data, for example, includes the coordinates of facial feature points. The first target algorithm may include, for example, a face detection algorithm.

[0059] In the portrait blurring scene, the first target algorithm is used to quickly perform portrait segmentation, obtaining a portrait segmentation mask and background blur parameters. When the second target algorithm is used for processing, the aforementioned portrait segmentation mask and background blur parameters can be directly reused to optimize the blur intensity and edge transition to obtain the target image data, avoiding re-segmentation of the portrait. This can ensure that the boundaries of the blurred areas of the preview image data and the target image data are consistent, and the difference in blur intensity between the preview image data and the target image data is reduced. In the night scene noise reduction scene, the noise distribution map and scene segmentation results of the reference image data can be extracted and stored during the process of generating the preview image data using the first target algorithm. When the second target algorithm is used for processing, based on the aforementioned noise distribution map and scene segmentation results, different areas are subjected to regional AI (Artificial Intelligence) noise reduction, TMC (Tone Mapping Curve) brightening, and other processing to obtain the target image data. Because the intermediate partitioning results of the first objective algorithm can be reused, the second objective algorithm does not need to re-segment. Instead, different AI denoising models are applied to different regions based on the segmentation results obtained by the first objective algorithm. Different regions can be processed simultaneously. For example, a sky denoising model can be used for the sky area and a face denoising model for the face area. While the GPU (Graphics Processing Unit) can be used for general rendering, the NPU (Neural Processing Unit) can be used for AI model processing, reducing processing time. The NPU is a dedicated AI accelerator chip that improves the computational efficiency of neural network models through optimized algorithms and architecture. In face optimization scenarios, the first objective algorithm can be used to process the baseline image data to obtain facial feature point coordinates and facial segmentation information. It then performs lightweight beautification and face de-distortion processing, resulting in a preview image data that can be immediately viewed by the user. When the second target algorithm is used for processing, based on the facial feature point coordinates and facial segmentation information obtained by the first target algorithm, fine-tuning processing such as skin beautification, facial ultra-clearness, and makeup can be further realized to obtain target image data, and the target image data is used to replace the preview image data for the user to view. This enables the user to see the preview image data for preliminary face optimization without having to wait too long after taking the photo. Since the deformation-related algorithm has been completed during the first target algorithm processing, there will be no obvious screen jump when the target image data is used to replace the preview image data. Only the image details will be further improved, avoiding the user waiting when the target image data is not generated. The image can be viewed in stages, and the transition from the preview image data to the target image data is natural, and the user can hardly perceive the replacement of the image.

[0060] In this embodiment, by identifying the shooting scene type corresponding to the shooting instruction, the first target algorithm is used to process the reference image data to obtain intermediate data corresponding to the shooting scene type, that is, different shooting scene types correspond to different intermediate data, and different intermediate data can be obtained according to different shooting scene types. Intermediate data that matches the shooting scene type can be obtained, thereby obtaining more accurate target image data based on the intermediate data.

[0061] In some embodiments, the above method further comprises:

[0062] Obtain the current device load; determine the target data accuracy corresponding to the current device load based on the corresponding relationship between the device load and data accuracy; wherein the device load and data accuracy are negatively correlated;

[0063] In step 106, the reference image data is processed using a first target algorithm to obtain intermediate data, including:

[0064] The reference image data is processed using a first target algorithm to obtain intermediate data of target data accuracy.

[0065] Data accuracy is used to characterize the accuracy of intermediate data. Device load and data accuracy are negatively correlated. That is, higher device load indicates lower data accuracy, and lower device load indicates higher data accuracy. The current device load can be characterized by at least one of the electronic device's current CPU (Central Processing Unit) load, RAM (Random Access Memory) load, disk load, network load, or GPU load. CPU load can be characterized by at least one of CPU utilization, load average, number of context switches, or CPU temperature. Memory load can be characterized by at least one of memory usage, swap (virtual memory) usage, and memory leak indicators. Disk load can be characterized by at least one of disk input / output utilization, read / write throughput, input / output operations per second (IOPS), and disk queue length. Network load can be characterized by at least one of bandwidth utilization, packet transmission rate, and number of TCP (Transmission Control Protocol) connections. GPU load can be characterized by at least one of GPU utilization, video memory usage, or GPU temperature.

[0066] In one exemplary embodiment, the electronic device obtains the current device load and determines a target data accuracy corresponding to the current device load based on a pre-set correspondence between the device load and data accuracy. The electronic device processes the reference image data using a first target algorithm, and the resulting intermediate data has the target data accuracy. If the current device load is high, lower-precision intermediate data is generated, enabling rapid generation of intermediate data even when the device load is high. If the current device load is low, higher-precision intermediate data can be generated, thereby improving the quality of the preview image data.

[0067] In this embodiment, the accuracy of the intermediate data is flexibly controlled by the device load condition. When the device load is low, higher-precision intermediate data is generated, and when the device load is high, lower-precision intermediate data is generated. This can balance the generation speed of the preview image data and the quality of the preview image data.

[0068] In some embodiments, the first target algorithm includes a first processing flow; the second target algorithm includes a first processing flow and a second processing flow; and step 108 of processing the reference image data and the initial image data set based on the intermediate data using the second target algorithm to obtain the target image data includes:

[0069] Based on the intermediate data, the reference image data and the initial image data set are processed using a second processing flow in a second target algorithm to obtain target image data.

[0070] The first processing flow refers to the processing flow corresponding to the first target algorithm, that is, the reference image data is processed based on the first processing flow in the first target algorithm to obtain intermediate data and preview image data. The second target algorithm includes the first processing flow and the second processing flow, that is, based on the intermediate data, the reference image data and the initial image data set are processed through the first processing flow and the second processing flow in the second target algorithm to obtain target image data.

[0071] Exemplarily, since the baseline image data is processed based on the first processing flow to obtain intermediate data, the baseline image data and the initial data set can be processed based on the intermediate data using the second processing flow in the second target algorithm to obtain target image data. Therefore, there is no need to perform the first processing flow on the baseline image data through the second target algorithm. When the second target algorithm is used for processing, the first processing flow is directly skipped, and the target image data can be obtained by performing the second processing flow, thereby avoiding repeated execution of the first processing flow.

[0072] In one example, the first processing flow corresponds to face segmentation processing, and the intermediate data obtained is a face segmentation mask. When the second target algorithm is used for processing, the reference image data and the initial image data set are processed by the second processing flow based on the face segmentation mask, such as skin smoothing, beautification or makeup processing, to obtain the target image data.

[0073] In this embodiment, by using the second processing flow in the second target algorithm to process the reference image data and the initial image data set based on the intermediate data to obtain the target image data, it is possible to use the intermediate result obtained by processing the reference image data through the first processing flow of the first target algorithm, and directly use the second processing flow in the second target algorithm to perform the second stage of processing on the reference image data and the initial image data to obtain the target image data, thereby avoiding repeated execution of the first processing flow, reducing repeated calculations, and reducing the consumption of equipment resources.

[0074] In some embodiments, the above method further comprises:

[0075] When it is detected that the accuracy of the intermediate data does not meet the accuracy condition, the intermediate data is adjusted using the first processing flow in the second target algorithm to obtain adjusted intermediate data; wherein the accuracy of the adjusted intermediate data is higher than the accuracy of the intermediate data before the adjustment;

[0076] Based on the intermediate data, the reference image data and the initial image data set are processed using the second processing flow in the second target algorithm to obtain target image data, including:

[0077] Based on the adjusted intermediate data, the reference image data and the initial image data set are processed using a second processing flow in a second target algorithm to obtain target image data.

[0078] The accuracy condition can be, for example, greater than a target accuracy. If the accuracy of the intermediate data is less than or equal to the target accuracy, it means that the accuracy of the intermediate data does not meet the accuracy condition. The target accuracy can be set according to the actual application scenario.

[0079] For example, after the first target algorithm is used to process the reference image data to obtain intermediate data, the accuracy of the intermediate data is sequentially identified. If the accuracy of the intermediate data is less than or equal to the target accuracy, the first processing flow in the second target algorithm is used to adjust the intermediate data, that is, to increase the accuracy of the intermediate data to obtain adjusted intermediate data. It is easy to understand that the first processing flow in the second target algorithm is used to adjust the intermediate data. It can be adjusted on part of the intermediate data or on all of the intermediate data. The specific adjustment can be determined based on the accuracy of the corresponding intermediate data. As long as the accuracy of the corresponding intermediate data does not meet the accuracy condition, the accuracy of the corresponding intermediate data is adjusted. If the accuracy of the intermediate data meets the accuracy condition, the accuracy of the intermediate data does not need to be adjusted. Based on the adjusted intermediate data, the electronic device can use the second processing flow in the second target algorithm to process the reference image data and the initial image data set to obtain target image data, which can improve the quality of the target image data.

[0080] In one example, the intermediate data includes noise reduction parameters. Assume that the first processing flow included in the first target algorithm is to process the reference image data through the first noise reduction algorithm, and the intermediate data obtained includes noise reduction parameters. When the second target algorithm is used for processing, the noise reduction parameters are accurately identified. If the accuracy of the noise reduction parameters does not meet the accuracy conditions, the second noise reduction algorithm in the second target algorithm can be used to adjust the noise reduction parameters to obtain the adjusted noise reduction parameters. Among them, the first noise reduction algorithm is, for example, a filtering noise reduction algorithm, and the second noise reduction algorithm is, for example, an AI partition noise reduction algorithm.

[0081] In this embodiment, the accuracy of the intermediate data is detected. When it is detected that the accuracy of the intermediate data does not meet the conditions, the first processing flow in the second target algorithm is used to adjust the intermediate data. Based on the adjusted intermediate data, the second processing flow in the second target algorithm is used to process the reference image data and the initial image data set to obtain the target image data. This can achieve the goal of meeting the accuracy of the intermediate data while avoiding recalculation of the intermediate data, maximizing the reduction in the consumption of device computing power, and ensuring the quality of the target image data.

[0082] In some embodiments, the above method further comprises:

[0083] Encrypt the intermediate data to obtain the intermediate data ciphertext, and store the intermediate data ciphertext;

[0084] Step 108 of processing the reference image data and the initial image data set based on the intermediate data using the second target algorithm to obtain target image data includes:

[0085] The stored intermediate data ciphertext is obtained, and the intermediate data ciphertext is decrypted to obtain decrypted intermediate data; a second target algorithm is used to process the reference image data and the initial image data set based on the decrypted intermediate data to obtain target image data.

[0086] In practical applications, intermediate data generated by key algorithms must be encrypted before storage to prevent data leakage. This ensures the security of the data processed by the key algorithms. Encryption can be achieved, for example, through hash encryption or public key encryption. The actual encryption method can be set based on the actual application scenario and is not specifically limited here.

[0087] For example, after obtaining the intermediate data, the intermediate data is encrypted using an encryption algorithm to obtain intermediate data ciphertext, and the intermediate data ciphertext is compressed to obtain compressed intermediate data ciphertext, which is then stored. During the storage process, whether to store the data in the memory can be determined based on the memory usage. If the memory usage is high, the compressed intermediate data ciphertext is stored on a disk or in the cloud. Storing the compressed intermediate data ciphertext in the memory is preferred so that it can be quickly accessed when needed. After obtaining the stored intermediate data ciphertext, the electronic device decrypts the intermediate data ciphertext using a decryption algorithm to obtain decrypted intermediate data. The second target algorithm is then used to process the reference image data and the initial image data set based on the decrypted intermediate data to obtain target image data.

[0088] In this embodiment, the intermediate data is encrypted to obtain the intermediate data ciphertext, and the intermediate data ciphertext is stored. When the second target algorithm is used for processing, the intermediate data ciphertext is decrypted to obtain the decrypted intermediate data. The reference image data and the initial image data set are processed based on the decrypted intermediate data to obtain the target image data. This can reduce the risk of leakage of the intermediate data and ensure the data security of the intermediate data. When the second target algorithm is used for processing, the intermediate data obtained by processing the first target algorithm is reused to continue processing, avoiding repeated calculation of the intermediate data and reducing the consumption of device resources. Compared with the traditional solution that needs to cache multiple frames of initial image data and recalculate using the second target algorithm, this embodiment only needs to store the key parameters corresponding to the intermediate data, which can reduce the amount of stored data and reduce storage pressure.

[0089] In some exemplary embodiments, the method further includes: storing the intermediate data in a hierarchical storage format.

[0090] The hierarchical storage format can include the storage format of the raw data layer and the storage format of the metadata layer. The raw data layer is used to store raw data, and the metadata layer is used to store metadata. Metadata can include lightweight algorithm version information, storage timestamp, precision information (such as precision identifier), etc. The raw data can include, for example, mask data and facial feature point coordinates. For example, intermediate data includes mask data and metadata. The mask data is stored in a compressed sparse row (CSR) format, while the metadata layer can be stored in an uncompressed format. The mask data can include a mask matrix.

[0091] In some exemplary embodiments, based on the spatial domain denoising of the lightweight algorithm, the full algorithm is used to perform temporal multi-frame denoising, which can obtain target image data with high-precision denoising.

[0092] Spatial noise reduction (SNR) involves performing noise reduction on the spatial dimensions of the original data (e.g., the pixel matrix of an image), eliminating noise by analyzing the statistical characteristics of adjacent pixels or local regions. For example, spatial noise reduction can be performed using methods such as mean / Gaussian filtering, median filtering, or bilateral filtering. Temporal multi-frame noise reduction (TMR) leverages the temporal correlation of data to reduce noise by fusing information across multiple frames (e.g., motion compensation). For example, TMR can be performed using methods such as inter-frame averaging, motion-compensated filtering, or optical flow. The noise reduction accuracy of spatial noise reduction is lower than that of temporal multi-frame noise reduction.

[0093] For example, a lightweight algorithm is used to perform spatial denoising on the reference image data to obtain a noise distribution map and noise segmentation results. Based on the obtained noise distribution map and noise distribution results, a full algorithm is used to perform temporal denoising on the reference image data and the initial image dataset to obtain target image data. This can produce target image data with better clarity.

[0094] In an exemplary embodiment, the flow chart of the image processing method is as follows: Figure 2As shown. The first target algorithm is a lightweight algorithm, and the second target algorithm is a full-scale algorithm. This is explained as an example. After the camera application (APP) layer of the electronic device issues preview and photo requests, the camera hardware layer returns a preview frame and a photo frame, respectively. When the camera application layer of the electronic device issues a photo request, the camera hardware layer returns a photo frame (i.e., an initial image dataset). The photo frame includes at least one frame of initial image data. The camera application layer inputs the photo frame into the lightweight algorithm for post-processing, i.e., processing the photo frame using the lightweight algorithm to generate an intermediate result (i.e., intermediate data) and a quick image (Quick JPEG). The quick image generated using the lightweight algorithm can be saved in the album, where the user can view the corresponding quick image (i.e., preview image data). The intermediate results generated using the lightweight algorithm can be stored in storage media such as memory, hard disk, or cloud. When the user opens the photo album or the electronic device is idle, the stored intermediate results are obtained from the storage medium. Based on the intermediate results, the full algorithm is used to process the photo frame to obtain the target image data. The target image data is converted into a display format such as JPEG (Joint Photographic Experts Group) or HEIC and saved in the photo album. The target image data is used to replace the aforementioned quick image for display. For example, the preview image data and target image data obtained for the same shooting scene are respectively as follows: Figure 3 He Ru Figure 4 As shown in the figure, since the target image data and the preview image data are both obtained based on the same intermediate data, there will be no screen jitter when the preview image data is replaced with the target image data. The output of the target image data and the preview image data maintains a relatively consistent visual effect, thereby improving the visual experience of the device.

[0095] During the implementation of the above example, the lightweight algorithm can dynamically adjust the accuracy of the intermediate results according to the load of the electronic device. For example, when the electronic device is in a low-load state, a high-precision portrait segmentation mask is generated, and when the electronic device is in a high-load state, a low-precision portrait segmentation mask is generated. When the device is highly loaded, priority is given to ensuring the generation of quick images for user viewing. The full algorithm is triggered to process when the device is idle or the user opens the album to view the corresponding image data. This can achieve the generation of higher-precision intermediate data while quickly displaying quick images, balancing the output speed and viewing effect. Among them, the load of the electronic device can be determined based on at least one of the CPU utilization, GPU utilization, or NPU utilization. Exemplarily, the accuracy mode of the corresponding intermediate result can be switched according to the CPU utilization threshold, the GPU utilization threshold, or the NPU utilization threshold. For example, if the CPU utilization is greater than the CPU utilization threshold, it switches to the low-precision mode, and generates low-precision intermediate data accordingly. If the CPU utilization, the GPU utilization, and the NPU utilization are all less than the corresponding utilization threshold, it switches to the high-precision mode, and generates high-precision intermediate data accordingly.

[0096] For example, consider the case where the intermediate data includes a portrait segmentation mask. If the device is under low load, a high-precision 1080p portrait segmentation mask can be generated. If the intermediate data meets the accuracy requirements for full algorithm processing, the full algorithm is directly reused. That is, based on the intermediate data, the second processing flow of the full algorithm is used to process the reference image data and the initial image dataset to obtain the target image data. If the device is under high load, a low-precision 720p portrait segmentation mask can be generated. If the accuracy of the intermediate data does not meet the accuracy requirements, the full algorithm can adjust the 720p portrait segmentation mask by interpolation compensation to obtain the adjusted portrait segmentation mask. The full algorithm is then used to process the reference image data and the initial image dataset based on the adjusted portrait segmentation mask to obtain the target image data.

[0097] In other examples, the load of the electronic device can be characterized by at least one of CPU utilization, GPU utilization, and remaining memory. For example, if the intermediate data includes a segmentation mask and facial feature points, if the electronic device is under high load, a lightweight algorithm is used to generate a low-resolution segmentation mask (e.g., 720p) and simplified facial feature points (e.g., 30 points). If the electronic device is under low load, a lightweight algorithm is used to generate a high-resolution segmentation mask (e.g., 1080p) and dense facial feature points (e.g., 106 points).

[0098] After processing the baseline image data using the first processing flow corresponding to the lightweight algorithm to obtain an intermediate result, the baseline image data and the initial image dataset are processed using the enhancement module corresponding to the second processing flow of the full algorithm based on the intermediate data to obtain the target image. The enhancement modules can be scheduled according to algorithm priority. For example, deformation algorithms are prioritized over non-deformation algorithms to ensure the real-time performance of key effects in the target image data. Deformation algorithms are algorithms that actively change the geometry of an object (such as stretching, twisting, and bending) to achieve a specific goal. Non-deformation algorithms maintain the geometric rigidity of an object (unchanged shape and size), allowing only overall translation, rotation, or scaling (i.e., rigid body transformations). It is easy to understand that different algorithms can be processed in parallel by different processors. For example, the GPU prioritizes rendering-related modules, the CPU mainly handles logic control and data scheduling, and the NPU mainly processes modules requiring neural network inference.

[0099] After obtaining intermediate data, the device's memory status can be identified. If memory is sufficient (i.e., the device is in a high-memory state), and the target processing instruction is triggered, the intermediate results are stored in memory to speed up data reading and writing. If memory is limited (i.e., the device is in a low-memory state), the intermediate results are stored on disk or in the cloud to avoid increasing memory pressure. During data storage, the intermediate data can be associated with corresponding metadata. This metadata can include lightweight algorithm version information, storage timestamp, and accuracy information (such as a precision flag). For example, image segmentation masks can be stored in a sparse matrix compression format, with the metadata annotated to indicate the segmentation model version. Intermediate data can be bound to the reference image data using a unique identifier to ensure the accuracy of the full algorithm matching the intermediate data. The storage medium can include disk, memory, or a distributed cache (such as Redis), enabling hierarchical access based on priority and processing level. For example, intermediate data corresponding to the current capture instruction can be stored in memory, while intermediate data corresponding to historical capture instructions can be stored on disk.

[0100] In real-world shooting scenarios, for example, if the scene type is night scene mode, the lightweight algorithm can extract the noise distribution map of the baseline image data. The full algorithm can then use this noise distribution map to perform temporal noise reduction on multiple frames of initial image data, reducing the overall noise reduction time. If the scene type is HDR (High Dynamic Range) imaging, the lightweight algorithm can generate local exposure parameters and scene segmentation results (such as sky and portrait). The full algorithm can then enhance the highlight and shadow areas of the initial image data based on at least one of these parameters to obtain the target image data, thereby improving the dynamic range synthesis speed of the target image data. If the scene type is portrait, the lightweight algorithm can generate facial landmark coordinates and save them to memory or disk. The full algorithm can then directly access these stored facial landmark coordinates for beauty enhancement, de-distortion, super-clearing, or makeup processing, eliminating the need to recalculate the facial landmark coordinates. The full algorithm performs subsequent processing based on the intermediate results of the same reference image data, ensuring that the outputs of key modules in the lightweight algorithm processing stage and the full algorithm processing stage are strictly aligned. For example, the segmentation boundaries and feature point positioning remain consistent, ensuring the consistency of the two-stage processing logic (for example, using the same segmentation mask for blurred rendering), eliminating the problem of screen jumps caused by algorithm independence.

[0101] In some examples, the full algorithm inherits the computational context of the lightweight algorithm, such as the ROI (Region of Interest) for face detection, to ensure consistency in the processing scope, meaning both the full and lightweight algorithms process the same region. For example, if the lightweight algorithm detects that the face region is rectangle A, the full algorithm will only perform super-resolution enhancement on the face within region A. When using the full algorithm for processing, if the intermediate results are corrupted or the versions are incompatible, the full algorithm automatically falls back to independent computation mode, meaning that the full algorithm recalculates the parameters corresponding to the intermediate results based on the baseline image data and performs the full processing of the first and second processing flows.

[0102] Furthermore, in terms of algorithm compatibility, the use of a unified data interface for intermediate data supports independent upgrades of both lightweight and full algorithms, ensuring compatibility between new and old algorithm versions. For example, after upgrading the full algorithm to version 2, the intermediate results of the lightweight algorithm version 1 can still be read, simply by adding a processing module. Intermediate results generated by the lightweight algorithm on the device side can be transmitted to the cloud for execution of the full algorithm, enabling distributed computing and improving computational efficiency. The reuse of intermediate data reduces the full algorithm's reliance on hardware computing power, allowing high-end image processing functions to run smoothly on low-end devices. Traditional solutions for mid-range and low-end mobile devices require two independent computational overhead platforms. Devices often cannot support these two computations running consecutively, forcing them to choose between two-stage image generation or abandoning the first lightweight algorithm calculation when the device is lag-free. As a result, users often cannot see intermediate images in the album until the final image is available. This is particularly true if users view the image in the album immediately after taking a shot, leading to long wait times. However, this embodiment saves the computational overhead of an independent algorithm by putting the algorithm corresponding to the final image in front, making the transition of viewing images more natural for users. For scenarios where users view images immediately after taking a photo, since the intermediate results processed by the lightweight algorithm in the first stage are saved, the full algorithm can be used in the second stage to directly obtain the intermediate results for subsequent processing, and there is no problem of resource preemption and memory peak in the two stages.

[0103] In some examples, a mobile device can use a lightweight algorithm to generate intermediate data and send the intermediate data to the cloud. The cloud uses a full algorithm to perform high-load computing on the baseline image data and the initial image data set based on the intermediate data to obtain the target image data, and the cloud sends the target image data to the mobile device. For example, a mobile device generates a portrait segmentation mask using a lightweight algorithm. The mobile device sends the portrait segmentation mask, the baseline image data, and the initial image data set to the cloud. The cloud performs AI background blur rendering based on the portrait segmentation mask to obtain the target image data. In other words, intermediate data can support cross-device sharing (such as shooting with a mobile phone and editing with a tablet), achieving a seamless workflow.

[0104] In some examples, the full algorithm performs pixel-level alignment on the input initial image dataset based on the reference image data. This aligns each frame of initial image data in the initial image dataset to the reference image data, eliminating jitter. The full algorithm can reuse the 3A and color gamut parameters of the lightweight algorithm to ensure color temperature and hue consistency between the preview image data and the target image data. The 3A parameters refer to autofocus (AF), auto exposure (AE), and auto white balance (AWB). When replacing the preview image data with the target image data, local areas of the preview image data can be gradually replaced with the target image data, for example, first updating the background blur intensity and then optimizing facial details. By outputting intermediate rendering results in stages through the full algorithm, a gradual improvement in image quality can be achieved.

[0105] In some scene examples, if the shooting scene type is a portrait blur scene, that is, blur processing in portrait mode. A lightweight algorithm can be used to detect the face area in the reference image data, quickly perform portrait segmentation, obtain intermediate data such as portrait segmentation mask, blur intensity parameters, and facial feature point coordinates, as well as preview image data, and store the portrait segmentation mask, blur intensity parameters, and facial feature point coordinates in a storage medium. When the full algorithm is used for processing, the portrait segmentation mask, blur intensity parameters, and facial feature point coordinates are obtained from the storage medium, the blur edge is adjusted, and after light field rendering, the target image data is output. If the shooting scene type is a night multi-frame noise reduction scene, a lightweight algorithm is used to extract intermediate data from the reference image data. The intermediate data includes a noise distribution map and scene segmentation results, and the noise distribution map and scene segmentation results are stored. When using the full algorithm for processing, the stored noise distribution map and scene segmentation results are obtained, and based on the noise distribution map and scene segmentation results, the various scenes in the initial image data set, such as the sky, portraits, and buildings, are processed using AI noise reduction, brightening, and TMC algorithms to obtain the target image data. This can reduce the processing time of the full algorithm, reduce peak memory usage, and support the coordinated calling of multiple algorithm modules based on intermediate data, which can avoid repeated calculations and shorten the processing time of the entire process. In addition, the processing is based on the intermediate data obtained from the baseline image data, which can improve the alignment of the preview image data and the target image data, avoid screen jumps in the process of changing from preview image data to target image data display, improve the smoothness and naturalness of screen transitions, and enhance the screen display experience.

[0106] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0107] Based on the same inventive concept, embodiments of the present application also provide an image processing device for implementing the aforementioned image processing method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more of the following image processing device embodiments can be found in the above-described limitations on the image processing method and will not be further elaborated here.

[0108] In some exemplary embodiments, Figure 5 As shown, an image processing device 500 is provided, comprising: an image data acquisition module 502, a reference image determination module 504, a first processing module 506, a second processing module 508 and an image data replacement module 510, wherein:

[0109] An image data acquisition module 502 is configured to acquire an initial image data set in response to a shooting instruction;

[0110] A reference image determination module 504 is configured to determine reference image data from the initial image data set;

[0111] A first processing module 506 is configured to process the reference image data using a first target algorithm to obtain intermediate data and preview image data;

[0112] A second processing module 508 is configured to process the reference image data and the initial image data set based on the intermediate data using a second target algorithm to obtain target image data; the processing load of the algorithm in the first target algorithm is lower than the processing load of the corresponding algorithm in the second target algorithm;

[0113] The image data replacement module 510 is configured to replace the preview image data with the target image data.

[0114] In some embodiments, the first processing module 506 is further configured to identify a shooting scene type corresponding to the shooting instruction; and process the reference image data using a first target algorithm to obtain intermediate data corresponding to the shooting scene type.

[0115] In some embodiments, the apparatus further includes a data accuracy determination module for obtaining a current device load; determining a target data accuracy corresponding to the current device load based on a correspondence between the device load and the data accuracy; the device load and the data accuracy are negatively correlated;

[0116] The first processing module 506 is further configured to process the reference image data using a first target algorithm to obtain intermediate data of target data accuracy.

[0117] In some embodiments, the first target algorithm includes a first processing flow; the second target algorithm includes a first processing flow and a second processing flow; the second processing module 508 is also used to process the reference image data and the initial image data set based on the intermediate data using the second processing flow in the second target algorithm to obtain target image data.

[0118] In some embodiments, the apparatus further includes a data precision adjustment module configured to adjust the intermediate data using the first processing flow in the second target algorithm to obtain adjusted intermediate data when it is detected that the precision of the intermediate data does not meet the precision condition, wherein the precision of the adjusted intermediate data is higher than the precision of the intermediate data before the adjustment;

[0119] The second processing module 508 is further configured to process the reference image data and the initial image data set based on the adjusted intermediate data using a second processing flow in a second target algorithm to obtain target image data.

[0120] In some embodiments, the apparatus further comprises a data encryption module for encrypting the intermediate data to obtain the intermediate data ciphertext and storing the intermediate data ciphertext;

[0121] The second processing module 508 is further used to obtain the stored intermediate data ciphertext, decrypt the intermediate data ciphertext to obtain decrypted intermediate data; use the second target algorithm to process the reference image data and the initial image data set based on the decrypted intermediate data to obtain target image data.

[0122] Each module in the above-mentioned image processing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0123] In an exemplary embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The electronic device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal via wired or wireless communication, and the wireless communication can be achieved via Wi-Fi, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, an image processing method is implemented. The display unit of the electronic device is used to form a visually visible image, and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.

[0124] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0125] In an exemplary embodiment, an electronic device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the image processing method in the above embodiment when executing the computer program.

[0126] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image processing method in the above embodiments are implemented.

[0127] In some embodiments, a computer program product is provided, including a computer program, which implements the steps of the image processing method in the above embodiments when executed by a processor.

[0128] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0129] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0130] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0131] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. An image processing method, characterized in that: The method comprises: In response to a shooting instruction, acquiring an initial image data set; determining reference image data from the initial image data set; Processing the reference image data using a first target algorithm to obtain intermediate data and preview image data; Using a second target algorithm, processing the reference image data and the initial image data set based on the intermediate data to obtain target image data; the processing amount of the algorithm in the first target algorithm is lower than the processing amount of the corresponding algorithm in the second target algorithm; The preview image data is replaced with the target image data.

2. The method according to claim 1, characterized in that The step of processing the reference image data using a first target algorithm to obtain intermediate data includes: Identifying a shooting scene type corresponding to the shooting instruction; The reference image data is processed using a first target algorithm to obtain intermediate data corresponding to the shooting scene type.

3. The method according to claim 2, characterized in that The shooting scene type includes a portrait blur scene, and the intermediate data includes a portrait segmentation mask and background blur parameters; or, The shooting scene type includes a night scene noise reduction scene, and the intermediate data includes a noise distribution map and a scene segmentation result; or, The shooting scene type includes a face optimization scene, and the intermediate data includes coordinates of facial feature points.

4. The method according to claim 1, wherein The method further comprises: Get the current device load status; Determining the target data accuracy corresponding to the current device load condition based on the corresponding relationship between device load and data accuracy; the device load and data accuracy are negatively correlated; The step of processing the reference image data using a first target algorithm to obtain intermediate data includes: The reference image data is processed using a first target algorithm to obtain intermediate data of the target data accuracy.

5. The method according to claim 1, characterized in that The first target algorithm includes a first processing flow; the second target algorithm includes a first processing flow and a second processing flow; The adopting a second target algorithm to process the reference image data and the initial image data set based on the intermediate data to obtain target image data includes: Based on the intermediate data, the reference image data and the initial image data set are processed using a second processing flow in the second target algorithm to obtain target image data.

6. The method according to claim 5, characterized in that The method further comprises: When it is detected that the accuracy of the intermediate data does not meet the accuracy condition, adjusting the intermediate data using the first processing flow in the second target algorithm to obtain adjusted intermediate data; the accuracy of the adjusted intermediate data is higher than the accuracy of the intermediate data before the adjustment; The step of processing the reference image data and the initial image data set based on the intermediate data using a second processing flow in the second target algorithm to obtain target image data includes: Based on the adjusted intermediate data, the reference image data and the initial image data set are processed using a second processing flow in the second target algorithm to obtain target image data.

7. The method according to claim 1, characterized in that The method further comprises: Encrypting the intermediate data to obtain intermediate data ciphertext, and storing the intermediate data ciphertext; The adopting a second target algorithm to process the reference image data and the initial image data set based on the intermediate data to obtain target image data includes: The stored intermediate data ciphertext is obtained, and the intermediate data ciphertext is decrypted to obtain decrypted intermediate data; a second target algorithm is used to process the reference image data and the initial image data set based on the decrypted intermediate data to obtain target image data.

8. An image processing device, characterized in that: The device comprises: An image data acquisition module, configured to acquire an initial image data set in response to a shooting instruction; a reference image determination module, configured to determine reference image data from the initial image data set; a first processing module, configured to process the reference image data using a first target algorithm to obtain intermediate data and preview image data; a second processing module, configured to process the reference image data and the initial image data set based on the intermediate data using a second target algorithm to obtain target image data; wherein the processing amount of the algorithm in the first target algorithm is lower than the processing amount of the corresponding algorithm in the second target algorithm; The image data replacement module is used to replace the preview image data with the target image data.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Image processing method, device and equipment and computer readable storage medium

    CN117314729A

  • Image processing method and device, medium and equipment

    CN119521011A

  • Photographing method and device

    CN119545168A

  • Shooting method and device, electronic equipment and computer readable storage medium

    CN119788957A

  • Processing method and electronic device

    US20240114233A1