Image processing method and device, electronic equipment and storage medium
By encoding and feature extraction of images of different sizes, the image quality is evaluated and enhanced, which solves the problem of poor image quality in real scenes and improves user experience.
Patent Information
- Application Number
- CN202410700728.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-10-11
AI Technical Summary
Images taken in real scenes are of poor quality due to environmental or climatic factors (such as rain, snow, fog, light spots), which is difficult to effectively solve with existing technology and affects user experience.
By obtaining images of different sizes in the image to be processed, image content encoding and image quality encoding are performed, image feature representations are extracted, and the image quality is evaluated based on these features. If it is lower than the threshold, targeted image enhancement processing is performed.
It improves the shooting quality of images, improves user experience, and solves various quality problems by making full use of image information to extract accurate features and perform targeted enhancement processing.
Smart Images

Figure CN118761930A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and more specifically, to an image processing method, device, electronic device and storage medium. Background Art
[0002] With the improvement of smart terminal shooting technology, more and more users like to use smart terminals to take pictures and videos to record their work and life. However, due to the influence of shooting environment or natural climate, the images taken in real scenes may contain rain, snow, fog, light spots, or blurred images, resulting in poor image quality, thus affecting the user experience. Summary of the invention
[0003] The present application proposes an image processing method, device, electronic device and storage medium to improve the above-mentioned problems.
[0004] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising: obtaining an image to be processed, the image to be processed comprising an image of a first size and an image of a second size, the first size being larger than the second size; performing image content encoding and image quality encoding on the image of the first size and the image of the second size, respectively, to obtain image content coding features and image quality coding features; splicing the image content coding features and the image quality coding features to obtain an image feature representation; obtaining an image quality evaluation parameter of the image to be processed based on the image feature representation; if the image quality evaluation parameter is lower than a preset threshold, performing at least one image enhancement processing on the image to be processed to obtain a target image.
[0005] In a second aspect, an embodiment of the present application provides an image processing device, the device comprising: an image acquisition module for acquiring an image to be processed, the image to be processed comprising an image of a first size and an image of a second size, the first size being larger than the second size; an image feature extraction module, the image content encoding and the image quality encoding of the image of the first size and the image of the second size, respectively, to obtain image content coding features and image quality coding features; an image stitching module, the image content coding features and the image quality coding features are stitched together to obtain an image feature representation; an image quality evaluation parameter acquisition module, the image quality evaluation parameter of the image to be processed based on the image feature representation; an image processing module, the image quality evaluation parameter being configured to perform at least one image enhancement process on the image to be processed to obtain a target image if the image quality evaluation parameter is lower than a preset threshold.
[0006] In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method of the first aspect above.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium having program code stored therein, wherein the method of the first aspect is executed when the program code is run.
[0008] The present application provides an image processing method, device, electronic device and storage medium, which obtains an image to be processed, wherein the image to be processed includes an image of a first size and an image of a second size, wherein the first size is larger than the second size; performs image content encoding and image quality encoding on the image of the first size and the image of the second size respectively, and obtains image content encoding features and image quality encoding features; splices the image content encoding features and the image quality encoding features to obtain an image feature representation; obtains an image quality evaluation parameter of the image to be processed based on the image feature representation; if the image quality evaluation parameter is lower than a preset threshold, performs at least one image enhancement process on the image to be processed to obtain a target image. Thus, the above-mentioned method realizes that the images to be processed of different sizes are respectively subjected to image content encoding and image quality encoding, so as to extract more accurate image features by making full use of the information of the image itself, and then evaluates the quality of the image to be processed based on the extracted image features, and performs targeted image enhancement on the image to be processed according to the image quality evaluation result, so as to improve the shooting quality of the image to be processed, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A flowchart of an image processing method provided by an embodiment of the present application is shown.
[0011] Figure 2 Shows Figure 1 Flow chart of the method of step S120 in .
[0012] Figure 3 An example diagram of similarity judgment of image quality perception between different image blocks of the same image provided by an embodiment of the present application is shown.
[0013] Figure 4 A flowchart of an image processing method provided by another embodiment of the present application is shown.
[0014] Figure 5 An example flowchart of image processing for an image to be processed provided by an embodiment of the present application is shown.
[0015] Figure 6 A structural block diagram of an image processing device provided in an embodiment of the present application is shown.
[0016] Figure 7 A structural block diagram of an electronic device provided in an embodiment of the present application is shown.
[0017] Figure 8 A storage unit for storing or carrying program codes for implementing the image processing method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0019] Image enhancement refers to adding some information or transforming data to the original image by certain means, selectively highlighting the features of interest in the image or suppressing (masking) some unnecessary features in the image, so that the image matches the visual response characteristics. In order to improve the quality of image shooting, the captured image can be enhanced.
[0020] However, the inventors have discovered that, affected by the shooting environment or natural climate, images captured in real scenes may contain at least one of the following conditions: rain, snow, fog, light spots, blurred images, etc., resulting in poor image quality. At this time, it is difficult to solve all problems existing in images captured in real scenes through a single image enhancement or direct image enhancement, thereby affecting the user experience.
[0021] After long-term research, the inventors found that the method can be implemented by obtaining an image to be processed, wherein the image to be processed includes an image of a first size and an image of a second size, wherein the first size is larger than the second size; performing image content encoding and image quality encoding on the image of the first size and the image of the second size, respectively, to obtain image content encoding features and image quality encoding features; splicing the image content encoding features and image quality encoding features to obtain an image feature representation; obtaining an image quality evaluation parameter of the image to be processed based on the image feature representation; and performing at least one image enhancement process on the image to be processed to obtain a target image if the image quality evaluation parameter is lower than a preset threshold. Thus, the method can realize image content encoding and image quality encoding of images to be processed of different sizes, respectively, so as to extract more accurate image features by making full use of the information of the image itself, and then evaluate the quality of the image to be processed based on the extracted image features, and perform targeted image enhancement on the image to be processed according to the image quality evaluation result, so as to improve the shooting quality of the image to be processed, thereby improving the user experience.
[0022] Therefore, in order to improve the above-mentioned problems, the inventors proposed the image processing method, device, electronic device and computer-readable storage medium provided in the present application, which can improve the shooting quality of the image to be processed and thereby improve the user experience.
[0023] In order to facilitate a better understanding of the solution described in the embodiments of the present application, the following briefly describes the terms involved in the description of the embodiments of the present application:
[0024] Self-supervised learning: (Self-supervised Learning) is a special form of unsupervised learning that learns by deriving supervisory signals from the data itself. Self-supervised learning does not require manually labeled supervisory signals, but creates supervisory signals by designing auxiliary tasks or using the intrinsic structure of the data. These supervisory signals can be obtained based on context, time series, or contrastive learning. Therefore, self-supervised learning can be regarded as a form of unsupervised learning that uses the inherent laws of the data to learn useful features without relying on manual labels.
[0025] Unsupervised learning: Unsupervised learning refers to learning from unlabeled data sets, with the goal of discovering patterns and structures in the data. Unsupervised learning methods include clustering and dimensionality reduction, which do not rely on any manual annotations, but instead try to learn and predict through the information in the data itself.
[0026] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0027] See also Figure 1, shows a flow chart of an image processing method provided by an embodiment of the present application. This embodiment provides an image processing method that can be applied to an electronic device, which can be a mobile phone, a computer, a tablet or a wearable electronic device. The specific type of electronic device is not limited. The method includes:
[0028] Step S110: Acquire an image to be processed, wherein the image to be processed includes an image of a first size and an image of a second size, wherein the first size is larger than the second size.
[0029] In this embodiment, the image to be processed may be an image captured by an electronic device. Specifically, the image to be processed may include an image captured in at least one environment such as cloud, rain, snow, fog, etc. Optionally, the image to be processed may also be an image with multiple quality problems.
[0030] In order to improve data usage as much as possible, the image to be processed may include images of multiple different sizes, and the image content of the images of multiple different sizes is the same. As an implementation, the image to be processed may include a first size image and a second size image, and the first size is larger than the second size. Exemplarily, the first size image may be a full-size image, and the second size image may be a half-size image. The specific values of the first size and the second size may not be limited. For example, the first size may be 128×128, and the second size may be 64×64. The image content of the first size image is the same as the image content of the second size image.
[0031] As an implementation mode, assuming that the size of the captured image is a first size, the image of the first size can be compressed to obtain an image of a second size, and then the image of the first size and the image of the second size are used together as images to be processed, thereby increasing the data set for image processing and improving the utilization rate of image data.
[0032] Step S120: performing image content coding and image quality coding on the first-size image and the second-size image respectively to obtain image content coding features and image quality coding features.
[0033] As an implementation method, in order to more accurately extract the image features of the image to be processed, the image to be processed may be subjected to image content coding and image quality coding respectively. Specifically, the image of the first size and the image of the second size may be subjected to image content coding and image quality coding respectively to obtain image content coding features and image quality coding features. The implementation process of performing image content coding and image quality coding on the image of the first size and the image of the second size respectively is described as follows.
[0034] See also Figure 2As an implementation, step S120 may include:
[0035] Step S121: inputting the first-size image and the second-size image into an image content encoder respectively, so as to perform image content encoding on the first-size image and the second-size image through the image content encoder, and outputting first image features and second image features.
[0036] When performing image content encoding on the image to be processed, the first size image and the second size image of the image to be processed can be respectively input into the image content encoder, so that the image content encoder performs image content encoding on the first size image and the second size image, and outputs the first image feature and the second image feature. The first image feature corresponds to the first size image, the second image feature corresponds to the second size image, and the dimension of the first size image can be the same as the dimension of the second size image. The specific implementation principle and process of the image content encoder performing image content encoding on the images to be processed of different sizes will not be repeated here.
[0037] Among them, the image content encoder can be pre-trained by unsupervised learning, and the unsupervised learning method is not limited, for example, it can be MoCo (Momentum Contrast, momentum contrast learning) series, SimCLR (aSimple Framework for Contrastive Learning, simple visual representation contrast learning framework) series, BYOL (Boostrap Your Own Latent, elegant and concise contrast learning framework), Simsiam, SwAR, Dino, etc. Optionally, the backbone network of the image content encoder can be CNN (Convolutional Neural Networks, convolutional neural network) and Vit (Vision Transformer Convolutional Neural Network) and other types, which can be specifically not limited. Optionally, the image content encoder can also be pre-trained by self-supervised learning, and the specific method used for training is not limited.
[0038] Step S122: concatenate the first image feature and the second image feature to obtain an image content coding feature.
[0039] In order to facilitate subsequent image processing of the image to be processed, the first image feature output by the image content encoder may be concatenated with the second image feature to obtain an image content coding feature.
[0040] In this implementation, assuming that the dimensions of the first image feature and the second image feature are both 2048, the dimension of the concatenated image content coding feature may be 4096.
[0041] Step S123: inputting the first size image and the second size image into an image quality encoder respectively, so as to perform image quality encoding on the first size image and the second size image through the image quality encoder, and outputting a third image feature and a fourth image feature.
[0042] In this embodiment, while encoding the image content of the image to be processed, the image quality of the image to be processed can be encoded, so as to evaluate the image quality of the image to be processed based on the image features obtained by encoding (including image content encoding and image quality encoding).
[0043] In the process of performing image quality coding on the image to be processed, the first size image and the second size image of the image to be processed can be respectively input into the image quality encoder, so as to perform image quality coding on the first size image and the second size image through the image quality encoder, and output a third image feature and a fourth image feature. The third image feature corresponds to the first size image, the fourth image feature corresponds to the second size image, and the dimension of the first size image can be the same as the dimension of the second size image.
[0044] Among them, the image quality encoder can be pre-trained by contrastive learning. Exemplarily, the image quality encoder can be trained by contrastive learning using image enhancement methods and internal image exchange schemes in frameworks such as MoCov2, and the training data in the image quality encoder training process can still use the first size image and the second size image of the image to be processed. Optionally, in the process of training the image quality encoder using the MoCov2 framework, in each training batch, when any paired query and keyword are used to generate features, positive samples will appear, and the pair can be marked as "similar", and when the query and key (i.e., keyword) do not belong to the same pair, negative samples will appear, and the pair can be marked as "different".
[0045] Optionally, in the process of training the image quality encoder, the image quality encoder may be trained according to some pre-set rules. In this embodiment, the pre-set rules may include: images with similar perceived quality may be closer to each other, while images with dissimilar perceived quality may be farther away from each other. For example, for the same image, the changes between adjacent image blocks are small, and the perceived image quality may be similar, while the perceived image quality between image blocks that are far away is dissimilar (for example, Figure 3The perceived image quality between the two image blocks identified as 1 is similar, the perceived image quality between the two image blocks identified as 2 is similar, but the perceived image quality between any image block identified as 1 and any image block identified as 2 is not similar); the perceived image quality between any two different images is different; and the perceived image quality between different shot versions of the same image is different.
[0046] Step S124: concatenate the third image feature and the fourth image feature to obtain an image quality coding feature.
[0047] Similarly, in order to facilitate subsequent image processing of the image to be processed, the third image feature output by the image quality encoder may be concatenated with the fourth image feature to obtain an image quality coding feature.
[0048] In this implementation, assuming that the dimensions of the third image feature and the fourth image feature are both 2048, the dimension of the image quality coding feature obtained by splicing may be 4096.
[0049] Step S130: concatenate the image content coding features and the image quality coding features to obtain an image feature representation.
[0050] In order to more comprehensively evaluate the image quality of the image to be processed, the image content coding features and the image quality coding features can be concatenated to obtain an image feature representation. Optionally, taking the above example, the dimensions of the image content coding features and the image quality coding features are both 4096, then the dimension of the concatenated image feature representation is 8192.
[0051] Step S140: obtaining image quality evaluation parameters of the image to be processed based on the image feature representation.
[0052] As an implementation manner, in order to accurately evaluate the quality of the image to be processed, the above-mentioned image feature representation may be input into an image quality regressor to obtain image quality evaluation parameters output by the image quality regressor.
[0053] The image quality regressor may be an image quality assessment regression model, and the specific type may not be limited. The specific implementation principle and implementation process of obtaining the image quality evaluation parameter through the image quality regressor will not be described in detail here.
[0054] Step S150: If the image quality evaluation parameter is lower than a preset threshold, at least one image enhancement process is performed on the image to be processed to obtain a target image.
[0055] The preset threshold value may be a critical value for determining that the image quality is poor, and the specific value of the preset threshold value may be set or adjusted according to actual needs. Optionally, if the image quality evaluation parameter is greater than or equal to the preset threshold value, it indicates that the image quality of the image to be processed is good; and if the image quality evaluation parameter is less than (i.e., lower than) the preset threshold value, it indicates that the image quality of the image to be processed is poor.
[0056] In order to improve the quality of the image to be processed, as an implementation method, if the image quality evaluation parameter obtained is lower than the preset threshold, at least one image enhancement process can be performed on the image to be processed, and the final image can be used as the target image. As an implementation method, in the process of performing at least one image enhancement process on the image to be processed, a multi-task method can be used to simultaneously perform multiple different types of image enhancement processes on the image to be processed. Specifically, a multi-task classification method can be used to predict the possible problems of the image to be processed, that is, each type (class) of task is used to predict the reason for the poor quality of the image to be processed (for example, the reason for the poor quality of the image to be processed can be predicted by a task classifier), different task types predict different reasons, and each task type can also output the prediction confidence while predicting the reason, then in this way, the image to be processed can be respectively subjected to image enhancement according to multiple groups of different prediction confidences and corresponding reasons, and multiple groups of different image enhancement processing results are obtained, and then the different image enhancement processing results are merged. For example, assuming that the reasons A, B, and C are predicted to be the reasons for the poor quality of the image to be processed, and the confidence of reason A is 90%, the confidence of reason B is 80%, and the confidence of reason C is 70%, then image enhancement processing can be performed on the image to be processed based on reason A with a confidence of 90% to obtain result 1, image enhancement processing can be performed on the image to be processed based on reason B with a confidence of 80% to obtain result 2, and image enhancement processing can be performed on the image to be processed based on reason C with a confidence of 70% to obtain result 3, and then results 1, 2, and 3 are merged to obtain the target image.
[0057] As another implementation method, in the process of performing at least one image enhancement process on the image to be processed, different types of image enhancement processes may also be performed on the image to be processed in sequence to obtain the final target image. Wherein, when performing the image enhancement processes in sequence, they may be performed in sequence according to the above-mentioned confidence levels. The result image of the previous image enhancement process serves as the input image of the adjacent subsequent image enhancement process. For example, taking the above example as an example, the image to be processed may first be subjected to image enhancement process based on reason A with a confidence level of 90% to obtain result 1, and then result 1 may be subjected to image enhancement process based on reason B with a confidence level of 80% to obtain result 4, and then result 4 may be subjected to image enhancement process based on reason C with a confidence level of 70% to obtain result 5, and result 5 is the final target image.
[0058] By performing at least one image enhancement process on the image to be processed, image enhancement can be performed on the image to be processed from multiple dimensions, thereby improving the image quality of the image to be processed.
[0059] The image processing method provided in this embodiment obtains an image to be processed, wherein the image to be processed includes an image of a first size and an image of a second size, wherein the first size is larger than the second size; performs image content encoding and image quality encoding on the image of the first size and the image of the second size respectively, and obtains image content encoding features and image quality encoding features; splices the image content encoding features and the image quality encoding features to obtain an image feature representation; obtains an image quality evaluation parameter of the image to be processed based on the image feature representation; if the image quality evaluation parameter is lower than a preset threshold, performs at least one image enhancement process on the image to be processed to obtain a target image. Thus, the above method realizes performing image content encoding and image quality encoding on images to be processed of different sizes respectively, so as to extract more accurate image features by making full use of the information of the image itself, and then evaluates the quality of the image to be processed based on the extracted image features, and performs targeted image enhancement on the image to be processed according to the image quality evaluation result, so as to improve the shooting quality of the image to be processed, thereby improving the user experience.
[0060] See also Figure 4 , shows a flow chart of an image processing method provided by another embodiment of the present application. This embodiment provides an image processing method that can be applied to an electronic device, which can be a mobile phone, a computer, a tablet or a wearable electronic device. The specific type of electronic device is not limited. The method includes:
[0061] Step S210: Acquire an image to be processed, wherein the image to be processed includes an image of a first size and an image of a second size, wherein the first size is larger than the second size.
[0062] The specific implementation of step S210 may refer to the relevant description in step S110 and will not be repeated here.
[0063] Step S220: performing image content coding and image quality coding on the first-size image and the second-size image respectively to obtain image content coding features and image quality coding features.
[0064] The specific implementation of step S220 may refer to the relevant description in step S120 and will not be repeated here.
[0065] Step S230: concatenate the image content coding features and the image quality coding features to obtain an image feature representation.
[0066] The specific implementation of step S230 may refer to the relevant description in step S130, which will not be repeated here.
[0067] Step S240: obtaining image quality evaluation parameters of the image to be processed based on the image feature representation.
[0068] The specific implementation of step S240 may refer to the relevant description in step S140 and will not be repeated here.
[0069] Step S250: If the image quality evaluation parameter is lower than a preset threshold, obtaining at least one quality evaluation factor corresponding to the image to be processed.
[0070] In the process of performing image enhancement processing on the image to be processed, if the image quality evaluation parameter is lower than a preset threshold, as a way, at least one quality evaluation factor corresponding to the image to be processed can be first obtained. For example, as an implementation method, if the image quality evaluation parameter is lower than the preset threshold, the image feature representation can be input into multiple image quality evaluation factor discriminators in a multi-task manner to obtain at least one quality evaluation factor corresponding to the image to be processed.
[0071] Specifically, when the image quality evaluation parameter is lower than a preset threshold, it can be determined that the quality of the image to be processed is poor. At this time, in order to more accurately determine the cause of the poor image quality of the image to be processed, the image feature representation can be input into at least one pre-trained cause judgment classifier (i.e., image quality evaluation factor discriminator). Each cause judgment classifier can determine whether the cause of the poor image quality of the image to be processed is the cause type corresponding to the classifier based on the image feature representation. For the sake of ease of description, the cause type can be referred to as a quality evaluation factor. Then, by inputting the image feature representation into at least one pre-trained cause judgment classifier, at least one quality evaluation factor corresponding to the image to be processed can be obtained.
[0072] Among them, at least one cause judgment classifier can use a multi-task method to perform parallel judgment to improve judgment efficiency and further improve image processing efficiency.
[0073] Optionally, the specific value and setting method of the quality evaluation factor can be determined according to actual needs. For example, if the quality evaluation factor is greater than 0, it can be determined that the cause of the poor quality of the image to be processed includes the quality evaluation factor, and if the quality evaluation factor is less than 0, it can be determined that the cause of the poor quality of the image to be processed does not include the quality evaluation factor.
[0074] Step S260: Obtain at least one confidence parameter corresponding to the at least one quality evaluation factor.
[0075] In this embodiment, in order to improve the effect of image processing, at least one confidence parameter corresponding to the at least one quality evaluation factor can be obtained, that is, each cause judgment classifier can output a confidence parameter, so that the user can distinguish (identify) the probability that the cause of the poor image quality of the image to be processed is the cause type corresponding to different cause judgment classifiers. The confidence parameters corresponding to different quality evaluation factors can be different (for example, five different quality evaluation factors correspond to five different confidence parameters) or partially the same (for example, five different quality evaluation factors correspond to three different confidence parameters).
[0076] For example, suppose that the "whether the image has rain classifier" is used to judge whether the reason for the poor image quality of the image to be processed is "rain", and the confidence parameter output by the "whether the image has rain classifier" is 0.8; the "whether the image has fog classifier" is used to judge whether the reason for the poor image quality of the image to be processed is "fog", and the confidence parameter output by the "whether the image has fog classifier" is 0.6; the "whether the image has flare classifier" is used to judge whether the reason for the poor image quality of the image to be processed is "flare", and the confidence parameter output by the "whether the image has flare classifier" is 0.7; then it can be determined that 80% of the reasons for the poor image quality of the image to be processed are rain, 70% are flares, and 60% are fog.
[0077] Step S270: Acquire an image enhancement model corresponding to the at least one quality evaluation factor.
[0078] In this embodiment, when at least one confidence parameter corresponding to at least one quality evaluation factor is obtained, in order to be able to perform image enhancement processing on the image to be processed more specifically and thus improve the quality of the image to be processed, an image enhancement model corresponding to at least one quality evaluation factor can be obtained. Different quality evaluation factors correspond to different image enhancement models.
[0079] For example, in the above example, the quality evaluation factor corresponding to the "whether the image has rain classifier" is "the image has rain", and the image enhancement model corresponding to the quality evaluation factor "the image has rain" is the "image deraining model"; the quality evaluation factor corresponding to the "whether the image has fog classifier" is "the image has fog", and the image enhancement model corresponding to the quality evaluation factor "the image has fog" is the "image defogging model"; and the quality evaluation factor corresponding to the "whether the image has flare classifier" is "the image has flare", and the image enhancement model corresponding to the quality evaluation factor "the image has flare" is the "image deflare model".
[0080] Step S280: performing image enhancement processing on the image to be processed in sequence based on the corresponding image enhancement model according to the size relationship of the at least one confidence parameter to obtain a target image.
[0081] In this embodiment, when an image enhancement model corresponding to at least one quality evaluation factor is obtained, image enhancement processing can be performed on the images to be processed in sequence based on the corresponding image enhancement model according to the size relationship of at least one confidence parameter to obtain a target image.
[0082] Specifically, the quality evaluation factors in this embodiment may include a first quality evaluation factor and a second quality evaluation factor. If the confidence parameter of the first quality evaluation factor is greater than the confidence parameter of the second quality evaluation factor, image enhancement processing can be first performed on the processed image based on the image enhancement model corresponding to the first quality evaluation factor to obtain a first reference image; and then image enhancement processing can be further performed on the first reference image based on the image enhancement model corresponding to the second quality evaluation factor to obtain a target image.
[0083] In a specific application scenario, see Figure 5 , shows an example flow chart of image processing for an image to be processed provided by an embodiment of the present application. Figure 5 As shown, we can first process the image ( Figure 5 The leftmost image) is encoded with image content and image quality according to the above-described method, and then the encoding results of the two are merged to obtain a spliced feature representation of 8192 dimensions, which is then input into the image quality assessment regressor and the classifier for judging the causes of poor image quality. Then, according to the size relationship of the confidence parameters of each classifier and the corresponding image quality enhancement model, the processed images are enhanced in turn. The final image is the target image ( Figure 5 rightmost image).
[0084] The image processing method provided in this embodiment realizes image content encoding and image quality encoding of images to be processed of different sizes respectively, so as to extract more accurate image features by making full use of the information of the image itself, and then evaluate the quality of the image to be processed based on the extracted image features, and perform targeted image enhancement on the image to be processed according to the image quality evaluation result, so as to improve the shooting quality of the image to be processed, thereby improving the user experience.
[0085] At the same time, by combining the confidence parameters output by each of the discriminators of multiple image quality evaluation factors, the image to be processed is enhanced in an orderly manner. Compared with performing multiple image enhancements on the image to be processed at the same time, this can be more targeted, thereby better solving the quality problems existing in the shooting process of the image to be processed, improving the look and feel of the image to be processed, and thus enhancing the user experience.
[0086] See also Figure 6, is a structural block diagram of an image processing device provided in an embodiment of the present application. This embodiment provides an image processing device 300, which can be run on an electronic device. The device 300 includes a to-be-processed image acquisition module 310, an image feature extraction module 320, an image stitching module 330, an image quality evaluation parameter acquisition module 340 and an image processing module 350:
[0087] The to-be-processed image acquisition module 310 is used to acquire the to-be-processed image, wherein the to-be-processed image includes an image of a first size and an image of a second size, wherein the first size is larger than the second size.
[0088] The image feature extraction module 320 is used to perform image content coding and image quality coding on the first size image and the second size image respectively to obtain image content coding features and image quality coding features.
[0089] As an implementation manner, the image feature extraction module 320 can be used to input the first size image and the second size image into an image content encoder respectively, so as to perform image content encoding on the first size image and the second size image through the image content encoder, and output first image features and second image features; splice the first image features and the second image features to obtain image content coding features; input the first size image and the second size image into an image quality encoder respectively, so as to perform image quality encoding on the first size image and the second size image through the image quality encoder, and output third image features and fourth image features; splice the third image features and the fourth image features to obtain image quality coding features.
[0090] Optionally, acquiring the image quality evaluation parameter of the image to be processed based on the image feature representation may include: inputting the image feature representation into an image quality regressor, and acquiring the image quality evaluation parameter output by the image quality regressor.
[0091] The image stitching module 330 is used to stitch the image content coding features and the image quality coding features to obtain an image feature representation.
[0092] The image quality evaluation parameter acquisition module 340 is used to acquire the image quality evaluation parameter of the image to be processed based on the image feature representation.
[0093] The image processing module 350 is used to perform at least one image enhancement process on the image to be processed to obtain a target image if the image quality evaluation parameter is lower than a preset threshold.
[0094] As an embodiment, the image processing module 350 can be used to obtain at least one quality evaluation factor corresponding to the image to be processed if the image quality evaluation parameter is lower than a preset threshold; obtain at least one confidence parameter corresponding to the at least one quality evaluation factor; obtain an image enhancement model corresponding to the at least one quality evaluation factor; and perform image enhancement processing on the image to be processed in sequence based on the corresponding image enhancement model according to the size relationship of the at least one confidence parameter to obtain a target image.
[0095] As an implementation method, the quality evaluation factor includes a first quality evaluation factor and a second quality evaluation factor. If the confidence parameter of the first quality evaluation factor is greater than the confidence parameter of the second quality evaluation factor, the image enhancement processing is performed on the image to be processed in sequence based on the corresponding image enhancement model according to the size relationship of the at least one confidence parameter to obtain a target image, including: performing image enhancement processing on the image to be processed based on the image enhancement model corresponding to the first quality evaluation factor to obtain a first reference image; performing image enhancement processing on the first reference image based on the image enhancement model corresponding to the second quality evaluation factor to obtain a target image.
[0096] In this implementation, different quality evaluation factors correspond to different image enhancement models.
[0097] As an implementation method, if the image quality evaluation parameter is lower than a preset threshold, obtaining at least one quality evaluation factor corresponding to the image to be processed may include: if the image quality evaluation parameter is lower than a preset threshold, using a multi-task method to input the image feature representation into multiple image quality evaluation factor discriminators to obtain at least one quality evaluation factor corresponding to the image to be processed.
[0098] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0099] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0100] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0101] See also Figure 7Based on the above-mentioned image processing method and apparatus, the embodiment of the present application further provides an electronic device 100 that can execute the above-mentioned image processing method. The electronic device 100 includes a memory 102 and one or more (only one is shown in the figure) processors 104 coupled to each other, and the memory 102 and the processor 104 are connected by a communication line. The memory 102 stores a program that can execute the content of the above-mentioned embodiment, and the processor 104 can execute the program stored in the memory 102.
[0102] Among them, the processor 104 may include one or more processing cores. The processor 104 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 102, and calling data stored in the memory 102. Optionally, the processor 104 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 104 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 104, but may be implemented separately through a communication chip.
[0103] The memory 102 may include a random access memory (RAM) or a read-only memory (ROM). The memory 102 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the aforementioned embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0104] Please refer to Figure 8, which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 400 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0105] The computer readable storage medium 400 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 400 includes a non-transitory computer-readable storage medium. The computer readable storage medium 400 has storage space for program code 410 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 410 can be compressed, for example, in an appropriate form.
[0106] In summary, the embodiment of the present application provides an image processing method, device, electronic device and storage medium. The method can be applied to electronic devices. The method obtains an image to be processed, wherein the image to be processed includes an image of a first size and an image of a second size, wherein the first size is larger than the second size; performs image content encoding and image quality encoding on the image of the first size and the image of the second size respectively to obtain image content encoding features and image quality encoding features; splices the image content encoding features and the image quality encoding features to obtain an image feature representation; obtains an image quality evaluation parameter of the image to be processed based on the image feature representation; if the image quality evaluation parameter is lower than a preset threshold, performs at least one image enhancement process on the image to be processed to obtain a target image. Thus, the above-mentioned method realizes that the images to be processed of different sizes are respectively subjected to image content encoding and image quality encoding, so as to extract more accurate image features by making full use of the information of the image itself, and then evaluates the quality of the image to be processed based on the extracted image features, and performs targeted image enhancement on the image to be processed according to the image quality evaluation result, so as to improve the shooting quality of the image to be processed, thereby improving the user experience.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire an image to be processed, wherein the image to be processed includes an image of a first size and an image of a second size, wherein the first size is larger than the second size; Performing image content coding and image quality coding on the first-size image and the second-size image respectively to obtain image content coding features and image quality coding features; Concatenating the image content coding features and the image quality coding features to obtain an image feature representation; Acquiring an image quality evaluation parameter of the image to be processed based on the image feature representation; If the image quality evaluation parameter is lower than a preset threshold, at least one image enhancement process is performed on the image to be processed to obtain a target image.
2. The method according to claim 1, characterized in that: If the image quality evaluation parameter is lower than a preset threshold, performing at least one image enhancement process on the image to be processed to obtain a target image, including: If the image quality evaluation parameter is lower than a preset threshold, obtaining at least one quality evaluation factor corresponding to the image to be processed; Acquire at least one confidence parameter corresponding to the at least one quality evaluation factor; Acquire an image enhancement model corresponding to the at least one quality evaluation factor; According to the size relationship of the at least one confidence parameter, image enhancement processing is performed on the image to be processed in sequence based on the corresponding image enhancement model to obtain a target image.
3. The method according to claim 2, characterized in that The quality evaluation factor includes a first quality evaluation factor and a second quality evaluation factor. If a confidence parameter of the first quality evaluation factor is greater than a confidence parameter of the second quality evaluation factor, performing image enhancement processing on the to-be-processed image in sequence based on the corresponding image enhancement model according to the magnitude relationship of the at least one confidence parameter to obtain a target image, including: Performing image enhancement processing on the image to be processed based on the image enhancement model corresponding to the first quality evaluation factor to obtain a first reference image; Perform image enhancement processing on the first reference image based on the image enhancement model corresponding to the second quality evaluation factor to obtain a target image.
4. The method according to claim 2, characterized in that: Different quality evaluation factors correspond to different image enhancement models.
5. The method according to claim 2, characterized in that: If the image quality evaluation parameter is lower than a preset threshold, obtaining at least one quality evaluation factor corresponding to the image to be processed includes: If the image quality evaluation parameter is lower than a preset threshold, the image feature representation is input into a plurality of image quality evaluation factor discriminators in a multi-task manner to obtain at least one quality evaluation factor corresponding to the image to be processed.
6. The method according to any one of claims 1 to 5, characterized in that: The performing image content coding and image quality coding on the first size image and the second size image respectively to obtain image content coding features and image quality coding features includes: Inputting the first-size image and the second-size image into an image content encoder respectively, so as to perform image content encoding on the first-size image and the second-size image by the image content encoder, and outputting first image features and second image features; Concatenate the first image feature and the second image feature to obtain an image content coding feature; Inputting the first size image and the second size image into an image quality encoder respectively, so as to perform image quality encoding on the first size image and the second size image through the image quality encoder, and outputting a third image feature and a fourth image feature; The third image feature and the fourth image feature are concatenated to obtain an image quality coding feature.
7. The method according to claim 6, characterized in that The obtaining of the image quality evaluation parameter of the image to be processed based on the image feature representation includes: The image feature representation is input into an image quality regressor to obtain an image quality evaluation parameter output by the image quality regressor.
8. An image processing device, characterized in that: The device comprises: The to-be-processed image acquisition module is used to acquire the to-be-processed image, wherein the to-be-processed image includes an image of a first size and an image of a second size, wherein the first size is larger than the second size; An image feature extraction module, used to perform image content coding and image quality coding on the first size image and the second size image respectively, to obtain image content coding features and image quality coding features; An image splicing module, used for splicing the image content coding features and the image quality coding features to obtain an image feature representation; An image quality evaluation parameter acquisition module, used for acquiring the image quality evaluation parameter of the image to be processed based on the image feature representation; The image processing module is used to perform at least one image enhancement process on the image to be processed to obtain a target image if the image quality evaluation parameter is lower than a preset threshold.
9. An electronic device, characterized in that: comprising one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method according to any one of claims 1 to 7 is executed.
