WO2020124374A1 - Image processing method, terminal device and storage medium - Google Patents

Image processing method, terminal device and storage medium Download PDF

Info

Publication number
WO2020124374A1
WO2020124374A1 PCT/CN2018/121796 CN2018121796W WO2020124374A1 WO 2020124374 A1 WO2020124374 A1 WO 2020124374A1 CN 2018121796 W CN2018121796 W CN 2018121796W WO 2020124374 A1 WO2020124374 A1 WO 2020124374A1
Authority
WO
WIPO (PCT)
Prior art keywords
algorithm
image
image processing
neural network
convolutional neural
Prior art date
Application number
PCT/CN2018/121796
Other languages
French (fr)
Chinese (zh)
Inventor
薛立君
克拉夫琴科·费奥多尔
赵丛
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2018/121796 priority Critical patent/WO2020124374A1/en
Priority to CN201880071017.2A priority patent/CN111373436A/en
Publication of WO2020124374A1 publication Critical patent/WO2020124374A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/192Recognition using electronic means using simultaneous comparisons or correlations of the image signals with a plurality of references
    • G06V30/194References adjustable by an adaptive method, e.g. learning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • the present application relates to the field of image processing technology, and in particular, to an image processing method, terminal device, and storage medium.
  • the present application provides an image processing method, a terminal device, and a storage medium.
  • the image processing method implements image processing based on a convolutional neural network, and aims to output a better image effect with a smaller amount of calculation.
  • the present application provides an image processing method, including:
  • the preset algorithm list includes multiple image processing algorithm indexes
  • a pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
  • the present application also provides a terminal device, wherein the terminal device includes a memory and a processor;
  • the memory is used to store computer programs
  • the processor is used to execute the computer program and when the computer program is executed, the following steps are implemented:
  • the preset algorithm list includes multiple image processing algorithm indexes
  • a pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
  • the present application further provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor realizes:
  • the preset algorithm list includes multiple image processing algorithm indexes
  • a pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
  • An embodiment of the present application provides an image processing method, a terminal device, and a storage medium.
  • the preset algorithm list includes a plurality of image processing algorithm indexes; according to the plurality of image processing algorithms
  • the index is sequentially read in the preset algorithm list to read the pre-trained convolutional neural network model to process the target image to obtain an output image.
  • This image processing method can achieve a better output of image processing results when a smaller amount of calculation is used.
  • FIG. 1 is a schematic flowchart of steps of an image processing method according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of sub-steps of the image processing method in FIG. 1;
  • FIG. 3 is a schematic flowchart of steps of an image processing method according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of sub-steps of the image processing method in FIG. 3;
  • FIG. 5 is a schematic diagram of a scene using an image processing method provided by an embodiment of the application.
  • FIG. 6 is a schematic flowchart of steps of an image processing method according to an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of steps of a convolutional neural network training method provided by an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of sub-steps of the convolutional neural network training method in FIG. 7;
  • FIG. 9 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present application.
  • Figure 10(a) is a schematic diagram of the convolutional neural network architecture used in reinforcement learning
  • FIG. 10(b) is a schematic diagram of a convolutional neural network architecture provided by an embodiment of the present application.
  • Figure 11(a) is a system resource allocation diagram when loading the convolutional neural network architecture used in reinforcement learning
  • 11(b) is a system resource allocation diagram when the convolutional neural network architecture provided by the embodiment of the present application is loaded.
  • FIG. 1 is a schematic flowchart of steps of an image processing method according to an embodiment of the application.
  • the image processing method can be applied to terminal devices for automatic post-processing of images.
  • Terminal devices include mobile phones, tablets, laptop computers and drones.
  • the unmanned aerial vehicle may be a rotary-wing unmanned aerial vehicle, such as a four-rotor unmanned aerial vehicle, a six-rotor unmanned aerial vehicle, an eight-rotor unmanned aerial vehicle, or a fixed-wing unmanned aerial vehicle.
  • the drone has camera equipment.
  • the image processing method includes steps S101 to S103.
  • the target image is an image to be processed, or an image to be processed selected by the user.
  • the original picture taken through the terminal device or one or more pictures selected by the user in the graphics library of the terminal device.
  • the image processing algorithm index is an algorithm identifier corresponding to the image processing algorithm.
  • the algorithm identifier corresponding to the color temperature adjustment algorithm is Temperature
  • the algorithm identifier corresponding to the color algorithm is set to Tint.
  • other types of marks can also be used as algorithm marks, such as Arabic numerals 1, 2, 3, etc., or letters a, b, c, etc.
  • the plurality of image processing algorithm indexes specifically include: adjusting color temperature algorithm index, setting color algorithm index, adjusting exposure algorithm index, adjusting contrast algorithm index, highlight recovery algorithm index, low light compensation algorithm index, white balance Algorithm index, adjust sharpness algorithm index, defogging algorithm index, adjust natural saturation algorithm index, adjust saturation algorithm index and tone curve algorithm index.
  • multiple image processing algorithms correspond to different algorithm indexes, and the multiple image processing algorithm indexes are arranged in sequence, and the sequence arrangement corresponds to the corresponding arrangement number.
  • Table 1 is a list of preset algorithms
  • 12 image processing algorithms are specifically used, and the order of these algorithms is as shown in Table 1. According to the experiment, it is shown that the 12 image processing algorithms and the corresponding sorting order can be used for related image processing, and a better image processing effect can be obtained.
  • the order of multiple image processing algorithm indexes in the preset algorithm list is to adjust color temperature, set color, adjust exposure, adjust contrast, highlight recovery, low light compensation, and white balance , Adjust the clarity, defog, adjust the natural saturation, adjust the saturation and tone curve and other image processing algorithms in the order of arrangement in Table 1, namely 1, 2, 3....11 and 12.
  • the pre-trained convolutional neural network model is sequentially read to process the target image to obtain an output image, specifically, each image is processed according to The algorithm starts the convolutional neural network model to process the target image to obtain the output image; the output image is used as the target image, and the cycle is executed according to an image processing algorithm to start the convolutional neural network model to process the target image to obtain the final output image, Then complete the processing of the target image.
  • step S103 specifically includes: sub-steps S1031 to S1034.
  • an image processing algorithm index in the preset algorithm list is determined, and the image processing algorithm index corresponds to an image processing algorithm.
  • the determining an image processing algorithm index in the preset algorithm list may be: sequentially determining the preset algorithm list according to the order in which multiple image processing algorithms are arranged in the preset algorithm list An image processing algorithm in.
  • Table 1 first determine the algorithm index Temperature and the corresponding color temperature adjustment algorithm, then determine the algorithm index Tint and the corresponding set color algorithm, and finally determine the algorithm index ToneCurce and the corresponding tone curve algorithm.
  • steps S1032 to S1033 are started; then, the algorithm index Tint and the corresponding color setting algorithm are determined, and the output after processing according to the color temperature adjustment algorithm With the image as the target image, continue to perform steps S1032 to S1033; this loops until the algorithm in Table 1 is executed.
  • an image processing algorithm may not be determined according to the order in which multiple image processing algorithms are arranged in the preset algorithm list, and each time an algorithm index and corresponding image processing algorithm may be randomly determined in the preset algorithm list , And then perform steps S1032 and S1033 until the algorithm in Table 1 is executed.
  • S1032 Determine algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model.
  • the target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm.
  • the determined image processing algorithm is an exposure adjustment algorithm (Exposure)
  • the target image is input into the convolutional neural network model for training to obtain an adjusted exposure algorithm (Exposure) Corresponding algorithm parameters.
  • the convolutional neural network model is a pre-trained model whose input is a target image with an image processing algorithm determined, and the target image is input into the convolutional neural network model for training to output corresponding algorithm parameters, such as Adjust the algorithm parameters corresponding to the exposure algorithm (Exposure).
  • inputting the target image into a convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm includes: inputting the target image into a convolutional neural network Train in the model to obtain multiple algorithm parameters corresponding to the image processing algorithm and the probability value corresponding to each of the algorithm parameters; and determine the algorithm parameters corresponding to the image processing algorithm according to the probability value.
  • adjusting the color temperature corresponding to the algorithm parameter is a range value, such as ⁇ -100,100 ⁇
  • the output result of the convolutional neural network model training is the probability value corresponding to the range value of the algorithm parameter, such as the color temperature 100, and the probability value is 15%;
  • the color temperature is 80, the probability value is 84%, and then the color temperature with a larger probability value is taken as the image color temperature.
  • the color temperature value with the largest selection probability can be selected and output through the comparator.
  • the processing the target image according to the image processing algorithm and corresponding algorithm parameters to obtain an output image includes: according to the algorithm parameters corresponding to the image processing algorithm, calling a function corresponding to the image processing algorithm The target image is processed to obtain an output image.
  • the function corresponding to the algorithm for adjusting the color temperature is called, for example, the temperature function.
  • the temperature function is used to process the target image to obtain the processed target image, that is, the output image.
  • the corresponding image processing tools for example, Camera, Raw tool, Photoshop tool, Lighting Tool
  • the algorithm parameters corresponding to the image processing algorithm can also be called according to the algorithm parameters corresponding to the image processing algorithm, and the image processing algorithm The target image is processed to obtain an output image.
  • the convolutional neural network can provide the encapsulated image processing module with an image processing algorithm parameter in the form of a plug-in, so that the image processing module performs a single processing on the input picture according to the algorithm parameter.
  • steps S1033 and S1034 are: using the image processing algorithm to process the target image according to the algorithm parameters to obtain an output image.
  • each convolutional neural network performs parameter output only once, and calls an image processing module for processing output parameters based on the output parameters.
  • the input of the image processing module is the processing result output by the last image processing module.
  • the image processing method provided in the above embodiment obtains a target image and a preset algorithm list, the preset algorithm list includes a plurality of image processing algorithm indexes; according to a plurality of the image processing algorithm indexes in the preset algorithm list
  • the pre-trained convolutional neural network model is sequentially read to process the target image to obtain an output image.
  • the image processing method uses the preset image algorithm list and the convolutional neural network model to complete the image processing. Compared with the reinforcement learning-based scheme or the generative adversarial network scheme, each time the neural network is convolved, only the target parameters are loaded.
  • the minimum neural network can reduce the convolution volume of the loaded neural network to a large extent, ensuring the credibility of the algorithm on low computing power platforms. In the case of using a smaller amount of calculation, a better image processing result can be achieved, that is, an image with the same resolution as the target image can be obtained.
  • FIG. 3 is a schematic flowchart of steps of another image processing method according to an embodiment of the application.
  • the image processing method can be applied to a terminal device to perform automatic post-processing on the captured original image, so as to output a better image processing result with a smaller amount of calculation.
  • the image processing method includes steps S201 to S206.
  • the to-be-processed image may be an image selected by the user in the picture library of the terminal device, or an image just taken by the user through the terminal device.
  • Each image to be processed includes a corresponding image format, and the image format of the image to be processed may be determined by naming the suffix of the image to be processed.
  • the suffix of image 1 to be processed is named .JPG
  • the image format of image 1 to be processed is JPG (Joint Photographic Experts Group) format
  • the suffix of image 2 to be processed is named .RAW
  • the image to be processed The image format of 2 is RAW (RAW Image Format) format.
  • the image in RAW format is the raw data of the image sensor that converts the captured light source signal into a digital signal.
  • S202 Determine whether the image format of the image to be processed is in RAW format.
  • step S203 it is determined whether the image format of the image to be processed is a RAW format according to the suffix name of the image to be processed, and a judgment result is generated; and different steps are executed according to different judgment results (step S203 and step S204).
  • the RAW format has many advantages, so in this embodiment, the image in the RAW format is selected for image processing, so as to obtain a better image processing effect.
  • the advantages are as follows:
  • RAW format images retain more color levels than JPG format images.
  • the operations that are often done in the later image processing, such as adding or subtracting exposure, adjusting highlights or shadows, increasing or decreasing contrast, adjusting color scales and curves, will destroy the continuity of the color scale, resulting in skipped color scales. It's hard to detect, but the range is so large that it can destroy the texture of the photo after being detected by the naked eye.
  • a common example is that the uniform gradient transition of the blue sky is destroyed in the later period and an unsightly color scale is displayed.
  • the 14-bit (RAW) color depth of RAW is advantageous because there are enough color levels to maintain the color level jump at a level that cannot be distinguished by the naked eye.
  • RAW format images use 14-bit sensor raw data, so accurate color temperature correction can be performed by the image processing tool (Camera Raw tool), such as cool 0k-10000k warm color correction. It doesn't matter if the white balance is completely set incorrectly when shooting (for example, shooting with daylight white balance under an indoor incandescent lamp), but if you shoot in JPG format, because the JPG format image uses 8-bit (bit) JPG File, so only a few limited methods (such as Color Balance) in PS (Photoshop tool) can be used to slightly adjust the color temperature. After adjusting a warm golden photo to the normal color temperature, the details will be terrible.
  • the image processing tool such as cool 0k-10000k warm color correction.
  • step S205 is executed.
  • step S205 if the image format of the image to be processed is not the RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image, and execute step S205.
  • the preset algorithm list includes a plurality of image processing algorithm indexes arranged in a stack form, specifically a first-in-first-out (First In First Out, FIFO) stack form. Since multiple image processing algorithm indexes are stored in a first-in first-out (First In Out, FIFO) stack format for data storage, it can be ensured that the index according to multiple image processing algorithm indexes in the preset algorithm list Read the pre-trained convolutional neural network model sequentially.
  • FIFO First In First Out
  • the image processing method before the step of obtaining the preset algorithm list, the image processing method further includes: step S205a and step S205b.
  • S205a Acquire a preset algorithm list, the algorithm list includes a plurality of image processing algorithm indexes arranged in order; S205b, save the image processing algorithm indexes in the algorithm list in a first-in first-out stack form to generate a pre- Set the algorithm list.
  • the algorithm list may be Table 1, including a plurality of image processing algorithm indexes arranged in sequence, and the image processing algorithm index is an algorithm identifier of the image processing algorithm.
  • the image processing algorithm indexes in the algorithm list are saved in a first-in first-out stack form to generate a preset algorithm list, thereby ensuring that they are read in the order of the plurality of image processing algorithm indexes in the preset algorithm list Take the pre-trained convolutional neural network model.
  • the pre-trained convolutional neural network model is sequentially read to process the target image to obtain the output image. Specifically, each time a convolutional neural network model is activated according to an image processing algorithm to process the target image to obtain an output image; the output image is used as a target image in a cyclic execution, and the convolutional neural network model is activated to the target image according to an image processing algorithm Process to obtain the output image; until all the image processing algorithms in the preset algorithm list are executed, the final output image is obtained, and then the processing of the target image is completed.
  • the terminal device is specifically a smartphone, and of course, it may also be a drone. In this embodiment, only a smartphone is used as an example. Before using the smart phone to adopt the image processing method to process the image to be processed, two setting operations need to be performed.
  • Setting operation 2 Save the pre-trained convolutional neural network model to the terminal device, of course, you can use the deep learning model compression technology, first compress the pre-trained convolutional neural network model, and then save it in the terminal device .
  • the user can use the smartphone to perform image processing on the image to be processed using the image processing method.
  • the smartphone can use the smartphone to perform image processing on the captured image using the image processing algorithm, so that a smaller amount of calculation can be used to obtain a better image processing effect.
  • the image processing algorithm is also particularly suitable for terminal devices such as smart phones and drones, which have poorer processing capabilities than servers.
  • a user uses a smartphone 10 to take a picture of a tree 20 in the distance, after the picture is taken, an image processing function or an automatic processing function is selected, wherein the image processing function and the automatic processing function are based on the image processing method For the design, the image processing algorithm is used to process the captured image, and finally a tree picture 30 with a better image effect is obtained.
  • the smartphone 10 specifically executes the following steps: acquiring the image to be processed and the image format of the image to be processed; determining whether the image format of the image to be processed is a RAW format; if the image format of the image to be processed is RAW Format, directly obtain the image to be processed as the target image; or, if the image format of the image to be processed is not RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image;
  • a sequence of the image processing algorithm indexes in the preset algorithm list reads a pre-trained convolutional neural network model to process the target image to obtain an output image 30.
  • the image processing method provided in the above embodiment determines whether the image format of the image to be processed is a RAW format by acquiring the image to be processed and the image format of the image to be processed; if the image format of the image to be processed is a RAW format , Directly obtain the image to be processed as the target image; or, if the image format of the image to be processed is not RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image; according to multiple
  • the order of the image processing algorithm index in the preset algorithm list is to read a pre-trained convolutional neural network model in order to process the target image. Therefore, the method can output an image with better effect under the condition of using less calculation amount of the terminal device, thereby improving the user experience.
  • FIG. 6 is a schematic flowchart of steps of yet another image processing method according to an embodiment of the application.
  • the image processing method can be applied to a terminal device to perform automatic post-processing on the captured original image, so as to output a better image processing result with a smaller amount of calculation.
  • the image processing method includes steps S301 to S305.
  • the target image is an image to be processed, or an image to be processed selected by the user.
  • the image processing algorithm index is the algorithm identifier corresponding to the image processing algorithm, for example, the algorithm identifier corresponding to the color temperature adjustment algorithm is Temperature, and the algorithm identifier corresponding to the color algorithm is set to Tint.
  • multiple image processing algorithms shown in Table 1 above may be used to correspond to different algorithm indexes, and the multiple image processing algorithm indexes are arranged in order.
  • the target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to an image processing algorithm in the preset algorithm list, such as random Determine the exposure of an image processing algorithm (eg, adjust the exposure algorithm) in the preset algorithm list.
  • the target image is input to the convolutional neural network model for training in an image-oriented manner to obtain algorithm parameters corresponding to an image processing algorithm in the preset algorithm list.
  • the convolutional neural network model is used to match the corresponding image, and then the algorithm parameters of the image processing algorithm corresponding to the image are determined. This is not the same as the image processing algorithm-based approach provided in the above embodiment, and the convolutional neural network module is used to determine the algorithm parameters of the corresponding image processing algorithm, so the image processing effect can be improved.
  • the processing the target image according to the image processing algorithm and corresponding algorithm parameters to obtain an output image includes: according to the algorithm parameters corresponding to the image processing algorithm, calling a function corresponding to the image processing algorithm The target image is processed to obtain an output image.
  • the function corresponding to the algorithm for adjusting the color temperature is called, for example, the temperature function. Then, according to the color temperature 80, the function temperature function is used to process the target image to obtain the processed target image, that is, the output image.
  • the output image processed by adjusting the color temperature algorithm is used as the target image, and then returns to steps S303 to S305 to determine another image processing algorithm, such as determining to set the color algorithm; then the output image processed by setting the color algorithm is used as the target Image, and then go through S303 to S305 repeatedly until all the image processing algorithms in the preset algorithm list are trained to get the final output image.
  • the image processing method provided in the above embodiment obtains a target image in RAW format and a preset algorithm list, the preset algorithm list includes multiple image processing algorithm indexes; the target image is input to a convolutional neural network model for training To obtain an algorithm parameter corresponding to an image processing algorithm in the preset algorithm list; process the target image according to the algorithm parameter and the corresponding image processing algorithm to obtain an output image; use the output image as a The target image is returned to the input of the target image to the convolutional neural network for training and continued execution until the image processing algorithms in the preset algorithm list are all trained to obtain the final output image.
  • the image processing method can not only reduce the calculation amount of the terminal device, but also obtain better image processing results.
  • FIG. 7 is a schematic flowchart of steps in a method for training a convolutional neural network according to an embodiment of the application.
  • This convolutional neural network training method is used to obtain a convolutional neural network model.
  • the above-mentioned image processing method embodiment may use the convolutional neural network model, and of course the convolutional neural network model trained by other methods.
  • GoogLeNet is used for model training to obtain a convolutional neural network model.
  • other networks may also be used, such as AlexNet or VGGNet.
  • AlexNet or VGGNet.
  • the following will use GoogLeNet as an example.
  • the convolutional neural network training method includes step S401 and step S404.
  • the image sample data is a post-processing data of a professional photographer, and a correspondingly processed data set.
  • the image sample data includes a plurality of image data processed by an image processing algorithm and algorithm parameters corresponding to the image data.
  • the algorithm parameters in the image sample data need to be quantized to obtain quantized image sample data.
  • the input of the image processing algorithm in all image sample data is quantized into a numerical variable with a fixed range.
  • the exposure value (Exposure) is quantified as ⁇ -5.00, +5.00 ⁇
  • the highlights recovery (Highlights Recovery) is quantified as ⁇ -100, +100 ⁇ .
  • the image sample data is used to train the model through GoogLeNet.
  • GoogLeNet Specifically, directional propagation training can be used.
  • the convolutional layer and the pooling layer of GoogLeNet are used to extract features from the input image sample data, and the fully connected layer is used for classification.
  • the output of the classifier and classifier are different image processing algorithms and corresponding algorithm parameters.
  • the neural network takes the trained image sample data as input and undergoes forward propagation steps (convolution, ReLU, and pooling operations to forward propagation in the fully connected layer ) To get the output probability of each class.
  • the algorithm parameters in the image sample data are quantized based on the convolutional neural network to obtain quantized image sample data.
  • iterative training based on the image sample data to obtain a convolutional neural network model includes: based on the convolutional neural network algorithm, iterative training is performed based on the quantized image sample data to obtain a convolutional neural network model.
  • the algorithm parameters corresponding to the image data are used as calibration data (ground) to define a loss function (loss) to verify the accuracy of the trained convolutional neural network model.
  • the verification of the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data specifically includes:
  • S4031 Set the algorithm parameter corresponding to the image data as calibration data; S4032, calculate the difference between the calibration data and the algorithm parameter corresponding to the image processing algorithm in the output parameter as the gap loss value; S4033, determine the Whether the gap loss value meets a preset condition, and the preset condition is a condition for measuring the accuracy of the convolutional neural network model; S4034, when the gap loss value meets the preset condition, it is determined that the The convolutional neural network model was verified.
  • the algorithm parameters corresponding to the image processing algorithm used by the photographer are used as calibration data (ground), and the prepared image sample data is used for large-scale iterative training to allow the convolutional neural network to output the image processing algorithm after learning the semantic information of the picture.
  • the gap between the output algorithm parameters and the calibration data (ground) is used as the gap loss value, and the gap loss value (loss) is minimized during model training to ensure the accuracy of the model.
  • the accuracy of the convolutional neural network model can be measured by determining whether the gap loss value satisfies a preset condition.
  • the judging whether the gap loss value meets the preset condition includes: monitoring the change value of the gap loss value corresponding to each iteration training; if the change value of the gap loss value corresponding to each iteration training is Within a preset range, it is determined that the gap loss value meets the preset condition.
  • the change value of the gap loss value corresponding to each iteration training is within a preset range.
  • the preset range such as (0.00001, 0.00002), indicates that the gap loss value has been basically stable, and the change is small.
  • the gap loss value meets the preset condition, and it is determined that the convolutional neural network model passes verification.
  • the judging whether the gap loss value satisfies the preset condition further includes: when the gap loss value corresponding to each iteration training decreases, determining whether the gap loss value is less than the preset value; The gap loss value is less than the preset value, and it is determined that the gap loss value meets the preset condition.
  • the preset value is 0.001
  • the gap loss value corresponding to each iteration training decreases and the gap loss value is less than 0.001
  • the network model is verified.
  • the weights and parameters in the convolutional neural network have been optimized, and the images or other images in the image sample data can be correctly classified and identified to obtain the corresponding algorithm parameters.
  • the verified convolutional neural network model is saved as a pre-trained convolutional neural network model in the terminal device.
  • the compression processing specifically includes pruning processing, quantization processing, and Huffman coding processing on the convolutional neural network model, so as to reduce the size of the convolutional neural network module and facilitate storage in a terminal device with a small capacity.
  • FIG. 9 is a schematic block diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 500 includes a processor 501 and a memory 502, and the processor 501 and the memory 502 are connected by a bus 503, for example, an I2C (Inter-integrated Circuit) bus.
  • I2C Inter-integrated Circuit
  • the processor 501 may be a micro-controller (MCU), a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), or the like.
  • MCU micro-controller
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • the memory 502 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a U disk, or a mobile hard disk.
  • the processor 501 is used to run a computer program stored in the memory 502, and implement the following steps when executing the computer program:
  • the target image acquires a preset algorithm list, the preset algorithm list includes multiple image processing algorithm indexes; read the pre-trained convolution according to the order of the multiple image processing algorithm indexes in the preset algorithm list Neural network model to process the target image.
  • the processor realizes the acquisition of the target image, it is used to realize:
  • the processor is further used to implement:
  • the preset algorithm list includes multiple image processing algorithm indexes arranged in a stack.
  • the processor is also used to implement:
  • the algorithm list includes a plurality of image processing algorithm indexes arranged in sequence; save the image processing algorithm indexes in the algorithm list in a first-in first-out stack form to generate a preset algorithm list.
  • the plurality of image processing algorithm indexes include adjusting color temperature algorithm indexes, setting color algorithm indexes, adjusting exposure algorithm indexes, adjusting contrast algorithm indexes, highlight recovery algorithm indexes, low light compensation algorithm indexes, white balance algorithm indexes, and adjustments Clarity algorithm index, defogging algorithm index, adjusting natural saturation algorithm index, adjusting saturation algorithm index and tone curve algorithm index.
  • the processor implements the order of reading the pre-trained convolutional neural network model in the preset algorithm list according to a plurality of the image processing algorithm indexes in order to process the target image , Used to achieve:
  • the target image is processed to obtain an output image.
  • the processor implements the image processing algorithm corresponding to the image processing algorithm index sequentially started according to the preset algorithm list, it is used to implement:
  • An image processing algorithm index in the preset algorithm list is determined, and the image processing algorithm index corresponds to an image processing algorithm.
  • the processor when implementing the determination of an image processing algorithm index in the preset algorithm list, is used to implement:
  • one image processing algorithm in the preset algorithm list is determined in sequence.
  • the processor when implementing the determination of the algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model, is used to implement:
  • the target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm.
  • the processor when the processor implements the input of the target image into a convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm, the processor is used to implement:
  • the algorithm parameters corresponding to the processing algorithm are
  • the processor when the processor implements the image processing algorithm to process the target image according to the algorithm parameter to obtain an output image, the processor is used to implement:
  • the processor implements the processing of the target image according to the image processing algorithm and corresponding algorithm parameters to obtain an output image, for implementing:
  • a function corresponding to the image processing algorithm is called to process the target image to obtain an output image.
  • the processor implements the order of reading the pre-trained convolutional neural network model in the preset algorithm list according to a plurality of the image processing algorithm indexes in order to process the target image , Used to achieve:
  • processor is also used to implement:
  • the image sample data includes a plurality of image data processed by an image processing algorithm and algorithm parameters corresponding to the image data; based on a convolutional neural network, iterative training is performed according to the image sample data to obtain a volume
  • a convolutional neural network model the output parameters of the convolutional neural network model are algorithm parameters corresponding to the image processing algorithm; the algorithm parameters corresponding to the image data are used as calibration data to verify the convolutional neural network model;
  • the convolutional neural network model is used as a pre-trained convolutional neural network model.
  • the processor when the processor implements the verification of the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data, it is used to implement:
  • the preset condition is a condition for measuring the accuracy of the convolutional neural network model; when the gap loss value meets the preset condition, it is determined that the convolutional neural network model passes verification.
  • the processor when the processor implements the judgment whether the gap loss value meets a preset condition, it is used to implement:
  • the processor when the processor implements the judgment whether the gap loss value meets a preset condition, it is used to implement:
  • the gap loss value corresponding to each iteration training decreases, determine whether the gap loss value is less than a preset value; if the gap loss value is less than the preset value, determine that the gap loss value meets the preset condition.
  • the processor before implementing the convolution-based neural network and iterative training based on the image sample data to obtain a convolutional neural network model, the processor is also used to implement:
  • the method includes: based on the convolutional neural network algorithm, iterative training is performed according to the quantized image sample data to obtain a convolutional neural network model.
  • FIGS. 10(a) and 10(b) a comparison between the architecture of a convolutional neural network and the architecture of a reinforcement learning neural network according to an embodiment of the present invention is described, as shown in FIGS. 10(a) and 10(b).
  • Figure 10(a) is the reinforcement learning neural network architecture, which has more convolutional layers and pooling layers, and its output will have multiple training parameters (not shown), and multiple training parameters correspond to different trainings of the output picture result.
  • the reinforcement neural network can also output one parameter at a time, but the reinforcement neural network itself still has a large volume (the number of convolutional layers and pooling layers M has a large value), which is more complicated in hardware configuration On low platforms, there will be problems such as long loading time and slow response speed.
  • 10(b) is a neural network architecture according to an embodiment of the present invention, which is composed of K independent convolutional neural sub-networks. Since each neural sub-network is only for one parameter, its volume is small (convolution of each neural sub-network The number of layers and pooling layers is small), according to the index, only one subnet needs to be loaded in memory at a time, while the other networks are not loaded. Of course, if the hardware resources allow, you can keep the next subnet to be calculated in the pre The loaded state.
  • the processor performs neural network operations and image processing in two parallel threads, and these two processing operations are extremely costly system resources, if you use a general neural network, such as enhanced neural Networks, because neural networks take up a large volume after being loaded into memory, the system resources reserved for image processing will be relatively small. On platforms with tight computing power resources, it often results in longer response times, even crashes or program failures. response.
  • the processing processor performs neural network operations and image processing in two parallel threads.
  • the system only needs to load the currently processed subnetwork, At the same time, the sub-network to be processed is preloaded at the same time, so that more computing power for image processing can be left, and the response speed of the calculation is improved.
  • An embodiment of the present application also provides a computer-readable storage medium that stores a computer program, where the computer program includes program instructions, and the processor executes the program instructions to implement the foregoing implementation Example provides the steps of the image processing method.
  • the computer-readable storage medium may be an internal storage unit of the terminal device according to any of the foregoing embodiments, such as a hard disk or a memory of the terminal device.
  • the computer-readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk provided on the terminal device, a smart memory card (Smart) Media (SMC), and secure digital (SD) ) Card, flash card (Flash Card), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)

Abstract

Disclosed are an image processing method, a terminal device and a storage medium. The method comprises: acquiring a target image (S101); acquiring a preset algorithm list, wherein the preset algorithm list comprises a plurality of image processing algorithm indexes (S102); and reading, according to the order of the plurality of image processing algorithm indexes in the preset algorithm list, a pre-trained convolutional neural network model to process the target image (S103). Therefore, a better image processing effect is obtained with a relatively small amount of calculation.

Description

图像处理方法、终端设备及存储介质Image processing method, terminal equipment and storage medium 技术领域Technical field
本申请涉及图像处理技术领域,尤其涉及一种图像处理方法、终端设备及存储介质。The present application relates to the field of image processing technology, and in particular, to an image processing method, terminal device, and storage medium.
背景技术Background technique
目前,一些自动化图像后期处理的方案中,比如基于强化学习的方案,当随着需要用到的图像处理算法增多时,会导致强化学习动作集合的搜索空间增大,从而大大增加了计算量,导致处理图像的速度降低。另外,对于图像处理而言,可能会产生某些图像处理算法被多次使用,但是有些图像处理算法从来没有被使用过的情况,同时很难定义出一个好的奖励等因素,因此会大大降低图像处理的效果。再比如基于生成式对抗网络的方案,对输出图片的分辨率有比较大的限制,为了保证运行速度一般只能生成较小分辨率的图片,对于目前广泛应用的大分辨率的图片,不能很好地生成与原图对应分辨率的输出结果。At present, in some automatic image post-processing solutions, such as reinforcement learning-based solutions, when the number of image processing algorithms needed increases, the search space of the reinforcement learning action set will increase, which greatly increases the amount of calculation. This results in a reduction in the speed of processing images. In addition, for image processing, some image processing algorithms may be used multiple times, but some image processing algorithms have never been used, and it is difficult to define a good reward and other factors, so it will be greatly reduced The effect of image processing. Another example is the solution based on the generative confrontation network, which has relatively large restrictions on the resolution of the output picture. In order to ensure the running speed, generally only a smaller resolution picture can be generated. For the currently widely used large resolution pictures, it is not very Good output results corresponding to the resolution of the original image.
发明内容Summary of the invention
基于此,本申请提供了一种图像处理方法、终端设备及存储介质,该图像处理方法基于卷积神经网络实现对图像处理,旨在以较小计算量并输出较好的图像效果。Based on this, the present application provides an image processing method, a terminal device, and a storage medium. The image processing method implements image processing based on a convolutional neural network, and aims to output a better image effect with a smaller amount of calculation.
第一方面,本申请提供了一种图像处理方法,包括:In the first aspect, the present application provides an image processing method, including:
获取目标图像;Get the target image;
获取预设算法列表,所述预设算法列表包括多个图像处理算法索引;Obtain a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes;
根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。A pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
第二方面,本申请还提供了一种终端设备,其中所述终端设备包括存储器和处理器;In a second aspect, the present application also provides a terminal device, wherein the terminal device includes a memory and a processor;
所述存储器用于存储计算机程序;The memory is used to store computer programs;
所述处理器,用于执行所述计算机程序并在执行所述计算机程序时,实现如下步骤:The processor is used to execute the computer program and when the computer program is executed, the following steps are implemented:
获取目标图像;Get the target image;
获取预设算法列表,所述预设算法列表包括多个图像处理算法索引;Obtain a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes;
根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。A pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
第三方面,本申请还提供了一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现:In a third aspect, the present application further provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor realizes:
获取目标图像;Get the target image;
获取预设算法列表,所述预设算法列表包括多个图像处理算法索引;Obtain a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes;
根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。A pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
本申请实施例提供了一种图像处理方法、终端设备及存储介质,通过获取目标图像和预设算法列表,所述预设算法列表包括多个图像处理算法索引;根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理得到输出图像。该图像处理方法可以在使用较小的计算量的情况下,实现输出较好的图像处理结果。An embodiment of the present application provides an image processing method, a terminal device, and a storage medium. By acquiring a target image and a preset algorithm list, the preset algorithm list includes a plurality of image processing algorithm indexes; according to the plurality of image processing algorithms The index is sequentially read in the preset algorithm list to read the pre-trained convolutional neural network model to process the target image to obtain an output image. This image processing method can achieve a better output of image processing results when a smaller amount of calculation is used.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present application.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without paying any creative labor.
图1是本申请一实施例提供的一种图像处理方法的步骤示意流程图;1 is a schematic flowchart of steps of an image processing method according to an embodiment of the present application;
图2是图1中的图像处理方法的子步骤示意流程图;2 is a schematic flowchart of sub-steps of the image processing method in FIG. 1;
图3是本申请一实施例提供的一种图像处理方法的步骤示意流程图;3 is a schematic flowchart of steps of an image processing method according to an embodiment of the present application;
图4是图3中的图像处理方法的子步骤示意流程图;4 is a schematic flowchart of sub-steps of the image processing method in FIG. 3;
图5是申请一实施例提供的使用图像处理方法的场景示意图;5 is a schematic diagram of a scene using an image processing method provided by an embodiment of the application;
图6是本申请一实施例提供的一种图像处理方法的步骤示意流程图;6 is a schematic flowchart of steps of an image processing method according to an embodiment of the present application;
图7是本申请一实施例提供的一种卷积神经网络训练方法的步骤示意流程图;7 is a schematic flowchart of steps of a convolutional neural network training method provided by an embodiment of the present application;
图8是图7中的卷积神经网络训练方法的子步骤示意流程图;8 is a schematic flowchart of sub-steps of the convolutional neural network training method in FIG. 7;
图9是本申请一实施例提供的一种终端设备的结构示意性框图;9 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present application;
图10(a)是强化学习所使用的卷积神经网络构架示意图;Figure 10(a) is a schematic diagram of the convolutional neural network architecture used in reinforcement learning;
图10(b)是本申请实施例提供的卷积神经网络构架示意图;10(b) is a schematic diagram of a convolutional neural network architecture provided by an embodiment of the present application;
图11(a)是加载强化学习所使用的卷积神经网络构架时的***资源分配图;Figure 11(a) is a system resource allocation diagram when loading the convolutional neural network architecture used in reinforcement learning;
图11(b)是加载本申请实施例提供的卷积神经网络构架时的***资源分配图。11(b) is a system resource allocation diagram when the convolutional neural network architecture provided by the embodiment of the present application is loaded.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without making creative efforts fall within the protection scope of the present application.
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowchart shown in the drawings is only an example, and it is not necessary to include all contents and operations/steps, nor to be executed in the order described. For example, some operations/steps can also be decomposed, combined, or partially merged, so the order of actual execution may change according to the actual situation.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。In the following, some embodiments of the present application will be described in detail with reference to the drawings. In the case of no conflict, the following embodiments and the features in the embodiments can be combined with each other.
请参阅图1,图1是申请一实施例提供的一种图像处理方法的步骤示意流程图。该图像处理方法可以应用在终端设备中,用于图像自动化后期处理。其中终端设备包括手机、平板、笔记本电脑和无人机等。Please refer to FIG. 1, which is a schematic flowchart of steps of an image processing method according to an embodiment of the application. The image processing method can be applied to terminal devices for automatic post-processing of images. Terminal devices include mobile phones, tablets, laptop computers and drones.
其中,无人机可以为旋翼型无人机,例如四旋翼无人机、六旋翼无人机、 八旋翼无人机,也可以是固定翼无人机。该无人机上带有摄像设备。Among them, the unmanned aerial vehicle may be a rotary-wing unmanned aerial vehicle, such as a four-rotor unmanned aerial vehicle, a six-rotor unmanned aerial vehicle, an eight-rotor unmanned aerial vehicle, or a fixed-wing unmanned aerial vehicle. The drone has camera equipment.
具体地,如图1所示,该图像处理方法包括步骤S101至步骤S103。Specifically, as shown in FIG. 1, the image processing method includes steps S101 to S103.
S101、获取目标图像。S101. Acquire a target image.
其中,目标图像为待处理图像,或者为用户选择的待处理图像。比如,通过终端设备拍摄的原始图片,或用户在终端设备的图形库选择的一张或多张图片。The target image is an image to be processed, or an image to be processed selected by the user. For example, the original picture taken through the terminal device, or one or more pictures selected by the user in the graphics library of the terminal device.
S102、获取预设算法列表,所述预设算法列表包括多个图像处理算法索引。S102. Acquire a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes.
其中,图像处理算法索引为图像处理算法对应的算法标识,比如调整色温算法对应的算法标识为Temperature,设置色彩算法对应的算法标识为Tint。除了用其对应的英文单词进行表示,当然也可以采用其他类型的标识作为算法标识,比如***数字1、2、3等,或者字母a、b、c等。The image processing algorithm index is an algorithm identifier corresponding to the image processing algorithm. For example, the algorithm identifier corresponding to the color temperature adjustment algorithm is Temperature, and the algorithm identifier corresponding to the color algorithm is set to Tint. In addition to its corresponding English words, of course, other types of marks can also be used as algorithm marks, such as Arabic numerals 1, 2, 3, etc., or letters a, b, c, etc.
在本实施例中,所述多个图像处理算法索引具体包括:调整色温算法索引、设置色彩算法索引、调整曝光算法索引、调整对比度算法索引、高光恢复算法索引、低光补偿算法索引、白平衡算法索引、调整清晰度算法索引、除雾算法索引、调整自然饱和度算法索引、调整饱和度算法索引和色调曲线算法索引。In this embodiment, the plurality of image processing algorithm indexes specifically include: adjusting color temperature algorithm index, setting color algorithm index, adjusting exposure algorithm index, adjusting contrast algorithm index, highlight recovery algorithm index, low light compensation algorithm index, white balance Algorithm index, adjust sharpness algorithm index, defogging algorithm index, adjust natural saturation algorithm index, adjust saturation algorithm index and tone curve algorithm index.
如表1所示,多个图像处理算法对应不同算法索引,并且多个图像处理算法索引按照顺序排列,顺序排列对应相应的排列序号。As shown in Table 1, multiple image processing algorithms correspond to different algorithm indexes, and the multiple image processing algorithm indexes are arranged in sequence, and the sequence arrangement corresponds to the corresponding arrangement number.
表1为预设算法列表Table 1 is a list of preset algorithms
序号Serial number 图像处理算法Image processing algorithm 算法索引Algorithm index
11 调整色温Adjust color temperature TemperatureTemperature
22 设置色彩Set color TintTint
33 调整曝光Adjust exposure ExposureExposure
44 调整对比度Adjust contrast ContrastContrast
55 高光恢复Highlight recovery Highlights RecoveryHighlights Recovery
66 低光补偿Low light compensation Shadows FillShadows Fill
77 白平衡White balance White BalanceWhite Balance
88 调整清晰度Adjust sharpness ClarityClarity
99 除雾 Defog DehazeDehaze
1010 调整自然饱和度Adjust natural saturation VibranceVibrance
1111 调整饱和度Adjust saturation SaturationSaturation
1212 色调曲线Tone curve Tone CurceTone Curce
在本实施例中,具体使用12个图像处理算法,这些算法的排列顺序如表1中的顺序。根据实验表明:采用该12个图像处理算法和对应的排序顺序进行相关的图像处理,可以取得较好的图像处理效果。In this embodiment, 12 image processing algorithms are specifically used, and the order of these algorithms is as shown in Table 1. According to the experiment, it is shown that the 12 image processing algorithms and the corresponding sorting order can be used for related image processing, and a better image processing effect can be obtained.
需要说明的是,根据实际图像处理需要,可以减少或增加相应的图像处理算法,比如删除色调曲线,或者增加剪切算法等。当然也可以,相应地调整各个图形处理算法的排序顺序,比如将白平衡和除雾两个算法在表1中的排序对调。It should be noted that, according to actual image processing needs, corresponding image processing algorithms can be reduced or added, such as deleting a tone curve, or adding a cutting algorithm. Of course, it is also possible to adjust the sorting order of each graphics processing algorithm accordingly, such as swapping the sorting of the two algorithms of white balance and defogging in Table 1.
S103、根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。S103: Read a pre-trained convolutional neural network model according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
具体地,多个所述图像处理算法索引在所述预设算法列表中的顺序,如表1所示,为调整色温、设置色彩、调整曝光、调整对比度、高光恢复、低光补偿、白平衡、调整清晰度、除雾、调整自然饱和度、调整饱和度和色调曲线等图像处理算法在表1中排列顺序,即1、2、3....11和12。Specifically, the order of multiple image processing algorithm indexes in the preset algorithm list, as shown in Table 1, is to adjust color temperature, set color, adjust exposure, adjust contrast, highlight recovery, low light compensation, and white balance , Adjust the clarity, defog, adjust the natural saturation, adjust the saturation and tone curve and other image processing algorithms in the order of arrangement in Table 1, namely 1, 2, 3....11 and 12.
按照多个所述图像处理算法索引在所述预设算法列表中的顺序,依次读取预先训练的卷积神经网络模型对目标图像进行处理以得到输出图像,具体地,每次根据一个图像处理算法启动卷积神经网络模型对目标图像进行处理以得到输出图像;将该输出图像作为目标图像,循环执行根据一个图像处理算法启动卷积神经网络模型对目标图像进行处理以得到最终的输出图像,进而完成对目标图像的处理。According to the order in which multiple image processing algorithm indexes are in the preset algorithm list, the pre-trained convolutional neural network model is sequentially read to process the target image to obtain an output image, specifically, each image is processed according to The algorithm starts the convolutional neural network model to process the target image to obtain the output image; the output image is used as the target image, and the cycle is executed according to an image processing algorithm to start the convolutional neural network model to process the target image to obtain the final output image, Then complete the processing of the target image.
在一实施例中,如图2所示,步骤S103具体包括:子步骤S1031至S1034。In an embodiment, as shown in FIG. 2, step S103 specifically includes: sub-steps S1031 to S1034.
S1031、根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法。S1031: The image processing algorithms corresponding to the image processing algorithm index are sequentially started according to the preset algorithm list.
具体地,确定所述预设算法列表中的一个图像处理算法索引,以及所述图像处理算法索引对应图像处理算法。Specifically, an image processing algorithm index in the preset algorithm list is determined, and the image processing algorithm index corresponds to an image processing algorithm.
其中,所述确定所述预设算法列表中的一个图像处理算法索引,可以是:按照多个所述图像处理算法在所述预设算法列表中的排列顺序,依次确定所述预设算法列表中的一个图像处理算法。Wherein, the determining an image processing algorithm index in the preset algorithm list may be: sequentially determining the preset algorithm list according to the order in which multiple image processing algorithms are arranged in the preset algorithm list An image processing algorithm in.
比如,在表1中,先确定算法索引Temperature以及对应的调整色温算法, 再确定算法索引Tint以及对应的设置色彩算法,最后再确定算法索引Tone Curce以及对应的色调曲线算法。For example, in Table 1, first determine the algorithm index Temperature and the corresponding color temperature adjustment algorithm, then determine the algorithm index Tint and the corresponding set color algorithm, and finally determine the algorithm index ToneCurce and the corresponding tone curve algorithm.
需要说明的是,在确定完算法索引Temperature以及对应的调整色温算法后,即开始执行步骤S1032至S1033;然后,再确定算法索引Tint以及对应的设置色彩算法,将根据调整色温算法处理后的输出图像作为目标图像,继续执行步骤S1032至S1033;以此循环直至表1中的算法执行完为止。It should be noted that after the algorithm index Temperature and the corresponding color temperature adjustment algorithm are determined, steps S1032 to S1033 are started; then, the algorithm index Tint and the corresponding color setting algorithm are determined, and the output after processing according to the color temperature adjustment algorithm With the image as the target image, continue to perform steps S1032 to S1033; this loops until the algorithm in Table 1 is executed.
当然,也可以不按照多个所述图像处理算法在所述预设算法列表中的排列顺序确定一个图像处理算法,每次可以随机在预设算法列表中确定一个算法索引以及对应的图像处理算法,然后执行步骤S1032和S1033,直至表1中的算法执行完为止。Of course, an image processing algorithm may not be determined according to the order in which multiple image processing algorithms are arranged in the preset algorithm list, and each time an algorithm index and corresponding image processing algorithm may be randomly determined in the preset algorithm list , And then perform steps S1032 and S1033 until the algorithm in Table 1 is executed.
S1032、根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数。S1032: Determine algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model.
其中,将所述目标图像输入至所述卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数。Wherein, the target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm.
具体地,在确定图像处理算法后,比如确定的图像处理算法为调整曝光算法(Exposure),再将所述目标图像输入至所述卷积神经网络模型中进行训练以得到调整曝光算法(Exposure)对应的算法参数。Specifically, after the image processing algorithm is determined, for example, the determined image processing algorithm is an exposure adjustment algorithm (Exposure), and then the target image is input into the convolutional neural network model for training to obtain an adjusted exposure algorithm (Exposure) Corresponding algorithm parameters.
卷积神经网络模型为预先训练好的模型,其输入为确定有图像处理算法的目标图像,将所述目标图像输入至所述卷积神经网络模型中进行训练以输出相应的算法参数,比如得到调整曝光算法(Exposure)对应的算法参数。The convolutional neural network model is a pre-trained model whose input is a target image with an image processing algorithm determined, and the target image is input into the convolutional neural network model for training to output corresponding algorithm parameters, such as Adjust the algorithm parameters corresponding to the exposure algorithm (Exposure).
在一个可选的实施例中,将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数,包括:将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的多个算法参数以及每个所述算法参数对应的概率值;根据所述概率值确定所述图像处理算法对应的算法参数。In an optional embodiment, inputting the target image into a convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm includes: inputting the target image into a convolutional neural network Train in the model to obtain multiple algorithm parameters corresponding to the image processing algorithm and the probability value corresponding to each of the algorithm parameters; and determine the algorithm parameters corresponding to the image processing algorithm according to the probability value.
比如,调整色温对应算法参数是一个范围值,例如{-100,100},卷积神经网络模型训练后的输出结果是针对算法参数的范围值对应的概率值,例如色温100,概率值是15%;色温80,概率值是84%,然后会取概率值较大的色温作为图像色温。在一个可选的示例中,通过在卷积神经网络的多个输出端增加一个比较器,可以通过比较器选择输出具有最大选择概率的色温值。For example, adjusting the color temperature corresponding to the algorithm parameter is a range value, such as {-100,100}, and the output result of the convolutional neural network model training is the probability value corresponding to the range value of the algorithm parameter, such as the color temperature 100, and the probability value is 15%; The color temperature is 80, the probability value is 84%, and then the color temperature with a larger probability value is taken as the image color temperature. In an optional example, by adding a comparator to multiple output terminals of the convolutional neural network, the color temperature value with the largest selection probability can be selected and output through the comparator.
S1033、根据算法参数采用所述图像处理算法对所述目标图像进行处理以获 得输出图像。S1033. Use the image processing algorithm to process the target image according to the algorithm parameters to obtain an output image.
具体地,所述根据所述图像处理算法以及对应的算法参数对所述目标图像进行处理以获得输出图像,包括:根据所述图像处理算法对应的算法参数,调用所述图像处理算法对应的函数对所述目标图像进行处理以获得输出图像。Specifically, the processing the target image according to the image processing algorithm and corresponding algorithm parameters to obtain an output image includes: according to the algorithm parameters corresponding to the image processing algorithm, calling a function corresponding to the image processing algorithm The target image is processed to obtain an output image.
比如,确定调整色温对应的算法参数为80,则调用调整色温算法对应的函数,例如为temperature函数。则根据色温80,采用temperature函数对目标图像进行处理以得到处理后的目标图像,即输出图像。For example, if the algorithm parameter corresponding to the adjustment of the color temperature is determined to be 80, the function corresponding to the algorithm for adjusting the color temperature is called, for example, the temperature function. According to the color temperature 80, the temperature function is used to process the target image to obtain the processed target image, that is, the output image.
需要说明的是,也可以根据所述图像处理算法对应的算法参数,调用相应的图像处理工具(比如,Camera Raw工具、Photoshop工具、Lighting Tool工具),通过该图像处理工具采用图像处理算法对所述目标图像进行处理以获得输出图像。即,卷积神经网络可以以插件的形式为已经封装好的图像处理模块提供图像处理的算法参数,以使图像处理模块根据算法参数对输入图片进行单次处理。It should be noted that the corresponding image processing tools (for example, Camera, Raw tool, Photoshop tool, Lighting Tool) can also be called according to the algorithm parameters corresponding to the image processing algorithm, and the image processing algorithm The target image is processed to obtain an output image. That is, the convolutional neural network can provide the encapsulated image processing module with an image processing algorithm parameter in the form of a plug-in, so that the image processing module performs a single processing on the input picture according to the algorithm parameter.
S1034、将所述输出图像作为所述目标图像,返回所述根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法继续执行,直至所述预设算法列表中的图像处理算法索引全部启动完时得到最终的输出图像。S1034. Using the output image as the target image, returning to the image processing algorithm corresponding to the image processing algorithm index sequentially started according to the preset algorithm list to continue execution until the image processing algorithm index in the preset algorithm list Get the final output image when all are started.
其中,步骤S1033和S1034为:根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像。Wherein, steps S1033 and S1034 are: using the image processing algorithm to process the target image according to the algorithm parameters to obtain an output image.
例如,将通过调整色温算法处理过得到输出图像作为目标图像;再返回执行步骤S1031至S1034确定设置色彩算法,将通过设置色彩算法处理过得到输出图像作为目标图像,再去循环执行;直至所述预设算法列表中的图像处理算法索引全部启动完时得到最终的输出图像。在每个步骤中,每个卷积神经网络仅进行一次参数的输出,并且基于输出参数调用用于处理输出参数的图像处理模块。图像处理模块的输入是上一次图像处理模块输出的处理结果。上述处理过程,可以使用轻量化的卷积神经网络,极大节省算力,提高对于图片的处理速度。For example, the output image processed by the color temperature adjustment algorithm will be taken as the target image; then return to step S1031 to S1034 to determine the set color algorithm, and the output image processed by the set color algorithm will be used as the target image, and then go to loop execution; until the When the image processing algorithm indexes in the preset algorithm list are all started, the final output image is obtained. In each step, each convolutional neural network performs parameter output only once, and calls an image processing module for processing output parameters based on the output parameters. The input of the image processing module is the processing result output by the last image processing module. In the above process, a lightweight convolutional neural network can be used, which greatly saves computing power and improves the processing speed of pictures.
上述实施例提供的图像处理方法通过获取目标图像和预设算法列表,所述预设算法列表包括多个图像处理算法索引;根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理得到输出图像。该图像处理方法借助了预设图像算法列表和卷积 神经网络模型完成图像处理,相对于基于强化学***台的可信性。使用较小的计算量的情况下,实现输出较好的图像处理结果,即可以得到和目标图像具有相同分辨率的图像。The image processing method provided in the above embodiment obtains a target image and a preset algorithm list, the preset algorithm list includes a plurality of image processing algorithm indexes; according to a plurality of the image processing algorithm indexes in the preset algorithm list The pre-trained convolutional neural network model is sequentially read to process the target image to obtain an output image. The image processing method uses the preset image algorithm list and the convolutional neural network model to complete the image processing. Compared with the reinforcement learning-based scheme or the generative adversarial network scheme, each time the neural network is convolved, only the target parameters are loaded. The minimum neural network can reduce the convolution volume of the loaded neural network to a large extent, ensuring the credibility of the algorithm on low computing power platforms. In the case of using a smaller amount of calculation, a better image processing result can be achieved, that is, an image with the same resolution as the target image can be obtained.
请参阅图3,图3是申请一实施例提供的另一种图像处理方法的步骤示意流程图。该图像处理方法可应用在终端设备中,用于对拍摄的原始图像进行自动化后期处理,实现以较小的计算量条件下输出较好的图像处理结果。Please refer to FIG. 3, which is a schematic flowchart of steps of another image processing method according to an embodiment of the application. The image processing method can be applied to a terminal device to perform automatic post-processing on the captured original image, so as to output a better image processing result with a smaller amount of calculation.
具体地,如图3所示,该图像处理方法包括步骤S201至S206。Specifically, as shown in FIG. 3, the image processing method includes steps S201 to S206.
S201、获取待处理图像以及所述待处理图像的图像格式。S201. Acquire an image to be processed and an image format of the image to be processed.
具体地,该待处理图像可以为用户在终端设备的图片库中选择的图像,也可以用户通过终端设备刚拍摄的图像。其中,每一个待处理图像均包括相应的图像格式,可以通过待处理图像的后缀命名确定所述待处理图像的图像格式。Specifically, the to-be-processed image may be an image selected by the user in the picture library of the terminal device, or an image just taken by the user through the terminal device. Each image to be processed includes a corresponding image format, and the image format of the image to be processed may be determined by naming the suffix of the image to be processed.
比如,若待处理图像1的后缀命名为.JPG,则该待处理图像1的图像格式为JPG(Joint Photographic Experts Group)格式;若待处理图像2的后缀命名为.RAW,则该待处理图像2的图像格式为RAW(RAW Image Format)格式,RAW格式的图像是图像感应器将捕捉到的光源信号转化为数字信号的原始数据。For example, if the suffix of image 1 to be processed is named .JPG, the image format of image 1 to be processed is JPG (Joint Photographic Experts Group) format; if the suffix of image 2 to be processed is named .RAW, the image to be processed The image format of 2 is RAW (RAW Image Format) format. The image in RAW format is the raw data of the image sensor that converts the captured light source signal into a digital signal.
S202、判断所述待处理图像的图像格式是否为RAW格式。S202: Determine whether the image format of the image to be processed is in RAW format.
具体地,根据待处理图像的后缀命名判断所述待处理图像的图像格式是否为RAW格式,生成判断结果;并根据不同的判断结果执行不同的步骤(步骤S203和步骤S204)。Specifically, it is determined whether the image format of the image to be processed is a RAW format according to the suffix name of the image to be processed, and a judgment result is generated; and different steps are executed according to different judgment results (step S203 and step S204).
其中,RAW格式具有很多优点,因此在本实施例中,选择RAW格式的图像进行图像处理,以便得到更好的图像处理效果。其优点如下:Among them, the RAW format has many advantages, so in this embodiment, the image in the RAW format is selected for image processing, so as to obtain a better image processing effect. The advantages are as follows:
一、就色阶而言:RAW格式的图像比JPG格式的图像保留更多的色阶。在后期的图像处理时常做的操作,比如加减曝光,调整高光或阴影,增减对比度,调整色阶和曲线都会破坏色阶的连续性,造成跳跃色阶,小幅度的跳跃色阶肉眼是很难察觉的,但是幅度大到肉眼察觉以后,就破坏了照片的质感。常见的例子是蓝天的均匀渐变过渡在后期的时候被破坏出现难看的色阶。相对于JPG格式,RAW的14位(bit)色深的好处是因为有足够的色阶层次使色阶跳跃维持在肉眼无法分辨的层级上。1. In terms of color levels: RAW format images retain more color levels than JPG format images. The operations that are often done in the later image processing, such as adding or subtracting exposure, adjusting highlights or shadows, increasing or decreasing contrast, adjusting color scales and curves, will destroy the continuity of the color scale, resulting in skipped color scales. It's hard to detect, but the range is so large that it can destroy the texture of the photo after being detected by the naked eye. A common example is that the uniform gradient transition of the blue sky is destroyed in the later period and an unsightly color scale is displayed. Compared with the JPG format, the 14-bit (RAW) color depth of RAW is advantageous because there are enough color levels to maintain the color level jump at a level that cannot be distinguished by the naked eye.
二、就白平衡矫正而言:RAW格式图像是使用14位的传感器原始数据,因此可以通过图像处理工具(Camera Raw工具)进行精确的色温矫正,比如冷色0k-10000k暖色矫正。即使在拍摄的时候白平衡完全设置错误也没所谓(比如在室内白炽灯下用日光白平衡进行拍摄),但是如果用的JPG格式拍摄的话,因为JPG格式的图像采用8位(bit)的JPG文件,因此只能通过PS(Photoshop工具)中几种有限的方法(比如色平衡Color balance)来略微调整色温,把一张暖色金璨璨的照片调整回正常色温后细节会惨不忍睹。Second, in terms of white balance correction: RAW format images use 14-bit sensor raw data, so accurate color temperature correction can be performed by the image processing tool (Camera Raw tool), such as cool 0k-10000k warm color correction. It doesn't matter if the white balance is completely set incorrectly when shooting (for example, shooting with daylight white balance under an indoor incandescent lamp), but if you shoot in JPG format, because the JPG format image uses 8-bit (bit) JPG File, so only a few limited methods (such as Color Balance) in PS (Photoshop tool) can be used to slightly adjust the color temperature. After adjusting a warm golden photo to the normal color temperature, the details will be terrible.
三、亮部暗部矫正。这是摄影中最常见的问题,曝光过度或曝光不足。如果拍摄后保存的RAW格式图像,可以在后期矫正至少+-2EV的曝光补偿仍然保留完整的画面细节,如果使用JPG格式图片,后期发现严重曝光过度或者曝光不足,因为即使矫正了曝光以后,也会看到画面上一片无细节的死白或者死黑。3. Correction of bright parts and dark parts. This is the most common problem in photography, overexposure or underexposure. If you save the RAW format image after shooting, you can correct the exposure compensation of at least +-2EV in the later stage and still retain the complete picture details. If you use JPG format pictures, you will find serious overexposure or underexposure in the later stage, because even after the exposure is corrected, You will see a dead white or black without details on the screen.
因此在本实施例中,在使用该图像处理方法之前,需要对终端设备进行图像保存设置以使终端设备将拍摄的图片保存为RAW格式的图像,或者在保存其他格式的图像后仍然保存该格式的图像对应的RAW格式的图像。Therefore, in this embodiment, before using the image processing method, it is necessary to perform image saving settings on the terminal device to enable the terminal device to save the captured picture as a RAW format image, or to save the format after saving other format images The image corresponds to the RAW format image.
S203、获取所述待处理图像作为目标图像。S203. Acquire the image to be processed as a target image.
具体地,若所述待处理图像的图像格式是RAW格式,则直接获取所述待处理图像作为目标图像,并执行步骤S205。Specifically, if the image format of the image to be processed is a RAW format, the image to be processed is directly acquired as the target image, and step S205 is executed.
S204、查询并获取所述待处理图像对应的RAW格式图像作为所述目标图像。S204. Query and obtain a RAW format image corresponding to the image to be processed as the target image.
具体地,若所述待处理图像的图像格式不是RAW格式,查询并获取所述待处理图像对应的RAW格式图像作为所述目标图像,并执行步骤S205。Specifically, if the image format of the image to be processed is not the RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image, and execute step S205.
S205、获取预设算法列表,所述预设算法列表包括多个图像处理算法索引。S205. Acquire a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes.
其中,所述预设算法列表包括以堆栈形式排列的多个图像处理算法索引,具体为先进先出(First In First Out、FIFO)的堆栈形式。因为多个图像处理算法索引是采用先进先出(First In First Out、FIFO)的堆栈形式进行数据保存的,因此可以确保按照根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型。Wherein, the preset algorithm list includes a plurality of image processing algorithm indexes arranged in a stack form, specifically a first-in-first-out (First In First Out, FIFO) stack form. Since multiple image processing algorithm indexes are stored in a first-in first-out (First In Out, FIFO) stack format for data storage, it can be ensured that the index according to multiple image processing algorithm indexes in the preset algorithm list Read the pre-trained convolutional neural network model sequentially.
在一实施例中,如图4所示,在所述获取预设算法列表的步骤之前,该图像处理方法还包括:步骤S205a和步骤S205b。In an embodiment, as shown in FIG. 4, before the step of obtaining the preset algorithm list, the image processing method further includes: step S205a and step S205b.
S205a、获取预先设置的算法列表,所述算法列表包括多个按照顺序排列的图像处理算法索引;S205b、将所述算法列表中的图像处理算法索引采用先进先 出的堆栈形式进行保存以生成预设算法列表。S205a. Acquire a preset algorithm list, the algorithm list includes a plurality of image processing algorithm indexes arranged in order; S205b, save the image processing algorithm indexes in the algorithm list in a first-in first-out stack form to generate a pre- Set the algorithm list.
具体地,该算法列表可以为表1,包括多个按照顺序排列的图像处理算法索引,该图像处理算法索引为图像处理算法的算法标识。将所述算法列表中的图像处理算法索引采用先进先出的堆栈形式进行保存以生成预设算法列表,进而确保按照根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型。Specifically, the algorithm list may be Table 1, including a plurality of image processing algorithm indexes arranged in sequence, and the image processing algorithm index is an algorithm identifier of the image processing algorithm. The image processing algorithm indexes in the algorithm list are saved in a first-in first-out stack form to generate a preset algorithm list, thereby ensuring that they are read in the order of the plurality of image processing algorithm indexes in the preset algorithm list Take the pre-trained convolutional neural network model.
S206、根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。S206. Read a pre-trained convolutional neural network model according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
按照先进先出的堆栈形式,依次读取预先训练的卷积神经网络模型对目标图像进行处理以得到输出图像。具体地,每次根据一个图像处理算法启动卷积神经网络模型对目标图像进行处理以得到输出图像;循环执行将该输出图像作为目标图像,根据一个图像处理算法启动卷积神经网络模型对目标图像进行处理以得到输出图像;直至预设算法列表中的图像处理算法全部执行完为止,得到最终的输出图像,进而完成对目标图像的处理。According to the first-in-first-out stack format, the pre-trained convolutional neural network model is sequentially read to process the target image to obtain the output image. Specifically, each time a convolutional neural network model is activated according to an image processing algorithm to process the target image to obtain an output image; the output image is used as a target image in a cyclic execution, and the convolutional neural network model is activated to the target image according to an image processing algorithm Process to obtain the output image; until all the image processing algorithms in the preset algorithm list are executed, the final output image is obtained, and then the processing of the target image is completed.
如图5所示,终端设备具体为智能手机,当然也可以为无人机,在本实施例中只是使用智能手机进行示例说明。在使用智能手机采用该图像处理方法对待处理图像进行处理之前,需要进行两个设置操作。As shown in FIG. 5, the terminal device is specifically a smartphone, and of course, it may also be a drone. In this embodiment, only a smartphone is used as an example. Before using the smart phone to adopt the image processing method to process the image to be processed, two setting operations need to be performed.
设置操作一:需要对终端设备(智能手机)进行图像保存设置以使终端设备将拍摄的图片保存为RAW格式的图像,或者在保存其他格式的图像后仍然保存该格式图像对应的RAW格式的图像。Setting operation one: You need to set the image saving settings on the terminal device (smartphone) to enable the terminal device to save the captured picture as a RAW format image, or to save the RAW format image corresponding to the format image after saving other format images .
设置操作二:将预先训练好的卷积神经网络模型保存至终端设备中,当然可以采用深度学习模型压缩技术,先对预先训练好的卷积神经网络模型进行压缩处理后,再保存在终端设备。Setting operation 2: Save the pre-trained convolutional neural network model to the terminal device, of course, you can use the deep learning model compression technology, first compress the pre-trained convolutional neural network model, and then save it in the terminal device .
在完成上述设置操作后,用户可以使用智能手机利用该图像处理方法对待处理图像进行图像处理。比如,使用智能手机对该拍摄的图像利用该图像处理算法进行图像处理,以便使用较小的计算量即可得到较好的图像处理效果。由此可见,该图像处理算法也特别适合像智能手机和无人机等终端设备,这些终端设备的处理能力较服务器的较差。After completing the above setting operation, the user can use the smartphone to perform image processing on the image to be processed using the image processing method. For example, using a smartphone to perform image processing on the captured image using the image processing algorithm, so that a smaller amount of calculation can be used to obtain a better image processing effect. It can be seen that the image processing algorithm is also particularly suitable for terminal devices such as smart phones and drones, which have poorer processing capabilities than servers.
如图5所示,假如用户使用智能手机10对远处的一棵树20进行拍照,拍照后选择图像处理功能或者是自动处理功能,其中图像处理功能和自动处理功 能均是基于该图像处理方法进行设计的,采用该图像处理算法对该拍摄的图像进行处理,最终得到具有较好的图像效果的树图片30。As shown in FIG. 5, if a user uses a smartphone 10 to take a picture of a tree 20 in the distance, after the picture is taken, an image processing function or an automatic processing function is selected, wherein the image processing function and the automatic processing function are based on the image processing method For the design, the image processing algorithm is used to process the captured image, and finally a tree picture 30 with a better image effect is obtained.
具体地,智能手机10具体执行以下步骤:获取待处理图像以及所述待处理图像的图像格式;判断所述待处理图像的图像格式是否为RAW格式;若所述待处理图像的图像格式是RAW格式,则直接获取所述待处理图像作为目标图像;或者,若所述待处理图像的图像格式不是RAW格式,查询并获取所述待处理图像对应的RAW格式图像作为所述目标图像;根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理,得到输出图像30。Specifically, the smartphone 10 specifically executes the following steps: acquiring the image to be processed and the image format of the image to be processed; determining whether the image format of the image to be processed is a RAW format; if the image format of the image to be processed is RAW Format, directly obtain the image to be processed as the target image; or, if the image format of the image to be processed is not RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image; A sequence of the image processing algorithm indexes in the preset algorithm list reads a pre-trained convolutional neural network model to process the target image to obtain an output image 30.
上述实施例提供的图像处理方法,通过获取待处理图像以及所述待处理图像的图像格式;判断所述待处理图像的图像格式是否为RAW格式;若所述待处理图像的图像格式是RAW格式,则直接获取所述待处理图像作为目标图像;或者,若所述待处理图像的图像格式不是RAW格式,查询并获取所述待处理图像对应的RAW格式图像作为所述目标图像;根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。由此,该方法可在使用终端设备较小的计算量的情况下,输出具有较好效果的图像,进而提高了用户的体验。The image processing method provided in the above embodiment determines whether the image format of the image to be processed is a RAW format by acquiring the image to be processed and the image format of the image to be processed; if the image format of the image to be processed is a RAW format , Directly obtain the image to be processed as the target image; or, if the image format of the image to be processed is not RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image; according to multiple The order of the image processing algorithm index in the preset algorithm list is to read a pre-trained convolutional neural network model in order to process the target image. Therefore, the method can output an image with better effect under the condition of using less calculation amount of the terminal device, thereby improving the user experience.
请参阅图6,图6是申请一实施例提供的又一种图像处理方法的步骤示意流程图。该图像处理方法可应用在终端设备中,用于对拍摄的原始图像进行自动化后期处理,实现以较小的计算量条件下输出较好的图像处理结果。Please refer to FIG. 6, which is a schematic flowchart of steps of yet another image processing method according to an embodiment of the application. The image processing method can be applied to a terminal device to perform automatic post-processing on the captured original image, so as to output a better image processing result with a smaller amount of calculation.
具体地,如图6所示,该图像处理方法包括步骤S301至步骤S305。Specifically, as shown in FIG. 6, the image processing method includes steps S301 to S305.
S301、获取目标图像,其中所述目标图像为RAW格式。S301. Acquire a target image, where the target image is in RAW format.
具体地,目标图像为待处理图像,或者为用户选择的待处理图像。比如,通过终端设备拍摄的原始图片,或用户在终端设备的图形库选择的一张或多张图片,其中该选择的图片为RAW格式的图像。Specifically, the target image is an image to be processed, or an image to be processed selected by the user. For example, the original picture taken through the terminal device, or one or more pictures selected by the user in the graphics library of the terminal device, where the selected picture is an image in RAW format.
S302、获取预设算法列表,所述预设算法列表包括多个图像处理算法索引。S302. Acquire a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes.
具体地,图像处理算法索引为图像处理算法对应的算法标识,比如调整色温算法对应的算法标识为Temperature,设置色彩算法对应的算法标识为Tint。其中,在本实施例中,可采用上述表1所示的多个图像处理算法对应不同算法索引,并且多个图像处理算法索引按照顺序排列。Specifically, the image processing algorithm index is the algorithm identifier corresponding to the image processing algorithm, for example, the algorithm identifier corresponding to the color temperature adjustment algorithm is Temperature, and the algorithm identifier corresponding to the color algorithm is set to Tint. In this embodiment, multiple image processing algorithms shown in Table 1 above may be used to correspond to different algorithm indexes, and the multiple image processing algorithm indexes are arranged in order.
S303、将所述目标图像输入至卷积神经网络模型进行训练,以得到所述预设算法列表中的一个图像处理算法对应的算法参数。S303. Input the target image into a convolutional neural network model for training, so as to obtain an algorithm parameter corresponding to an image processing algorithm in the preset algorithm list.
具体地,在确定预设算法列表后,再将所述目标图像输入至所述卷积神经网络模型中进行训练以得到所述预设算法列表中的一个图像处理算法对应的算法参数,比如随机确定所述预设算法列表中的一个图像处理算法(例如,调整曝光算法)的曝光度。Specifically, after determining the preset algorithm list, the target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to an image processing algorithm in the preset algorithm list, such as random Determine the exposure of an image processing algorithm (eg, adjust the exposure algorithm) in the preset algorithm list.
在本实施例中,是以图像为主导的方式,将所述目标图像输入至卷积神经网络模型进行训练以得到所述预设算法列表中的一个图像处理算法对应的算法参数。利用卷积神经网络模型匹配相应的图像,再确定该图像对应的图像处理算法的算法参数。这和上述实施例中提供的以图像处理算法为主导的方式,利用卷积神经网络模确定相应的图像处理算法的算法参数并不相同,因此可以提高图像处理效果。In this embodiment, the target image is input to the convolutional neural network model for training in an image-oriented manner to obtain algorithm parameters corresponding to an image processing algorithm in the preset algorithm list. The convolutional neural network model is used to match the corresponding image, and then the algorithm parameters of the image processing algorithm corresponding to the image are determined. This is not the same as the image processing algorithm-based approach provided in the above embodiment, and the convolutional neural network module is used to determine the algorithm parameters of the corresponding image processing algorithm, so the image processing effect can be improved.
S304、根据所述算法参数及对应的图像处理算法对所述目标图像进行处理以获得输出图像。S304. Process the target image according to the algorithm parameter and the corresponding image processing algorithm to obtain an output image.
具体地,所述根据所述图像处理算法以及对应的算法参数对所述目标图像进行处理以获得输出图像,包括:根据所述图像处理算法对应的算法参数,调用所述图像处理算法对应的函数对所述目标图像进行处理以获得输出图像。Specifically, the processing the target image according to the image processing algorithm and corresponding algorithm parameters to obtain an output image includes: according to the algorithm parameters corresponding to the image processing algorithm, calling a function corresponding to the image processing algorithm The target image is processed to obtain an output image.
比如,确定调整色温对应的算法参数为80,则调用调整色温算法对应的函数,例如为temperature函数。则根据色温80,采用函数temperature函数对目标图像进行处理以得到处理后的目标图像,即输出图像。For example, if the algorithm parameter corresponding to the adjustment of the color temperature is determined to be 80, the function corresponding to the algorithm for adjusting the color temperature is called, for example, the temperature function. Then, according to the color temperature 80, the function temperature function is used to process the target image to obtain the processed target image, that is, the output image.
S305、将所述输出图像作为所述目标图像,返回所述将目标图像输入至卷积神经网络进行训练继续执行,直至所述预设算法列表中的图像处理算法全部训练完时得到最终的输出图像。S305. Use the output image as the target image, and return to input the target image to the convolutional neural network for training and continue execution until the image processing algorithms in the preset algorithm list are all trained to obtain the final output image.
譬如,将通过调整色温算法处理过得到输出图像作为目标图像,再返回执行步骤S303至S305确定另一图像处理算法,比如确定为设置色彩算法;再将通过设置色彩算法处理过得到输出图像作为目标图像,再去循环执行S303至S305,直至所述预设算法列表中的图像处理算法全部训练完时得到最终的输出图像。For example, the output image processed by adjusting the color temperature algorithm is used as the target image, and then returns to steps S303 to S305 to determine another image processing algorithm, such as determining to set the color algorithm; then the output image processed by setting the color algorithm is used as the target Image, and then go through S303 to S305 repeatedly until all the image processing algorithms in the preset algorithm list are trained to get the final output image.
上述实施例提供的图像处理方法,通过获取RAW格式的目标图像和预设算法列表,所述预设算法列表包括多个图像处理算法索引;将所述目标图像输入 至卷积神经网络模型进行训练,以得到所述预设算法列表中的一个图像处理算法对应的算法参数;根据所述算法参数及对应的图像处理算法对所述目标图像进行处理以获得输出图像;将所述输出图像作为所述目标图像,返回所述将目标图像输入至卷积神经网络进行训练继续执行,直至所述预设算法列表中的图像处理算法全部训练完时得到最终的输出图像。该图像处理方法不仅可以降低终端设备的计算量,还可以得到较好的图像处理结果。The image processing method provided in the above embodiment obtains a target image in RAW format and a preset algorithm list, the preset algorithm list includes multiple image processing algorithm indexes; the target image is input to a convolutional neural network model for training To obtain an algorithm parameter corresponding to an image processing algorithm in the preset algorithm list; process the target image according to the algorithm parameter and the corresponding image processing algorithm to obtain an output image; use the output image as a The target image is returned to the input of the target image to the convolutional neural network for training and continued execution until the image processing algorithms in the preset algorithm list are all trained to obtain the final output image. The image processing method can not only reduce the calculation amount of the terminal device, but also obtain better image processing results.
请参阅图7,图7是申请一实施例提供的一种卷积神经网络训练方法的步骤示意流程图。该卷积神经网络训练方法用于得到卷积神经网络模型。上述图像处理方法的实施例,可采用该卷积神经网络模型,当然其他方法训练得到的卷积神经网络模型。Please refer to FIG. 7, which is a schematic flowchart of steps in a method for training a convolutional neural network according to an embodiment of the application. This convolutional neural network training method is used to obtain a convolutional neural network model. The above-mentioned image processing method embodiment may use the convolutional neural network model, and of course the convolutional neural network model trained by other methods.
需要说明的是,在本实施例中,使用GoogLeNet进行模型训练以得到卷积神经网络模型,当然也可以采用其他网络,比如采用AlexNet或VGGNet等。以下将以GoogLeNet为例进行介绍。It should be noted that, in this embodiment, GoogLeNet is used for model training to obtain a convolutional neural network model. Of course, other networks may also be used, such as AlexNet or VGGNet. The following will use GoogLeNet as an example.
具体地,如图7所示,该卷积神经网络训练方法包括步骤S401和步骤S404。Specifically, as shown in FIG. 7, the convolutional neural network training method includes step S401 and step S404.
S401、获取图像样本数据,所述图像样本数据包括多个经过图像处理算法处理过的图像数据以及所述图像数据对应的算法参数。S401. Acquire image sample data, where the image sample data includes a plurality of image data processed by an image processing algorithm and algorithm parameters corresponding to the image data.
具体地,该图像样本数据为采用专业摄影师的摄影后期处理数据,并且经过相应地处理后的数据集。该图像样本数据包括多个经过图像处理算法处理过的图像数据以及所述图像数据对应的算法参数。Specifically, the image sample data is a post-processing data of a professional photographer, and a correspondingly processed data set. The image sample data includes a plurality of image data processed by an image processing algorithm and algorithm parameters corresponding to the image data.
在一实施例中,为了方便卷积神经网络模型计算出可用的算法参数,在进行模型训练之前,需要对所述图像样本数据中的算法参数进行量化处理,得到量化后的图像样本数据。In an embodiment, in order to facilitate calculation of available algorithm parameters by the convolutional neural network model, before performing model training, the algorithm parameters in the image sample data need to be quantized to obtain quantized image sample data.
具体地,将所有图像样本数据中的图像处理算法的输入量化为具有固定范围的数值变量。例如曝光值(Exposure)量化为为{-5.00,+5.00},高光恢复(Highlights Recovery)量化为为{-100,+100}。Specifically, the input of the image processing algorithm in all image sample data is quantized into a numerical variable with a fixed range. For example, the exposure value (Exposure) is quantified as {-5.00, +5.00}, and the highlights recovery (Highlights Recovery) is quantified as {-100, +100}.
S402、基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,所述卷积神经网络模型的输出参数为图像处理算法对应的算法参数。S402. Based on the convolutional neural network, iterative training is performed according to the image sample data to obtain a convolutional neural network model, and the output parameters of the convolutional neural network model are algorithm parameters corresponding to the image processing algorithm.
具体地,使用图像样本数据,通过GoogLeNet进行模型训练,具体地是可以采用方向传播训练,使用GoogLeNet的卷积层和池化层从输入图像样本数据 中提取特征,使用完全连接层用来做分类器,分类器的输出即是不同的图像处理算法以及对应算法参数。Specifically, the image sample data is used to train the model through GoogLeNet. Specifically, directional propagation training can be used. The convolutional layer and the pooling layer of GoogLeNet are used to extract features from the input image sample data, and the fully connected layer is used for classification. The output of the classifier and classifier are different image processing algorithms and corresponding algorithm parameters.
具体地,用随机值初始化所有过滤器和参数/权重;神经网络将训练的图像样本数据作为输入,经过前向传播步骤(卷积,ReLU和池化操作以在完全连接层中的前向传播),得到每个类的输出概率。Specifically, all filters and parameters/weights are initialized with random values; the neural network takes the trained image sample data as input and undergoes forward propagation steps (convolution, ReLU, and pooling operations to forward propagation in the fully connected layer ) To get the output probability of each class.
在一实施例中,为了方便卷积神经网络模型计算出可用的算法参数,所述基于卷积神经网络,对所述图像样本数据中的算法参数进行量化处理,得到量化后的图像样本数据。相应地,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,包括:基于卷积神经网络算法,根据所述量化后的图像样本数据进行迭代训练以得到卷积神经网络模型。In one embodiment, in order to facilitate the calculation of available algorithm parameters by the convolutional neural network model, the algorithm parameters in the image sample data are quantized based on the convolutional neural network to obtain quantized image sample data. Accordingly, iterative training based on the image sample data to obtain a convolutional neural network model includes: based on the convolutional neural network algorithm, iterative training is performed based on the quantized image sample data to obtain a convolutional neural network model.
S403、将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证。S403. Use the algorithm parameters corresponding to the image data as calibration data to verify the convolutional neural network model.
具体地,将所述图像数据对应的算法参数作为标定数据(ground truth)来定义损失函数(loss)来验证训练后的卷积神经网络模型的准确度。Specifically, the algorithm parameters corresponding to the image data are used as calibration data (ground) to define a loss function (loss) to verify the accuracy of the trained convolutional neural network model.
其中,如图8所示,所述将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证,具体包括:Wherein, as shown in FIG. 8, the verification of the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data specifically includes:
S4031、将所述图像数据对应的算法参数设为标定数据;S4032、计算所述标定数据与所述输出参数中的图像处理算法对应的算法参数的差值作为差距损失值;S4033、判断所述差距损失值是否满足预设条件,所述预设条件为用于衡量所述卷积神经网络模型的准确度的条件;S4034、在所述差距损失值满足所述预设条件时,判定所述卷积神经网络模型验证通过。S4031: Set the algorithm parameter corresponding to the image data as calibration data; S4032, calculate the difference between the calibration data and the algorithm parameter corresponding to the image processing algorithm in the output parameter as the gap loss value; S4033, determine the Whether the gap loss value meets a preset condition, and the preset condition is a condition for measuring the accuracy of the convolutional neural network model; S4034, when the gap loss value meets the preset condition, it is determined that the The convolutional neural network model was verified.
具体地,将摄影师所用的图像处理算法对应的算法参数作为标定数据(ground truth),利用准备的图像样本数据通过大规模迭代训练,让卷积神经网络在学习图片语义信息后输出图像处理算法对应的算法参数,使用输出的算法参数与标定数据(ground truth)的差距作为差距损失值(loss),在模型训练中尽量缩小差距损失值(loss),来保证模型的准确度。Specifically, the algorithm parameters corresponding to the image processing algorithm used by the photographer are used as calibration data (ground), and the prepared image sample data is used for large-scale iterative training to allow the convolutional neural network to output the image processing algorithm after learning the semantic information of the picture. Corresponding algorithm parameters, the gap between the output algorithm parameters and the calibration data (ground) is used as the gap loss value, and the gap loss value (loss) is minimized during model training to ensure the accuracy of the model.
在模型训练中尽量缩小差距损失值(loss),可以通过判断所述差距损失值是否满足预设条件,通过该预设条件来衡量所述卷积神经网络模型的准确度。To minimize the gap loss value (loss) in model training, the accuracy of the convolutional neural network model can be measured by determining whether the gap loss value satisfies a preset condition.
在一实施例中,所述判断所述差距损失值是否满足预设条件,包括:监测每次迭代训练对应的差距损失值的变化值;若每次迭代训练对应的差距损失值 的变化值均在预设范围内,判定所述差距损失值满足所述预设条件。In an embodiment, the judging whether the gap loss value meets the preset condition includes: monitoring the change value of the gap loss value corresponding to each iteration training; if the change value of the gap loss value corresponding to each iteration training is Within a preset range, it is determined that the gap loss value meets the preset condition.
比如,每次迭代训练对应的差距损失值的变化值均在一个预设范围内,预设范围比如(0.00001,0.00002),则表明差距损失值已基本稳定,变化较小,由此判定所述差距损失值满足所述预设条件,确定所述卷积神经网络模型验证通过。For example, the change value of the gap loss value corresponding to each iteration training is within a preset range. The preset range, such as (0.00001, 0.00002), indicates that the gap loss value has been basically stable, and the change is small. The gap loss value meets the preset condition, and it is determined that the convolutional neural network model passes verification.
在一实施例中,所述判断所述差距损失值是否满足预设条件,还包括:在每次迭代训练对应的差距损失值均减小时,判断所述差距损失值是否小于预设值;若所述差距损失值小于所述预设值,判定所述差距损失值满足所述预设条件。In an embodiment, the judging whether the gap loss value satisfies the preset condition further includes: when the gap loss value corresponding to each iteration training decreases, determining whether the gap loss value is less than the preset value; The gap loss value is less than the preset value, and it is determined that the gap loss value meets the preset condition.
比如,该预设值为0.001,在每次迭代训练对应的差距损失值均减小时并且所述差距损失值小于0.001,判定所述差距损失值满足所述预设条件,确定所述卷积神经网络模型验证通过。For example, the preset value is 0.001, and when the gap loss value corresponding to each iteration training decreases and the gap loss value is less than 0.001, it is determined that the gap loss value meets the preset condition, and the convolutional nerve is determined The network model is verified.
S404、保存验证通过的卷积神经网络模型作为预先训练的卷积神经网络模型。S404. Save the verified convolutional neural network model as a pre-trained convolutional neural network model.
具体地,进行上述模型训练验证过后,该卷积神经网络中的所有权重和参数都已经过优化,可以对图像样本数据中的图像或者其他图像进行正确分类识别,以得到相应的算法参数。由此,保存验证通过的卷积神经网络模型作为预先训练的卷积神经网络模型至终端设备中。Specifically, after the above model training is verified, the weights and parameters in the convolutional neural network have been optimized, and the images or other images in the image sample data can be correctly classified and identified to obtain the corresponding algorithm parameters. Thus, the verified convolutional neural network model is saved as a pre-trained convolutional neural network model in the terminal device.
当然,在将验证通过的卷积神经网络模型作为预先训练的卷积神经网络模型之前,还可对卷积神经网络模型进行压缩处理后,再将压缩处理后的卷积神经网络模型保存在终端设备中。该压缩处理具体包括对卷积神经网络模型进行剪枝处理、量化处理和哈夫曼编码处理等,以减小卷积神经网络模的大小进而方便保存在容量较小的终端设备中。Of course, before using the verified convolutional neural network model as a pre-trained convolutional neural network model, you can also compress the convolutional neural network model, and then save the compressed convolutional neural network model in the terminal In the device. The compression processing specifically includes pruning processing, quantization processing, and Huffman coding processing on the convolutional neural network model, so as to reduce the size of the convolutional neural network module and facilitate storage in a terminal device with a small capacity.
请参阅图9,图9是本申请一实施例提供的终端设备的示意性框图。该终端设备500包括处理器501和存储器502,处理器501和存储器502通过总线503连接,该总线503比如为I2C(Inter-integrated Circuit)总线。Please refer to FIG. 9, which is a schematic block diagram of a terminal device according to an embodiment of the present application. The terminal device 500 includes a processor 501 and a memory 502, and the processor 501 and the memory 502 are connected by a bus 503, for example, an I2C (Inter-integrated Circuit) bus.
具体地,处理器501可以是微控制单元(Micro-controller Unit,MCU)、中央处理单元(Central Processing Unit,CPU)或数字信号处理器(Digital Signal Processor,DSP)等。Specifically, the processor 501 may be a micro-controller (MCU), a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), or the like.
具体地,存储器502可以是Flash芯片、只读存储器(ROM,Read-Only  Memory)磁盘、光盘、U盘或移动硬盘等。Specifically, the memory 502 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a U disk, or a mobile hard disk.
其中,所述处理器501用于运行存储在存储器502中的计算机程序,并在执行所述计算机程序时实现如下步骤:Wherein, the processor 501 is used to run a computer program stored in the memory 502, and implement the following steps when executing the computer program:
获取目标图像;获取预设算法列表,所述预设算法列表包括多个图像处理算法索引;根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。Acquire the target image; acquire a preset algorithm list, the preset algorithm list includes multiple image processing algorithm indexes; read the pre-trained convolution according to the order of the multiple image processing algorithm indexes in the preset algorithm list Neural network model to process the target image.
可选地,所述处理器在实现所述获取目标图像时,用于实现:Optionally, when the processor realizes the acquisition of the target image, it is used to realize:
获取待处理图像以及所述待处理图像的图像格式;判断所述待处理图像的图像格式是否为RAW格式;若所述待处理图像的图像格式是RAW格式,获取所述待处理图像作为目标图像。Obtain the image to be processed and the image format of the image to be processed; determine whether the image format of the image to be processed is RAW format; if the image format of the image to be processed is RAW format, obtain the image to be processed as the target image .
可选地,所述处理器在实现所述判断所述待处理图像的图像格式是否为RAW格式之后,还用于实现:Optionally, after implementing the judgment whether the image format of the image to be processed is in the RAW format, the processor is further used to implement:
若所述待处理图像的图像格式不是RAW格式,查询并获取所述待处理图像对应的RAW格式图像作为所述目标图像。If the image format of the image to be processed is not the RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image.
可选地,所述预设算法列表包括以堆栈形式排列的多个图像处理算法索引。Optionally, the preset algorithm list includes multiple image processing algorithm indexes arranged in a stack.
可选地,所述处理器在实现所述获取预设算法列表之前,还用于实现:Optionally, before implementing the acquiring the preset algorithm list, the processor is also used to implement:
获取预先设置的算法列表,所述算法列表包括多个按照顺序排列的图像处理算法索引;将所述算法列表中的图像处理算法索引采用先进先出的堆栈形式进行保存以生成预设算法列表。Obtain a preset algorithm list, the algorithm list includes a plurality of image processing algorithm indexes arranged in sequence; save the image processing algorithm indexes in the algorithm list in a first-in first-out stack form to generate a preset algorithm list.
可选地,所述多个图像处理算法索引包括调整色温算法索引、设置色彩算法索引、调整曝光算法索引、调整对比度算法索引、高光恢复算法索引、低光补偿算法索引、白平衡算法索引、调整清晰度算法索引、除雾算法索引、调整自然饱和度算法索引、调整饱和度算法索引和色调曲线算法索引。Optionally, the plurality of image processing algorithm indexes include adjusting color temperature algorithm indexes, setting color algorithm indexes, adjusting exposure algorithm indexes, adjusting contrast algorithm indexes, highlight recovery algorithm indexes, low light compensation algorithm indexes, white balance algorithm indexes, and adjustments Clarity algorithm index, defogging algorithm index, adjusting natural saturation algorithm index, adjusting saturation algorithm index and tone curve algorithm index.
可选地,所述处理器在实现所述根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理时,用于实现:Optionally, the processor implements the order of reading the pre-trained convolutional neural network model in the preset algorithm list according to a plurality of the image processing algorithm indexes in order to process the target image , Used to achieve:
根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法;根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数;根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像。Sequentially start the image processing algorithms corresponding to the image processing algorithm index according to the preset algorithm list; determine the algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model; adopt the image processing algorithm pair according to the algorithm parameters The target image is processed to obtain an output image.
可选地,所述处理器在实现所述根据所述预设算法列表依次启动图像处理 算法索引对应的图像处理算法时,用于实现:Optionally, when the processor implements the image processing algorithm corresponding to the image processing algorithm index sequentially started according to the preset algorithm list, it is used to implement:
确定所述预设算法列表中的一个图像处理算法索引,以及所述图像处理算法索引对应图像处理算法。An image processing algorithm index in the preset algorithm list is determined, and the image processing algorithm index corresponds to an image processing algorithm.
可选地,所述处理器在实现所述确定所述预设算法列表中的一个图像处理算法索引时,用于实现:Optionally, the processor, when implementing the determination of an image processing algorithm index in the preset algorithm list, is used to implement:
按照多个所述图像处理算法在所述预设算法列表中的排列顺序,依次确定所述预设算法列表中的一个图像处理算法。According to the arrangement order of the plurality of image processing algorithms in the preset algorithm list, one image processing algorithm in the preset algorithm list is determined in sequence.
可选地,所述处理器在实现所述根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数时,用于实现:Optionally, the processor, when implementing the determination of the algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model, is used to implement:
将所述目标图像输入至所述卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数。The target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm.
可选地,所述处理器在实现所述将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数时,用于实现:Optionally, when the processor implements the input of the target image into a convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm, the processor is used to implement:
将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的多个算法参数以及每个所述算法参数对应的概率值;根据所述概率值确定所述图像处理算法对应的算法参数。Input the target image into a convolutional neural network model for training to obtain a plurality of algorithm parameters corresponding to the image processing algorithm and a probability value corresponding to each of the algorithm parameters; determine the image according to the probability value The algorithm parameters corresponding to the processing algorithm.
可选地,所述处理器在实现所述根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像时,用于实现:Optionally, when the processor implements the image processing algorithm to process the target image according to the algorithm parameter to obtain an output image, the processor is used to implement:
根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像;将所述输出图像作为所述目标图像,返回所述根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法继续执行,直至所述预设算法列表中的图像处理算法索引全部启动完时得到最终的输出图像。Use the image processing algorithm to process the target image according to the algorithm parameters to obtain an output image; use the output image as the target image and return to the index of starting the image processing algorithm in turn according to the preset algorithm list The corresponding image processing algorithm continues to be executed until the image processing algorithm indexes in the preset algorithm list are all started to obtain the final output image.
可选地,所述处理器在实现所述根据所述图像处理算法以及对应的算法参数对所述目标图像进行处理以获得输出图像,用于实现:Optionally, the processor implements the processing of the target image according to the image processing algorithm and corresponding algorithm parameters to obtain an output image, for implementing:
根据所述图像处理算法对应的算法参数,调用所述图像处理算法对应的函数对所述目标图像进行处理以获得输出图像。According to the algorithm parameters corresponding to the image processing algorithm, a function corresponding to the image processing algorithm is called to process the target image to obtain an output image.
可选地,所述处理器在实现所述根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理时,用于实现:Optionally, the processor implements the order of reading the pre-trained convolutional neural network model in the preset algorithm list according to a plurality of the image processing algorithm indexes in order to process the target image , Used to achieve:
将所述目标图像输入至卷积神经网络模型进行训练,以得到所述预设算法 列表中的一个图像处理算法对应的算法参数;根据所述算法参数及对应的图像处理算法对所述目标图像进行处理以获得输出图像;将所述输出图像作为所述目标图像,返回所述将目标图像输入至卷积神经网络进行训练继续执行,直至所述预设算法列表中的图像处理算法全部训练完时得到最终的输出图像。Input the target image into a convolutional neural network model for training to obtain an algorithm parameter corresponding to an image processing algorithm in the preset algorithm list; according to the algorithm parameter and the corresponding image processing algorithm, the target image Perform processing to obtain an output image; use the output image as the target image, return to input the target image to the convolutional neural network for training, and continue to execute until the image processing algorithms in the preset algorithm list are all trained To get the final output image.
可选地,所述处理器,还用于实现:Optionally, the processor is also used to implement:
获取图像样本数据,所述图像样本数据包括多个经过图像处理算法处理过的图像数据以及所述图像数据对应的算法参数;基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,所述卷积神经网络模型的输出参数为图像处理算法对应的算法参数;将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证;保存验证通过的卷积神经网络模型作为预先训练的卷积神经网络模型。Obtain image sample data, the image sample data includes a plurality of image data processed by an image processing algorithm and algorithm parameters corresponding to the image data; based on a convolutional neural network, iterative training is performed according to the image sample data to obtain a volume A convolutional neural network model, the output parameters of the convolutional neural network model are algorithm parameters corresponding to the image processing algorithm; the algorithm parameters corresponding to the image data are used as calibration data to verify the convolutional neural network model; The convolutional neural network model is used as a pre-trained convolutional neural network model.
可选地,所述处理器在实现所述将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证时,用于实现:Optionally, when the processor implements the verification of the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data, it is used to implement:
将所述图像数据对应的算法参数设为标定数据;计算所述标定数据与所述输出参数中的图像处理算法对应的算法参数的差值作为差距损失值;判断所述差距损失值是否满足预设条件,所述预设条件为用于衡量所述卷积神经网络模型的准确度的条件;在所述差距损失值满足所述预设条件时,判定所述卷积神经网络模型验证通过。Set the algorithm parameter corresponding to the image data as calibration data; calculate the difference between the calibration data and the algorithm parameter corresponding to the image processing algorithm in the output parameter as the gap loss value; determine whether the gap loss value meets the Suppose that the preset condition is a condition for measuring the accuracy of the convolutional neural network model; when the gap loss value meets the preset condition, it is determined that the convolutional neural network model passes verification.
可选地,所述处理器在实现所述判断所述差距损失值是否满足预设条件时,用于实现:Optionally, when the processor implements the judgment whether the gap loss value meets a preset condition, it is used to implement:
监测每次迭代训练对应的差距损失值的变化值;若每次迭代训练对应的差距损失值的变化值均在预设范围内,判定所述差距损失值满足所述预设条件。Monitoring the change value of the gap loss value corresponding to each iteration training; if the change value of the gap loss value corresponding to each iteration training is within a preset range, it is determined that the gap loss value meets the preset condition.
可选地,所述处理器在实现所述判断所述差距损失值是否满足预设条件时,用于实现:Optionally, when the processor implements the judgment whether the gap loss value meets a preset condition, it is used to implement:
在每次迭代训练对应的差距损失值均减小时,判断所述差距损失值是否小于预设值;若所述差距损失值小于所述预设值,判定所述差距损失值满足所述预设条件。When the gap loss value corresponding to each iteration training decreases, determine whether the gap loss value is less than a preset value; if the gap loss value is less than the preset value, determine that the gap loss value meets the preset condition.
可选地,所述处理器在实现所述基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型之前,还用于实现:Optionally, before implementing the convolution-based neural network and iterative training based on the image sample data to obtain a convolutional neural network model, the processor is also used to implement:
对所述图像样本数据中的算法参数进行量化处理,得到量化后的图像样本 数据;相应地,所述基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,包括:基于卷积神经网络算法,根据所述量化后的图像样本数据进行迭代训练以得到卷积神经网络模型。Quantize the algorithm parameters in the image sample data to obtain quantized image sample data; accordingly, the iterative training based on the image sample data based on the convolutional neural network to obtain a convolutional neural network model, The method includes: based on the convolutional neural network algorithm, iterative training is performed according to the quantized image sample data to obtain a convolutional neural network model.
在一个可选的实施例中,描述了本发明实施例的卷积神经网络构架与强化学***台,会存在加载时间长,响应速度慢等问题。图10(b)为本发明实施例神经网络构架,其有K个独立卷积神经子网络构成,由于每个神经子网络只针对一个参数,其体积较小(每个神经子网络的卷积层和池化层数量较小),根据索引,每次只需要在内存中加载一个子网络,而其它网络处于未加载状态,当然如果硬件资源允许,可以保持下一个要计算的子网络处于预加载的状态。In an optional embodiment, a comparison between the architecture of a convolutional neural network and the architecture of a reinforcement learning neural network according to an embodiment of the present invention is described, as shown in FIGS. 10(a) and 10(b). Figure 10(a) is the reinforcement learning neural network architecture, which has more convolutional layers and pooling layers, and its output will have multiple training parameters (not shown), and multiple training parameters correspond to different trainings of the output picture result. Of course, as a modification of the reinforcement learning neural network, it can also output one parameter at a time, but the reinforcement neural network itself still has a large volume (the number of convolutional layers and pooling layers M has a large value), which is more complicated in hardware configuration On low platforms, there will be problems such as long loading time and slow response speed. Fig. 10(b) is a neural network architecture according to an embodiment of the present invention, which is composed of K independent convolutional neural sub-networks. Since each neural sub-network is only for one parameter, its volume is small (convolution of each neural sub-network The number of layers and pooling layers is small), according to the index, only one subnet needs to be loaded in memory at a time, while the other networks are not loaded. Of course, if the hardware resources allow, you can keep the next subnet to be calculated in the pre The loaded state.
如图11(a)所示,处理器在两个并行的线程中进行神经网络运算和图像处理,而这两个处理操作都是极其耗费***资源的,如果使用一般的神经网络,例如强化神经网络,由于神经网络在加载到内存之后占用体积较大,留给图像处理的***资源就会比较小,在算力资源紧张的平台,常常会导致较长的响应时间,甚至出现死机或者程序无响应。As shown in Figure 11(a), the processor performs neural network operations and image processing in two parallel threads, and these two processing operations are extremely costly system resources, if you use a general neural network, such as enhanced neural Networks, because neural networks take up a large volume after being loaded into memory, the system resources reserved for image processing will be relatively small. On platforms with tight computing power resources, it often results in longer response times, even crashes or program failures. response.
如图11(b)所示,处理处理器在两个并行的线程中进行神经网络运算和图像处理,当使用本发明的较小体积神经网络网络之后,***只需要加载当前处理的子网络,至多同时预加载将要进行处理的子网络,这样就可以留给图像处理较多的算力,提高运算的响应速度。As shown in FIG. 11(b), the processing processor performs neural network operations and image processing in two parallel threads. After using the smaller volume neural network of the present invention, the system only needs to load the currently processed subnetwork, At the same time, the sub-network to be processed is preloaded at the same time, so that more computing power for image processing can be left, and the response speed of the calculation is improved.
本申请的实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序中包括程序指令,所述处理器执行所述程序指令,实现上述实施例提供的图像处理方法的步骤。An embodiment of the present application also provides a computer-readable storage medium that stores a computer program, where the computer program includes program instructions, and the processor executes the program instructions to implement the foregoing implementation Example provides the steps of the image processing method.
其中,所述计算机可读存储介质可以是前述任一实施例所述的终端设备的内部存储单元,例如所述终端设备的硬盘或内存。所述计算机可读存储介质也可以是所述终端设备的外部存储设备,例如所述终端设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪 存卡(Flash Card)等。Wherein, the computer-readable storage medium may be an internal storage unit of the terminal device according to any of the foregoing embodiments, such as a hard disk or a memory of the terminal device. The computer-readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk provided on the terminal device, a smart memory card (Smart) Media (SMC), and secure digital (SD) ) Card, flash card (Flash Card), etc.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above is only the specific implementation of this application, but the scope of protection of this application is not limited to this, any person skilled in the art can easily think of various equivalents within the technical scope disclosed in this application Modifications or replacements, these modifications or replacements should be covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (57)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, which includes:
    获取目标图像;Get the target image;
    获取预设算法列表,所述预设算法列表包括多个图像处理算法索引;Obtain a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes;
    根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。A pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
  2. 根据权利要求1所述的图像处理方法,其特征在于,所述获取目标图像,包括:The image processing method according to claim 1, wherein the acquiring the target image comprises:
    获取待处理图像以及所述待处理图像的图像格式;Acquiring the image to be processed and the image format of the image to be processed;
    判断所述待处理图像的图像格式是否为RAW格式;Determine whether the image format of the image to be processed is in RAW format;
    若所述待处理图像的图像格式是RAW格式,获取所述待处理图像作为目标图像。If the image format of the image to be processed is a RAW format, obtain the image to be processed as a target image.
  3. 根据权利要求2所述的图像处理方法,其特征在于,所述判断所述待处理图像的图像格式是否为RAW格式之后,还包括:The image processing method according to claim 2, wherein after determining whether the image format of the image to be processed is a RAW format, the method further includes:
    若所述待处理图像的图像格式不是RAW格式,查询并获取所述待处理图像对应的RAW格式图像作为所述目标图像。If the image format of the image to be processed is not the RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image.
  4. 根据权利要求1至3任一所述的图像处理方法,其特征在于,所述预设算法列表包括以堆栈形式排列的多个图像处理算法索引。The image processing method according to any one of claims 1 to 3, wherein the preset algorithm list includes a plurality of image processing algorithm indexes arranged in a stack.
  5. 根据权利要求4所述的图像处理方法,其特征在于,在所述获取预设算法列表之前,还包括:The image processing method according to claim 4, wherein before the acquiring the preset algorithm list, the method further comprises:
    获取预先设置的算法列表,所述算法列表包括多个按照顺序排列的图像处理算法索引;Obtain a preset algorithm list, the algorithm list includes a plurality of image processing algorithm indexes arranged in sequence;
    将所述算法列表中的图像处理算法索引采用先进先出的堆栈形式进行保存以生成预设算法列表。The image processing algorithm index in the algorithm list is saved in a first-in first-out stack form to generate a preset algorithm list.
  6. 根据权利要求1至5任一项所述的图像处理方法,其特征在于,所述多个图像处理算法索引包括调整色温算法索引、设置色彩算法索引、调整曝光算法索引、调整对比度算法索引、高光恢复算法索引、低光补偿算法索引、白平衡算法索引、调整清晰度算法索引、除雾算法索引、调整自然饱和度算法索引、 调整饱和度算法索引和色调曲线算法索引。The image processing method according to any one of claims 1 to 5, wherein the plurality of image processing algorithm indexes include adjusting color temperature algorithm indexes, setting color algorithm indexes, adjusting exposure algorithm indexes, adjusting contrast algorithm indexes, highlights Restore algorithm index, low light compensation algorithm index, white balance algorithm index, adjust sharpness algorithm index, defog algorithm index, adjust natural saturation algorithm index, adjust saturation algorithm index and tone curve algorithm index.
  7. 根据权利要求1所述的图像处理方法,其特征在于,所述根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理,包括:The image processing method according to claim 1, characterized in that the pre-trained convolutional neural network model is read in order in the preset algorithm list according to a plurality of the image processing algorithm indexes in order to The target image is processed, including:
    根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法;Sequentially start the image processing algorithms corresponding to the image processing algorithm index according to the preset algorithm list;
    根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数;Determining algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model;
    根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像。The image processing algorithm is used to process the target image according to the algorithm parameters to obtain an output image.
  8. 根据权利要求7所述的图像处理方法,其特征在于,所述根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法,包括:The image processing method according to claim 7, wherein the sequentially starting the image processing algorithms corresponding to the image processing algorithm index according to the preset algorithm list includes:
    确定所述预设算法列表中的一个图像处理算法索引,以及所述图像处理算法索引对应图像处理算法。An image processing algorithm index in the preset algorithm list is determined, and the image processing algorithm index corresponds to an image processing algorithm.
  9. 根据权利要求8所述的图像处理方法,其特征在于,所述确定所述预设算法列表中的一个图像处理算法索引,包括:The image processing method according to claim 8, wherein the determining an image processing algorithm index in the preset algorithm list includes:
    按照多个所述图像处理算法在所述预设算法列表中的排列顺序,依次确定所述预设算法列表中的一个图像处理算法。According to the arrangement order of the plurality of image processing algorithms in the preset algorithm list, one image processing algorithm in the preset algorithm list is determined in sequence.
  10. 根据权利要求7所述的图像处理方法,其特征在于,所述根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数,包括:The image processing method according to claim 7, wherein the determining the algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model includes:
    将所述目标图像输入至所述卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数。The target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm.
  11. 根据权利要求10所述的图像处理方法,其特征在于,所述将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数,包括:The image processing method according to claim 10, wherein the inputting the target image into a convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm includes:
    将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的多个算法参数以及每个所述算法参数对应的概率值;Input the target image into a convolutional neural network model for training to obtain a plurality of algorithm parameters corresponding to the image processing algorithm and a probability value corresponding to each of the algorithm parameters;
    根据所述概率值确定所述图像处理算法对应的算法参数。The algorithm parameter corresponding to the image processing algorithm is determined according to the probability value.
  12. 根据权利要求7至11任一所述的图像处理方法,其特征在于,所述根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像,包括:The image processing method according to any one of claims 7 to 11, wherein the processing of the target image by using the image processing algorithm according to the algorithm parameters to obtain an output image includes:
    根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得 输出图像;Use the image processing algorithm to process the target image according to the algorithm parameters to obtain an output image;
    将所述输出图像作为所述目标图像,返回所述根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法继续执行,直至所述预设算法列表中的图像处理算法索引全部启动完时得到最终的输出图像。Use the output image as the target image, and return to the image processing algorithm corresponding to the image processing algorithm index sequentially started according to the preset algorithm list to continue execution until the image processing algorithm index in the preset algorithm list is all started When finished, get the final output image.
  13. 根据权利要求12所述的图像处理方法,其特征在于,所述根据所述图像处理算法以及对应的算法参数对所述目标图像进行处理以获得输出图像,包括:The image processing method according to claim 12, wherein the processing the target image according to the image processing algorithm and corresponding algorithm parameters to obtain an output image includes:
    根据所述图像处理算法对应的算法参数,调用所述图像处理算法对应的函数对所述目标图像进行处理以获得输出图像。According to the algorithm parameters corresponding to the image processing algorithm, a function corresponding to the image processing algorithm is called to process the target image to obtain an output image.
  14. 根据权利要求1所述的图像处理方法,其特征在于,所述根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理,包括:The image processing method according to claim 1, characterized in that the pre-trained convolutional neural network model is read in order in the preset algorithm list according to a plurality of the image processing algorithm indexes in order to The target image is processed, including:
    将所述目标图像输入至卷积神经网络模型进行训练,以得到所述预设算法列表中的一个图像处理算法对应的算法参数;Input the target image into a convolutional neural network model for training to obtain an algorithm parameter corresponding to an image processing algorithm in the preset algorithm list;
    根据所述算法参数及对应的图像处理算法对所述目标图像进行处理以获得输出图像;Processing the target image according to the algorithm parameter and the corresponding image processing algorithm to obtain an output image;
    将所述输出图像作为所述目标图像,返回所述将目标图像输入至卷积神经网络进行训练继续执行,直至所述预设算法列表中的图像处理算法全部训练完时得到最终的输出图像。Taking the output image as the target image, returning the input of the target image to the convolutional neural network for training and continuing execution, until all the image processing algorithms in the preset algorithm list are completely trained to obtain the final output image.
  15. 根据权利要求1所述的图像处理方法,其特征在于,还包括:The image processing method according to claim 1, further comprising:
    获取图像样本数据,所述图像样本数据包括多个经过图像处理算法处理过的图像数据以及所述图像数据对应的算法参数;Acquiring image sample data, the image sample data including a plurality of image data processed by an image processing algorithm and algorithm parameters corresponding to the image data;
    基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,所述卷积神经网络模型的输出参数为图像处理算法对应的算法参数;Based on the convolutional neural network, iterative training is performed according to the image sample data to obtain a convolutional neural network model, and the output parameters of the convolutional neural network model are algorithm parameters corresponding to the image processing algorithm;
    将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证;Validate the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data;
    保存验证通过的卷积神经网络模型作为预先训练的卷积神经网络模型。Save the verified convolutional neural network model as the pre-trained convolutional neural network model.
  16. 根据权利要求15所述的图像处理方法,其特征在于,所述将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证,包括:The image processing method according to claim 15, wherein the verification of the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data includes:
    将所述图像数据对应的算法参数设为标定数据;Set the algorithm parameters corresponding to the image data as calibration data;
    计算所述标定数据与所述输出参数中的图像处理算法对应的算法参数的差值作为差距损失值;Calculating the difference between the calibration data and the algorithm parameter corresponding to the image processing algorithm in the output parameter as the gap loss value;
    判断所述差距损失值是否满足预设条件,所述预设条件为用于衡量所述卷积神经网络模型的准确度的条件;Judging whether the gap loss value meets a preset condition, and the preset condition is a condition for measuring the accuracy of the convolutional neural network model;
    在所述差距损失值满足所述预设条件时,判定所述卷积神经网络模型验证通过。When the gap loss value meets the preset condition, it is determined that the convolutional neural network model passes verification.
  17. 根据权利要求16所述的图像处理方法,其特征在于,所述判断所述差距损失值是否满足预设条件,包括:The image processing method according to claim 16, wherein the determining whether the gap loss value meets a preset condition includes:
    监测每次迭代训练对应的差距损失值的变化值;Monitor the change value of the gap loss value corresponding to each iteration training;
    若每次迭代训练对应的差距损失值的变化值均在预设范围内,判定所述差距损失值满足所述预设条件。If the change value of the gap loss value corresponding to each iteration training is within a preset range, it is determined that the gap loss value meets the preset condition.
  18. 根据权利要求16所述的图像处理方法,其特征在于,所述判断所述差距损失值是否满足预设条件,包括:The image processing method according to claim 16, wherein the determining whether the gap loss value meets a preset condition includes:
    在每次迭代训练对应的差距损失值均减小时,判断所述差距损失值是否小于预设值;When the gap loss value corresponding to each iteration training decreases, determine whether the gap loss value is less than a preset value;
    若所述差距损失值小于所述预设值,判定所述差距损失值满足所述预设条件。If the gap loss value is less than the preset value, it is determined that the gap loss value meets the preset condition.
  19. 根据权利要求15所述的图像处理方法,其特征在于,所述基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型之前,还包括:The image processing method according to claim 15, wherein the convolutional neural network-based iterative training based on the image sample data to obtain a convolutional neural network model further includes:
    对所述图像样本数据中的算法参数进行量化处理,得到量化后的图像样本数据;Quantize the algorithm parameters in the image sample data to obtain quantized image sample data;
    所述基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,包括:基于卷积神经网络算法,根据所述量化后的图像样本数据进行迭代训练以得到卷积神经网络模型。The convolutional neural network-based iterative training based on the image sample data to obtain a convolutional neural network model includes: based on the convolutional neural network algorithm, iterative training based on the quantized image sample data to obtain convolution Neural network model.
  20. 一种终端设备,其特征在于,所述终端设备包括存储器和处理器;A terminal device, characterized in that the terminal device includes a memory and a processor;
    所述存储器用于存储计算机程序;The memory is used to store computer programs;
    所述处理器,用于执行所述计算机程序并在执行所述计算机程序时,实现如下步骤:The processor is used to execute the computer program and when the computer program is executed, the following steps are implemented:
    获取目标图像;Get the target image;
    获取预设算法列表,所述预设算法列表包括多个图像处理算法索引;Obtain a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes;
    根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。A pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
  21. 根据权利要求20所述的终端设备,其特征在于,所述处理器在实现所述获取目标图像时,用于实现:The terminal device according to claim 20, wherein the processor, when implementing the acquiring the target image, is used to implement:
    获取待处理图像以及所述待处理图像的图像格式;Acquiring the image to be processed and the image format of the image to be processed;
    判断所述待处理图像的图像格式是否为RAW格式;Determine whether the image format of the image to be processed is in RAW format;
    若所述待处理图像的图像格式是RAW格式,获取所述待处理图像作为目标图像。If the image format of the image to be processed is a RAW format, obtain the image to be processed as a target image.
  22. 根据权利要求21所述的终端设备,其特征在于,所述处理器在实现所述判断所述待处理图像的图像格式是否为RAW格式之后,还用于实现:The terminal device according to claim 21, wherein the processor is further used to implement after determining whether the image format of the image to be processed is in RAW format:
    若所述待处理图像的图像格式不是RAW格式,查询并获取所述待处理图像对应的RAW格式图像作为所述目标图像。If the image format of the image to be processed is not the RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image.
  23. 根据权利要求20至22任一所述的终端设备,其特征在于,所述预设算法列表包括以堆栈形式排列的多个图像处理算法索引。The terminal device according to any one of claims 20 to 22, wherein the preset algorithm list includes a plurality of image processing algorithm indexes arranged in a stack.
  24. 根据权利要求23所述的终端设备,其特征在于,所述处理器在实现所述获取预设算法列表之前,还用于实现:The terminal device according to claim 23, wherein the processor is further configured to implement: before implementing the acquiring the preset algorithm list:
    获取预先设置的算法列表,所述算法列表包括多个按照顺序排列的图像处理算法索引;Obtain a preset algorithm list, the algorithm list includes a plurality of image processing algorithm indexes arranged in sequence;
    将所述算法列表中的图像处理算法索引采用先进先出的堆栈形式进行保存以生成预设算法列表。The image processing algorithm index in the algorithm list is saved in a first-in first-out stack form to generate a preset algorithm list.
  25. 根据权利要求20至24任一项所述的终端设备,其特征在于,所述多个图像处理算法索引包括调整色温算法索引、设置色彩算法索引、调整曝光算法索引、调整对比度算法索引、高光恢复算法索引、低光补偿算法索引、白平衡算法索引、调整清晰度算法索引、除雾算法索引、调整自然饱和度算法索引、调整饱和度算法索引和色调曲线算法索引。The terminal device according to any one of claims 20 to 24, wherein the plurality of image processing algorithm indexes include adjusting color temperature algorithm indexes, setting color algorithm indexes, adjusting exposure algorithm indexes, adjusting contrast algorithm indexes, and highlight recovery Algorithm index, low light compensation algorithm index, white balance algorithm index, adjustment sharpness algorithm index, defogging algorithm index, adjusting natural saturation algorithm index, adjusting saturation algorithm index and tone curve algorithm index.
  26. 根据权利要求20所述的终端设备,其特征在于,所述处理器在实现所述根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理时,用于实现:The terminal device according to claim 20, wherein the processor is configured to read the pre-trained convolutional neural network in the order in the preset algorithm list according to the plurality of image processing algorithm indexes The model, when processing the target image, is used to realize:
    根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法;Sequentially start the image processing algorithms corresponding to the image processing algorithm index according to the preset algorithm list;
    根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数;Determining algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model;
    根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像。The image processing algorithm is used to process the target image according to the algorithm parameters to obtain an output image.
  27. 根据权利要求26所述的终端设备,其特征在于,所述处理器在实现所述根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法时,用于实现:The terminal device according to claim 26, wherein the processor, when implementing the image processing algorithms corresponding to the image processing algorithm index sequentially activated according to the preset algorithm list, is used to implement:
    确定所述预设算法列表中的一个图像处理算法索引,以及所述图像处理算法索引对应图像处理算法。An image processing algorithm index in the preset algorithm list is determined, and the image processing algorithm index corresponds to an image processing algorithm.
  28. 根据权利要求27所述的终端设备,其特征在于,所述处理器在实现所述确定所述预设算法列表中的一个图像处理算法索引时,用于实现:The terminal device according to claim 27, wherein the processor, when implementing the determination of an image processing algorithm index in the preset algorithm list, is used to implement:
    按照多个所述图像处理算法在所述预设算法列表中的排列顺序,依次确定所述预设算法列表中的一个图像处理算法。According to the arrangement order of the plurality of image processing algorithms in the preset algorithm list, one image processing algorithm in the preset algorithm list is determined in sequence.
  29. 根据权利要求26所述的终端设备,其特征在于,所述处理器在实现所述根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数时,用于实现:The terminal device according to claim 26, wherein the processor, when implementing the algorithm parameter corresponding to the image processing algorithm according to the convolutional neural network model, is used to implement:
    将所述目标图像输入至所述卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数。The target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm.
  30. 根据权利要求29所述的终端设备,其特征在于,所述处理器在实现所述将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数时,用于实现:The terminal device according to claim 29, characterized in that, when the processor implements the input of the target image into a convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm , To achieve:
    将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的多个算法参数以及每个所述算法参数对应的概率值;Input the target image into a convolutional neural network model for training to obtain a plurality of algorithm parameters corresponding to the image processing algorithm and a probability value corresponding to each of the algorithm parameters;
    根据所述概率值确定所述图像处理算法对应的算法参数。The algorithm parameter corresponding to the image processing algorithm is determined according to the probability value.
  31. 根据权利要求26至30任一所述的终端设备,其特征在于,所述处理器在实现所述根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像时,用于实现:The terminal device according to any one of claims 26 to 30, wherein when the processor implements the image processing algorithm to process the target image according to the algorithm parameter to obtain an output image, Used to achieve:
    根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像;Use the image processing algorithm to process the target image according to the algorithm parameters to obtain an output image;
    将所述输出图像作为所述目标图像,返回所述根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法继续执行,直至所述预设算法列表 中的图像处理算法索引全部启动完时得到最终的输出图像。Use the output image as the target image, and return to the image processing algorithm corresponding to the image processing algorithm index sequentially started according to the preset algorithm list to continue execution until the image processing algorithm index in the preset algorithm list is all started When finished, get the final output image.
  32. 根据权利要求31所述的终端设备,其特征在于,所述处理器在实现所述根据所述图像处理算法以及对应的算法参数对所述目标图像进行处理以获得输出图像,用于实现:The terminal device according to claim 31, wherein the processor is processing the target image according to the image processing algorithm and the corresponding algorithm parameters to obtain an output image for implementing:
    根据所述图像处理算法对应的算法参数,调用所述图像处理算法对应的函数对所述目标图像进行处理以获得输出图像。According to the algorithm parameters corresponding to the image processing algorithm, a function corresponding to the image processing algorithm is called to process the target image to obtain an output image.
  33. 根据权利要求20所述的终端设备,其特征在于,所述处理器在实现所述根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理时,用于实现:The terminal device according to claim 20, wherein the processor is configured to read the pre-trained convolutional neural network in the order in the preset algorithm list according to the plurality of image processing algorithm indexes The model, when processing the target image, is used to realize:
    将所述目标图像输入至卷积神经网络模型进行训练,以得到所述预设算法列表中的一个图像处理算法对应的算法参数;Input the target image into a convolutional neural network model for training to obtain an algorithm parameter corresponding to an image processing algorithm in the preset algorithm list;
    根据所述算法参数及对应的图像处理算法对所述目标图像进行处理以获得输出图像;Processing the target image according to the algorithm parameter and the corresponding image processing algorithm to obtain an output image;
    将所述输出图像作为所述目标图像,返回所述将目标图像输入至卷积神经网络进行训练继续执行,直至所述预设算法列表中的图像处理算法全部训练完时得到最终的输出图像。Taking the output image as the target image, returning the input of the target image to the convolutional neural network for training and continuing execution, until all the image processing algorithms in the preset algorithm list are completely trained to obtain the final output image.
  34. 根据权利要求20所述的终端设备,其特征在于,所述处理器,还用于实现:The terminal device according to claim 20, wherein the processor is further used to implement:
    获取图像样本数据,所述图像样本数据包括多个经过图像处理算法处理过的图像数据以及所述图像数据对应的算法参数;Acquiring image sample data, the image sample data including a plurality of image data processed by an image processing algorithm and algorithm parameters corresponding to the image data;
    基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,所述卷积神经网络模型的输出参数为图像处理算法对应的算法参数;Based on the convolutional neural network, iterative training is performed according to the image sample data to obtain a convolutional neural network model, and the output parameters of the convolutional neural network model are algorithm parameters corresponding to the image processing algorithm;
    将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证;Validate the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data;
    保存验证通过的卷积神经网络模型作为预先训练的卷积神经网络模型。Save the verified convolutional neural network model as the pre-trained convolutional neural network model.
  35. 根据权利要求34所述的终端设备,其特征在于,所述处理器在实现所述将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证时,用于实现:The terminal device according to claim 34, characterized in that, when the processor implements the verification of the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data, it is used to implement:
    将所述图像数据对应的算法参数设为标定数据;Set the algorithm parameters corresponding to the image data as calibration data;
    计算所述标定数据与所述输出参数中的图像处理算法对应的算法参数的差 值作为差距损失值;Calculating the difference between the calibration data and the algorithm parameter corresponding to the image processing algorithm in the output parameter as the gap loss value;
    判断所述差距损失值是否满足预设条件,所述预设条件为用于衡量所述卷积神经网络模型的准确度的条件;Judging whether the gap loss value meets a preset condition, and the preset condition is a condition for measuring the accuracy of the convolutional neural network model;
    在所述差距损失值满足所述预设条件时,判定所述卷积神经网络模型验证通过。When the gap loss value meets the preset condition, it is determined that the convolutional neural network model passes verification.
  36. 根据权利要求35所述的终端设备,其特征在于,所述处理器在实现所述判断所述差距损失值是否满足预设条件时,用于实现:The terminal device according to claim 35, wherein, when the processor realizes the judgment whether the gap loss value meets a preset condition, it is used to implement:
    监测每次迭代训练对应的差距损失值的变化值;Monitor the change value of the gap loss value corresponding to each iteration training;
    若每次迭代训练对应的差距损失值的变化值均在预设范围内,判定所述差距损失值满足所述预设条件。If the change value of the gap loss value corresponding to each iteration training is within a preset range, it is determined that the gap loss value meets the preset condition.
  37. 根据权利要求35所述的终端设备,其特征在于,所述处理器在实现所述判断所述差距损失值是否满足预设条件时,用于实现:The terminal device according to claim 35, wherein, when the processor realizes the judgment whether the gap loss value meets a preset condition, it is used to implement:
    在每次迭代训练对应的差距损失值均减小时,判断所述差距损失值是否小于预设值;When the gap loss value corresponding to each iteration training decreases, determine whether the gap loss value is less than a preset value;
    若所述差距损失值小于所述预设值,判定所述差距损失值满足所述预设条件。If the gap loss value is less than the preset value, it is determined that the gap loss value meets the preset condition.
  38. 根据权利要求34所述的终端设备,其特征在于,所述处理器在实现所述基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型之前,还用于实现:The terminal device according to claim 34, characterized in that the processor is further used to implement the convolutional neural network before iterative training based on the image sample data to obtain a convolutional neural network model :
    对所述图像样本数据中的算法参数进行量化处理,得到量化后的图像样本数据;Quantize the algorithm parameters in the image sample data to obtain quantized image sample data;
    所述基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,包括:基于卷积神经网络算法,根据所述量化后的图像样本数据进行迭代训练以得到卷积神经网络模型。The convolutional neural network-based iterative training based on the image sample data to obtain a convolutional neural network model includes: based on the convolutional neural network algorithm, iterative training based on the quantized image sample data to obtain convolution Neural network model.
  39. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现:A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor realizes:
    获取目标图像;Get the target image;
    获取预设算法列表,所述预设算法列表包括多个图像处理算法索引;Obtain a preset algorithm list, where the preset algorithm list includes multiple image processing algorithm indexes;
    根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理。A pre-trained convolutional neural network model is sequentially read according to the order of multiple image processing algorithm indexes in the preset algorithm list to process the target image.
  40. 根据权利要求39所述的计算机可读存储介质,其特征在于,所述处理器在实现所述获取目标图像时,用于实现:The computer-readable storage medium according to claim 39, wherein the processor, when implementing the acquiring the target image, is used to implement:
    获取待处理图像以及所述待处理图像的图像格式;Acquiring the image to be processed and the image format of the image to be processed;
    判断所述待处理图像的图像格式是否为RAW格式;Determine whether the image format of the image to be processed is in RAW format;
    若所述待处理图像的图像格式是RAW格式,获取所述待处理图像作为目标图像。If the image format of the image to be processed is a RAW format, obtain the image to be processed as a target image.
  41. 根据权利要求40所述的计算机可读存储介质,其特征在于,所述处理器在实现所述判断所述待处理图像的图像格式是否为RAW格式之后,还用于实现:The computer-readable storage medium according to claim 40, wherein the processor is further used to implement after determining whether the image format of the image to be processed is in RAW format:
    若所述待处理图像的图像格式不是RAW格式,查询并获取所述待处理图像对应的RAW格式图像作为所述目标图像。If the image format of the image to be processed is not the RAW format, query and obtain the RAW format image corresponding to the image to be processed as the target image.
  42. 根据权利要求39至41任一所述的计算机可读存储介质,其特征在于,所述预设算法列表包括以堆栈形式排列的多个图像处理算法索引。The computer-readable storage medium according to any one of claims 39 to 41, wherein the preset algorithm list includes a plurality of image processing algorithm indexes arranged in a stack.
  43. 根据权利要求42所述的计算机可读存储介质,其特征在于,所述处理器在实现所述获取预设算法列表之前,还用于实现:The computer-readable storage medium according to claim 42, wherein the processor is further configured to implement: before obtaining the preset algorithm list:
    获取预先设置的算法列表,所述算法列表包括多个按照顺序排列的图像处理算法索引;Obtain a preset algorithm list, the algorithm list includes a plurality of image processing algorithm indexes arranged in sequence;
    将所述算法列表中的图像处理算法索引采用先进先出的堆栈形式进行保存以生成预设算法列表。The image processing algorithm index in the algorithm list is saved in a first-in first-out stack form to generate a preset algorithm list.
  44. 根据权利要求39至43任一项所述的计算机可读存储介质,其特征在于,所述多个图像处理算法索引包括调整色温算法索引、设置色彩算法索引、调整曝光算法索引、调整对比度算法索引、高光恢复算法索引、低光补偿算法索引、白平衡算法索引、调整清晰度算法索引、除雾算法索引、调整自然饱和度算法索引、调整饱和度算法索引和色调曲线算法索引。The computer-readable storage medium according to any one of claims 39 to 43, wherein the plurality of image processing algorithm indexes include adjusting color temperature algorithm indexes, setting color algorithm indexes, adjusting exposure algorithm indexes, and adjusting contrast algorithm indexes , High light recovery algorithm index, low light compensation algorithm index, white balance algorithm index, adjust sharpness algorithm index, defogging algorithm index, adjust natural saturation algorithm index, adjust saturation algorithm index and tone curve algorithm index.
  45. 根据权利要求39所述的计算机可读存储介质,其特征在于,所述处理器在实现所述根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理时,用于实现:The computer-readable storage medium according to claim 39, wherein the processor implements the order of reading the pre-trained volumes in the preset algorithm list according to the plurality of image processing algorithm indexes The product neural network model is used to realize:
    根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法;Sequentially start the image processing algorithms corresponding to the image processing algorithm index according to the preset algorithm list;
    根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数;Determining algorithm parameters corresponding to the image processing algorithm according to the convolutional neural network model;
    根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得 输出图像。The image processing algorithm is used to process the target image according to the algorithm parameters to obtain an output image.
  46. 根据权利要求45所述的计算机可读存储介质,其特征在于,所述处理器在实现所述根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法时,用于实现:The computer-readable storage medium according to claim 45, wherein the processor, when implementing the image processing algorithms corresponding to the image processing algorithm index sequentially activated according to the preset algorithm list, is used to implement:
    确定所述预设算法列表中的一个图像处理算法索引,以及所述图像处理算法索引对应图像处理算法。An image processing algorithm index in the preset algorithm list is determined, and the image processing algorithm index corresponds to an image processing algorithm.
  47. 根据权利要求46所述的计算机可读存储介质,其特征在于,所述处理器在实现所述确定所述预设算法列表中的一个图像处理算法索引时,用于实现:The computer-readable storage medium according to claim 46, wherein the processor, when implementing the determination of an image processing algorithm index in the preset algorithm list, is used to implement:
    按照多个所述图像处理算法在所述预设算法列表中的排列顺序,依次确定所述预设算法列表中的一个图像处理算法。According to the arrangement order of the plurality of image processing algorithms in the preset algorithm list, one image processing algorithm in the preset algorithm list is determined in sequence.
  48. 根据权利要求45所述的计算机可读存储介质,其特征在于,所述处理器在实现所述根据所述卷积神经网络模型确定所述图像处理算法对应的算法参数时,用于实现:The computer-readable storage medium according to claim 45, wherein the processor, when implementing the algorithm parameter corresponding to the image processing algorithm according to the convolutional neural network model, is used to implement:
    将所述目标图像输入至所述卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数。The target image is input into the convolutional neural network model for training to obtain algorithm parameters corresponding to the image processing algorithm.
  49. 根据权利要求48所述的计算机可读存储介质,其特征在于,所述处理器在实现所述将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的算法参数时,用于实现:The computer-readable storage medium according to claim 48, wherein the processor performs training by implementing the input of the target image into a convolutional neural network model to obtain the corresponding image processing algorithm Algorithm parameters, used to achieve:
    将所述目标图像输入至卷积神经网络模型中进行训练,以得到所述图像处理算法对应的多个算法参数以及每个所述算法参数对应的概率值;Input the target image into a convolutional neural network model for training to obtain a plurality of algorithm parameters corresponding to the image processing algorithm and a probability value corresponding to each of the algorithm parameters;
    根据所述概率值确定所述图像处理算法对应的算法参数。The algorithm parameter corresponding to the image processing algorithm is determined according to the probability value.
  50. 根据权利要求45至49任一所述的计算机可读存储介质,其特征在于,所述处理器在实现所述根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像时,用于实现:The computer-readable storage medium according to any one of claims 45 to 49, wherein the processor is processing the target image by using the image processing algorithm according to the algorithm parameter to obtain an output The image is used to achieve:
    根据所述算法参数采用所述图像处理算法对所述目标图像进行处理以获得输出图像;Use the image processing algorithm to process the target image according to the algorithm parameters to obtain an output image;
    将所述输出图像作为所述目标图像,返回所述根据所述预设算法列表依次启动图像处理算法索引对应的图像处理算法继续执行,直至所述预设算法列表中的图像处理算法索引全部启动完时得到最终的输出图像。Use the output image as the target image, and return to the image processing algorithm corresponding to the image processing algorithm index sequentially started according to the preset algorithm list to continue execution until the image processing algorithm index in the preset algorithm list is all started When finished, get the final output image.
  51. 根据权利要求50所述的计算机可读存储介质,其特征在于,所述处理 器在实现所述根据所述图像处理算法以及对应的算法参数对所述目标图像进行处理以获得输出图像,用于实现:The computer-readable storage medium of claim 50, wherein the processor is implementing the processing of the target image according to the image processing algorithm and corresponding algorithm parameters to obtain an output image for achieve:
    根据所述图像处理算法对应的算法参数,调用所述图像处理算法对应的函数对所述目标图像进行处理以获得输出图像。According to the algorithm parameters corresponding to the image processing algorithm, a function corresponding to the image processing algorithm is called to process the target image to obtain an output image.
  52. 根据权利要求39所述的计算机可读存储介质,其特征在于,所述处理器在实现所述根据多个所述图像处理算法索引在所述预设算法列表中的顺序读取预先训练的卷积神经网络模型,以对所述目标图像进行处理时,用于实现:The computer-readable storage medium according to claim 39, wherein the processor implements the order of reading the pre-trained volumes in the preset algorithm list according to the plurality of image processing algorithm indexes The product neural network model is used to realize:
    将所述目标图像输入至卷积神经网络模型进行训练,以得到所述预设算法列表中的一个图像处理算法对应的算法参数;Input the target image into a convolutional neural network model for training to obtain an algorithm parameter corresponding to an image processing algorithm in the preset algorithm list;
    根据所述算法参数及对应的图像处理算法对所述目标图像进行处理以获得输出图像;Processing the target image according to the algorithm parameter and the corresponding image processing algorithm to obtain an output image;
    将所述输出图像作为所述目标图像,返回所述将目标图像输入至卷积神经网络进行训练继续执行,直至所述预设算法列表中的图像处理算法全部训练完时得到最终的输出图像。Taking the output image as the target image, returning the input of the target image to the convolutional neural network for training and continuing execution, until all the image processing algorithms in the preset algorithm list are completely trained to obtain the final output image.
  53. 根据权利要求39所述的计算机可读存储介质,其特征在于,所述处理器,还用于实现:The computer-readable storage medium of claim 39, wherein the processor is further configured to implement:
    获取图像样本数据,所述图像样本数据包括多个经过图像处理算法处理过的图像数据以及所述图像数据对应的算法参数;Acquiring image sample data, the image sample data including a plurality of image data processed by an image processing algorithm and algorithm parameters corresponding to the image data;
    基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,所述卷积神经网络模型的输出参数为图像处理算法对应的算法参数;Based on the convolutional neural network, iterative training is performed according to the image sample data to obtain a convolutional neural network model, and the output parameters of the convolutional neural network model are algorithm parameters corresponding to the image processing algorithm;
    将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证;Validate the convolutional neural network model using the algorithm parameters corresponding to the image data as calibration data;
    保存验证通过的卷积神经网络模型作为预先训练的卷积神经网络模型。Save the verified convolutional neural network model as the pre-trained convolutional neural network model.
  54. 根据权利要求53所述的计算机可读存储介质,其特征在于,所述处理器在实现所述将所述图像数据对应的算法参数作为标定数据对所述卷积神经网络模型进行验证时,用于实现:The computer-readable storage medium according to claim 53, wherein the processor uses the algorithm parameter corresponding to the image data as calibration data to verify the convolutional neural network model by using To achieve:
    将所述图像数据对应的算法参数设为标定数据;Set the algorithm parameters corresponding to the image data as calibration data;
    计算所述标定数据与所述输出参数中的图像处理算法对应的算法参数的差值作为差距损失值;Calculating the difference between the calibration data and the algorithm parameter corresponding to the image processing algorithm in the output parameter as the gap loss value;
    判断所述差距损失值是否满足预设条件,所述预设条件为用于衡量所述卷 积神经网络模型的准确度的条件;Judging whether the gap loss value meets a preset condition, and the preset condition is a condition for measuring the accuracy of the convolutional neural network model;
    在所述差距损失值满足所述预设条件时,判定所述卷积神经网络模型验证通过。When the gap loss value meets the preset condition, it is determined that the convolutional neural network model passes verification.
  55. 根据权利要求54所述的计算机可读存储介质,其特征在于,所述处理器在实现所述判断所述差距损失值是否满足预设条件时,用于实现:The computer-readable storage medium according to claim 54, wherein the processor, when implementing the judgment whether the gap loss value meets a preset condition, is used to implement:
    监测每次迭代训练对应的差距损失值的变化值;Monitor the change value of the gap loss value corresponding to each iteration training;
    若每次迭代训练对应的差距损失值的变化值均在预设范围内,判定所述差距损失值满足所述预设条件。If the change value of the gap loss value corresponding to each iteration training is within a preset range, it is determined that the gap loss value meets the preset condition.
  56. 根据权利要求54所述的计算机可读存储介质,其特征在于,所述处理器在实现所述判断所述差距损失值是否满足预设条件时,用于实现:The computer-readable storage medium according to claim 54, wherein the processor, when implementing the judgment whether the gap loss value meets a preset condition, is used to implement:
    在每次迭代训练对应的差距损失值均减小时,判断所述差距损失值是否小于预设值;When the gap loss value corresponding to each iteration training decreases, determine whether the gap loss value is less than a preset value;
    若所述差距损失值小于所述预设值,判定所述差距损失值满足所述预设条件。If the gap loss value is less than the preset value, it is determined that the gap loss value meets the preset condition.
  57. 根据权利要求53所述的计算机可读存储介质,其特征在于,所述处理器在实现所述基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型之前,还用于实现:The computer-readable storage medium of claim 53, wherein the processor, before implementing the convolution-based neural network and performing iterative training based on the image sample data to obtain a convolutional neural network model, Used to achieve:
    对所述图像样本数据中的算法参数进行量化处理,得到量化后的图像样本数据;Quantize the algorithm parameters in the image sample data to obtain quantized image sample data;
    所述基于卷积神经网络,根据所述图像样本数据进行迭代训练以得到卷积神经网络模型,包括:基于卷积神经网络算法,根据所述量化后的图像样本数据进行迭代训练以得到卷积神经网络模型。The convolutional neural network-based iterative training based on the image sample data to obtain a convolutional neural network model includes: based on the convolutional neural network algorithm, iterative training based on the quantized image sample data to obtain convolution Neural network model.
PCT/CN2018/121796 2018-12-18 2018-12-18 Image processing method, terminal device and storage medium WO2020124374A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/121796 WO2020124374A1 (en) 2018-12-18 2018-12-18 Image processing method, terminal device and storage medium
CN201880071017.2A CN111373436A (en) 2018-12-18 2018-12-18 Image processing method, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/121796 WO2020124374A1 (en) 2018-12-18 2018-12-18 Image processing method, terminal device and storage medium

Publications (1)

Publication Number Publication Date
WO2020124374A1 true WO2020124374A1 (en) 2020-06-25

Family

ID=71100102

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/121796 WO2020124374A1 (en) 2018-12-18 2018-12-18 Image processing method, terminal device and storage medium

Country Status (2)

Country Link
CN (1) CN111373436A (en)
WO (1) WO2020124374A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726592A (en) * 2020-06-30 2020-09-29 北京市商汤科技开发有限公司 Method and apparatus for obtaining architecture of image signal processor

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112163468A (en) * 2020-09-11 2021-01-01 浙江大华技术股份有限公司 Image processing method and device based on multiple threads
CN112153343B (en) * 2020-09-25 2022-09-02 北京百度网讯科技有限公司 Elevator safety monitoring method and device, monitoring camera and storage medium
CN112507833A (en) * 2020-11-30 2021-03-16 北京百度网讯科技有限公司 Face recognition and model training method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321270A (en) * 2008-07-16 2008-12-10 中国人民解放军国防科学技术大学 Monitoring system and method for real-time optimized image
US20140307930A1 (en) * 2013-04-15 2014-10-16 Drvision Technologies Llc Teachable object contour mapping for biology image region partition
CN106934426A (en) * 2015-12-29 2017-07-07 三星电子株式会社 The method and apparatus of the neutral net based on picture signal treatment
CN108364267A (en) * 2018-02-13 2018-08-03 北京旷视科技有限公司 Image processing method, device and equipment
CN108876745A (en) * 2018-06-27 2018-11-23 厦门美图之家科技有限公司 Image processing method and device
CN108965723A (en) * 2018-09-30 2018-12-07 易诚高科(大连)科技有限公司 A kind of original image processing method, image processor and image imaging sensor

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7893975B2 (en) * 2006-10-13 2011-02-22 Apple Inc. System and method for processing images using predetermined tone reproduction curves
CN106446782A (en) * 2016-08-29 2017-02-22 北京小米移动软件有限公司 Image identification method and device
CN107391244A (en) * 2017-07-11 2017-11-24 重庆邮电大学 A kind of Internet of Things operating system dispatching method based on mixed scheduling model
CN107943571B (en) * 2017-11-14 2020-03-10 Oppo广东移动通信有限公司 Background application control method and device, storage medium and electronic equipment
CN107820069B (en) * 2017-11-16 2020-10-27 安徽亿联智能有限公司 Video monitoring equipment ISP debugging method
CN108985147A (en) * 2018-05-31 2018-12-11 成都通甲优博科技有限责任公司 Object detection method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321270A (en) * 2008-07-16 2008-12-10 中国人民解放军国防科学技术大学 Monitoring system and method for real-time optimized image
US20140307930A1 (en) * 2013-04-15 2014-10-16 Drvision Technologies Llc Teachable object contour mapping for biology image region partition
CN106934426A (en) * 2015-12-29 2017-07-07 三星电子株式会社 The method and apparatus of the neutral net based on picture signal treatment
CN108364267A (en) * 2018-02-13 2018-08-03 北京旷视科技有限公司 Image processing method, device and equipment
CN108876745A (en) * 2018-06-27 2018-11-23 厦门美图之家科技有限公司 Image processing method and device
CN108965723A (en) * 2018-09-30 2018-12-07 易诚高科(大连)科技有限公司 A kind of original image processing method, image processor and image imaging sensor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726592A (en) * 2020-06-30 2020-09-29 北京市商汤科技开发有限公司 Method and apparatus for obtaining architecture of image signal processor
CN111726592B (en) * 2020-06-30 2022-06-21 北京市商汤科技开发有限公司 Method and apparatus for obtaining architecture of image signal processor

Also Published As

Publication number Publication date
CN111373436A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
WO2020124374A1 (en) Image processing method, terminal device and storage medium
US11151700B2 (en) Image processing method, terminal, and non-transitory computer-readable storage medium
TWI729606B (en) Load balancing device and method for an edge computing network
US11107198B2 (en) Method and apparatus for incorporating noise pattern into image on which bokeh processing has been performed
CN106249508B (en) Atomatic focusing method and system, filming apparatus
US10929961B2 (en) Electronic device and method for correcting images using external electronic device
CN111062876A (en) Method and device for correcting model training and image correction and electronic equipment
WO2020172888A1 (en) Image processing method and device
CN111670575B (en) White balance processing method and device for image
WO2019029573A1 (en) Image blurring method, computer-readable storage medium and computer device
CN105681775A (en) White balance method and device
WO2023155353A1 (en) Depth image acquisition method and apparatus, and depth system, terminal and storage medium
KR20190105380A (en) Electronic device and method for correcting images based on image feature information and image correction scheme
CN114385280A (en) Parameter determination method and electronic equipment
CN110727810A (en) Image processing method, image processing device, electronic equipment and storage medium
US10970587B2 (en) Electronic device for notifying of update of image signal processing and method for operating the same
CN116645282A (en) Data processing method and system based on big data
US20170163852A1 (en) Method and electronic device for dynamically adjusting gamma parameter
CN116506737A (en) Method, device, equipment and storage medium for determining exposure parameters
CN115797267A (en) Image quality evaluation method, system, electronic device, and storage medium
WO2023109374A1 (en) User interface poster picture processing method and apparatus, storage medium, and electronic device
WO2018214900A1 (en) Storage apparatus, mobile terminal and image processing method thereof
WO2022141094A1 (en) Model generation method and apparatus, image processing method and apparatus, and readable storage medium
CN115829827A (en) Face image processing method, device, equipment and medium
CN114663570A (en) Map generation method and device, electronic device and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18944074

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18944074

Country of ref document: EP

Kind code of ref document: A1