An image enhancement method with adjustable output image parameters

The transformation matrix of the image is updated through the neural network model to generate enhanced images with high VMAF or PSNR that meet user needs, solving the problem of image quality in the existing technology that cannot meet user needs, and improving the accuracy and speed of image enhancement processing. .

CN117408926BActive Publication Date: 2024-09-20沐曦科技(成都)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311458818.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2024-09-20
Estimated Expiration
2043-11-02

AI Technical Summary

Technical Problem

It is difficult with the existing technology to obtain enhanced images with relatively high video/image quality evaluation indicators VMAF or PSNR according to user needs, and the quality of the enhanced images cannot meet user needs.

Method used

A neural network model including the first sub-model, the second sub-model and the third sub-model is used to update the transformation matrix of the image through the parameter adjustment requirement information input by the user to generate an enhanced image that meets the user's needs. The third sub-model uses Convolution operations and summation operations generate the final enhanced image.

Benefits of technology

It achieves the acquisition of enhanced images with relatively high VMAF or PSNR according to user needs, improves the accuracy and speed of image enhancement processing, simplifies the neural network structure, and reduces training difficulty and computing resource requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117408926B
    Figure CN117408926B
Patent Text Reader

Abstract

The present application relates to the field of image data processing technology, and in particular to an image enhancement method with adjustable output image parameters. The method comprises: obtaining an image S to be enhanced; obtaining parameter adjustment requirement information input by a user; inputting S and the parameter adjustment requirement information input by the user into a trained first neural network model to obtain an enhanced image S' corresponding to S; the first neural network model comprises a first sub-model, a second sub-model and a third sub-model, the first sub-model being used to obtain a transformation matrix of the input image; the second sub-model being used to update the transformation matrix of the input image according to the parameter adjustment requirement information input by the user to obtain an updated transformation matrix of the input image; the third sub-model being used to obtain an enhanced image corresponding to the input image according to the updated transformation matrix of the input image. The present invention can meet the needs of users for obtaining enhanced images with relatively high VMAF or relatively high PSNR.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image data processing, and in particular to an image enhancement method with adjustable output image parameters. Background Art

[0002] A variety of image enhancement algorithms are disclosed in the prior art. For example, the contrast-constrained adaptive histogram equalization (CLAHE) algorithm is a relatively effective image enhancement algorithm. Video quality multi-method assessment fusion (VMAF) and peak signal-to-noise ratio (PSNR) are two common parameters for evaluating video / image quality. In different application scenarios, users want to obtain enhanced images with relatively high VMAF or relatively high PSNR. However, the VMAF and PSNR of the enhanced image obtained after image enhancement processing using a certain image enhancement algorithm in the prior art are fixed, and it is easy for the VMAF or PSNR of the enhanced image to fail to meet user needs. How to obtain an enhanced image with relatively high VMAF or relatively high PSNR according to user needs is a technical problem that needs to be solved urgently. Summary of the invention

[0003] The present invention aims to provide an image enhancement method with adjustable output image parameters, so as to obtain an enhanced image with a relatively high VMAF or a relatively high PSNR according to user needs.

[0004] According to the present invention, there is provided an image enhancement method with adjustable output image parameters, comprising the following steps:

[0005] S1000, obtaining an image S to be enhanced.

[0006] S2000: Acquire parameter adjustment requirement information input by a user, where the parameter adjustment requirement information is information indicating increasing VMAF or PSNR.

[0007] S3000, input S and parameter adjustment requirement information input by the user into the trained first neural network model to obtain an enhanced image S' corresponding to S.

[0008] The first neural network model includes a first sub-model, a second sub-model and a third sub-model, the output of the first sub-model is the input of the second sub-model, and the output of the second sub-model is the input of the third sub-model.

[0009] The first sub-model is used to obtain the transformation matrix of the input image. The first sub-model includes, in order of information transmission direction: four cascaded convolutional layers, a two-dimensional adaptive average pooling layer, a flatten layer, a first linear layer, a relu activation layer, a second linear layer and a sigmoid activation layer; the output of the sigmoid activation layer is the transformation matrix of the input image.

[0010] The second sub-model is used to update the transformation matrix of the input image according to the parameter adjustment requirement information input by the user to obtain the updated transformation matrix of the input image.

[0011] The third sub-model is used to obtain an enhanced image corresponding to the input image according to the updated transformation matrix of the input image. The third sub-model includes a convolution operation module and a summation operation module. The input of the convolution operation module is the input image and the updated transformation matrix of the input image. The input of the summation operation module is the input image and the output of the convolution operation module. The output of the summation operation module is the enhanced image corresponding to the input image.

[0012] Compared with the prior art, the present invention has at least the following beneficial effects:

[0013] The trained first neural network model in the present invention has the function of obtaining an enhanced image corresponding to an input image. The present invention uses the trained first neural network model to obtain an enhanced image corresponding to an image to be enhanced. Specifically, the first neural network model in the present invention includes a first sub-model, a second sub-model and a third sub-model, wherein the second sub-model is used to update the transformation matrix of the input image according to parameter adjustment requirement information input by a user, wherein the parameter adjustment requirement information input by the user can reflect the user's need to obtain an enhanced image with a relatively high VMAF or a relatively high PSNR. After the second sub-model updates the transformation matrix of the input image, the VMAF or PSNR of the enhanced image output by the third sub-model is improved compared to when the transformation matrix of the input image is not updated, thereby satisfying the user's need to obtain an enhanced image with a relatively high VMAF or a relatively high PSNR.

[0014] Moreover, the output of the convolution operation module in the present invention represents the difference between the input image and the corresponding enhanced image, the input of the convolution operation module is the input image and the updated conversion matrix of the input image, the conversion matrix of the input image is obtained by the first sub-model, and the first sub-model includes the structure of the neural network; it can be seen that the present invention does not use the neural network to directly learn how to obtain the corresponding enhanced image based on the input image, but uses the neural network to indirectly learn the difference between the input image and the corresponding enhanced image. Since the variation range of the difference between the input image and the enhanced image is relatively small, it is easier to learn. Therefore, in the process of training the first neural network model of the present invention, the first neural network model is easier to converge, the corresponding training process is shorter, and the accuracy of the enhanced image obtained by using the trained first neural network model is also higher. Moreover, the structure of the first sub-model included in the first neural network model in the present invention is relatively simple, and it is a lightweight neural network. The time required to obtain the enhanced image using the trained first neural network model is shorter, which improves the speed of image enhancement processing. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0016] Figure 1 A flowchart of an image enhancement method with adjustable output image parameters provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0018] Embodiment 1

[0019] According to this embodiment, Figure 1 As shown, a method for image enhancement with adjustable output image parameters is provided, comprising the following steps:

[0020] S1000, obtaining an image S to be enhanced.

[0021] S2000: Acquire parameter adjustment requirement information input by a user, where the parameter adjustment requirement information is information indicating increasing VMAF or PSNR.

[0022] As a specific implementation, two buttons are set on the user interface, the first button corresponds to increasing VMAF, and the second button corresponds to increasing PSNR; if it is obtained that the user clicks the first button, it is determined that the parameter adjustment requirement information input by the user is information indicating increasing VMAF; if it is obtained that the user clicks the second button, it is determined that the parameter adjustment requirement information input by the user is information indicating increasing PSNR.

[0023] S3000, input S and parameter adjustment requirement information input by the user into the trained first neural network model to obtain an enhanced image S' corresponding to S.

[0024] Specifically, the first neural network model includes a first sub-model, a second sub-model and a third sub-model, the output of the first sub-model is the input of the second sub-model, and the output of the second sub-model is the input of the third sub-model.

[0025] Specifically, the first sub-model is used to obtain the transformation matrix of the input image. The first sub-model includes, in order of information transmission direction: four cascaded convolutional layers, a two-dimensional adaptive average pooling layer, a flatten layer, a first linear layer, a relu activation layer, a second linear layer and a sigmoid activation layer; the output of the sigmoid activation layer is the transformation matrix of the input image.

[0026] Specifically, each convolution layer includes a convolution processing module, a batch normalization operation processing module and a relu activation processing module which are connected in sequence.

[0027] Specifically, when the first neural network model is a neural network model for obtaining an enhanced image of a single-channel image, the convolution processing module includes 1 3×3 convolution kernel, and the transformation matrix of the input image is 1 3×3 matrix; when the first neural network model is a neural network model for obtaining an enhanced image of a three-channel image, the convolution processing module includes 3 3×3 convolution kernels, and the transformation matrix of the input image is 3 3×3 matrices, wherein the first 3×3 matrix is ​​used to convolve with the first channel image of the input image, the second 3×3 matrix is ​​used to convolve with the second channel image of the input image, and the third 3×3 matrix is ​​used to convolve with the third channel image of the input image.

[0028] As a first specific implementation manner, when the first neural network model is a neural network model for obtaining an enhanced image of a single-channel image, according to the direction of information transmission, the convolution processing module of the first convolution layer includes a convolution kernel with parameters of (1, 32, 3, 1), the first 1 indicates that the input is a single channel, the output is 32 channels, the convolution kernel size is 3×3, and the second 1 indicates that the step size is 1; the convolution processing module of the second convolution layer includes a convolution kernel with parameters of (32, 64, 3, 1), 32 indicates that the input is 32 channels, 64 indicates that the output is 64 channels, the convolution kernel size is 3×3, and 1 indicates that the step size is 1; the convolution processing module of the third convolution layer includes a convolution kernel with parameters of (32, 64, 3, 1), 32 indicates that the input is 32 channels, 64 indicates that the output is 64 channels, the convolution kernel size is 3×3, and 1 indicates that the step size is 1. The parameters are (64, 128, 3, 1), 64 means the input is 64 channels, 128 means the output is 128 channels, the convolution kernel size is 3×3, and 1 means the stride is 1; the convolution processing module of the fourth convolution layer includes the convolution kernel parameters (128, 256, 3, 1), 128 means the input is 128 channels, 256 means the output is 256 channels, the convolution kernel size is 3×3, and 1 means the stride is 1; the parameters of the first linear layer are (256, 128), 256 means the input size is 256, and 128 means the output size is 128; the parameters of the second linear layer are (128, 9), 128 means the input size is 128, and 9 means the output size is 9.

[0029] As a second specific implementation manner, when the first neural network model is a neural network model for obtaining an enhanced image of a 3-channel image, according to the direction of information transmission, the convolution processing module of the first convolution layer includes a convolution kernel with parameters of (3, 32, 3, 1), the first 3 indicates that the input is 3 channels and the output is 32 channels, the second 3 indicates that the convolution kernel size is 3×3, and 1 indicates that the step size is 1; the convolution processing module of the second convolution layer includes a convolution kernel with parameters of (32, 64, 3, 1), 32 indicates that the input is 32 channels, 64 indicates that the output is 64 channels, the convolution kernel size is 3×3, and 1 indicates that the step size is 1; the convolution processing module of the third convolution layer includes a convolution kernel with parameters of (3, 32, 3, 1), 32 indicates that the input is 32 channels, 64 indicates that the output is 64 channels, the convolution kernel size is 3×3, and 1 indicates that the step size is 1. The parameters are (64, 128, 3, 1), 64 means the input is 64 channels, 128 means the output is 128 channels, the convolution kernel size is 3×3, and 1 means the stride is 1; the parameters of the convolution kernel included in the convolution processing module of the fourth convolution layer are (128, 256, 3, 1), 128 means the input is 128 channels, 256 means the output is 256 channels, the convolution kernel size is 3×3, and 1 means the stride is 1; the parameters of the first linear layer are (256, 128), 256 means the input size is 256, and 128 means the output size is 128; the parameters of the second linear layer are (128, 27), 128 means the input size is 128, and 27 means the output size is 27.

[0030] Specifically, the second sub-model is used to update the transformation matrix of the input image according to the parameter adjustment requirement information input by the user to obtain an updated transformation matrix of the input image.

[0031] When the first neural network model is a neural network model for obtaining an enhanced image of a single-channel image, the conversion matrix of the input image is a 3×3 matrix; updating the conversion matrix of the input image according to the parameter adjustment requirement information input by the user includes:

[0032] S3110, obtain the transformation matrix T0 of the input image, T0 = [e 0 1,1 ,e 0 1,2 ,e 0 1,3 ;e 0 2,1 ,e 0 2,2 ,e 0 2,3 ;e 0 3,1 ,e 0 3,2 ,e 0 3,3 ],e 0 x,y is the element in the xth row and yth column of T0, x=1,2,3, y=1,2,3.

[0033] S3120, obtaining a first target adjustment value w1; if the parameter adjustment requirement information input by the user is information indicating increasing VMAF, then w1=e 0 2,2 +Δw1, Δw1 is the adjustment amplitude of the first parameter, 0<Δw1≤f max -e 0 2,2 , f max is the maximum value of the preset conversion matrix value range F'; if the parameter adjustment requirement information input by the user is information indicating increasing PSNR, then w1 = e 0 2,2 -Δw2, Δw2 is the adjustment amplitude of the second parameter, 0<Δw2≤e 0 2,2 -f min , f min is the minimum value of F'.

[0034] In this embodiment, Δw1 and Δw2 are empirical values, and Δw1=(f max -e 0 2,2 ) / 2, Δw2=(e0 2,2 -f min ) / 2.

[0035] S3130, will [e 0 1,1 ,e 0 1,2 ,e 0 1,3 ;e 0 2,1 ,w1,e 0 2,3 ;e 0 3,1 ,e 0 3,2 ,e 0 3,3 ] is determined as the transformation matrix after updating the transformation matrix of the input image.

[0036] When the first neural network model is a neural network model for obtaining an enhanced image of a 3-channel image, the conversion matrix of the input image is three 3×3 matrices; updating the conversion matrix of the input image according to the parameter adjustment requirement information input by the user includes:

[0037] S3210, obtain the transformation matrix T0 of the input image, T0=(T 1 0,T 2 0,T 3 0), T k 0 is the kth transformation matrix corresponding to the input image, k = 1, 2, 3; T k 0=[e k,0 1,1 ,e k,0 1,2 ,e k,0 1,3 ;e k,0 2,1 ,e k,0 2,2 ,e k,0 2,3 ;e k,0 3,1 ,e k,0 3,2 ,e k ,0 3,3 ],e k,0 x,y T k The element at row x and column y of 0.

[0038] S3220, obtain the second target adjustment value w2, w2=(w 2,1 ,w 2,2 ,w2,3 ), w 2,k for e k,0 2,2 corresponding target adjustment value; if the parameter adjustment requirement information input by the user is information indicating an increase in VMAF, then w 2,k =e k,0 2,2 +Δw3, Δw3 is the adjustment amplitude of the third parameter, 0<Δw3≤f max -max(e 1,0 2,2 ,e 2,0 2,2 ,e 3,0 2,2 ), f max is the maximum value of the preset conversion matrix value range F', and max() is the maximum value; if the parameter adjustment requirement information input by the user is information indicating increasing PSNR, then w 2,k =e k,0 2,2 -Δw4, Δw4 is the fourth parameter adjustment range, 0<Δw4≤min(e 1,0 2,2 ,e 2,0 2,2 ,e 3 ,0 2,2 )-f min , f min is the minimum value of F', and min() is the minimum value.

[0039] In this embodiment, Δw3 and Δw4 are empirical values, and Δw3=(f max -max(e 1,0 2,2 ,e 2,0 2,2 ,e 3 ,0 2,2 )) / 2, Δw4=(min(e 1,0 2,2 ,e 2,0 2,2 ,e 3,0 2,2 )-f min ) / 2.

[0040] In this embodiment, if the parameter adjustment requirement information input by the user is information indicating to increase VMAF and f max -max(e 1,0 2,2 ,e 2,0 2,2 ,e 3,0 2,2)=0, then Δw3=0, and the preset information indicating that VMAF is not to be increased is displayed on the user interface; if the parameter adjustment requirement information input by the user is the information indicating the increase of PSNR and min(e 1,0 2,2 ,e 2 ,0 2,2 ,e 3,0 2,2 )-f min =0, then Δw4=0, and preset information indicating that the PSNR increase is not performed is displayed on the user interface.

[0041] S3230, ([e 1,0 1,1 ,e 1,0 1,2 ,e 1,0 1,3 ;e 1,0 2,1 ,w 2,1 ,e 1,0 2,3 ;e 1,0 3,1 ,e 1,0 3,2 ,e 1,0 3,3 ],[e 2 ,0 1,1 ,e 2,0 1,2 ,e 2,0 1,3 ;e 2,0 2,1 ,w 2,2 ,e 2,0 2,3 ;e 2,0 3,1 ,e 2,0 3,2 ,e 2,0 3,3 ],[e 3,0 1,1 ,e 3,0 1,2 ,e 3,0 1,3 ;e 3,0 2,1 ,w 2,3 ,e 3,0 2,3 ;e 3,0 3,1 ,e 3,0 3,2 ,e 3,0 3,3]) is used as the transformation matrix after updating the transformation matrix of the input image.

[0042] Optionally, the process of obtaining F' includes:

[0043] S1100, obtain a test image set C, C = {c1, c2, ..., c r ,…,c R},c r is the rth test image, the value range of r is 1 to R, R is the number of test images included in C, and each c r Same number and type of channels as S.

[0044] In this embodiment, each c r It is an image in the same application scenario as S.

[0045] In this embodiment, R is an empirical value, and R=1000 is optional.

[0046] S1200, traverse C, c r Input to the first trained neural network model to get c r The corresponding transformation matrix T' r , and T' r Append to the preset transformation matrix set T', and get T'={T'1,T'2,…,T' r ,…,T' R}, T' is initialized to the empty set.

[0047] S1300, obtaining the value range F of the elements in the conversion matrix according to T', F=(f1,f2,…,f h ,…,f H ), f h is the value range of the hth element in the transformation matrix, f h =[f h,1 ,f h,2 ], f h,1 f h The minimum value of f h,2 f h The maximum value of f h,1 =min(D h ), f h,2 =max(D h ), D h To convert each T' in T' r The corresponding h-th element is appended to the preset h-th element set D' h The resulting set, D' h is initialized to an empty set, min() is the minimum value, max() is the maximum value, and the value range of h is 1 to H, where H is the number of elements in the transformation matrix.

[0048] In this embodiment, when the conversion matrix of the input image is a 3×3 matrix, the number of elements in the conversion matrix is ​​9; when the conversion matrix of the input image is three 3×3 matrices, the number of elements in the conversion matrix is ​​27.

[0049] S1400, obtain F', F' = [f min ,f max ], f min =min(f 1,1 ,f 2,1 ,…,f h,1 ,…,f H,1 ), f max =max(f 1,2 ,f 2,2 ,…,f h,2 ,…,f H,2 ).

[0050] According to S1100-S1400 of this embodiment, the overall value range corresponding to all elements in the conversion matrix can be obtained, and the overall value range is used as the value range F' of the conversion matrix to limit the amplitude of adjustment of the intermediate elements of the conversion matrix, which can avoid the situation where the element value of the intermediate element of the conversion matrix after adjustment exceeds the overall value range corresponding to all elements in the conversion matrix before adjustment.

[0051] Specifically, the third sub-model is used to obtain an enhanced image corresponding to the input image according to the updated transformation matrix of the input image. The third sub-model includes a convolution operation module and a summation operation module. The input of the convolution operation module is the input image and the updated transformation matrix of the input image. The input of the summation operation module is the input image and the output of the convolution operation module. The output of the summation operation module is the enhanced image corresponding to the input image.

[0052] In this embodiment, the convolution operation module is used to perform padding processing on the input image, and use the output of the second sub-model to perform a convolution operation on the input image after the padding processing, and the summation operation module is used to perform a summation operation on the input image and the convolution result output by the convolution operation module.

[0053] In this embodiment, when the first neural network model is a neural network model for obtaining an enhanced image of a single-channel image, the updated transformation matrix of the input image is a 3×3 matrix; when the first neural network model is a neural network model for obtaining an enhanced image of a three-channel image, the updated transformation matrix of the input image is three 3×3 matrices; accordingly, when padding is performed on the input image, the padding size is 1, specifically, a circle of 0s is filled outside the input image, thereby, the convolution result output by the convolution operation module is equal to the size of the input image, and a summation operation can be performed.

[0054] In the process of training the first neural network model in this embodiment, the user has no input, the second sub-model does not update the transformation matrix of the input image, the output of the second sub-model is the transformation matrix of the input image, and the input of the third sub-model is the transformation matrix of the input image.

[0055] In this embodiment, the training process of the first neural network model includes the following steps:

[0056] S3010, obtain image sample list A, A=(a1, a2, …, a n ,…,a N ), a n is the nth image sample, the value range of n is 1 to N, N is the number of image samples; each a n The number and type of channels corresponding to S are the same.

[0057] S3020, obtain image sample label list B = (b1, b2, ..., b n ,…,b N ), b n For a n Image after image enhancement.

[0058] In this embodiment, b n for a n The corresponding label.

[0059] Those skilled in the art know that any method for enhancing an image in the prior art falls within the protection scope of the present invention; optionally, b n To use the clahe algorithm to n Image after image enhancement.

[0060] S3030, using A and B to train the first neural network model.

[0061] Those skilled in the art are aware that any supervised training method in the prior art falls within the protection scope of the present invention.

[0062] Optionally, the image enhancement method with adjustable output image parameters in this embodiment is executed on a CPU or a GPU.

[0063] Preferably, the image enhancement method with adjustable output image parameters of this embodiment is executed on the GPU, so that the operation of performing image enhancement processing on the image no longer occupies CPU resources, which can save more CPU resources for the user; moreover, the GPU is parallel computing, and the time for performing image enhancement processing on a large number of images is shorter, which can improve the efficiency of image enhancement processing on a large number of images and meet the user's high efficiency requirements for image enhancement.

[0064] In this embodiment, the trained first neural network model has the function of obtaining an enhanced image corresponding to the input image. In this embodiment, the trained first neural network model is used to obtain the enhanced image corresponding to the image to be enhanced. Specifically, the first neural network model in this embodiment includes a first sub-model, a second sub-model and a third sub-model, wherein the second sub-model is used to update the transformation matrix of the input image according to the parameter adjustment requirement information input by the user, wherein the parameter adjustment requirement information input by the user can reflect the user's need to obtain an enhanced image with a relatively high VMAF or a relatively high PSNR. After the second sub-model updates the transformation matrix of the input image, the VMAF or PSNR of the enhanced image output by the third sub-model is improved compared to when the transformation matrix of the input image is not updated, thereby satisfying the user's need to obtain an enhanced image with a relatively high VMAF or a relatively high PSNR.

[0065] Moreover, the output of the convolution operation module in this embodiment represents the difference between the input image and the corresponding enhanced image, and the input of the convolution operation module is the input image and the updated conversion matrix of the input image. The conversion matrix of the input image is obtained by the first sub-model, and the first sub-model includes the structure of the neural network. It can be seen that this embodiment does not use the neural network to directly learn how to obtain the corresponding enhanced image based on the input image, but uses the neural network to indirectly learn the difference between the input image and the corresponding enhanced image. Since the variation range of the difference between the input image and the enhanced image is relatively small, it is easier to learn. Therefore, in the process of training the first neural network model in this embodiment, the first neural network model is easier to converge, the corresponding training process is shorter, and the accuracy of the enhanced image obtained by using the trained first neural network model is also higher. Moreover, the structure of the first sub-model included in the first neural network model in this embodiment is relatively simple, which is a lightweight neural network. The time required to obtain the enhanced image using the trained first neural network model is shorter, which improves the speed of image enhancement processing.

[0066] Embodiment 2

[0067] The present embodiment differs from the first embodiment in that the image enhancement method with adjustable output image parameters in the present embodiment further includes between S2000 and S3000: S2100, obtaining the image type of S, wherein the image type is a key frame type or a forward prediction coding frame type.

[0068] In this embodiment, S is any frame image in the target video V, V = (v1, v2, ..., v q ,…,v Q ), v q is the qth frame image included in V, the value range of q is 1 to Q, Q is the number of images included in V, v q v q+1 The previous frame image, v q+1 is the q+1th frame image included in V; v q A key frame or a forward predictive coded frame in V.

[0069] In this embodiment, the target video V corresponds to a key frame frame number list L, L = (id1, id2, ..., id m ,…,id M ), id m is the number of frames corresponding to the mth key needle in V, the value range of m is 1 to M, and M is the number of key frames included in V. Those skilled in the art know that any method of parsing key frames and forward predictive coding frames in a video in the prior art falls within the protection scope of the present invention. Optionally, ffmpeg is used to parse the target video to obtain a frame number list of key frames in the target video.

[0070] Specifically, S2100 includes: traversing L, if a certain id exists in L m If it is equal to num, the type of S is determined to be a key frame type; otherwise, the type of S is determined to be a forward predictive coding frame type; num is the frame number of S in the target video.

[0071] In this embodiment, if S is the first frame image in the target video, then num=1; if S is the second frame image in the target video, then num=2; and so on. In this embodiment, the frame number of each image in the target video is determined according to the time sequence corresponding to each frame image, that is, the earlier the image corresponds to, the smaller its corresponding frame number.

[0072] In this embodiment, if the image type of S is a key frame type, S3000 includes:

[0073] S3001, using the first sub-model in the trained first neural network model to obtain the transformation matrix of S, and using the transformation matrix of S as the input of the second sub-model in the trained first neural network model, using the output of the second sub-model in the trained first neural network model as the input of the third sub-model in the trained first neural network model, and determining the output of the third sub-model in the trained first neural network model as S'.

[0074] In this embodiment, if the image type of S is a forward prediction coding frame type, S3000 includes:

[0075] S3002, obtaining a target conversion matrix, taking the target conversion matrix as the input of the second sub-model in the trained first neural network model, taking the output of the second sub-model in the trained first neural network model as the input of the third sub-model in the trained first neural network model, and determining the output of the third sub-model in the trained first neural network model as S'; the target conversion matrix is ​​the conversion matrix corresponding to the key frame in V whose frame number is less than num and whose difference with num is the smallest.

[0076] For example, the target video includes 100 frames of images. According to the time sequence corresponding to each frame, the 1st, 10th, 20th, 30th, 40th, 50th, 60th, 70th, 80th and 90th frames are key frames, and the others are forward prediction coding frames. Specifically, frames 2-9 are forward prediction coding frames corresponding to the 1st frame, frames 11-19 are forward prediction coding frames corresponding to the 10th frame, frames 21-29 are forward prediction coding frames corresponding to the 20th frame, and so on. If the number of frames of S in V is 10, then the type of S is the key frame type; if the number of frames of S in V is 13, then the type of S is the forward prediction coding frame type, and the corresponding target conversion matrix is ​​the conversion matrix corresponding to the 10th frame in V, that is, when the 10th frame image is used as the input of the first sub-model in the trained first neural network model, the output of the first sub-model is determined as the target conversion matrix corresponding to the 13th frame image.

[0077] When performing image enhancement processing on each frame image in the target video, this embodiment performs image enhancement processing in the order of the frame number of each frame in the target video from small to large. Therefore, the transformation matrix corresponding to the key frame can be obtained first and stored. When the image enhancement is subsequently performed on the forward prediction coding frame, the transformation matrix corresponding to the corresponding key frame is a known value and can be directly used as the input of the second sub-model. Therefore, in the process of performing image enhancement processing on the forward prediction coding frame, the process of using the first sub-model to obtain the transformation matrix corresponding to the forward prediction coding frame can be omitted, which can save the time of obtaining the enhanced image and improve the efficiency of obtaining the enhanced image.

[0078] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. An image enhancement method with adjustable output image parameters, characterized in that: The following steps are involved: S1000, obtaining an image S to be enhanced; S2000, obtaining parameter adjustment requirement information input by a user, where the parameter adjustment requirement information is information indicating increasing VMAF or PSNR; S3000, inputting S and parameter adjustment requirement information input by the user into the trained first neural network model to obtain an enhanced image S' corresponding to S; The first neural network model includes a first sub-model, a second sub-model and a third sub-model, the output of the first sub-model is the input of the second sub-model, and the output of the second sub-model is the input of the third sub-model; The first sub-model is used to obtain the transformation matrix of the input image. The first sub-model includes, in order of information transmission direction: four cascaded convolutional layers, a two-dimensional adaptive average pooling layer, a flatten layer, a first linear layer, a relu activation layer, a second linear layer and a sigmoid activation layer; the output of the sigmoid activation layer is the transformation matrix of the input image; The second sub-model is used to update the transformation matrix of the input image according to the parameter adjustment requirement information input by the user to obtain an updated transformation matrix of the input image; The third sub-model is used to obtain an enhanced image corresponding to the input image according to the updated transformation matrix of the input image. The third sub-model includes a convolution operation module and a summation operation module. The input of the convolution operation module is the input image and the updated transformation matrix of the input image. The input of the summation operation module is the input image and the output of the convolution operation module. The output of the summation operation module is the enhanced image corresponding to the input image.

2. The image enhancement method with adjustable output image parameters according to claim 1, characterized in that: When the first neural network model is a neural network model for obtaining an enhanced image of a single-channel image, the conversion matrix of the input image is a 3×3 matrix; updating the conversion matrix of the input image according to the parameter adjustment requirement information input by the user includes: S3110, obtain the transformation matrix T0 of the input image, T0 = [e 0 1,1 ,e 0 1,2 ,e 0 1,3 ;e 0 2,1 ,e 0 2,2 ,e 0 2,3 ;e 0 3,1 ,e 0 3,2 ,e 0 3,3 ],e 0 x,y is the element in the xth row and yth column of T0, x=1,2,3, y=1,2,3; S3120, obtaining a first target adjustment value w1; if the parameter adjustment requirement information input by the user is information indicating increasing VMAF, then w1=e 0 2,2 +Δw1, Δw1 is the adjustment amplitude of the first parameter, 0<Δw1≤f max -e 0 2,2 , f max is the maximum value of the preset conversion matrix value range F'; if the parameter adjustment requirement information input by the user is information indicating increasing PSNR, then w1 = e 0 2,2 -Δw2, Δw2 is the adjustment amplitude of the second parameter, 0<Δw2≤e 0 2,2 -f min , f min is the minimum value of F'; S3130, will [e 0 1,1 ,e 0 1,2 ,e 0 1,3 ;e 0 2,1 ,w1,e 0 2,3 ;e 0 3,1 ,e 0 3,2 ,e 0 3,3 ] is determined as the transformation matrix after updating the transformation matrix of the input image.

3. The image enhancement method with adjustable output image parameters according to claim 1, characterized in that: When the first neural network model is a neural network model for obtaining an enhanced image of a 3-channel image, the conversion matrix of the input image is three 3×3 matrices; The updating of the conversion matrix of the input image according to the parameter adjustment requirement information input by the user includes: S3210, obtain the transformation matrix T0 of the input image, T0=(T 1 0,T 2 0,T 3 0), T k 0 is the kth transformation matrix corresponding to the input image, k = 1, 2, 3; T k 0=[e k,0 1,1 ,e k,0 1,2 ,e k,0 1,3 ;e k,0 2,1 ,e k,0 2,2 ,e k,0 2,3 ;e k,0 3,1 ,e k,0 3,2 ,e k,0 3,3 ],e k ,0 x,y T k The element at row x and column y of 0; S3220, obtain the second target adjustment value w2, w2=(w 2,1 ,w 2,2 ,w 2,3 ), w 2,k for e k,0 2,2 corresponding target adjustment value; if the parameter adjustment requirement information input by the user is information indicating an increase in VMAF, then w 2,k =e k,0 2,2 +Δw3, Δw3 is the adjustment amplitude of the third parameter, 0<Δw3≤f max -max(e 1,0 2,2 ,e 2,0 2,2 ,e 3,0 2,2 ), f max is the maximum value of the preset conversion matrix value range F', and max() is the maximum value; if the parameter adjustment requirement information input by the user is information indicating increasing PSNR, then w 2,k =e k,0 2,2 -Δw4, Δw4 is the fourth parameter adjustment range, 0<Δw4≤min(e 1,0 2,2 ,e 2,0 2,2 ,e 3,0 2,2 )-f min , f min is the minimum value of F', min() is the minimum value; S3230, ([e 1,0 1,1 ,e 1,0 1,2 ,e 1,0 1,3 ;e 1,0 2,1 ,w 2,1 ,e 1,0 2,3 ;e 1,0 3,1 ,e 1,0 3,2 ,e 1,0 3,3 ],[e 2,0 1,1 ,e 2 ,0 1,2 ,e 2,0 1,3 ;e 2,0 2,1 ,w 2,2 ,e 2,0 2,3 ;e 2,0 3,1 ,e 2,0 3,2 ,e 2,0 3,3 ],[e 3,0 1,1 ,e 3,0 1,2 ,e 3,0 1,3 ;e 3,0 2,1 ,w 2,3 ,e 3 ,0 2,3 ;e 3,0 3,1 ,e 3,0 3,2 ,e 3,0 3,3 ]) is used as the transformation matrix after updating the transformation matrix of the input image.

4. The image enhancement method with adjustable output image parameters according to claim 2, characterized in that: The process of obtaining F' includes: S1100, obtain a test image set C, C = {c1, c2, ..., c r ,…,c R },c r is the rth test image, the value range of r is 1 to R, R is the number of test images included in C, and each c r Same number and type of channels as S; S1200, traverse C, c r Input to the first trained neural network model to get c r The corresponding transformation matrix T' r , and T' r Append to the preset transformation matrix set T', and get T'={T'1,T'2,…,T' r ,…,T' R }, T' is initialized to an empty set; S1300, obtaining the value range F of the elements in the conversion matrix according to T', F=(f1,f2,…,f h ,…,f H ), f h is the value range of the hth element in the transformation matrix, f h =[f h,1 ,f h,2 ], f h,1 f h The minimum value of f h,2 f h The maximum value of f h,1 =min(D h ), f h,2 =max(D h ), D h To convert each T' in T' r The corresponding h-th element is appended to the preset h-th element set D' h The resulting set, D' h is initialized to an empty set, min() is used to take the minimum value, max() is used to take the maximum value, and the value range of h is 1 to H, where H is the number of elements in the transformation matrix; S1400, obtain F', F' = [f min ,f max ], f min =min(f 1,1 ,f 2,1 ,…,f h,1 ,…,f H,1 ), f max =max(f 1,2 ,f 2,2 ,…,f h,2 ,…, f H,2 )。 5. The image enhancement method with adjustable output image parameters according to claim 1, characterized in that: The training process of the first neural network model includes the following steps: S3010, obtain image sample list A, A=(a1, a2, …, a n ,…,a N ), a n is the nth image sample, the value range of n is 1 to N, N is the number of image samples; each a n The number and type of channels corresponding to S are the same; S3020, obtain image sample label list B = (b1, b2, ..., b n ,…,b N ), b n For a n Image after image enhancement; S3030, using A and B to train the first neural network model.

6. The image enhancement method with adjustable output image parameters according to claim 1, characterized in that: The image enhancement method is executed on a GPU.

7. The image enhancement method with adjustable output image parameters according to claim 5, characterized in that: b n To use the clahe algorithm to n Image after image enhancement.