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

By combining traditional interpolation algorithms and neural network models, the demosaicing effect in image processing is optimized, solving the problems of high computing performance and poor practicality in the existing technology, and achieving efficient and flexible image processing.

CN112700433BActive Publication Date: 2024-08-23HORIZON JOURNEY (SHANGHAI) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110034345.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-11
Publication Date
2024-08-23
Estimated Expiration
2041-01-11

AI Technical Summary

Technical Problem

In existing demosaicing algorithms, interpolation and neural network methods are used separately, making it difficult to give full play to the advantages of both, resulting in high computing performance and poor practicality.

Method used

Combining the traditional demosaic interpolation algorithm with the neural network model, the interpolation results are optimized by presetting the color components of the channels and optimization parameters, forming parallel operations to improve the image processing effect.

Benefits of technology

It achieves efficient image demosaic processing, increases the flexibility and practicality of the algorithm model, and simplifies the training and computing performance of the neural network model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112700433B
    Figure CN112700433B
Patent Text Reader

Abstract

Disclosed is an image processing method, comprising: determining the color component of each point of a preset channel based on the color component of the preset channel of the native image in the preset color space; determining the color component of each point of the remaining channels other than the preset channel of the native image in the preset color space based on the color components of the remaining channels; determining the optimization parameters of the native image in the preset channel through a first neural network model; determining the optimization data of the preset channel based on the optimization parameters and the color component of each point of the preset channel; determining the optimization parameters of all channels of the native image in the preset color space through a second neural network model; determining the final full-color image based on the optimization parameters of all channels of the preset color space and the color component of each point on all channels in the preset color space. The advantages of the interpolation algorithm and the neural network can be combined to obtain a good image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] There are two main types of existing de-mosaicing algorithms. One is to use interpolation. Through a large amount of mathematical analysis and exploration of correlation principles, it attempts to restore the lost channel information from the perspective of logical analysis and mathematical models. However, considering the diversity and complexity of real-world scenarios, it is difficult to use a single algorithm model to solve all interpolation problems. In addition, the introduction of a large number of mathematical formulas will increase the complexity of algorithm design. Although the interpolation effect can be optimized, the computing performance required will also increase, which is not conducive to the hardware implementation of the algorithm. The other is to implement it through machine learning. This method has different degrees of improvement in computing effect compared to traditional algorithms, but complex neural network models will also consume a lot of computing resources, especially end-to-end model training structures, which often improve performance by continuously increasing the number of neural network layers, affecting the practicality of the algorithm. In the prior art, both methods are used separately, which makes it difficult to give full play to the advantages of both. Summary of the invention

[0003] In order to solve the above technical problems, the present disclosure is proposed. The embodiments of the present disclosure provide an image processing method, device, electronic device and computer-readable storage medium, which can give full play to the advantages of interpolation algorithms and neural networks to obtain good images.

[0004] According to one aspect of the present disclosure, there is provided an image processing method, comprising:

[0005] Determine the color component of each point of a preset channel based on the color component of the preset channel of the native image in the preset color space;

[0006] Based on color components of remaining channels of the native image other than the preset channel in the preset color space, determine a color component of each point of the remaining channels;

[0007] Determining the optimization parameters of the native image in the preset channel through the first neural network model;

[0008] Determining optimization data of the preset channel based on the optimization parameters and the color component of each point of the preset channel;

[0009] Determining optimization parameters of all channels of the native image in the preset color space through a second neural network model;

[0010] A final full-color image is determined based on all channel optimization parameters of the preset color space and the color components of each point on all channels in the preset color space.

[0011] The image processing method disclosed in the present invention includes two aspects. The first aspect is an improved scheme based on the traditional demosaicing interpolation algorithm. The correlation between the preset channel data and other channels is used as a priori theory to interpolate the preset channel data with relatively good effect in the preset color space, and then the data of other channels are interpolated based on this. The second aspect is an optimization link designed based on a neural network. The ultimate goal is to calculate the optimization parameters based on the original image, and obtain the final demosaicing result by cooperating with the channel data obtained by the demosaicing interpolation algorithm.

[0012] Since the two aspects are in a state of parallel operation, closing the optimization link designed based on the neural network will not affect the work of the mosaic interpolation algorithm. However, the final calculation effect will not be optimized. In actual use, you can consider whether to enable the neural network optimization function according to your needs, which increases the flexibility and practicality of the algorithm model.

[0013] According to a second aspect of the present disclosure, there is provided an image processing apparatus, comprising:

[0014] A preset channel interpolation module, used to determine the color component of each point of the preset channel based on the color component of the preset channel of the native image in the preset color space;

[0015] A remaining channel interpolation module, configured to determine a color component of each point of the remaining channels based on color components of the remaining channels of the native image other than the preset channels in the preset color space;

[0016] A first optimization module, used for determining the optimization parameters of the native image in the preset channel through a first neural network model;

[0017] A first output module, configured to determine the optimization data of the preset channel based on the optimization parameter and the color component of each point of the preset channel;

[0018] A second optimization module, used to determine the optimization parameters of all channels of the native image in the preset color space through a second neural network model;

[0019] The second output module is used to determine a final full-color image based on the optimization parameters of all channels in the preset color space and the color components of each point on all channels in the preset color space.

[0020] The image processing device disclosed in the present invention includes two aspects. The first aspect is an improved scheme based on the traditional demosaicing interpolation algorithm. The correlation between the preset channel data and other channels is used as a priori theory to interpolate the preset channel data with relatively good effect in the preset color space, and then the data of other channels are interpolated based on this. The second aspect is an optimization link designed based on a neural network. The ultimate goal is to be able to calculate the optimization parameters based on the original image, and obtain the final demosaicing result by cooperating with the channel data obtained by the demosaicing interpolation algorithm.

[0021] Since the two aspects are in a state of parallel operation, closing the optimization link designed based on the neural network will not affect the work of the mosaic interpolation algorithm. However, the final calculation effect will not be optimized. In actual use, you can consider whether to enable the neural network optimization function according to your needs, which increases the flexibility and practicality of the algorithm model.

[0022] According to a third aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory; the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the processor executes any of the image processing methods described above.

[0023] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute any of the above-mentioned image processing methods.

[0024] The image processing method disclosed in the present invention calculates the color components of each point of each channel of the original image in the preset color space by interpolation, and optimizes the interpolation result through the neural network model on the other hand, so that an accurate full-color image can be obtained. In addition, since the two aspects are in a state of parallel operation, the work of the de-mosaic interpolation algorithm will not be affected when the optimization link designed based on the neural network model is closed, but the effect of the final calculation will not be optimized. In actual use, it can be considered whether to turn on the neural network optimization function according to needs, which increases the flexibility and practicality of the algorithm model. Considering the importance of preset channel data in overall data recovery, the present invention inputs the result of the preset channel obtained by interpolation into the first neural network model, so that it can affect the parameter iteration during the training process of the first neural network model. At the same time, due to the rich amount of information in the preset channel, adding it to the first neural network model is also conducive to simplifying the model and accelerating the convergence of the training model. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

[0026] Figure 1 is a flowchart of an image processing method according to an exemplary embodiment of the present disclosure;

[0027] Figure 2 A flowchart of determining a preset channel color component in an image processing method of an exemplary embodiment of the present disclosure;

[0028] Figure 3 A flowchart of determining a preset channel interpolation direction in an image processing method of an exemplary embodiment of the present disclosure;

[0029] Figure 4 A flowchart of determining the color components of the remaining channels in the image processing method of the exemplary embodiment of the present disclosure;

[0030] Figure 5 A flowchart of interpolation according to an interpolation direction in an image processing method of an exemplary embodiment of the present disclosure;

[0031] Figure 6 A schematic diagram of a sampling area according to an exemplary embodiment of the present disclosure;

[0032] Figure 7 is a specific block diagram of an image processing method of an exemplary embodiment of the present disclosure;

[0033] Figure 8 is a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure;

[0034] Fig. 9 A block diagram of a preset channel interpolation module of an image processing device according to an exemplary embodiment of the present disclosure;

[0035] Fig.10 A component determination submodule block diagram of an image processing device according to an exemplary embodiment of the present disclosure;

[0036] Fig.11 A block diagram of a residual channel interpolation module of an image processing device according to an exemplary embodiment of the present disclosure;

[0037] Fig.12 A block diagram of a residual channel interpolation module of an image processing device according to an exemplary embodiment of the present disclosure;

[0038] Fig.13 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0039] Below, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.

[0040] Application Overview

[0041] For modern digital cameras, in order to facilitate use and reduce costs, image sensors use color filter arrays to obtain color images. Each unit of this type of sensor can only receive data information of one color channel at a time, so in order to obtain the final full-color image, people usually use interpolation to reconstruct the lost data information of other channels, and this process of restoring color is called demosaicing. There are two current demosaicing methods: demosaicing using an interpolation algorithm and demosaicing using a neural network. However, both methods are used separately, and it is difficult to give full play to the advantages of both. The present invention uses a neural network to optimize the parameters of the interpolation algorithm during the demosaicing process of the interpolation algorithm, and finally forms a good full-color image.

[0042] Exemplary Methods

[0043] like Figure 1 As shown, the image processing method in the exemplary embodiment provided by the present disclosure includes:

[0044] Step 100, determining the color component of each point of a preset channel based on the color component of the preset channel of the native image in the preset color space;

[0045] In some embodiments, the native image is an image obtained by an image sensor, in which each unit has data information of a color channel, and the image may be an image instantly obtained by the image sensor; in other embodiments, the image obtained by the image sensor is stored, and when the image needs to be de-mosaiced, the image is obtained from the memory.

[0046] In some embodiments, for example, the preset color space includes three color channels R, G, and B. Since the G channel contains the most information among the three channels, the preset channel is preferably the G channel; when the preset channel is the G channel, the value of the G pixel in the native image is first read and filled into the pixel corresponding to the G channel of the preset color space, and then the interpolation algorithm is used to calculate the values ​​of other pixel points in the G channel of the preset color space, so as to obtain the color component of each point of the G channel of the native image in the preset color space.

[0047] Step 200, based on the color components of the remaining channels of the native image other than the preset channel in the preset color space, determine the color components of each point of the remaining channels;

[0048] In some embodiments, the preset color space includes three color channels of R, G, and B. When the preset channel is the G channel, the remaining channels are the R channel and the B channel. In the process of determining the color component of each point of the R channel and the B channel, in order to avoid introducing new calculation errors by using the reconstructed G channel data, it is preferred to first read the B pixel points and the R pixel points of the native image to the positions corresponding to the B channel and the R channel of the preset space, and then use the original B channel and R channel data to perform a difference, and determine the color component of each point of the R channel and the B channel based on the difference.

[0049] Step 300, determining the optimization parameters of the native image in the preset channel through the first neural network model;

[0050] In some embodiments, the first neural network model is a pre-trained neural network model. After the color component of each point of the preset channel is determined in step 100, the color component of each point of the preset channel and the original image are used as inputs of the first neural network model to obtain the optimized parameters of the preset channel.

[0051] Step 400, determining the optimization data of the preset channel based on the optimization parameters and the color component of each point of the preset channel;

[0052] In some embodiments, since the optimization parameters are obtained in step 300 and the color components of each point of the preset channel are obtained in step 100, the color components of each point of the preset channel are optimized using the optimization parameters obtained in step 300 to obtain the optimized data of the preset channel. For example, when the first neural network model is a residual neural network model, the residual calculated by the first neural network model can be summed with the color components of each point of the preset channel to obtain the optimized data of the preset channel.

[0053] Step 500, determining the optimization parameters of all channels of the native image in the preset color space through a second neural network model;

[0054] In some embodiments, the second neural network model is a pre-trained model, and the optimization data of the preset channel is obtained in step 400. The optimization data of the preset channel and the native image are used as input, and the second neural network model can output the optimization parameters of all channels. For example, taking the second neural network as a residual neural network as an example, taking the optimization data of the preset channel and the native image as input, the second neural network model can calculate the optimization parameters of all channels in the preset color space.

[0055] Step 600: Determine a final full-color image based on the optimization parameters of all channels in the preset color space and the color components of each point on all channels in the preset color space.

[0056] In some embodiments, the color component of each point of the preset channel is obtained in step 100, and the color component of each point in the remaining channels is obtained in step 200, thereby obtaining data of all channels through interpolation; in step 500, the optimization parameters of all channels in the preset color space are obtained; the data of all channels are optimized using the optimization parameters of all channels in the preset space to obtain the final full-color image. Still taking the second neural network model as a residual neural network model as an example, the optimization parameters of all channels calculated by the second neural network model are the residuals of the full-color image, and the residuals of the full-color image are added to the color components of each point of all channels in the preset color space to obtain the final full-color image.

[0057] The image processing method of this exemplary embodiment calculates the color component of each point of each channel of the original image in the preset color space by interpolation, and optimizes the interpolation result through the neural network model on the other hand, so that an accurate full-color image can be obtained. In addition, since the two aspects are in a state of parallel operation, the work of the de-mosaic interpolation algorithm will not be affected when the optimization link designed based on the neural network model is closed, but the effect of the final calculation will not be optimized. In actual use, it can be considered whether to turn on the neural network optimization function according to needs, which increases the flexibility and practicality of the algorithm model. Considering the importance of preset channel data in overall data recovery, this exemplary embodiment inputs the result of the preset channel obtained by interpolation into the first neural network model, so that it can affect the parameter iteration during the training process of the first neural network model. At the same time, due to the rich amount of information in the preset channel, adding it to the first neural network model is also conducive to simplifying the model and accelerating the convergence of the training model.

[0058] exist Figure 1 Based on the embodiment shown, Figure 2 As shown, step 100 may further include the following steps:

[0059] Step 110, extracting the color component of the preset channel of the native image in a preset color space;

[0060] In some embodiments, there are two possibilities for the color component of the preset color channel of the native image in the preset color space, one of which is the color component calculated along the vertical direction, and the other is the color component calculated along the vertical direction. Figure 7As shown in the figure, we first need to calculate the direction vector of the G plane channel to map the g1 plane. The pixel points in the g1 plane correspond to a set of direction vectors (G H , G V ), G H is the value obtained by interpolation along the horizontal direction, G V is the value obtained by interpolation along the vertical direction. Since the method of calculating the G plane data in the original image data is similar to that of the R pixel point and the B pixel point position, the following takes the R pixel point as an example to calculate the direction vector (G H , G V ) calculation process is described, and the processing method of pixel B is similar and will not be repeated here. Figure 6 Take the situation shown as an example, Figure 6 The figure shows a processing area with the R pixel as the center point. What needs to be obtained is the G channel data corresponding to the R5 pixel point, as follows:

[0061] The FIR filter is used to calculate the direction vector of the corresponding point position. The calculation formula is as follows:

[0062]

[0063]

[0064] The direction vector g1(G H , G V ), based on the direction vector, we can get two possible interpolation values ​​of the R5 pixel, namely G H and G V .

[0065] Step 120, determining the color component of the preset channel at each point in the preset color space by direction judgment and weight interpolation.

[0066] In some embodiments, direction judgment is performed to better preserve edge information in the image. For example, when the edge direction is along the vertical direction, interpolation is performed along the vertical direction to better preserve the edge information. When the edge direction is along the horizontal direction, interpolation is performed along the horizontal direction to better preserve the edge information.

[0067] According to the g1 plane calculated in the above step 110, the difference between the g1 plane and the corresponding positions of the R channel and the B channel is calculated to obtain the color difference plane data. According to the color difference plane data, the gradient of the color difference plane data in the horizontal direction and the vertical direction is calculated. When the gradient in the horizontal direction is less than the gradient in the vertical direction, it indicates that the edge is along the horizontal direction. At this time, interpolation should be performed in the horizontal direction, that is, G HDetermine the pixel value at that position; when the gradient in the vertical direction is smaller than the gradient in the horizontal direction, it indicates that the edge is along the vertical direction, that is, G V Determine the pixel value at that location.

[0068] The above interpolation method is used to obtain the color components of each point of the predetermined color channel in the predetermined color space interpolated along the vertical direction and along the horizontal direction, and then the direction of the edge is determined by the gradient information of the color difference plane, and finally the interpolation direction is determined along the edge direction, which can fully retain the edge information in the image and make the image more accurate. Taking the predetermined color space as the RGB color space as an example, when the predetermined color channel is the G channel, for the sampling center point is the R pixel point or the B pixel point, according to the values ​​of the pixel points with the same horizontal coordinate value or the same vertical coordinate value around the sampling center point, the color components of the G channel of the sampling center point when interpolated in the horizontal direction and in the vertical direction are obtained to obtain the g1 plane; and then the color difference plane is determined by the difference between the g1 plane and the R channel and the g1 plane and the B channel. According to the color components of the corresponding position of the relationship between the horizontal gradient and the vertical gradient of the color difference plane, the color components of each point of the G channel can be restored in the preset color space.

[0069] In the above Figure 2 Based on the embodiment shown, Figure 3 The step 120 further includes the following steps:

[0070] Step 121, obtaining color difference plane data based on the color components of a preset channel in the preset space and the color components of the remaining channels of the native image except the preset color channel;

[0071] In some embodiments, the g1 plane can be used to perform a difference with the original R channel and B channel data, where the R channel and B channel are the R channel and B channel data obtained by reading the corresponding R pixel points and B pixel points in the original image. Figure 7 The g1-r0 and g1-b0 shown in the figure can obtain a set of direction vectors based on the difference between the g1 plane and the R channel and B channel data, which is defined as D and expressed as (D H , D V ), each direction vector represents the data of the color difference plane at the corresponding position. The calculation formula of vector D is as follows:

[0072] When the center point is R channel data, then:

[0073] D H (x,y)=R(x,y)-G H (x,y),

[0074] D V (x,y)=R(x,y)-G V(x,y),

[0075] When the center point is the B channel data, then:

[0076] D H (x,y)=B(x,y)-G H (x,y),

[0077] D V (x,y)=B(x,y)-G V (x,y),

[0078] Among them G H With G V is the direction vector obtained when extracting the color component of the G channel. R(x,y) is the pixel value of the R channel at the (x,y) position, B(x,y) is the pixel value of the B channel at the (x,y) position, and G H (x, y) is the value obtained by horizontally interpolating the preset color channel at the position (x, y). V (x, y) is the value obtained by interpolating the preset color channel at the position (x, y) along the vertical direction, D H is R(x,y) or B(x,y) and G H The pixel value difference at (x,y).

[0079] Step 122, based on the color difference plane data, obtaining the gradients of the color difference plane in the horizontal and vertical directions;

[0080] In some embodiments, based on the color difference plane data, the gradients of the color difference plane in the horizontal and vertical directions are calculated, and each pixel position on the color difference plane corresponds to a set of direction vectors representing the gradient, which is defined as T and expressed in the form of (T H , T V ). Among them, T H is the horizontal gradient, T V is the gradient in the vertical direction, and the specific operation expression is:

[0081] T H (x,y)=|D H (x,y)-D H (x,y+2)|+|D H (x,y)-D H (x,y-2)|

[0082] T V (x,y)=|D V (x,y)-D V (x+2,y)|+|D V (x,y)-D V (x-2,y)|

[0083] D H is R(x,y) or B(x,y) and G H The pixel value difference of (x,y), T H (x, y) is the horizontal gradient at the color difference plane (x, y), T V (x,y) is the horizontal gradient at the color difference plane (x,y).

[0084] Step 123, obtaining an interpolation direction of the preset channel in the preset color space based on the gradients in the horizontal and vertical directions;

[0085] In some embodiments, the above-mentioned gradient information in the horizontal and vertical directions represents the edge information in the image. When the gradient in the horizontal direction is smaller than the gradient in the vertical direction, it indicates that the edge is along the horizontal direction. When the gradient in the horizontal direction is larger than the gradient in the vertical direction, it indicates that the edge is along the vertical direction. When the edge is along the horizontal direction, horizontal interpolation can fully retain the edge information. When the edge is along the vertical direction, vertical interpolation can fully retain the edge information. Figure 7 As shown, the obtained (T H , T V ) is used as the criterion for selecting the horizontal and vertical interpolation results of the G channel. The final G channel interpolation result is determined by direction determination. The determination rules are as follows:

[0086]

[0087] In this embodiment, the data selected for interpolation is determined based on the gradients in the horizontal and vertical directions on the color difference plane. When the horizontal gradient is smaller than the vertical gradient, the probability of a horizontal edge existing at the center point is relatively high, and the interpolation of the G channel color component at the center is performed in the horizontal direction; when the horizontal gradient is larger than the vertical gradient, the probability of a vertical edge existing at the center point is relatively high, and the interpolation of the G channel color component at the center is performed in the vertical direction. Interpolation is performed in different directions according to different situations, so that a better interpolation result can be obtained.

[0088] In the above Figure 1 Based on the embodiment shown, Figure 4 As shown, step 200 further includes:

[0089] Step 210, extracting color components of remaining channels of the native image except for the preset color channel in the preset color space;

[0090] In some embodiments, when extracting the color components of the remaining channels, the color components of the remaining channels corresponding to the remaining channels in the original image are extracted. In this step, the RGB color space is still used as an example. Figure 7r1 and b1 in the original image; first read the data of the R pixel and the B pixel in the original image, and fill them to form the values ​​of the corresponding positions in the R channel and the B channel.

[0091] Step 220, determining the interpolation value of the remaining channels other than the preset channels at each point based on the difference of the color components of the remaining channels;

[0092] In some embodiments, in the interpolation calculation process of the remaining channels, in order to avoid introducing the error in the interpolation calculation process of the preset channels into the calculation process of the remaining channels, the data of one of the remaining channels can be interpolated based on the data of another channel. Taking the interpolation process of the R channel in the RGB color space as an example, the interpolation of the R channel in the predetermined color space can be calculated using the data of the B channel, and the calculation formula is as follows:

[0093]

[0094] Among them, R(x,y) is the interpolation value of the R channel at the (x,y) position, and B(x,y) is the pixel value of the B channel at the (x,y) position.

[0095] In some embodiments, after interpolation of the remaining channels is performed in the above manner, the positions corresponding to the pixel positions of the preset channels in the native image are still not interpolated. In order to complete the interpolation of all positions of the remaining channels, the preset channels can be used to interpolate the remaining channels. Taking the interpolation calculation of the R channel in the RGB color space as an example, when the G pixel in the native image is adjacent to the R pixel in the Y direction, the following calculation method can be used for calculation:

[0096]

[0097] Among them, G(x,y) is the pixel value at the (x,y) position in the g2 plane, and R(x,y) is the pixel value at the (x,y) position in the R channel.

[0098] In this exemplary embodiment, the data of one of the remaining channels is interpolated based on the data of another channel, thereby avoiding the introduction of calculation errors of the preset channel in the interpolation process into the remaining channels, thereby ensuring the accuracy of the interpolation of the remaining channels. Taking the interpolation process of the R channel or B channel in the RGB color space as an example, the interpolation information of the R channel or B channel is calculated through the R channel and B channel data, thereby avoiding the introduction of new calculation errors due to the use of reconstructed G channel data, and being able to reconstruct the R channel and B channel data more accurately.

[0099] In the above Figure 4 Based on the embodiment shown, Figure 5 As shown, after step 220, the following further comprises:

[0100] Step 230, determining the interpolation direction of the color components of the remaining channels based on the color components of the preset channel;

[0101] In some embodiments, since it is also necessary to ensure that the edge information in the image is fully preserved during the interpolation process of the remaining channels, in this step, the gradient vector in the aforementioned step 122 can be used to determine the difference direction of the remaining channels.

[0102] Step 240, interpolating the color components of the remaining channels according to the interpolation direction to obtain the color components of the remaining channels at each point in a preset color space;

[0103] In some embodiments, in step 230, there are two interpolation results of calculating another channel through one of the remaining channels, namely, the result of interpolation in the horizontal direction and the result of interpolation in the vertical direction. Taking the interpolation of the R channel in the RGB color space as an example, the interpolation direction is determined according to the method in the above step 221, and the calculation formula in step 220 calculates the interpolation of the R channel or the B channel, thereby determining the color component of each point in the R channel and the B channel. The specific determination formula is as follows:

[0104]

[0105] T V is the gradient of the color difference plane in the horizontal direction, T H is the gradient of the color difference plane in the vertical direction, R(x,y) is the interpolation value of the R channel at the (x,y) position, and B(x,y) is the pixel value of the B channel at the (x,y) position.

[0106] In this embodiment, the gradient information of the color difference plane is used to determine the direction of the edge, and the same interpolation direction is maintained as in the interpolation process in the preset channel, so that the edge information of the image can be fully retained and the accuracy of the image interpolation can be ensured.

[0107] In each of the above exemplary embodiments, as an optional manner: the first neural network model is a residual neural network model;

[0108] Determining the optimization parameters of the native image in the preset channel by the first neural network model includes:

[0109] The color component of each point of the preset channel in the native image and the preset color space is used as the input of the first neural network model, and the standard color component of each point of the preset channel in the preset color space corresponding to the native image is used as the true value of the first neural network model to determine the optimization parameters of the preset channel.

[0110] In some embodiments, Figure 7 As shown, during the training process, appropriate native images are selected as training sets, and the G channel of the final result image is used as Groundtruth to start the first stage of training. The corresponding loss function is as follows:

[0111]

[0112] In the above formula, l1 corresponds to loss_G, Θ1 represents the parameters of the first neural network model, F1 represents the operation of the first neural network model, and x i,raw Represents the native image data in the dataset, h i Represents the color component of the G channel calculated by interpolation, y i,G Represents the G channel data Groundtruth of the corresponding image.

[0113] In the above method, since the difference between the color component of each point of the G channel obtained by interpolation and the Groundtruth of the G channel is much smaller than the difference between the original image data and the Groundtruth of the G channel, the difficulty of training will be relatively low, which is conducive to the convergence of the neural network model.

[0114] In each of the above exemplary embodiments, as an optional manner: the second neural network model is a residual neural network model;

[0115] Determining the optimization parameters of all channels of the native image in the preset color space by the second neural network model includes:

[0116] The optimized data of the preset channel and the data of all channels of the native image in the preset color space are used as inputs of the second neural network model, and the standard data corresponding to all channels of the native image in the preset color space are used as the true value of the second neural network model to determine the optimized parameters of all channels of the preset color space.

[0117] In some embodiments, Figure 7 As shown, the second neural network model uses the optimized G channel optimized data and the original image data as the model input, and uses the final full-color image as the groundtruth for training, with the aim of restoring the R and B channel data. The corresponding Loss function is as follows:

[0118]

[0119] x i,m =F1(x i,raw ; θ1)+h i

[0120] In the above formula, l2 corresponds to Loss_RGB in the overall block diagram, x i,m represents the optimization data of the G channel, Θ2 represents the parameters of the residual neural network in the second stage, and k i Represents the RGB three-channel data obtained by interpolation method, y i Groundtruth representing the full color of the corresponding image.

[0121] For the above implementation, it is obvious that the difference between the three-channel data obtained by interpolation and the Groundtruth is much smaller than the difference between the original image and the Groundtruth, which can accelerate the convergence of the model.

[0122] Exemplary Devices

[0123] like Figure 8 As shown, the present disclosure provides an image processing device in an exemplary embodiment, comprising:

[0124] A preset channel interpolation module 810 determines a color component of each point of a preset channel based on a color component of the preset channel of a native image in a preset color space;

[0125] In some embodiments, the native image is an image obtained by an image sensor, in which each unit has data information of a color channel, and the image may be an image instantly obtained by the image sensor; in other embodiments, the image obtained by the image sensor is stored, and when the image needs to be de-mosaiced, the image is obtained from the memory.

[0126] In some embodiments, for example, the preset color space includes three color channels R, G, and B. Since the G channel contains the most information among the three channels, the preset channel is preferably the G channel; when the preset channel is the G channel, the value of the G pixel in the native image is first read and filled into the pixel corresponding to the G channel of the preset color space, and then the interpolation algorithm is used to calculate the values ​​of other pixel points in the G channel of the preset color space, so as to obtain the color component of each point of the G channel of the native image in the preset color space.

[0127] The remaining channel interpolation module 820 determines the color component of each point of the remaining channels based on the color components of the remaining channels of the native image other than the preset channels in the preset color space;

[0128] In some embodiments, the preset color space includes three color channels of R, G, and B. When the preset channel is the G channel, the remaining channels are the R channel and the B channel. In the process of determining the color component of each point of the R channel and the B channel, in order to avoid introducing new calculation errors by using the reconstructed G channel data, it is preferred to first read the B pixel points and the R pixel points of the native image to the positions corresponding to the B channel and the R channel of the preset space, and then use the original B channel and R channel data to perform a difference, and determine the color component of each point of the R channel and the B channel based on the difference.

[0129] A first optimization module 830 determines the optimization parameters of the native image in the preset channel through a first neural network model;

[0130] In some embodiments, the first neural network model is a pre-trained neural network model. After the color component of each point of the preset channel is determined in the preset channel interpolation module 810, the color component of each point of the preset channel and the original image are used as inputs of the first neural network model to obtain the optimized parameters of the preset channel.

[0131] A first output module 840 determines the optimization data of the preset channel based on the optimization parameters and the color component of each point of the preset channel;

[0132] In some embodiments, since the optimization parameters are obtained in the first optimization module 830, the color component of each point of the preset channel is obtained in the preset channel interpolation module 810, and the color component of each point of the preset channel is optimized using the optimization parameters obtained in the first optimization module 830 to obtain the optimized data of the preset channel. For example, when the first neural network model is a residual neural network model, the residual calculated by the first neural network model can be summed with the color component of each point of the preset channel to obtain the optimized data of the preset channel.

[0133] A second optimization module 850 determines optimization parameters of all channels of the native image in the preset color space through a second neural network model;

[0134] In some embodiments, the second neural network model is a pre-trained model, and the optimization data of the preset channel is obtained in the first output module 840. The optimization data of the preset channel and the native image are used as input, and the second neural network model can output the optimization parameters of all channels. For example, taking the second neural network as a residual neural network as an example, taking the optimization data of the preset channel and the native image as input, the second neural network model can calculate the optimization parameters of all channels in the preset color space.

[0135] The second output module 860 determines a final full-color image based on the optimization parameters of all channels in the preset color space and the color components of each point on all channels in the preset color space.

[0136] In some embodiments, the color component of each point of the preset channel is obtained in the preset channel interpolation module 810, and the color component of each point in the remaining channels is obtained in the remaining channel interpolation module 820, so that the data of all channels are obtained by interpolation; the optimization parameters of all channels in the preset color space are obtained in the second optimization module 850; the data of all channels are optimized using the optimization parameters of all channels in the preset space to obtain the final full-color image. Still taking the second neural network model as a residual neural network model as an example, the optimization parameters of all channels calculated by the second neural network model are the residuals of the full-color image, and the residuals of the full-color image are added to the color components of each point of all channels in the preset color space to obtain the final full-color image.

[0137] The image processing method of this exemplary embodiment calculates the color component of each point of each channel of the original image in the preset color space by interpolation, and optimizes the interpolation result through the neural network model on the other hand, so that an accurate full-color image can be obtained. In addition, since the two aspects are in a state of parallel operation, the work of the de-mosaic interpolation algorithm will not be affected when the optimization link designed based on the neural network model is closed, but the effect of the final calculation will not be optimized. In actual use, it can be considered whether to turn on the neural network optimization function according to needs, which increases the flexibility and practicality of the algorithm model. Considering the importance of preset channel data in overall data recovery, this exemplary embodiment inputs the result of the preset channel obtained by interpolation into the first neural network model, so that it can affect the parameter iteration during the training process of the first neural network model. At the same time, due to the rich amount of information in the preset channel, adding it to the first neural network model is also conducive to simplifying the model and accelerating the convergence of the training model.

[0138] exist Figure 8 Based on the embodiment shown, Fig. 9 As shown, the preset channel interpolation module 810 may further include the following submodules:

[0139] A component extraction submodule 811 extracts the color component of the preset channel of the native image in a preset color space;

[0140] In some embodiments, there are two possibilities for the color component of the preset color channel of the native image in the preset color space, one of which is the color component calculated along the vertical direction, and the other is the color component calculated along the vertical direction. Figure 7As shown in the figure, we first need to calculate the direction vector of the G plane channel to map the g1 plane. The pixel points in the g1 plane correspond to a set of direction vectors (G H , G V ), G H is the value obtained by interpolation along the horizontal direction, G V is the value obtained by interpolation along the vertical direction. Since the method of calculating the G plane data in the original image data is similar to that of the R pixel point and the B pixel point position, the following takes the R pixel point as an example to calculate the direction vector (G H , G V ) calculation process is described, and the processing method of pixel B is similar and will not be repeated here. Figure 6 Take the situation shown as an example, Figure 6 The figure shows a processing area with the R pixel as the center point. What needs to be obtained is the G channel data corresponding to the R5 pixel point, as follows:

[0141] The FIR filter is used to calculate the direction vector of the corresponding point position. The calculation formula is as follows:

[0142]

[0143]

[0144] The direction vector g1(G H , G V ), based on the direction vector, we can get two possible interpolation values ​​of the R5 pixel, namely G H and G V .

[0145] The component determination submodule 812 determines the color component of each point of the preset channel in the preset color space by direction judgment and weight interpolation.

[0146] In some embodiments, direction judgment is performed to better preserve edge information in the image. For example, when the edge direction is along the vertical direction, interpolation is performed along the vertical direction to better preserve the edge information. When the edge direction is along the horizontal direction, interpolation is performed along the horizontal direction to better preserve the edge information.

[0147] According to the g1 plane calculated in the component extraction submodule 811, the difference between the g1 plane and the corresponding positions of the R channel and the B channel is calculated to obtain the color difference plane data. According to the color difference plane data, the gradient of the color difference plane data in the horizontal direction and the vertical direction is calculated. When the gradient in the horizontal direction is less than the gradient in the vertical direction, it indicates that the edge is along the horizontal direction. At this time, interpolation should be performed in the horizontal direction, that is, G HDetermine the pixel value at that position; when the gradient in the vertical direction is smaller than the gradient in the horizontal direction, it indicates that the edge is along the vertical direction, that is, G V Determine the pixel value at that location.

[0148] The above interpolation method is used to obtain the color components of each point of the predetermined color channel in the predetermined color space interpolated along the vertical direction and along the horizontal direction, and then the direction of the edge is determined by the gradient information of the color difference plane, and finally the interpolation direction is determined along the edge direction, which can fully retain the edge information in the image and make the image more accurate. Taking the predetermined color space as the RGB color space as an example, when the predetermined color channel is the G channel, for the sampling center point is the R pixel point or the B pixel point, according to the values ​​of the pixel points with the same horizontal coordinate value or the same vertical coordinate value around the sampling center point, the color components of the G channel of the sampling center point when interpolated in the horizontal direction and in the vertical direction are obtained to obtain the g1 plane; and then the color difference plane is determined by the difference between the g1 plane and the R channel and the g1 plane and the B channel. According to the color components of the corresponding position of the relationship between the horizontal gradient and the vertical gradient of the color difference plane, the color components of each point of the G channel can be restored in the preset color space.

[0149] In the above Fig. 9 Based on the embodiment shown, Fig.10 The component determination submodule 812 further includes the following units:

[0150] The color difference plane determining unit 8121 obtains color difference plane data based on the color components of a preset channel in a preset space and the color components of the remaining channels of the native image except the preset color channel;

[0151] In some embodiments, the g1 plane can be used to perform a difference with the original R channel and B channel data, where the R channel and B channel are the R channel and B channel data obtained by reading the corresponding R pixel points and B pixel points in the original image. Figure 7 The g1-r0 and g1-b0 shown in the figure can obtain a set of direction vectors based on the difference between the g1 plane and the R channel and B channel data, which is defined as D and expressed as (D H , D V ), each direction vector represents the data of the color difference plane at the corresponding position. The calculation formula of vector D is as follows:

[0152] When the center point is R channel data, then:

[0153] D H (x,y)=R(x,y)-G H (x,y),

[0154] D V (x,y)=R(x,y)-GV (x,y),

[0155] When the center point is the B channel data, then:

[0156] D H (x,y)=B(x,y)-G H (x,y),

[0157] D V (x,y)=B(x,y)-G V (x,y),

[0158] Among them G H With G V is the direction vector obtained when extracting the color component of the G channel. R(x,y) is the pixel value of the R channel at the (x,y) position, B(x,y) is the pixel value of the B channel at the (x,y) position, and G H (x, y) is the value obtained by horizontally interpolating the preset color channel at the position (x, y). V (x, y) is the value obtained by interpolating the preset color channel at the position (x, y) along the vertical direction, D H is R(x,y) or B(x,y) and G H The pixel value difference at (x,y).

[0159] A gradient determination unit 8122 obtains the gradients of the color difference plane in the horizontal and vertical directions based on the color difference plane data;

[0160] In some embodiments, based on the color difference plane data, the gradients of the color difference plane in the horizontal and vertical directions are calculated, and each pixel position on the color difference plane corresponds to a set of direction vectors representing the gradient, which is defined as T and expressed in the form of (T H , T V ). Among them, T H is the horizontal gradient, T V is the gradient in the vertical direction, and the specific operation expression is:

[0161] T H (x,y)=|D H (x,y)-D H (x,y+2)|+|D H (x,y)-D H (x,y-2)|

[0162] T V (x,y)=|D V (x,y)-D V (x+2,y)|+|D V (x,y)-D V(x-2,y)|

[0163] D H is R(x,y) or B(x,y) and G H The pixel value difference of (x,y), T H (x, y) is the horizontal gradient at the color difference plane (x, y), T V (x,y) is the horizontal gradient at the color difference plane (x,y).

[0164] An interpolation direction determining unit 8123 obtains an interpolation direction of the preset channel in the preset color space based on the gradients in the horizontal and vertical directions;

[0165] In some embodiments, the above-mentioned gradient information in the horizontal and vertical directions represents the edge information in the image. When the gradient in the horizontal direction is smaller than the gradient in the vertical direction, it indicates that the edge is along the horizontal direction. When the gradient in the horizontal direction is larger than the gradient in the vertical direction, it indicates that the edge is along the vertical direction. When the edge is along the horizontal direction, horizontal interpolation can fully retain the edge information. When the edge is along the vertical direction, vertical interpolation can fully retain the edge information. Figure 7 As shown, the obtained (T H , T V ) is used as the criterion for selecting the horizontal and vertical interpolation results of the G channel. The final G channel interpolation result is determined by direction determination. The determination rules are as follows:

[0166]

[0167] In this embodiment, the data selected for interpolation is determined based on the gradients in the horizontal and vertical directions on the color difference plane. When the horizontal gradient is smaller than the vertical gradient, the probability of a horizontal edge existing at the center point is relatively high, and the interpolation of the G channel color component at the center is performed in the horizontal direction; when the horizontal gradient is larger than the vertical gradient, the probability of a vertical edge existing at the center point is relatively high, and the interpolation of the G channel color component at the center is performed in the vertical direction. Interpolation is performed in different directions according to different situations, so that a better interpolation result can be obtained.

[0168] In the above Figure 8 Based on the embodiment shown, Fig.11 As shown, the remaining channel interpolation module 820 further includes:

[0169] The remaining channel component submodule 821 extracts the color components of the remaining channels of the original image except the preset color channel in the preset color space;

[0170] In some embodiments, when extracting the color components of the remaining channels, the color components of the corresponding remaining channels of the remaining channels in the original image are extracted. In this module 8, the RGB color space is still used as an example. Figure 7 r1 and b1 in the original image; first read the data of the R pixel and the B pixel in the original image, and fill them to form the values ​​of the corresponding positions in the R channel and the B channel.

[0171] The remaining channel interpolation submodule 822 determines the interpolation value of the remaining channels other than the preset channels at each point based on the difference of the color components of the remaining channels;

[0172] In some embodiments, in the interpolation calculation process of the remaining channels, in order to avoid introducing the error in the interpolation calculation process of the preset channels into the calculation process of the remaining channels, the data of one of the remaining channels can be interpolated based on the data of another channel. Taking the interpolation process of the R channel in the RGB color space as an example, the interpolation of the R channel in the predetermined color space can be calculated using the data of the B channel, and the calculation formula is as follows:

[0173]

[0174] Among them, R(x,y) is the interpolation value of the R channel at the (x,y) position, and B(x,y) is the pixel value of the B channel at the (x,y) position.

[0175] In some embodiments, after interpolation of the remaining channels is performed in the above manner, the positions corresponding to the pixel positions of the preset channels in the native image are still not interpolated. In order to complete the interpolation of all positions of the remaining channels, the preset channels can be used to interpolate the remaining channels. Taking the interpolation calculation of the R channel in the RGB color space as an example, when the G pixel in the native image is adjacent to the R pixel in the Y direction, the following calculation method can be used for calculation:

[0176]

[0177] Among them, G(x,y) is the pixel value at the (x,y) position in the g2 plane, and R(x,y) is the pixel value at the (x,y) position in the R channel.

[0178] In this exemplary embodiment, the data of one of the remaining channels is interpolated based on the data of another channel, thereby avoiding the introduction of calculation errors of the preset channel in the interpolation process into the remaining channels, thereby ensuring the accuracy of the interpolation of the remaining channels. Taking the interpolation process of the R channel or B channel in the RGB color space as an example, the interpolation information of the R channel or B channel is calculated through the R channel and B channel data, thereby avoiding the introduction of new calculation errors due to the use of reconstructed G channel data, and being able to reconstruct the R channel and B channel data more accurately.

[0179] In the above Fig.11 Based on the embodiment shown, Fig.12 As shown, the remaining channel interpolation module 820 further includes:

[0180] The remaining channel direction submodule 823 determines the interpolation direction of the color components of the remaining channels based on the color components of the preset channels;

[0181] In some embodiments, since it is also necessary to ensure that the edge information in the image is fully preserved during the interpolation process of the remaining channels, in this module 8, the gradient vector in the aforementioned module 8122 can be used to determine the difference direction of the remaining channels.

[0182] The remaining channel determination submodule 824 interpolates the color components of the remaining channels according to the interpolation direction to obtain the color components of the remaining channels at each point in a preset color space;

[0183] In some embodiments, in module 8221, there are two interpolations of another channel calculated by one of the remaining channels, namely, the result of interpolation in the horizontal direction and the result of interpolation in the vertical direction. Taking the interpolation of the R channel in the RGB color space as an example, the interpolation direction is determined according to the method in the remaining channel direction submodule 823, and the calculation formula in the remaining channel interpolation submodule 822 calculates the interpolation of the R channel or the B channel, thereby determining the color component of each point in the R channel and the B channel. The specific determination formula is as follows:

[0184]

[0185] T V is the gradient of the color difference plane in the horizontal direction, T H is the gradient of the color difference plane in the vertical direction, R(x,y) is the interpolation value of the R channel at the (x,y) position, and B(x,y) is the pixel value of the B channel at the (x,y) position.

[0186] In this embodiment, the gradient information of the color difference plane is used to determine the direction of the edge, and the same interpolation direction is maintained as in the interpolation process in the preset channel, so that the edge information of the image can be fully retained and the accuracy of the image interpolation can be ensured.

[0187] In each of the above exemplary embodiments, as an optional manner: the first neural network model is a residual neural network model;

[0188] Determining the optimization parameters of the native image in the preset channel by the first neural network model includes:

[0189] The color component of each point of the preset channel in the native image and the preset color space is used as the input of the first neural network model, and the standard color component of each point of the preset channel in the preset color space corresponding to the native image is used as the true value of the first neural network model to determine the optimization parameters of the preset channel.

[0190] In some embodiments, Figure 7 As shown, during the training process, appropriate native images are selected as training sets, and the G channel of the final result image is used as Groundtruth to start the first stage of training. The corresponding loss function is as follows:

[0191]

[0192] In the above formula, l1 corresponds to loss_G, Θ1 represents the parameters of the first neural network model, F1 represents the operation of the first neural network model, and x i,raw Represents the native image data in the dataset, h i Represents the color component of the G channel calculated by interpolation, y i,G Represents the G channel data Groundtruth of the corresponding image.

[0193] In the above method, since the difference between the color component of each point of the G channel obtained by interpolation and the Groundtruth of the G channel is much smaller than the difference between the original image data and the Groundtruth of the G channel, the difficulty of training will be relatively low, which is conducive to the convergence of the neural network model.

[0194] In each of the above exemplary embodiments, as an optional manner: the second neural network model is a residual neural network model;

[0195] Determining the optimization parameters of all channels of the native image in the preset color space by the second neural network model includes:

[0196] The optimized data of the preset channel and the data of all channels of the native image in the preset color space are used as inputs of the second neural network model, and the standard data corresponding to all channels of the native image in the preset color space are used as the true value of the second neural network model to determine the optimized parameters of all channels of the preset color space.

[0197] In some embodiments, Figure 7 As shown, the second neural network model uses the optimized G channel optimized data and the original image data as the model input, and uses the final full-color image as the groundtruth for training, with the aim of restoring the R and B channel data. The corresponding Loss function is as follows:

[0198]

[0199] x i,m =F1(x i,raw ; θ1)+h i

[0200] In the above formula, l2 corresponds to Loss_RGB in the overall block diagram, x i,m represents the optimization data of the G channel, Θ2 represents the parameters of the residual neural network in the second stage, and k i Represents the RGB three-channel data obtained by interpolation method, y i Groundtruth representing the full color of the corresponding image.

[0201] For the above implementation, it is obvious that the difference between the three-channel data obtained by interpolation and the Groundtruth is much smaller than the difference between the original image and the Groundtruth, which can accelerate the convergence of the model.

[0202] Exemplary Electronic Devices

[0203] Below, reference Fig.13 The electronic device according to the embodiment of the present disclosure is described. The electronic device may be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the collected input signals from them.

[0204] Fig.13 A block diagram of an electronic device according to an embodiment of the present disclosure is illustrated.

[0205] like Fig.13 As shown, the electronic device 11 includes one or more processors 111 and a memory 112 .

[0206] The processor 111 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 11 to perform desired functions.

[0207] The memory 112 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may run the program instructions to implement the neural network calculation method of each embodiment of the present disclosure described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

[0208] In one example, the electronic device 11 may further include: an input device 113 and an output device 114 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0209] For example, when the electronic device is the first device or the second device, the input device 113 may be the camera mentioned above, and may acquire the actual image. When the electronic device is a stand-alone device, the image stored in the device may be used.

[0210] In addition, the input device 113 may also include, for example, a keyboard, a mouse, and the like.

[0211] The output device 114 can output various information to the outside, including determined distance information, direction information, etc. The output device 114 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0212] Of course, to simplify, Fig. 9 Only some of the components related to the present disclosure in the electronic device 11 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 11 may also include any other appropriate components.

[0213] Exemplary computer program products and computer-readable storage media

[0214] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the neural network computing method according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.

[0215] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0216] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, causes the processor to execute the steps of the neural network computing method according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.

[0217] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0218] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0219] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0220] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0221] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0222] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. An image processing method, comprising: Based on the color component of a preset channel of the native image in the preset color space, determine the color component of each point of the preset channel by interpolation; Based on the color components of the remaining channels of the native image other than the preset channel in the preset color space, determine the color component of each point of the remaining channels by interpolation; Taking the native image and the color component of each point of the preset channel in the preset color space as inputs of the first neural network model, determining the optimization parameters of the native image in the preset channel through the first neural network model; Determining optimization data of the preset channel based on the optimization parameters and the color component of each point of the preset channel; Taking the optimization data of the preset channel and all channel data of the native image in the preset color space as inputs of the second neural network model, the optimization parameters of all channels of the native image in the preset color space are determined through the second neural network model; A final full-color image is determined based on all channel optimization parameters of the preset color space and the color components of each point on all channels in the preset color space.

2. The image processing method according to claim 1, wherein: Determining the color component of each point of a preset channel based on the color component of the preset channel in the preset color space of the native image includes: Extracting the color component of the preset channel of the native image in a preset color space; The color component of the preset channel is determined by direction judgment and weight interpolation to determine the color component of each point of the preset channel in the preset color space.

3. The image processing method according to claim 2, wherein: The step of determining the color component of each point of the preset channel in the preset color space by direction judgment and weight interpolation of the color component of the preset channel comprises: Obtaining color difference plane data based on a color component of a preset channel in a preset space and a color component of a remaining channel of the native image except the preset color channel; Based on the color difference plane data, obtaining the gradients of the color difference plane in the horizontal and vertical directions; Based on the gradients in the horizontal and vertical directions, an interpolation direction of the preset channel in the preset color space is obtained.

4. The image processing method according to claim 1, wherein: Based on the color components of the remaining channels of the native image other than the preset channel in the preset color space, determining the color component of each point of the remaining channels includes: Extracting color components of remaining channels of the native image except for a preset color channel in the preset color space; The interpolation value of the remaining channels other than the preset channel at each point is determined based on the difference of the color components of the remaining channels.

5. The image processing method according to claim 4, wherein: Based on the color components of the remaining channels of the native image other than the preset channel in the preset color space, determining the color component of each point of the remaining channels further comprises: Determining an interpolation direction of the color components of the remaining channels based on the color components of the preset channel; The color components of the remaining channels are interpolated according to the interpolation direction to obtain the color components of the remaining channels at each point in a preset color space.

6. An image processing device, comprising: A preset channel interpolation module, used to determine the color component of each point of a preset channel by interpolation based on the color component of the preset channel of the native image in the preset color space; A remaining channel interpolation module, configured to determine the color component of each point of the remaining channels by interpolation based on the color components of the remaining channels of the native image other than the preset channels in the preset color space; A first optimization module is used to use the native image and the color component of each point of the preset channel in the preset color space as inputs of a first neural network model, and determine the optimization parameters of the native image in the preset channel through the first neural network model; A first output module, configured to determine the optimization data of the preset channel based on the optimization parameter and the color component of each point of the preset channel; A second optimization module is used to use the optimization data of the preset channel and all channel data of the native image in the preset color space as inputs of a second neural network model, and determine the optimization parameters of all channels of the native image in the preset color space through the second neural network model; The second output module is used to determine a final full-color image based on the optimization parameters of all channels in the preset color space and the color components of each point on all channels in the preset color space.

7. An electronic device, comprising a processor and a memory; the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the processor executes the image processing method as claimed in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the image processing method according to any one of claims 1 to 5.