Image processing method, system, device and storage medium

By using the reversible image conversion model to convert the image of the second format to the first format and performing reverse processing, the problem that the device is difficult to directly acquire Raw images is solved, and the training effect and output image quality of the image processing model are improved.

CN114240794BActive Publication Date: 2025-04-04SUZHOU KEDA TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111576172.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2025-04-04
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In the prior art, the original Raw image collected by CMOS sensors is large in size and takes up a lot of storage space, making it difficult to directly acquire on low-configured mobile devices, and the manual acquisition time is high, which limits the use scenarios of image processing algorithms. At the same time, the quality of the target image is crucial to the effect of the image processing algorithm, but in some tasks such as the image white balance algorithm, the target image is difficult to obtain, resulting in poor generalization ability of the image processing model.

Method used

The reversible image conversion model is adopted, the image of the second format is converted into the first format, and reverse processing is performed to obtain an image of the second format used to train the image processing model. This method solves the problem that the device is difficult to directly acquire the first-format image by acquiring the image in the second format and converting and reverse processing using the reversible image conversion model, and improves the training effect of the image processing model.

Benefits of technology

It is realized that in the training stage of the image processing model, it only needs to acquire images in the second format without collecting images in the first format, which improves the processing effect and output image quality of the image processing model, solves the problem that it is difficult for the device to directly acquire Raw images, and improves the generalization ability of the image processing model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114240794B_ABST
    Figure CN114240794B_ABST
Patent Text Reader

Abstract

The present invention provides an image processing method, system, device and storage medium, the method comprising: obtaining a reversible image conversion model, which is used to convert an image between a first format and a second format; collecting a first image in a second format, and obtaining the first image in the first format based on the reversible image conversion model; processing the first image in the first format using an inverse algorithm of a preset image processing algorithm to obtain a second image in the first format, and obtaining the second image in the second format based on the reversible image conversion model; training the image processing model based on the second image in the second format and the first image in the second format; inputting the image to be processed in the second format into the trained image processing model to obtain a processed image in the second format. By adopting the present invention, the second image and the first image in the second format used for training the image processing model can be obtained, and the processing effect of the image processing model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In many image processing algorithms, such as image white balance and image denoising, the unprocessed Raw image is the most important data input part of the image processing algorithm. However, the original Raw images collected by CMOS (Complementary Metal Oxide Semiconductor) sensors are generally large in size and occupy a large storage space. It is difficult for some low-configuration mobile devices to directly obtain the original Raw images, and the time cost of manually collecting Raw images is often huge, which limits the use scenarios of image processing algorithms.

[0003] In addition, in the field of image processing algorithms based on deep learning, supervised learning methods generally have stronger generalization capabilities than unsupervised learning methods or semi-supervised learning methods, and the quality of the target image is crucial to the effect of the image processing algorithm. For some specific tasks, such as image white balance algorithms, the target image is difficult to obtain. Due to the placement of the lens and the depth of field, the captured image has pixel deviations and there is often a certain degree of depth error for occluded objects, and it is impossible to capture matching images with color deviations and corresponding images at normal color temperatures. In general, the above problems can be solved by image alignment, but after alignment using this method, there are still slight errors between the target image and the source image, resulting in blurring of the image after white balance. In addition, the color deviation image can be synthesized by adding color temperature changes to the source RGB image, and then the source RGB image is used as the target image to form an image pair to achieve the training of the image white balance model, but the color deviation image synthesized by this method is quite different from the color deviation image in the real world, resulting in poor generalization of the model. Summary of the invention

[0004] In response to the problems in the prior art, the purpose of the present invention is to provide an image processing method, system, device and storage medium, which can obtain a second image and a first image in a second format for training an image processing model based on a reversible image conversion model, improve the processing effect of the image processing model, and solve the data acquisition problem.

[0005] An embodiment of the present invention provides an image processing method, comprising the following steps:

[0006] Acquire a reversible image conversion model, wherein the reversible image conversion model is used to convert an image between a first format and a second format;

[0007] Acquire the first image in the second format, and acquire the first image in the first format based on the reversible image conversion model;

[0008] Processing the first image in the first format using an inverse algorithm of a preset image processing algorithm to obtain a second image in the first format, and acquiring a second image in the second format based on the reversible image conversion model;

[0009] training the image processing model based on a second image in the second format and a first image in the second format;

[0010] The image to be processed in the second format is input into the trained image processing model to obtain a processed image in the second format.

[0011] The present invention provides an image processing method, firstly obtaining a reversible image conversion model, then obtaining a first image in a first format based on the reversible image conversion model obtained in the previous step from a first image in a second format, and then performing inverse processing on the first image in the first format to obtain a second image in a second format, thereby, the collected first image in the second format and the obtained second image in the second format can be used for training the image processing model, which is conducive to improving the effect of the image processing model training, so that the image processing model can obtain better image processing results, and then the trained image processing model is used to process the image to be processed in the second format, that is, to obtain a processed image in the second format, thereby improving the output image effect of the image processing model. At the same time, by adopting this method, it is only necessary to collect the first image in the second format in the training stage of the image processing model, without collecting the first image in the first format, which solves the problem that some devices are difficult to directly collect the first image in the first format that accurately corresponds.

[0012] In some embodiments, the forward process of the reversible image conversion model converts the image from a first format to a second format, and the reverse process converts the image from the second format to the first format;

[0013] Acquiring a first image in a first format based on the reversible image conversion model includes: inputting the first image in the second format into a reverse process of the reversible image conversion model to obtain the first image in the first format output by the reverse process;

[0014] Acquiring a second image in a second format based on the reversible image conversion model includes: inputting the second image in the first format into a forward process of the reversible image conversion model to obtain a second image in a second format output by the forward process.

[0015] In some embodiments, obtaining a reversible image transformation model comprises the following steps:

[0016] Construct a reversible image transformation model;

[0017] A third image in the first format and a third image in the second format are collected as an input image and a target image of a forward process of a reversible image conversion model, respectively, to train the reversible image conversion model.

[0018] In some embodiments, after training the reversible image conversion model, the following steps are further included:

[0019] Acquire a fourth image in a first format and a fifth image in a second format, wherein the fifth image in the second format is an image obtained by processing the fourth image in the second format using an inverse algorithm of a preset image processing algorithm;

[0020] Processing the fourth image in the first format by using an inverse algorithm of a preset image processing algorithm to obtain a fifth image in the first format;

[0021] The fifth image in the first format and the fifth image in the second format are used as an input image and a target image of a forward process of the reversible image conversion model, respectively, and the reversible image conversion model is trained again.

[0022] In some embodiments, constructing a reversible image conversion model includes: constructing a reversible submodule, and sequentially connecting a plurality of the reversible submodules in series to form a reversible image conversion model.

[0023] In some embodiments, training the image processing model based on the second image in the second format and the first image in the second format comprises the following steps:

[0024] Build image processing models;

[0025] The second image in the second format and the first image in the second format are used as an input image and a target image of an image processing model respectively to train the image processing model.

[0026] In some embodiments, the first format is a raw format, and the second format is an RGB format;

[0027] The preset image processing algorithm includes at least one of an image white balance algorithm, an image denoising algorithm, an image enhancement algorithm and an image deblurring algorithm.

[0028] The embodiment of the present invention further provides an image processing system, which is applied to the image processing method, and the system includes:

[0029] A first model acquisition module, used for acquiring a reversible image conversion model, wherein the reversible image conversion model is used for converting an image between a first format and a second format;

[0030] A first image processing module is used to collect a first image in a second format, and obtain the first image in the first format based on the reversible image conversion model; and process the first image in the first format using an inverse algorithm of a preset image processing algorithm to obtain a second image in the first format, and obtain the second image in the second format based on the reversible image conversion model;

[0031] A second model acquisition module, used for training the image processing model based on the second image in the second format and the first image in the second format;

[0032] The second image processing module is used to input the image to be processed in the second format into the trained image processing model to obtain the processed image in the second format.

[0033] An embodiment of the present invention further provides an image processing device, comprising:

[0034] processor;

[0035] a memory storing executable instructions of the processor;

[0036] The processor is configured to perform the steps of the image processing method by executing the executable instructions.

[0037] By adopting the image processing device provided by the present invention, the processor executes the image processing method when executing the executable instructions, thereby obtaining the beneficial effects of the above-mentioned image processing method.

[0038] An embodiment of the present invention further provides a computer-readable storage medium for storing a program, wherein the program implements the steps of the image processing method when executed by a processor.

[0039] By adopting the computer-readable storage medium provided by the present invention, the program stored therein implements the steps of the image processing method when being executed, thereby obtaining the beneficial effects of the above-mentioned image processing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following accompanying drawings.

[0041] Figure 1 is a flow chart of an image processing method according to an embodiment of the present invention;

[0042] Figure 2 is a schematic diagram of the network composition of a reversible submodule according to an embodiment of the present invention;

[0043] Figure 3is a schematic diagram of the network composition of a reversible image conversion module according to an embodiment of the present invention, wherein a forward process is shown;

[0044] Figure 4 is a schematic diagram of a network composition of a reversible image conversion module according to an embodiment of the present invention, wherein a reverse process is shown;

[0045] Figure 5 is a flowchart of image data preprocessing according to an embodiment of the present invention;

[0046] Figure 6 is a schematic diagram of the network composition of an image processing module according to an embodiment of the present invention;

[0047] Figure 7 is a schematic diagram of the network composition of a residual block in an image processing module according to an embodiment of the present invention;

[0048] Figure 8 is a schematic diagram of an image processing system according to an embodiment of the present invention;

[0049] Fig. 9 is a schematic structural diagram of an image processing device according to an embodiment of the present invention;

[0050] Fig.10 It is a schematic diagram of the structure of a computer storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar structures, and thus their repeated description will be omitted.

[0052] like Figure 1 As shown, in one embodiment, the present invention provides an image processing method, comprising the following steps:

[0053] S100: Acquire a reversible image conversion model, where the reversible image conversion model is used to convert an image between a first format and a second format;

[0054] S200: Acquire a first image in a second format, and acquire a first image in a first format based on the reversible image conversion model;

[0055] S300: Processing the first image in the first format by using an inverse algorithm of a preset image processing algorithm to obtain a second image in the first format, and acquiring a second image in the second format based on the reversible image conversion model;

[0056] S400: Training the image processing model based on the second image in the second format and the first image in the second format;

[0057] S500: Inputting the image to be processed in the second format into the trained image processing model to obtain a processed image in the second format.

[0058] The present invention provides an image processing method. First, a reversible image conversion model is obtained through step S100. Through step S200, a first image in a second format can be obtained based on the reversible image conversion model obtained in step S100 to obtain a first image in a first format. Then, through step S300, the first image in the first format can be reversely processed to obtain a second image in a second format. Thus, the first image in the second format acquired in step S200 and the second image in the second format acquired in step S300 can be used for training the image processing model in step S400, which is beneficial to improving the effect of the image processing model training, so that the image processing model can obtain better image processing results. Then, through step S500, the trained image processing model can be used to process the image to be processed in the second format to obtain a processed image in the second format, thereby improving the output image effect of the image processing model. In addition, in the training stage of the image processing model, it is only necessary to acquire the first image in the second format instead of the first image in the first format, thereby solving the problem that some devices are difficult to directly acquire the first image in the first format that accurately corresponds to the first image.

[0059] In the present invention, the image can be in the first format or the second format, that is, the image can be stored in the first format data or in the second format data. In the present invention, the image data stored in the first format is collectively referred to as the image in the first format, and the image data stored in the second format is collectively referred to as the image in the second format.

[0060] In this embodiment, the reversible image conversion model obtained in step S100 includes a forward process and a reverse process. The forward process of the reversible image conversion model converts an image from a first format to a second format, and the reverse process converts an image from a second format to a first format. The first format may be, for example, a raw format, and the second format may be, for example, an RGB format. The following specifically describes the implementation of each step of this embodiment by taking the first format as a raw format and the second format as an RGB format as an example, but the present invention is not limited thereto.

[0061] In this embodiment, the preset image processing algorithm includes at least one of an image white balance algorithm, an image denoising algorithm, an image enhancement algorithm, and an image deblurring algorithm. For example, when the preset image processing algorithm is an image white balance algorithm, the image processing model is a white balance processing model, and the inverse algorithm of the preset image processing algorithm is an algorithm for adding color cast. When the preset image processing algorithm is an image denoising algorithm, the image processing model is an image denoising processing model, and the inverse algorithm of the preset image processing algorithm is an algorithm for adding noise. When the preset image processing algorithm is an image deblurring algorithm, the image processing model is an image deblurring model, and the inverse algorithm of the preset image processing algorithm is a blurring algorithm. The following description takes the preset image processing algorithm as an image white balance algorithm as an example, but the present invention is not limited to this.

[0062] In this embodiment, the step S100: obtaining a reversible image transformation model includes the following steps:

[0063] Construct a reversible image conversion model. The reversible image conversion model can adopt the structure of a reversible flow model, which includes at least one reversible submodule W110. The structure of the reversible submodule is as follows: Figure 2 As shown, it includes a 1x1 convolution layer, and then connects the separation layer 1 and the separation layer 2 in parallel. The separation layer 2 passes through the coupling layer 1 and then inputs the addition layer 1. The output of the separation layer 1 is connected to the input of the addition layer 1. The output of the addition layer 1 passes through the separation layer 3 and then connects the input of the coupling layer 2 and the input of the coupling layer 3 respectively. The output of the coupling layer 2 passes through the point product layer 1 and the addition layer 2 in turn and inputs the separation layer 4. The output of the coupling layer 3 is input into the addition layer 2. The outputs of the coupling layer 3 and the separation layer 4 are superimposed as the output of the reversible submodule. Figure 2 The structure of the reversible submodule shown in is only an example, and other neural network modules that can achieve reversibility can also be applied to the reversible image conversion model of the present invention;

[0064] Since the characterization capability of a single reversible submodule is limited, e.g. Figure 3 and Figure 4 As shown, the reversible image conversion model W100 optionally includes a plurality of reversible submodules W110, and the plurality of reversible submodules W110 are connected in series. By connecting the reversible submodules W110 in series, the representation ability of the network can be increased. Since a single reversible submodule W110 is reversible, the entire image conversion model W100 is also reversible. Therefore, the forward process of image processing (such as Figure 3 as shown) and the reverse process (as shown Figure 4 As shown); the number of reversible submodules N is arbitrary and can be adjusted according to the running time and the complexity of the network. Generally speaking, the more reversible submodules there are, the longer the running time is, the greater the complexity of the network is, and the more complex the images that can be processed are;

[0065] Acquire a third image in the first format and a third image in the second format, respectively as an input image and a target image of a forward process of a reversible image conversion model, and train the reversible image conversion model;

[0066] When capturing a third image in a first format and a third image in a second format, for example, raw images with different illuminations, different scenes, and different exposure times captured by mobile terminals such as different cameras and corresponding RGB images can be paired and used as input images and target images of a forward process of a reversible image conversion model, wherein the raw images directly captured by the camera are used as input images of the forward process of the reversible image conversion model, and the RGB images directly captured by the camera are used as target images of a reverse process of the reversible image conversion model, thereby realizing training of the forward process of the reversible image conversion model. Since the image conversion model is reversible, as long as the forward process is trained, its reverse process can also be applied to reverse format conversion of the image.

[0067] In this embodiment, the third image is directly acquired by a camera. The black level and effective number of bits of the raw images obtained by different CMOS sensors are different. The training of the model can be stabilized and the robustness of the model can be improved by preprocessing the data. In general, the output of the image processing algorithm is 8 bits, with a numerical range between 0-255, while the CMOS sensor data is generally 12 bits or 16 bits, with a numerical range between 0-4095 or 0-65535. Directly using the original raw image for training will increase the difficulty of structural tuning of the reversible image conversion model, because the mapping range from the original 12 bits or 16 bits to 8 bits is large, and the training of the reversible image conversion model is very easy to fall into local optimum or non-convergence. By performing relevant preprocessing operations on the raw image, normalized data is obtained, and its numerical range is between 0-1. The numerical range of the network output is also fixed between 0-1, and then converted to 255 by multiplying the coefficients, which can reduce the difficulty of training and make the reversible image conversion model easier to converge.

[0068] Therefore, in the step S100, after acquiring the third image in the first format and the third image in the second format, before training the reversible image conversion model, a process of performing data preprocessing on the third image in the first format may also be included. Figure 5 The figure exemplarily shows the preprocessing process of the third image in raw format, including: horizontal or vertical flipping to achieve data augmentation, Bayer format unification, splitting the raw image into multiple channels (Pack Raw), random cropping of the image, and normalization processing, which is beneficial to improve the robustness of the reversible image conversion model trained subsequently.

[0069] In this embodiment, in step S100, the low-light loss function used to train the reversible image conversion model consists of three parts: a pixel loss function, a high-level semantic loss function, and an image quality loss function, and the expression is as follows:

[0070]

[0071] Among them, α1, α2 and α3 are the weights of the pixel loss function, high-level semantic loss function and image quality loss function respectively; y represents the output pixel value of the forward process of the reversible image conversion model; represents the pixel value of the third image in the second format corresponding to the third image in the first format input; L pixel Represents the pixel loss function, which constrains the image at the pixel level; L vgg Represents a high-level semantic loss function, which constrains the image in terms of color and details; L ssim The loss function representing the image quality constrains the overall quality of the image, making the image style more in line with the sensory perception of the human eye.

[0072] L pixel The expression is as follows:

[0073]

[0074] L vgg The expression is as follows:

[0075]

[0076] in, It represents the feature vector extracted by the network, which is generally the feature vector extracted by the network structure of VGG16. Through the constraints of high-level semantic loss functions, a more realistic output image can be obtained, retaining details and color texture.

[0077] L ssim The expression is as follows:

[0078]

[0079] Among them, C1 and C2 are preset coefficients; u y is the output grayscale average of the flow model network; is the grayscale average of the RGB image corresponding to the input Raw image; σ y is the output grayscale standard deviation value of the flow model network; It is the grayscale standard deviation value of the RGB image corresponding to the input Raw image.

[0080] In this embodiment, in step S100, the third image collected is an image without color cast, that is, an image of normal color temperature. After the reversible image conversion model is trained using a raw image of normal color temperature (the third image of the first format) and an RGB image of normal color temperature (the third image of the second format), the reversible image conversion model can be further optimized and trained based on the raw image with color cast and the RGB image with color cast. That is, in step S100, after the reversible image conversion model is trained, the following steps are further included:

[0081] Acquire a fourth image in a first format and a fifth image in a second format, wherein the fifth image in the second format is an image obtained by processing the fourth image in the second format using an inverse algorithm of a preset image processing algorithm;

[0082] The collected images may no longer be collected directly through a camera or other equipment, but may be collected from some public data sets. For example, a raw image with normal color temperature (the fourth image in the first format) and an RGB image with color deviation (the fifth image in the second format) are obtained from the Gehler data set. The RGB image with color deviation is an image obtained by adjusting the hue of the raw image with normal color temperature (i.e., the inverse algorithm of the preset image processing algorithm). The data of the RGB image with color deviation includes pixel values ​​in the RGB image and hue adjustment parameters of each channel corresponding to the color deviation.

[0083] Processing the fourth image in the first format by using an inverse algorithm of a preset image processing algorithm to obtain a fifth image in the first format;

[0084] For example, a raw image with normal color temperature is subjected to color temperature corresponding to the color adjustment parameter of the fifth image in the second format, and the color tone is adjusted according to the color temperature curve to obtain a raw image with color deviation (the fifth image in the first format);

[0085] using the fifth image in the first format and the fifth image in the second format as an input image and a target image of a forward process of the reversible image conversion model, respectively, and training the reversible image conversion model again;

[0086] For example, a raw image with color deviation and an RGB image with color deviation are used as the input image and the target image of the forward process of the reversible image conversion model, respectively, and the reversible image conversion model is trained again, so that the forward process from the raw image with color deviation to the RGB image with color deviation is realized, and the reversible image conversion model can generate a more realistic RGB image. In the process of re-optimizing the training of the reversible image conversion model, the loss function used can also include the loss function of the above-mentioned pixel loss function, the high-level semantic loss function and the image quality loss function, and the calculation formula of the above-mentioned corresponding loss function can be used for calculation.

[0087] In the step S200, the first image in the second format is collected, and the first image in the first format is obtained based on the reversible image conversion model, including: inputting the first image in the second format into the reverse process of the reversible image conversion model to obtain the first image in the first format output by the reverse process.

[0088] For example, a large number of high-quality RGB images at normal color temperature (first images in the second format) are collected and input into the reverse process of the reversible image conversion model to generate corresponding raw images at normal color temperature (first images in the first format). Through this step, a large number of raw images at normal color temperature can be obtained. Then, through step S300, the hue of these raw images at normal color temperature is adjusted based on the color temperature curve (the reverse algorithm of the preset image processing algorithm) to obtain a raw image with color deviation, that is, the second image in the first format.

[0089] In the step S300, acquiring the second image in the second format based on the reversible image conversion model includes: inputting the second image in the first format into the forward process of the reversible image conversion model to obtain the second image in the second format output by the forward process.

[0090] For example, a raw image with color bias after hue adjustment based on a color temperature curve is input into the forward process of a reversible image conversion model, and a large number of RGB images with color bias are outputted through the forward process, that is, second images in a second format.

[0091] In this embodiment, the step S400: training the image processing model based on the second image in the second format and the first image in the second format comprises the following steps:

[0092] Build image processing models;

[0093] In this embodiment, the image processing model may adopt a structure of a deep autoencoder, for example, and the autoencoder may adopt a structure of Figure 6The network structure of UResnet shown in FIG. 1 includes the following serial layers: convolution layer 1, pooling layer 1, convolution layer 2, pooling layer 2, residual block, upsampling layer 1, convolution layer 3, upsampling layer 2 and convolution layer 4. The input is an RGB image with color deviation, represented as rRGB, and the output is an RGB image after white balance processing. The residual block can be, for example, Figure 7 The structure shown includes a convolutional layer 11, a channel merging module and a convolutional layer 12 connected in series in sequence;

[0094] using the second image in the second format and the first image in the second format as an input image and a target image of an image processing model, respectively, to train the image processing model;

[0095] For example, the color-biased RGB image (the second image in the second format) obtained in step S400 is used as the input image of the image processing model, and the RGB image with normal color temperature (the first image in the second format) acquired in step S200 is used as the input image of the deep autoencoder, and the autoencoder is trained until the autoencoder converges, thus completing the training of the image processing model.

[0096] Therefore, the training of the image processing model of this embodiment implements a supervised learning method, which can effectively improve the processing effect of the image white balance algorithm, and provides an end-to-end reversible image conversion model. The reversibility of the reversible image conversion model realizes the mutual conversion between RGB images and raw images, which can effectively solve the problem of difficulty in acquiring and storing raw images. By performing the inverse algorithm processing of the image processing algorithm on the raw image, and then passing it through the reversible image conversion model, an RGB image as the training input of the image processing model can be obtained, which is almost the same as the image that needs to be processed in the real world, thus solving the problem of image acquisition. In the training process of the reversible image conversion model, only its forward process needs to be trained. After the forward process training is completed, the reverse process of the reversible image conversion model can be directly used to realize the conversion from RGB image to raw image.

[0097] In this embodiment, in step S500, the image to be processed in the second format is input into the trained image processing model to obtain a processed image in the second format, which may include, for example: inputting the RGB image to be processed into a trained deep autoencoder, where the RGB image to be processed is an RGB image with color bias, and obtaining the RGB image after white balance processing output by the autoencoder.

[0098] like Figure 8 As shown, an embodiment of the present invention further provides an image processing system, which is applied to the image processing method, and the system includes:

[0099] A first model acquisition module M100, used to acquire a reversible image conversion model, wherein the reversible image conversion model is used to convert an image between a first format and a second format;

[0100] The first image processing module M200 is used to collect a first image in a second format, and obtain the first image in the first format based on the reversible image conversion model; and process the first image in the first format using an inverse algorithm of a preset image processing algorithm to obtain a second image in the first format, and obtain the second image in the second format based on the reversible image conversion model;

[0101] A second model acquisition module M300, configured to train the image processing model based on the second image in the second format and the first image in the second format;

[0102] The second image processing module M400 is used to input the image to be processed in the second format into the trained image processing model to obtain a processed image in the second format.

[0103] The present invention provides an image processing system. First, a reversible image conversion model is acquired through a first model acquisition module M100. Through the first image processing module M200, a first image in a second format can be obtained based on the reversible image conversion model acquired by the first model acquisition module M100 to obtain a first image in a first format. Then, through the first image processing module M200, the first image in the first format can be reversely processed to obtain a second image in a second format. Thus, the first image in the second format acquired by the first image processing module M200 and the second image in the second format acquired can be used for training an image processing model in a second model acquisition module M300, which is beneficial to improving the effect of image processing model training, so that the image processing model can obtain better image processing results. Then, the second image processing module M400 can use the trained image processing model to process the image to be processed in the second format to obtain a processed image in the second format, thereby improving the output image effect of the image processing model. In addition, in the training stage of the image processing model, it is only necessary to acquire the first image in the second format instead of the first image in the first format, thereby solving the problem that some devices are difficult to directly acquire the first image in the first format that accurately corresponds to the first image.

[0104] In the image processing system of the present invention, the function of each module can be implemented by adopting the specific implementation methods of each step of the above-mentioned image processing method. For example, the first model acquisition module M100 can adopt the specific implementation method of step S100 to construct and train a reversible image conversion model, the first image processing module M200 can adopt the specific implementation methods of the above-mentioned steps S200 and S300 to acquire a second image in a second format based on the reversible image conversion model, the second model acquisition module M300 can adopt the specific implementation method of step S400 to train an image processing model, and the second image processing module M400 can perform image processing on the image to be processed in the second format based on the trained image processing model to obtain a processed image in the second format.

[0105] An embodiment of the present invention further provides an image processing device, comprising a processor; and a memory in which executable instructions of the processor are stored; wherein the processor is configured to perform the steps of the image processing method by executing the executable instructions.

[0106] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0107] Refer to the following Fig. 9 The electronic device 600 according to this embodiment of the present invention is described. Fig. 9 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0108] like Fig. 9 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0109] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present invention described in the electronic prescription circulation processing method section of this specification. For example, the processing unit 610 can execute the following steps: Figure 1 Follow the steps shown in .

[0110] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0111] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0112] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0113] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0114] By adopting the image processing device provided by the present invention, the processor executes the image processing method when executing the executable instructions, thereby obtaining the beneficial effects of the above-mentioned image processing method.

[0115] The embodiment of the present invention also provides a computer-readable storage medium for storing a program, which implements the steps of the image processing method when executed by a processor. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above-mentioned electronic prescription circulation processing method section of this specification.

[0116] refer to Fig.10 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0117] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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.

[0118] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0119] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, 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 cluster. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0120] By adopting the computer-readable storage medium provided by the present invention, the program stored therein implements the steps of the image processing method when being executed, thereby obtaining the beneficial effects of the above-mentioned image processing method.

[0121] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.

Claims

1. An image processing method, characterized in that: The steps include: Acquire a reversible image conversion model, wherein the reversible image conversion model is used to convert an image between a first format and a second format; Acquire the first image in the second format, and acquire the first image in the first format based on the reversible image conversion model; The first image in the first format is processed by an inverse algorithm of a preset image processing algorithm to obtain a second image in the first format, and a second image in the second format is acquired based on the reversible image conversion model, wherein the preset image processing algorithm includes at least one of an image white balance algorithm, an image denoising algorithm, an image enhancement algorithm, and an image deblurring algorithm; and the inverse algorithm of the preset image processing algorithm includes at least one of an algorithm for adding color cast, an algorithm for adding noise, an inverse algorithm for image enhancement, and a blurring algorithm; training an image processing model based on a second image in the second format and a first image in the second format; The image to be processed in the second format is input into the trained image processing model to obtain a processed image in the second format.

2. The image processing method according to claim 1, characterized in that: The forward process of the reversible image conversion model converts the image from a first format to a second format, and the reverse process converts the image from the second format to the first format; Acquiring a first image in a first format based on the reversible image conversion model includes: inputting the first image in the second format into a reverse process of the reversible image conversion model to obtain the first image in the first format output by the reverse process; Acquiring a second image in a second format based on the reversible image conversion model includes: inputting the second image in the first format into a forward process of the reversible image conversion model to obtain a second image in a second format output by the forward process.

3. The image processing method according to claim 2, characterized in that: The step of obtaining a reversible image transformation model comprises the following steps: Construct a reversible image transformation model; A third image in the first format and a third image in the second format are collected as an input image and a target image of a forward process of a reversible image conversion model, respectively, to train the reversible image conversion model.

4. The image processing method according to claim 3, characterized in that: After training the reversible image conversion model, the following steps are also included: Acquire a fourth image in a first format and a fifth image in a second format, wherein the fifth image in the second format is an image obtained by processing the fourth image in the second format using an inverse algorithm of a preset image processing algorithm; Processing the fourth image in the first format by using an inverse algorithm of a preset image processing algorithm to obtain a fifth image in the first format; The fifth image in the first format and the fifth image in the second format are used as an input image and a target image of a forward process of the reversible image conversion model, respectively, and the reversible image conversion model is trained again.

5. The image processing method according to claim 3, characterized in that: The constructing of a reversible image conversion model includes: constructing a reversible submodule, and connecting a plurality of the reversible submodules in series in sequence to form a reversible image conversion model.

6. The image processing method according to claim 1, characterized in that: Training the image processing model based on the second image in the second format and the first image in the second format comprises the following steps: Build image processing models; The second image in the second format and the first image in the second format are used as an input image and a target image of an image processing model respectively to train the image processing model.

7. The image processing method according to claim 1, characterized in that: The first format is a raw format, and the second format is an RGB format.

8. An image processing system, characterized in that: The image processing method according to any one of claims 1 to 7, wherein the system comprises: A first model acquisition module, used to acquire a reversible image conversion model, wherein the reversible image conversion model is used to convert an image between a first format and a second format; A first image processing module is used to collect a first image in a second format, and obtain the first image in the first format based on the reversible image conversion model; and process the first image in the first format using an inverse algorithm of a preset image processing algorithm to obtain a second image in the first format, and obtain the second image in the second format based on the reversible image conversion model; A second model acquisition module, used for training the image processing model based on the second image in the second format and the first image in the second format; The second image processing module is used to input the image to be processed in the second format into the trained image processing model to obtain the processed image in the second format.

9. An image processing device, characterized in that: include: processor; a memory storing executable instructions of the processor; The processor is configured to perform the steps of the image processing method according to any one of claims 1 to 7 by executing the executable instructions.

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

Citation Information

Patent Citations

  • Image conversion method and device, computer equipment and storage medium

    CN108564127A

  • Model training and image processing method and device, medium and electronic equipment

    CN110163237A