Image processing method, electronic device, storage medium and computer program product

By performing regional segmentation and parameterized adjustment on the image, the problem of reduced image quality caused by common parameter beautification in the prior art is solved, and a higher quality image processing effect is achieved.

CN118229602BActive Publication Date: 2024-10-01HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410638363.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-10-01
Estimated Expiration
2044-05-22

AI Technical Summary

Technical Problem

When the existing technology beautifies an image, adjustment based on common parameters may lead to a reduction in image quality in local areas, resulting in image distortion and quality problems.

Method used

By dividing the image to be processed into multiple areas, using different adjustment parameters to locally adjust different areas according to the depth value and color contrast of each area, and using parameters such as color correction matrices and three-dimensional display lookup tables to perform pixel-level Adjustment.

Benefits of technology

It effectively avoids image distortion problems caused by poor image processing in local areas, improves the overall quality of the image, and ensures the clarity and color performance of the beautified image in each area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118229602B_ABST
    Figure CN118229602B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing technology, and provides an image processing method, electronic device, storage medium and computer program product. In the method, when beautifying an image to be processed, the bounding box of each object can be identified from the image to be processed. For the area selected by the bounding box of different objects, the adjustment parameter of the area can be determined according to at least one of the image data such as the depth value and color contrast of the area to adjust the area to obtain a beautified image. In this way, when beautifying the image to be processed, different adjustment parameters can be used to make local adjustments to different areas, which can effectively avoid the problem of image distortion caused by poor image processing effect in local areas, and is conducive to improving image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, electronic equipment, storage medium and computer program product. Background Art

[0002] At present, in the related solutions for image beautification, the whole image is usually beautified based on a set of general parameters, which may sacrifice the image quality of local areas in the image, resulting in quality problems such as image distortion and deformation. Summary of the invention

[0003] In order to solve the problem of image quality degradation caused by beautifying the entire image based on general parameters, the embodiments of the present application provide an image processing method, an electronic device, a storage medium, and a computer program product, including:

[0004] In a first aspect, an embodiment of the present application provides an image processing method, which is applied to an electronic device, comprising: acquiring a first image to be processed; dividing the first image into multiple regions, wherein the multiple regions include a first region and a second region; adjusting the first region based on a first adjustment parameter, and adjusting the second region based on a second adjustment parameter to obtain a second image.

[0005] Based on the above scheme, when beautifying the image to be processed, different adjustment parameters can be used to perform local adjustments on different areas, which can effectively avoid the problem of image distortion caused by poor image processing effect in local areas, and is conducive to improving image quality.

[0006] It can be understood that in some specific implementations, in the scene of beautifying an image, the first image can be the image to be processed mentioned below, and the second image can be the beautified image mentioned below. In addition, the region in the multiple regions includes but is not limited to the first region and the second region, and the regions in the multiple regions can be sequentially described as the first region, the second region, etc. for distinction.

[0007] In some optional implementations, the first area may include objects. For example, in a portrait shooting scene, the object may be part or all of the shooting subject, such as the person's face, the person's arms, the person's skirt, bricks on the wall, doorbells and door handles on the wall.

[0008] In some optional implementations of the first aspect, the first adjustment parameter and the second adjustment parameter include at least one of the following: a color correction matrix, a three-dimensional display lookup table, sharpness, color contrast, blur level, clarity, and exposure.

[0009] It can be understood that the first adjustment parameter and the second adjustment parameter may also include other parameters, which are not specifically limited in the embodiment of the present application.

[0010] In some optional implementations of the first aspect, the first adjustment parameter is determined by: extracting image parameters of each pixel in the first area, where the image parameters include depth values ​​and / or contrast; and determining the first adjustment parameter based on the image parameters of each pixel in the first area.

[0011] In some optional implementations, depth estimation may be performed on the first image, and the depth value of each pixel in the first image may be extracted to obtain the depth value of each region. Based on the depth value of each region, different adjustment parameters may be used to perform different degrees of adjustment on different regions.

[0012] In some other optional implementations, the color contrast of each region in the first image may be extracted, and based on the color contrast of each region, different adjustment parameters may be used to perform different degrees of adjustment on different regions.

[0013] In other optional implementations, the depth value of each area in the first image can be extracted, and the color contrast of each area in the first image can be extracted, and based on the depth value and color contrast of each area, different adjustment parameters can be used to adjust different areas to different degrees.

[0014] In an embodiment of the present application, when beautifying the first image to be processed, different adjustment parameters can be used for different areas in the first image to be processed by comprehensively considering whether the depth value and color contrast of the area meet the preset adjustment conditions, thereby further improving the image quality of the beautified image.

[0015] In some optional implementations of the first aspect, a first adjustment parameter is determined based on the image parameters of each pixel in the first area, including: corresponding to the image parameters of each pixel in the first area satisfying a preset adjustment condition, a color correction matrix and a three-dimensional display lookup table are determined as the first adjustment parameter; corresponding to the image parameters of each pixel in the first area not satisfying the preset adjustment condition, a color correction matrix is ​​determined as the first adjustment parameter.

[0016] For example, when the depth value of a certain area does not meet the preset adjustment conditions, such as when the average value of the depth values ​​of the pixels in the area is greater than the preset average value threshold, the color correction matrix is ​​used to adjust the area. When the depth value of a certain area meets the preset adjustment conditions, such as when the average value of the depth values ​​of the pixels in the area is less than or equal to the preset average value threshold, the color correction matrix and the three-dimensional display lookup table can be used to adjust the area.

[0017] For example, when the color contrast of a certain area does not meet the preset adjustment conditions, for example, when the color contrast of the area is greater than the preset color contrast threshold, the color correction matrix can be used to adjust the area. When the color contrast of a certain area meets the preset adjustment conditions, for example, when the color contrast of the area is less than or equal to the preset color contrast threshold, the color correction matrix and the three-dimensional display lookup table can be used to adjust the area.

[0018] For example, when the depth value of a certain area does not meet the preset adjustment conditions, such as when the average value of the depth values ​​of the pixels in the area is greater than the preset average value threshold, or when the color contrast of the area does not meet the preset adjustment conditions, such as when the color contrast of the area is greater than the preset color contrast threshold, the color correction matrix can be used to adjust the area. When the depth value of a certain area meets the preset adjustment conditions, such as when the average value of the depth values ​​of the pixels in the area is less than or equal to the preset average value threshold, and the color contrast of the area meets the preset adjustment conditions, such as when the color contrast of the area is less than or equal to the preset color contrast threshold, the color correction matrix and the three-dimensional display lookup table can be used to adjust the area, or the area is not adjusted.

[0019] In some optional implementations of the first aspect, the preset adjustment condition includes at least one of the following: an average depth value of multiple pixels in the first area is less than or equal to an average value threshold, and a contrast of the first area is less than or equal to a contrast threshold.

[0020] It is understandable that the preset adjustment condition may also include conditions, which are not specifically limited in the embodiments of the present application.

[0021] In some optional implementations of the first aspect, corresponding to the first adjustment parameter being a color correction matrix, the first area is adjusted based on the first adjustment parameter, including: extracting a first pixel value of each pixel in the first area in a first color space, wherein the first color space includes an RGB space; multiplying the first pixel value of each pixel in the first area by the color correction matrix to obtain a second pixel value of each pixel.

[0022] It can be understood that both the first pixel value and the second pixel value can be RGB data.

[0023] In some specific implementations, the following formula may be used to multiply the RGB data of each pixel by the color correction matrix to obtain the transformed RGB data of each pixel.

[0024] I output = M×I input T

[0025] in, I output It can represent the transformed RGB data of each pixel. I input It can represent the RGB data of each pixel before transformation. T can represent transpose operations, for example, I input T It can represent the transpose of the RGB data before each pixel transformation. M A color correction matrix can be represented.

[0026] In some optional implementations of the first aspect, corresponding to the first adjustment parameter being a color correction matrix and a three-dimensional display lookup table, the first area is adjusted based on the first adjustment parameter, including: extracting a first pixel value of each pixel in the first area in a first color space, wherein the first color space includes an RGB space; based on a mapping relationship between the first color space and the second color space, converting the first pixel value of each pixel to obtain a third pixel value corresponding to the first pixel value in the second color space, wherein the second color space includes an HSL color space; adjusting the first area based on the third pixel value of each pixel in the second color space and the data in the three-dimensional display lookup table.

[0027] In some optional implementations of the first aspect, based on the third pixel value of each pixel in the second color space and data in a three-dimensional display lookup table, the first area is adjusted, including: corresponding to a fourth pixel value in the three-dimensional display lookup table that is the same as the third pixel value of each pixel in the second color space, adjusting the third pixel value of each pixel in the first area to the fourth pixel value in the three-dimensional display lookup table; corresponding to a pixel value in the three-dimensional display lookup table that is not the same as the third pixel value of each pixel in the second color space, interpolating a fourth pixel value in the three-dimensional display lookup table that is adjacent to the third pixel value of each pixel in the second color space to obtain a fifth pixel value of each pixel in the second color space, and adjusting the third pixel value of each pixel in the first area to the fifth pixel value in the three-dimensional display lookup table.

[0028] It can be understood that the first pixel value may be RGB data, and the third pixel value and the fourth pixel value may both be HSL data.

[0029] In some specific implementations, the following formula may be used to adjust the HSL data of each pixel. In this way, the hue, saturation, and brightness may be adjusted.

[0030]

[0031] in, H outIt can represent the adjusted hue of each pixel. H in It can represent the hue of each pixel before adjustment. ΔH Can be expressed H in The corresponding disturbance term is, S out It can represent the adjusted saturation of each pixel. H in It can represent the saturation of each pixel before adjustment. ΔS Can be expressed S in The corresponding disturbance term is, L out It can represent the adjusted brightness of each pixel. L in It can represent the brightness of each pixel before adjustment. ΔL Can be expressed L in The corresponding disturbance term.

[0032] In some other specific implementations, the RGB data of each pixel in each area of ​​the image to be processed may be converted into HSL data. If the HSL data of a certain pixel does not fall on the 256×256×256 anchor points of the HSL color space, the HSL data of the pixel may be determined by interpolation.

[0033] In the embodiment of the present application, the numerical value corresponding to each anchor point of the HSL color space can be a tiny amount, so that fine-grained adjustment of each pixel can be achieved, thereby improving image quality.

[0034] In some optional implementations of the first aspect, segmenting the first image into multiple regions includes: extracting image features of each pixel in the first image, where the image features include at least one of color, texture, and depth; determining multiple bounding boxes in the first image based on the image features of each pixel in the first image; and dividing the first image into multiple regions based on the multiple bounding boxes.

[0035] In some optional implementations, when beautifying the first image, the first image can be first input into a segmentation model (e.g., segment anything model, SAM), and then the image output by the SAM can be input into a recognition model (e.g., recognize anything model, RAM), or the first image can be directly input into a RAM model to identify the bounding box of each object in the first image and the category of the object in the area selected by the bounding box of each object.

[0036] It can be understood that instance segmentation can also be used to identify the bounding box of each object in the first image and the category of the object in the area selected by the bounding box of each object. Other methods can also be used to identify the bounding box of each object in the first image and the category of the object in the area selected by the bounding box of each object. The embodiments of the present application are not specifically limited to this.

[0037] It is understandable that, in order to reduce the amount of data processing, for the SAM model and the RAM model, the model is not required to be able to identify the categories of all objects in the first image, but only needs to identify the categories of the objects of focus.

[0038] For example, in a portrait shooting scene, the model is required to be able to identify the categories of the focus objects such as the face and arms of the person in the first image, so that when beautifying the first image, the focus can be on beautifying the color (i.e., skin color) of the face and arms of the person. For another example, in a landscape shooting scene, the model is required to be able to identify the categories of objects such as the sunset in the first image and the car in a prominent position in the foreground image, so that when beautifying the first image, the focus can be on beautifying the sunset and the car in a prominent position in the foreground image.

[0039] In some specific implementations, the RAM model can output the category name of the object identified in the first image, and can also output the confidence of the category of the identified object. For example, the RAM model can identify that the category of the object is a car, and can also identify the confidence that the object is a car, that is, the RAM model can output (car, 0.95), which means that the confidence that the object is a car is 95%. Based on this, a confidence threshold can be set in advance, and the category recognition of objects with low confidence is not considered. In this way, the amount of data processing can be reduced and the data processing efficiency can be improved.

[0040] In some optional implementations of the first aspect, the method also includes: scoring the second image as a whole and locally to determine a total score of the second image; corresponding to the total score of the second image being less than a preset score threshold, adjusting the first adjustment parameter to a third adjustment parameter based on an optimization algorithm, and adjusting the second adjustment parameter to a fourth adjustment parameter; adjusting the first area based on the third adjustment parameter, and adjusting the second area based on the fourth adjustment parameter to obtain a third image.

[0041] In some optional implementations of the first aspect, the optimization algorithm includes an evolutionary algorithm and / or a Bayesian optimization algorithm.

[0042] In some optional implementations of the first aspect, the second image is scored as a whole and partially to determine a total score of the second image, including: scoring the second image as a whole to obtain an overall score of the second image; scoring a first area in the second image and scoring a second area in the second image to obtain a local score of the second image; and determining the total score of the second image based on the overall score and the local score of the second image.

[0043] In some specific implementations, the overall score of the second image, the regional scores of each region, and the dimension scores of each dimension of each region may be determined, wherein the total score of the regional scores and the dimension scores may be used as the local score. Then, the product of the overall score of the second image, the regional scores of each region, and the dimension scores of each dimension of each region and the corresponding weights may be used as the total score of the second image.

[0044] It is understandable that the first image may be scored as a whole and in part, that is, the image to be processed before beautification may be scored. If the total score of the first image is greater than a preset score threshold, that is, the quality of the first image is high, the first image may not be beautified, thus saving processing resources.

[0045] In some optional implementations of the first aspect, the first area in the second image is scored, and the second area in the second image is scored to obtain a local score of the second image, including: scoring the first area and the second area of ​​the second image respectively to obtain a first area score of the first area and a second area score of the second area; scoring at least one dimension in the first area and the second area of ​​the second image respectively to obtain a dimension score corresponding to the first area in at least one dimension and a dimension score corresponding to the second area in at least one dimension, wherein the at least one dimension includes color, noise, clarity, exposure, sharpness, color contrast, hue, saturation, brightness, blur, light and shadow effects, and 3D effects; determining the local score of the second image according to the first area score of the first area, the second area score of the second area, the dimension score corresponding to the first area in at least one dimension, and the dimension score corresponding to the second area in at least one dimension.

[0046] In some specific implementations, when beautifying a single dimension of the first image, such as beautifying the color dimension, the following formula can be used to sum the products of the overall score of the second image, the regional scores of each region, and the dimension scores of the color dimension of each region with the corresponding weights to obtain the total score of the second image.

[0047]

[0048] in, scoreall can represent the total score of the second image, w 1 It can represent the weight corresponding to the overall score, C The overall score of the second image can be expressed as C , w 2 It can represent the weight corresponding to the local score, w j Can indicate the j The weight corresponding to each region is B j The second image can be represented by j The regional score of each region, A j The second image can be represented by j The dimension score of the color dimension of each region, M can represent the total number of regions.

[0049] and, w 1 + w 2 =1, .

[0050] In other specific implementations, when beautifying all dimensions of the first image, the following formula is used to multiply the overall score of the second image, the regional score of each area, and the dimensional score of each dimension of each area with the corresponding weight to obtain the total score of the second image.

[0051]

[0052] in, score all can represent the total score of the second image, w 1 It can represent the weight corresponding to the overall score, C The overall score of the second image can be expressed as C , w 2 It can represent the weight corresponding to the regional score, w j Can indicate the j The weight corresponding to each region is B j The second image can be represented by j The regional score of each region, w j Can indicate the i The weights corresponding to the dimensions are A ij The second image can be represented by j Regioni The dimension score of the dimension, M can represent the total number of regions, and N can represent the j The total number of dimensions for each region.

[0053] and, w 1 + w 2 =1, , .

[0054] In some optional implementations of the first aspect, scoring the first area and the second area of ​​the second image respectively includes: scoring the first area and the second area of ​​the second image respectively using a scoring algorithm.

[0055] In some optional implementations of the first aspect, the scoring algorithm includes any one of the following: CNN-IQA algorithm, HyperlQA algorithm, NIMA algorithm, KonlQ++ algorithm, Transformer model.

[0056] It can be understood that after obtaining the beautified image, not only can the beautified image be scored using a scoring algorithm to determine the image quality of the beautified image, but the quality of the beautified image can also be determined by performing Fourier transform, derivation, etc. on the beautified image. When the image quality of the beautified image is lower than the preset quality standard, the above-mentioned evolutionary algorithm or Bayesian optimization algorithm can be used to automatically adjust the adjustment parameters.

[0057] In some optional implementations of the first aspect, the method further includes: normalizing the overall score of the second image and the local score of the second image so that the overall score of the second image and the local score of the second image are in the same range.

[0058] It can be understood that in order to reduce the gap between dimension scores of different dimensions, after determining the dimension score of each dimension, a mapping function can be used to map the dimension score of each dimension to between 0 and 1. For example, when the dimension score has positive and negative values, each dimension score can be mapped to between 0 and 1, and when the dimension score has only positive values, each dimension score can be mapped to between 0 and 1. The sigmoid mapping function and the tanh function can be in the form shown in the following formula:

[0059]

[0060]

[0061] Among them, α can represent the adjustment factor, x can represent the score before mapping, and y can represent the score after mapping. It can be understood that the adjustment factor can be fixed first, and then the dimension scores between different dimensions are mapped.

[0062] It is worth noting that the overall score of the image to be processed and the regional scores of each region also need to be normalized to between 0 and 1, so as to reduce the gap between the overall score, the regional scores of different regions and the dimension scores between different dimensions.

[0063] In a second aspect, the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the one or more processors of the electronic device, for executing the image processing method mentioned in the first aspect of the present application or any item of the first aspect.

[0064] In a third aspect, the present application provides a readable storage medium having instructions stored thereon. When the instructions are executed on an electronic device, the electronic device executes the image processing method mentioned in the first aspect of the present application or any item of the first aspect.

[0065] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions. When executed by an electronic device, the electronic device executes the computer program code of the image processing method mentioned in the first aspect of the present application or any item of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 A schematic diagram of an image beautification scene is shown;

[0067] Figure 2 According to some embodiments of the present application, a schematic diagram of an image processing process is shown;

[0068] Figure 3 According to some embodiments of the present application, a schematic diagram of segmenting an image to be processed to obtain multiple regions is shown;

[0069] Figure 4 According to some embodiments of the present application, a schematic diagram of identifying an image to be processed to obtain a target image is shown;

[0070] Figure 5 According to some embodiments of the present application, another schematic diagram of an image processing process is shown;

[0071] Figure 6 According to some embodiments of the present application, a schematic diagram of a sigmoid mapping function is shown;

[0072] Figure 7According to some embodiments of the present application, a schematic diagram of a tanh function is shown;

[0073] Figure 8 According to some embodiments of the present application, a schematic diagram of the hardware structure of an electronic device is shown;

[0074] Fig. 9 According to some embodiments of the present application, a schematic diagram of the software structure of an electronic device is shown. DETAILED DESCRIPTION

[0075] The illustrative embodiments of the present application include, but are not limited to, an image processing method, an electronic device, a storage medium, and a computer program product.

[0076] It can be understood that the image processing method mentioned in the embodiments of the present application can be used in electronic devices, where the electronic devices can also be called terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. The electronic devices can be mobile phones, wearable devices, tablet computers (Pad), etc.

[0077] It can be understood that the image processing method mentioned in the embodiments of the present application can be applied to scenarios such as image beautification, taking pictures, recording videos, and video calls.

[0078] Figure 1 A schematic diagram of an image beautification scene is shown. Figure 1 As shown, image A can be beautified based on default parameters (a general parameter) or filters. It can be understood that HSL (a color mode) can include three dimensions: hue (H), saturation (S), and lightness (L). Among them, the value range of H can be 0~360°, and the value range of S and L can both be 0%~100%. In order to facilitate data processing, the values ​​of the three dimensions of HSL can be normalized to 0-1, or to -100 to 100. For example, the values ​​of the three dimensions of HSL can be normalized to between -100 and 100.

[0079] In this way, the hue of image A can be adjusted from a value of 60 to a value of 63, the saturation can be adjusted from a value of -30 to a value of -36, and the brightness can be adjusted from a value of 0 to a value of -5, to obtain the beautified image B. Comparing images A and B, it can be seen that beautifying the entire image based on the default parameters or filters will uniformly modify the entire image, which may improve some areas, but the image quality of other areas will be reduced, such as color cast, low brightness, high saturation and other problems. Therefore, when beautifying the entire image based on the default parameters or filters, all local areas cannot be taken into account. Moreover, when the default parameters also include parameters such as sharpness, color contrast, and blur (blur) degree, uniformly adjusting the entire image will cause the entire image to change, resulting in reduced image quality.

[0080] In order to solve the above problems, an embodiment of the present application provides an image processing method. When beautifying an image to be processed, the bounding box of each object can be identified from the image to be processed. For example, in a portrait shooting scene, the object can be part or all of the subject of the shooting, such as the face of a person, the arm of a person, the skirt of a person, a brick on a wall, a doorbell on a wall, a door handle, etc. The bounding box of the object can represent the position of the object. For the areas selected by the bounding boxes of different objects, the adjustment parameters of the area can be determined according to at least one of the image data such as the depth value and color contrast of the area to adjust the area to obtain a beautified image. In this way, when beautifying the image to be processed, different adjustment parameters can be used to make local adjustments to different areas, which can effectively avoid the problem of image distortion caused by poor image processing effect in local areas, which is conducive to improving image quality.

[0081] It can be understood that when performing depth estimation on the image to be processed, the depth value can reflect the distance between the area selected by the bounding box of the object and the image acquisition device (such as a camera). For example, the closer the area selected by the bounding box of the object is to the image acquisition device, the smaller the depth value of the area selected by the bounding box of the object.

[0082] It is understood that a segmentation model (such as segment anything model, SAM) can be used to identify the bounding box of each object in the image to be processed. Alternatively, an instance segmentation method can be used to identify the bounding box of each object in the image to be processed, which is not specifically limited in the embodiments of the present application.

[0083] It is understood that the adjustment parameters may include parameters such as color correction matrix (CCM), three-dimensional display lookup table (3DLUT), sharpness, color contrast, blur (blurring), clarity, exposure, etc., which are not specifically limited in the embodiments of the present application. Among them, the color correction matrix and the three-dimensional display lookup table are both pixel-level adjustments for the image to be processed. For example, the color correction matrix adjusts the RGB data of each pixel in the area, and the three-dimensional display lookup table adjusts the HSL data of each pixel in the area.

[0084] For example, in some specific implementations, if the depth value of the area selected by the bounding box of the object does not meet the preset adjustment conditions, it is adjusted at the pixel level based on the color correction matrix, or it is not adjusted. If the depth value of the area selected by the bounding box of the object meets the preset adjustment conditions, it is adjusted at the pixel level based on the color correction matrix and the three-dimensional display lookup table. In this way, different adjustment parameters can be used for different depth values ​​of the area selected by the bounding box of the object, so that the quality of the beautified image can be improved.

[0085] The image processing method mentioned in the embodiments of the present application is introduced in detail below.

[0086] Figure 2 According to an embodiment of the present application, a flow chart of an image processing method is shown. The method can be executed by an electronic device, that is, Figure 2 The execution subject of each step of the method shown can be an electronic device.

[0087] Specifically, Figure 2 As shown, the method may include the following steps:

[0088] 201: Obtain the image to be processed.

[0089] Exemplarily, the image to be processed may be the first image to be processed mentioned above.

[0090] In some specific implementations, when beautifying an image, the image to be processed may be imported into an image processing application to perform subsequent image processing operations.

[0091] 202: Divide the image to be processed into multiple regions.

[0092] For example, a segmentation model (such as SAM) can be used to identify the bounding box of each object from the image to be processed, and the bounding box of each object can select an area. In the portrait shooting scene, the object can be part or all of the subject such as the face of the person, the arm of the person, the skirt of the person, the bricks on the wall, the doorbell on the wall, the door handle, etc. The bounding box of the object can indicate the position of the object. The regions in the multiple regions can be described as the first region, the second region, etc. in turn for distinction.

[0093] For example, in some specific implementations, the image to be processed is input into the SAM model, the image features (such as color, texture, depth, etc.) of each pixel in the image to be processed are extracted, and the bounding box of each object in the image to be processed is predicted based on the image features of each pixel in the image to be processed. In this way, the SAM model can output the image to be processed divided into multiple regions.

[0094] It is understandable that, in practical applications, other segmentation models may be used to segment the image to be processed, and the SAM model listed above is only one of the segmentation models listed in the embodiment of the present application. Instance segmentation may also be used to identify the bounding box of each object in the image to be processed from the image to be processed, so as to segment the image to be processed into multiple regions, which is not specifically limited in the embodiment of the present application.

[0095] In practical applications, the image to be processed, which is divided into multiple regions, can be input into a recognition model (such as recognize anything model, RAM) to extract image features (such as color, texture, shape, etc.) of objects in each region of the image to be processed, which is divided into multiple regions. Based on the image features in each region, the category label of the object in each region is predicted.

[0096] 203: Perform image processing on different regions based on different adjustment parameters to obtain a beautified image.

[0097] For example, the beautified image may be the second image mentioned above. The adjustment parameters may be described as a first adjustment parameter, a second adjustment parameter, etc., for distinction.

[0098] In some optional examples, the adjustment parameters may include color correction matrix, three-dimensional display lookup table, sharpness, color contrast, blur (blur) degree and other parameters, which are not specifically limited in the embodiments of the present application. The following takes the adjustment parameters including color correction matrix and three-dimensional display lookup table as an example to illustrate image processing of different areas based on different adjustment parameters.

[0099] In some optional implementations, depth estimation may be performed on the image to be processed, and the depth value of each pixel in the image to be processed may be extracted to obtain the depth value of each region. Based on the depth value of each region, different adjustment parameters may be used to adjust different regions to different degrees.

[0100] For example, when the depth value of a certain area does not meet the preset adjustment conditions, such as when the average value of the depth values ​​of the pixels in the area is greater than the preset average value threshold, the color correction matrix is ​​used to adjust the area, or the area is not adjusted. When the depth value of a certain area meets the preset adjustment conditions, such as when the average value of the depth values ​​of the pixels in the area is less than or equal to the preset average value threshold, the color correction matrix and the three-dimensional display lookup table can be used to adjust the area.

[0101] In some optional implementations, the color contrast of each region in the image to be processed may be extracted, and based on the color contrast of each region, different adjustment parameters may be used to adjust different regions to different degrees. For example, when the color contrast of a certain region does not meet the preset adjustment conditions, for example, when the color contrast of the region is greater than a preset color contrast threshold, the region may be adjusted using a color correction matrix, or the region may not be adjusted. When the color contrast of a certain region meets the preset adjustment conditions, for example, when the color contrast of the region is less than or equal to the preset color contrast threshold, the region may be adjusted using a color correction matrix and a three-dimensional display lookup table.

[0102] In some other optional implementations, the depth value of each region in the image to be processed may be extracted, and the color contrast of each region in the image to be processed may be extracted, and based on the depth value and color contrast of each region, different adjustment parameters may be used to adjust different regions to different degrees. For example, when the depth value of a certain region does not meet the preset adjustment conditions, such as when the average value of the depth values ​​of the pixels in the region is greater than the preset average value threshold, and / or when the color contrast of the region does not meet the preset adjustment conditions, such as when the color contrast of the region is greater than the preset color contrast threshold, the color correction matrix may be used to adjust the region, or the region may not be adjusted.

[0103] When the depth value of a certain area meets the preset adjustment conditions, for example, when the average value of the depth values ​​of the pixels in the area is less than or equal to the preset average value threshold, and when the color contrast of the area meets the preset adjustment conditions, for example, when the color contrast of the area is less than or equal to the preset color contrast threshold, the color correction matrix and the three-dimensional display lookup table can be used to adjust the area, or the area can not be adjusted.

[0104] In the embodiment of the present application, when beautifying an image to be processed, the image quality can be improved by adjusting different areas based on different adjustment parameters.

[0105] The following is an introduction to the specific implementation method of identifying the bounding box of each object from the image to be processed mentioned in the embodiment of the present application.

[0106] In some specific implementations, first, a SAM model for image segmentation can be pre-trained. For example, a sample image set is input into the SAM model to be trained, and each sample image in the sample image set has multiple annotated bounding boxes. The SAM model to be trained can be, for example, a convolution neural network (CNN), a recurrent neural network (RNN), a long short term memory (LSTM) or other neural network models.

[0107] For each sample image, after inputting the SAM model to be trained, the SAM model can extract the image features of each pixel in the sample image, such as color, texture, depth and other features. In addition, the SAM model can perform image segmentation on the sample image based on the image features of each pixel in the sample image, and determine multiple prediction bounding boxes in the sample image. Furthermore, the model parameters of the SAM model to be trained can be adjusted based on the position parameters of the annotated bounding box and the predicted bounding box until the pre-set training convergence conditions are met. For example, the convergence condition can include that the difference between the position parameters of the annotated bounding box and the predicted bounding box is within a preset difference range. When the model parameters of the SAM model meet the training convergence conditions, the training of the SAM model can be completed.

[0108] At the same time, a RAM model for image recognition can be trained. For example, a sample image set is input into the RAM model to be trained. Each sample image may include multiple sample bounding boxes, and the sample objects in the area selected by each sample bounding box have a corresponding labeled category probability distribution.

[0109] For each sample image, after inputting the RAM model to be trained, the RAM model can extract the image features of each pixel in the area selected by the sample bounding box, such as color, texture, shape and other features. Moreover, the RAM model can classify the sample object based on the image features of each pixel in the area selected by the sample bounding box, and determine the predicted category probability distribution corresponding to the sample object. Furthermore, the model parameters of the RAM model to be trained can be adjusted based on the labeled category probability distribution and the predicted category probability distribution until the pre-set training convergence conditions are met. For example, the convergence condition may include that the difference between the labeled category probability distribution and the predicted category probability distribution is within a preset difference range. When the model parameters of the RAM model meet the training convergence conditions, the training of the RAM model can be completed.

[0110] It can be understood that when performing model training, the existing trained SAM and RAM pre-trained models can also be fine-tuned, so that the trained SAM and RAM models can perform better in specific tasks while retaining the basic functions of the SAM and RAM pre-trained models.

[0111] As an example, Figure 3 According to an embodiment of the present application, a schematic diagram of segmenting an image to be processed to obtain multiple regions is shown.

[0112] like Figure 3 As shown, the image to be processed can be first input into the trained SAM model, and the image to be processed divided into multiple regions is output. In the image to be processed divided into multiple regions, the bounding box can be an irregular shape. In some optional implementations, the bounding box can also be a regular shape, such as a square, a rectangle, a circle, etc., which is not specifically limited in the embodiments of the present application.

[0113] As an example, Figure 4 According to an embodiment of the present application, a schematic diagram of identifying an image to be processed to obtain a target image is shown.

[0114] like Figure 4 As shown, the image to be processed, which is divided into multiple areas, can be input into the trained RAM model to output a target image marked with the category label of the object. For example, in the target image, "1", "2", "3" and "4" can be identified, where "1" can represent a water cup, "2" can represent a desktop, "3" can represent a baffle, and "4" can represent a calendar. It should be noted that the category labels in the embodiment of the present application are displayed in digital form. In actual applications, the category labels can be displayed in Chinese or English, and the embodiment of the present application does not make specific limitations.

[0115] The following is an introduction to the method of performing pixel-level adjustment on the image to be processed based on the color correction matrix mentioned in the embodiment of the present application.

[0116] It can be understood that for each pixel in each area of ​​the image to be processed (for example, the area selected by the bounding box of the person's face, the person's arm, the person's face wearing a skirt, the bricks on the wall, the doorbell on the wall, the door handle and other objects mentioned above), the RGB data of each pixel can be extracted, and then the RGB data of each pixel can be multiplied by the color correction matrix using the following formula (1) to obtain the transformed RGB data of each pixel.

[0117] I output = M×I input T Formula (1)

[0118] in, I output It can represent the transformed RGB data of each pixel. I input It can represent the RGB data of each pixel before transformation. T can represent transpose operations, for example, I input T It can represent the transpose of the RGB data before each pixel transformation. M A color correction matrix can be represented.

[0119] Color Correction Matrix M This can be represented as a 3×3 matrix, where each row of the matrix sums to 1.

[0120]

[0121] In this way, the RGB data of each pixel can be transformed to correct the white under different color temperatures to a uniform white, that is, to achieve white balance.

[0122] The following is an introduction to the method of performing pixel-level adjustment on the image to be processed based on the three-dimensional display lookup table mentioned in the embodiment of the present application.

[0123] First, the HSL color space and RGB color space are introduced.

[0124] It can be understood that, as mentioned above, HSL can include three dimensions: hue, saturation, and brightness. Among them, the value range of H can be 0~360°, and the value range of S and L can both be 0%~100%. In order to facilitate data conversion, the values ​​of the three dimensions of HSL can be normalized to 0-1, or normalized to -100 to 100. For example, the values ​​of the three dimensions of HSL can be normalized to between -100 and 100. In the method of adjusting the processed image based on the three-dimensional display lookup table, it is first necessary to fix some anchor points on the three-dimensional display lookup table, such as fixing 256×256×256 anchor points, and each anchor point corresponds to a set of HSL values. In order to reduce the amount of data processing and increase the speed of image beautification, the number of anchor points fixed on the three-dimensional display lookup table can be reduced, such as 128×128×128, and the embodiments of the present application are not specifically limited.

[0125] It can be understood that the three dimensions of the RGB color space are red (red, R), green (green, G), and blue (blue, B). In practical applications, the HSL color space and the RGB color space can be converted to each other.

[0126] Secondly, a method of performing pixel-level adjustment on the image to be processed based on a three-dimensional display lookup table is introduced.

[0127] In some specific implementations, the RGB data of each pixel in each area of ​​the image to be processed may be converted into HSL data. If the HSL data of a certain pixel does not fall on the 256×256×256 anchor points of the HSL color space, the HSL data of the pixel may be determined by interpolation.

[0128] After converting the RGB data of each pixel into HSL data, it can be adjusted to the HSL data in the three-dimensional display lookup table based on the perturbation term, that is, the value corresponding to each anchor point in the HSL color space. Specifically, the HSL data of each pixel can be adjusted using the following formula (2). In this way, the hue, saturation, and brightness can be adjusted.

[0129] Formula (2)

[0130] in, H out It can represent the adjusted hue of each pixel. H in It can represent the hue of each pixel before adjustment. ΔH Can be expressed H in The corresponding disturbance term is, S outIt can represent the adjusted saturation of each pixel. S in It can represent the saturation of each pixel before adjustment. ΔS Can be expressed S in The corresponding disturbance term is, L out It can represent the adjusted brightness of each pixel. L in It can represent the brightness of each pixel before adjustment. ΔL Can be expressed L in The corresponding disturbance term.

[0131] It can be understood that the value corresponding to each anchor point of the HSL color space can be a tiny amount, so that fine-grained adjustment of each pixel can be achieved, thereby improving image quality.

[0132] In an embodiment of the present application, when beautifying an image to be processed, different adjustment parameters can be used for different areas in the image to be processed by comprehensively considering whether the depth value and color contrast of the area meet the preset adjustment conditions, thereby further improving the image quality of the beautified image.

[0133] It can be understood that when the pixel level adjustment is performed on the region based on the color correction matrix and the three-dimensional display lookup table, since the color correction matrix has 6 independent variables and the three-dimensional display lookup table has 3×256 independent variables, 3 parameters, that is, a total of 6+3×256 3 To this end, the parameters of the 3D display lookup table can be reduced, for example, to 3×100 3 parameters, so that the amount of data processing can be reduced on the basis of improving the image quality of the beautified image.

[0134] The following is a detailed introduction to the implementation process of the image processing method mentioned in the embodiment of the present application using a specific example. Example

[0135] In some optional implementations, a single dimension of the image to be processed may be beautified, wherein the dimension of the image to be processed includes color, noise, clarity, exposure, sharpness, color contrast, hue, saturation, brightness, blur (blur) degree, light and shadow effect, 3D effect, etc. Specifically, the color of the image to be processed may be beautified.

[0136] In some specific implementations, when beautifying an image to be processed, the image to be processed can be first input into the SAM model, and then the image output by the SAM can be input into the RAM model, or the image to be processed can be directly input into the RAM model to identify the bounding box of each object in the image to be processed and the category of the object in the area selected by the bounding box of each object. For specific identification methods, please refer to the above Figure 3 and Figure 4 To avoid repetition, the steps shown are not described here again.

[0137] It can be understood that instance segmentation can also be used to identify the bounding box of each object in the image to be processed and the category of the object in the area selected by the bounding box of each object. Other methods can also be used to identify the bounding box of each object in the image to be processed and the category of the object in the area selected by the bounding box of each object. The embodiments of the present application are not specifically limited to this.

[0138] It is understandable that in order to reduce the amount of data processing, for the SAM model and the RAM model, the model is not required to be able to identify the categories of all objects in the image to be processed, but only needs to identify the categories of the objects of focus.

[0139] For example, in a portrait shooting scene, the model is required to be able to identify the categories of the focus objects such as the face and arms of the person in the image to be processed, so that when beautifying the image to be processed, the focus can be placed on beautifying the color (i.e., skin color) of the person's face and arms. For another example, in a landscape shooting scene, the model is required to be able to identify the categories of objects such as the sunset and the car in a prominent position in the foreground image in the image to be processed, so that when beautifying the image to be processed, the focus can be placed on beautifying the sunset and the car in a prominent position in the foreground image.

[0140] In some specific implementations, the RAM model can output the category name of the object identified in the image to be processed, and can also output the confidence of the category of the identified object. For example, the RAM model can identify that the category of the object is a car, and can also identify the confidence that the object is a car, that is, the RAM model can output (car, 0.95), which means that the confidence that the object is a car is 95%. Based on this, a confidence threshold can be set in advance, and the category recognition of objects with low confidence is not considered. In this way, the amount of data processing can be reduced and the data processing efficiency can be improved.

[0141] After identifying the bounding box of each object in the image to be processed, the depth value of each pixel in the area selected by the bounding box of each object can be extracted, and based on the depth value of each pixel in each area, different adjustment parameters are used to adjust different areas to different degrees to obtain a beautified image.

[0142] For example, after extracting the depth value of each pixel in a certain area, the average depth value of all pixels in the area may be calculated, and the average depth value may be compared with a preset average value threshold.

[0143] When the average depth value is greater than the preset average value threshold, that is, the area does not meet the preset adjustment condition, the area can be adjusted at the pixel level based on the color correction matrix, for example, the pixel level adjustment can be performed based on the initialized color correction matrix and the HSL data in the three-dimensional display table, wherein the initialized color correction matrix can be a unit matrix, and the perturbation item in the initialized three-dimensional display table ΔH , ΔS , ΔL All can be 0. It can be understood that the disturbance items in the color correction matrix and the three-dimensional display table can also be initialized to other random adjustment parameters, which are not specifically limited in the embodiments of the present application, and the specific adjustment method can refer to the above, and will not be repeated here to avoid repetition. When the average depth value is greater than the preset average value threshold, that is, when the area does not meet the preset adjustment conditions, the area may not be adjusted, which is not specifically limited in the embodiments of the present application.

[0144] When the average depth value is less than or equal to the preset average value threshold, that is, the area meets the preset adjustment conditions, the area can be adjusted at the pixel level based on the color correction matrix and the three-dimensional display lookup table. The specific adjustment method can be referred to above. In order to avoid repetition, it will not be repeated here.

[0145] It can be understood that after obtaining the beautified image based on the above scheme, the image quality of the beautified image can be determined according to the image data (such as color, noise, clarity, color contrast, sharpness, etc.) of the image to be processed and the beautified image.

[0146] For example, in a portrait shooting scenario, a scoring algorithm can be used to score the beautified image, such as the convolutional neural networks for no-reference image quality assessment (CNN-IQA) algorithm, the HyperlQA algorithm (an image quality assessment algorithm), the neural image assessment (NIMA) algorithm, the KonlQ++ algorithm (an image quality assessment algorithm), the Transformer model (a sequence transformation model based on the attention mechanism), etc.

[0147] The following uses the Transformer model as an example to explain how to score the beautified images.

[0148] It can be understood that in some optional implementations, the beautified image can be scored regionally and overall based on the Transformer model to obtain a local score and an overall score. As mentioned above, for example, the color dimension of the processed image is beautified, so the overall score of the beautified image, the regional score of each region, and the dimension score of the color dimension of each region can be determined, wherein the total score of the regional score and the dimension score can be used as the local score. Then, the product of the overall score of the beautified image, the regional score of each region, and the dimension score of the color dimension of each region and the corresponding weight can be used as the total score of the beautified image.

[0149] In some specific implementations, the depth value of each area in the beautified image can be obtained, wherein the depth value can reflect the distance between the area selected by the bounding box of the object and the image acquisition device (e.g., a camera). For example, the closer the area selected by the bounding box of the object is to the image acquisition device, the smaller the depth value of the area selected by the bounding box of the object. And the depth value of each area can be the average depth value of multiple pixels in the area. Then, the weight corresponding to each area can be determined based on the depth value of each area. It can be understood that the sum of the weights corresponding to multiple areas is 1.

[0150] In addition, by performing depth estimation on the beautified image, such as using monocular depth estimation or binocular depth estimation, the depth value of each pixel in the beautified image can be estimated, so that the depth value of each area in the beautified image can be determined. Therefore, the score weight corresponding to each area can be determined according to the depth value of each area. For example, for the background area that is farther away in the beautified image, the corresponding score weight can be set smaller, so that more attention is paid to the foreground area, especially in selfie and character shooting scenes, at this time, the face of the character needs to be focused on, and the background that is farther away, such as hills, forests, etc., can be less focused, so that the final effect of beautification is: the face of the character is well beautified, and the background is relatively generally beautified, so that the focus of character beautification can be highlighted.

[0151] It can be understood that the weight corresponding to the overall score and the weight corresponding to the local score can be preset, and the sum of the weight corresponding to the overall score and the weight corresponding to the local score is 1. For example, the weight corresponding to the overall score can be preset to 0.6, and the weight corresponding to the local score can be preset to 0.4. Of course, different weight values ​​can also be set for different shooting scenes. For example, for selfie scenes and portrait shooting scenes, the weight corresponding to the overall score can be higher. For landscape scenes, the weight corresponding to the overall score can be lower.

[0152] Assume that the overall score of the beautified image is determined to beC , No. j The regional score for the region is B j , No. j The dimension score of the color dimension of the region is A j .

[0153] In this way, the following formula (3) can be used to sum the products of the overall score of the beautified image, the regional score of each region, and the dimension score of the color dimension of each region with the corresponding weight to obtain the total score of the beautified image.

[0154] Formula (3)

[0155] in, score all It can represent the total score of the beautified image. w 1 It can represent the weight corresponding to the overall score, C The overall score of the beautified image can be expressed as C , w 2 It can represent the weight corresponding to the local score, w j Can indicate the j The weight corresponding to each region is B j It can represent the first j The regional score of each region, A j It can represent the first j The dimension score of the color dimension of each region, M can represent the total number of regions.

[0156] and, w 1 + w 2 =1, .

[0157] It can be understood that in order to reduce the gap between the scores, after the scores are determined, a mapping function can be used to map the overall score, the regional scores of different regions, and the dimension score of the color dimension to between 0 and 1.

[0158] When the score obtained by scoring the beautified image using the scoring algorithm is lower than the preset score threshold, an evolutionary algorithm (EA) or a Bayesian optimization (BO) algorithm can be used to automatically adjust the adjustment parameters, such as adjusting the parameters in the color correction matrix and adjusting the HSL data in the three-dimensional display lookup table. After the processed image is beautified again based on the adjusted parameters, the beautified image is scored again using the scoring algorithm, and this process is repeated until the score obtained by scoring the beautified image is higher than the preset score threshold. At this time, the adjusted parameters can be used as the target adjustment parameters.

[0159] The following is a detailed introduction to the evolutionary algorithm (EA) and Bayesian optimization (BO) algorithm.

[0160] In the evolutionary algorithm, the initial population of adjustment parameters can be set first, for example, the initial population of adjustment parameters is set to 500, that is, 500 groups of random adjustment parameters are initialized, which are called the parent generation. The image beautified by the parent generation is scored by using the scoring algorithm mentioned above, and 250 groups of random adjustment parameters with the highest scores are retained. Then, the 250 groups of random adjustment parameters can be crossover and mutation processed to obtain 250 new groups of adjustment parameters, which are called the first offspring. The image beautified by the first offspring is scored again by using the scoring algorithm mentioned above, and the 250 groups of random adjustment parameters with the highest scores retained by the parent generation beautified images and the first offspring are re-retained. Then, the 250 groups of random adjustment parameters are crossover and mutation processed again to obtain 250 new groups of adjustment parameters, which are called the second offspring. This is repeated until the score obtained by scoring the beautified image converges, that is, the score has reached the highest and cannot or cannot be increased again. At this time, the preset score threshold can be determined according to the highest score. And the adjustment parameter with the highest score in the last generation can be used as the target adjustment parameter. The target adjustment parameter acts on the image to be processed, and a beautified image with the best beautification effect can be obtained.

[0161] Since the evolutionary algorithm is an optimization algorithm, it retains excellent adjustment parameters each time, so the best adjustment parameters can be obtained through continuous iteration.

[0162] In the Bayesian optimization algorithm, after initializing a set of adjustment parameters, the initialized adjustment parameters can be applied to the image to be processed, and multiple beautified images can be scored and the scores can be normalized to obtain the normalized scores. The Bayesian optimization algorithm will give the next set of adjustment parameters based on the normalized scores, and the adjustment parameters will be applied to the image to be processed again, and so on, until the scores obtained by scoring the beautified images converge, that is, the scores have reached the highest and cannot or cannot be improved again. At this time, a preset score threshold can be determined based on the highest score. And the adjustment parameter with the highest score can be used as the target adjustment parameter. The target adjustment parameter is applied to the image to be processed, and the beautified image with the best beautification effect can be obtained.

[0163] It should be understood that in some specific implementations, the score of the beautified image can be determined based on the dimensional scores corresponding to all dimensions of each region of the beautified image. The score of the beautified image can also be determined based only on the dimensional scores corresponding to a single dimension of each region of the beautified image, for example, the score of the beautified image can be determined based only on the dimensional scores corresponding to the noise dimensions of each region of the beautified image to reduce the noise of the image, which is not specifically limited in the embodiments of the present application.

[0164] It can be understood that after obtaining the beautified image, not only can the beautified image be scored using a scoring algorithm to determine the image quality of the beautified image, but the quality of the beautified image can also be determined by performing Fourier transform, derivation, etc. on the beautified image. When the image quality of the beautified image is lower than the preset quality standard, the above-mentioned evolutionary algorithm or Bayesian optimization algorithm can be used to automatically adjust the adjustment parameters.

[0165] The following introduces a method of performing Fourier transform on the beautified image and determining the quality of the beautified image.

[0166] In some optional instances, Fourier transform can be performed on the image to be processed and the beautified image to convert both the image to be processed and the beautified image from the spatial domain to the frequency domain. If the high-frequency amount of the beautified image is smaller than the high-frequency amount of the image to be processed, and the difference between the high-frequency amount of the beautified image and the high-frequency amount of the image to be processed is smaller than a preset high-frequency amount threshold, or the high-frequency amount of the beautified image is greater than the high-frequency amount of the image to be processed, that is, the image quality of the beautified image is lower than the preset quality standard.

[0167] The following introduces how to derive the beautified image and determine the quality of the beautified image.

[0168] In some optional examples, since the first-order derivative of an image (i.e., the rate of change of a unit pixel) can reflect the degree of change of a pixel point, and the second-order derivative of an image can reflect the edge texture and noise of an image, the image to be processed and the beautified image can be smoothed first (e.g., the beautified image is smoothed using Gaussian smoothing technology) to reduce the impact of noise on the image. Then, if the difference between the second-order derivative of the beautified image and the second-order derivative of the image to be processed is greater than a preset derivative difference threshold, the image quality of the beautified image is lower than the preset quality standard. Example

[0169] In some specific implementations, such as Figure 5 As shown, an image (i.e., a beautified image, hereinafter referred to as an image for the sake of convenience) can be input into an image processing application, and then the image can be depth estimated, and the image can be detected, segmented, and recognized to divide the image into multiple areas. When the depth of the image to be processed is estimated, the depth value can be used to determine whether the background needs to be blurred and the degree of beautification of each area of ​​the image.

[0170] Next, a set of parameters (i.e., the adjustment parameters mentioned above) can be set, such as color correction matrix, three-dimensional display lookup table, sharpness, color contrast, blur (blurring) degree, clarity, exposure and other parameters. And based on the set adjustment parameters and scoring algorithm, each area and the whole image can be scored to obtain the final score (i.e., the total score mentioned above). If the score converges, the set adjustment parameters can be applied to the original image (i.e., the image to be processed before beautification) and the beautified image can be output. Otherwise, the set parameters can be automatically adjusted based on an optimization algorithm, such as the evolutionary algorithm or Bayesian optimization algorithm mentioned above.

[0171] In some optional implementations, different from the first embodiment, multiple dimensions of the image (i.e., the beautified image) can be beautified. Therefore, the overall score of the beautified image, the regional scores of each region, and the dimension scores of each dimension of each region can be determined, wherein the total score of the regional score and the dimension score can be used as the local score. Then, the product sum of the overall score of the beautified image, the regional scores of each region, and the dimension scores of each dimension of each region and the corresponding weights can be used as the total score of the beautified image.

[0172] It can be understood that the weight corresponding to each dimension in each region can also be determined according to the category label of the object in the region, and the sum of the weights corresponding to multiple dimensions in each region is 1. As mentioned above, after the image to be processed is segmented into multiple regions using a segmentation model, the image to be processed divided into multiple regions can be input into the recognition model of any object, and the regional image features (such as color, texture, shape, etc.) of the object in each region can be extracted. According to the regional image features of each region, the category label of the object in each region is predicted. In this way, the weights of each dimension of each region can be determined based on the category label of the object in each region.

[0173] For example, j The region includes two dimensions: saturation and clarity. When the object category label in the region is the category label corresponding to a person, the weight corresponding to saturation can be determined as 0.8, and the weight corresponding to clarity can be determined as 0.2. This means that for a person, more attention is paid to saturation.

[0174] It can be understood that the weight corresponding to the overall score and the weight corresponding to the local score can be preset, and the sum of the weight corresponding to the overall score and the weight corresponding to the local score is 1. For example, the weight corresponding to the overall score can be preset to 0.6, and the weight corresponding to the local score can be preset to 0.4. Of course, different weight values ​​can also be set for different shooting scenes. For example, for selfie scenes and portrait shooting scenes, the weight of the overall score can be higher. For landscape scenes, the weight of the overall score can be lower.

[0175] Assume that the overall score of the beautified image is determined to be C , No. j The regional score for the region is B j , No. j Region i The dimension scores of the dimensions are A ij .

[0176] In this way, the following formula (4) can be used to sum the products of the overall score of the beautified image, the regional score of each region, and the dimension score of each dimension of each region with the corresponding weight to obtain the total score of the beautified image.

[0177] Formula (4)

[0178] in, score all It can represent the total score of the beautified image. w 1 It can represent the weight corresponding to the overall score, CThe overall score of the beautified image can be expressed as C , w 2 It can represent the weight corresponding to the regional score, w j Can indicate the j The weight corresponding to each region is B j It can represent the first j The regional score of each region, w j Can indicate the i The weights corresponding to the dimensions are A ij It can represent the first j Region i The dimension score of the dimension, M can represent the total number of regions, and N can represent the j The total number of dimensions for each region.

[0179] and, w 1 + w 2 =1, , .

[0180] In order to reduce the difference in dimension scores between different dimensions, after determining the dimension score of each dimension, a mapping function can be used to map the dimension score of each dimension to between 0 and 1. For example, when the dimension score has positive and negative values, the following can be used: Figure 6 The sigmoid mapping function shown in the figure maps each dimension score to between 0 and 1. When the dimension score has only positive values, the following can be used: Figure 7 The tanh function shown in the figure maps each dimension score to between 0 and 1. The sigmoid mapping function can be in the form shown in formula (5), and the tanh function can be in the form shown in formula (6):

[0181] Formula (5)

[0182] Formula (6)

[0183] Among them, α can represent the adjustment factor, x can represent the score before mapping, and y can represent the score after mapping. It can be understood that the adjustment factor can be fixed first, and then the dimension scores between different dimensions are mapped.

[0184] It is worth noting that the overall score of the beautified image and the regional scores of each area also need to be normalized to between 0 and 1, so as to reduce the gap between the overall score, the regional scores of different areas and the dimension scores between different dimensions.

[0185] It is understandable that the image processing method provided in the embodiment of the present application can be applied to electronic devices. The hardware structure of the electronic device to which the image processing method provided in the embodiment of the present application is applicable is exemplarily introduced below.

[0186] like Figure 8 As shown, the electronic device 800 may include a processor 810, an external memory interface 820, an internal memory 821, a universal serial bus (USB) interface 830, a charging management module 840, a power management module 841, a battery 842, an antenna 1, an antenna 2, a mobile communication module 850, a wireless communication module 860, an audio module 870, a speaker 870A, a receiver 870B, a microphone 870C, an earphone interface 870D, a sensor module 880, a button 890, a motor 891, an indicator 892, a camera 893, a display screen 894, and a subscriber identification module (SIM) card interface 895, etc. The sensor module 880 may include a pressure sensor 880A, etc.

[0187] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device 800 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0188] The processor 810 may include one or more processing units, for example, the processor 810 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0189] In some optional implementations, the processor 810 may execute the image processing method mentioned in the embodiments of the present application.

[0190] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0191] The processor 810 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 810 is a cache memory. The memory may store instructions or data that the processor 810 has just used or cyclically used. If the processor 810 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 810, and thus improves the efficiency of the system.

[0192] In some optional implementations, the memory may store instructions or data of the image processing method mentioned in the embodiments of the present application.

[0193] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 850, wireless communication module 860, modem processor and baseband processor.

[0194] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0195] The mobile communication module 850 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 850 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 850 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 850 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 850 may be set in the processor 810. In some embodiments, at least some of the functional modules of the mobile communication module 850 may be set in the same device as at least some of the modules of the processor 810.

[0196] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 870A, a receiver 870B, etc.), or displays an image or video through a display screen 894. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 810 and may be set in the same device as the mobile communication module 850 or other functional modules.

[0197] The wireless communication module 860 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 860 can be one or more devices integrating at least one communication processing module. The wireless communication module 860 receives electromagnetic waves via antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 810. The wireless communication module 860 can also receive the signal to be sent from the processor 510, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through antenna 2.

[0198] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 850, and the antenna 2 is coupled to the wireless communication module 860, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).

[0199] The electronic device implements the display function through a GPU, a display screen 894, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 894 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 810 may include one or more GPUs that execute program instructions to generate or change display information.

[0200] The display screen 894 is used to display images, videos, etc. The display screen 894 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-LED, MicroLED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 894, where N is a positive integer greater than 1.

[0201] In some optional implementations, the display screen 894 may display the following: Figure 1 , Figure 3 , Figure 4 The content displayed.

[0202] The pressure sensor 880A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 880A can be set on the display screen 894. There are many types of pressure sensors 880A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 880A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 894, the electronic device detects the touch operation intensity according to the pressure sensor 880A. The electronic device can also calculate the touch position according to the detection signal of the pressure sensor 880A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0203] The following is an exemplary introduction to the software structure of an electronic device to which the image processing method provided in the embodiment of the present application is applicable.

[0204] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present invention takes the layered architecture as an example to illustrate the software structure of the electronic device. In some embodiments, the software structure of the electronic device may be the same.

[0205] Fig. 9 It is a software structure block diagram of the electronic device according to an embodiment of the present application.

[0206] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer, framework layer, system runtime, and kernel layer.

[0207] like Fig. 9 As shown, the application layer may include a series of application packages, which may include image processing, gallery, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0208] Among them, the image processing application can integrate the above-mentioned SAM model module and RAM model module to implement the image processing method provided in the embodiment of the present application.

[0209] In some specific implementations, when beautifying an image to be processed, the bounding box of each object can be identified from the image to be processed. For example, in a portrait shooting scene, the object can be part or all of the subject of the shooting, such as the face of a person, the arm of a person, the skirt of a person, a brick on a wall, a doorbell on a wall, a door handle, etc. The bounding box of the object can indicate the position of the object. For the areas selected by the bounding boxes of different objects, the adjustment parameters of the area can be determined according to at least one of the image data such as the depth value and color contrast of the area to adjust the area to obtain a beautified image. In this way, when beautifying the image to be processed, different adjustment parameters can be used to make local adjustments to different areas, which can effectively avoid the problem of image distortion caused by poor image processing effect in local areas, and is conducive to improving image quality.

[0210] In this way, when beautifying the image to be processed, the image processing application can improve the image quality by adjusting different areas based on different adjustment parameters.

[0211] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0212] like Fig. 9As shown, the application framework layer may include a window manager, a content provider, a phone manager, a resource manager, a notification manager, a view system, and the like.

[0213] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0214] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0215] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).

[0216] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0217] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0218] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0219] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0220] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0221] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0222] The system library may include multiple functional modules, such as surface manager, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), media libraries, etc.

[0223] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0224] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0225] A 2D graphics engine is a drawing engine for 2D drawings.

[0226] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0227] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0228] In some cases, the embodiments disclosed herein may be implemented in hardware, firmware, software, or any combination thereof.

[0229] The embodiments disclosed in the present application may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which can be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer-readable media. Therefore, the machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to a floppy disk, an optical disk, an optical disk, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic card or an optical card, a flash memory, or a tangible machine-readable memory for transmitting information (e.g., a carrier wave, an infrared signal, a digital signal, etc.) using the Internet in an electrical, optical, acoustic or other form of propagation signal. Therefore, the machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).

[0230] Embodiments of the present application may be implemented as a computer program or program code executed on a programmable system comprising at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0231] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit, or a microprocessor.

[0232] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0233] The above describes the hardware structure that the electronic device may have. It is understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0234] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0235] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0236] Although the present application has been illustrated and described with reference to certain embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the present application.

Claims

1. An image processing method, applied to an electronic device, characterized in that: include: Acquire a first image to be processed; dividing the first image into a plurality of regions, wherein the plurality of regions include a first region and a second region; Adjusting the first region based on a first adjustment parameter, and adjusting the second region based on a second adjustment parameter to obtain a second image; The first adjustment parameter is determined by: Extracting image parameters of each pixel in the first area, wherein the image parameters include depth value and / or contrast; Corresponding to the image parameters of each pixel in the first area satisfying a preset adjustment condition, a color correction matrix and a three-dimensional display lookup table are determined as the first adjustment parameters; If the image parameters of each pixel in the first area do not satisfy the preset adjustment condition, a color correction matrix is ​​determined as the first adjustment parameter.

2. The method according to claim 1, characterized in that: The first adjustment parameter and the second adjustment parameter include at least one of the following: Color correction matrix, 3D display lookup table, sharpness, color contrast, blur, clarity, exposure.

3. The method according to claim 1, characterized in that The preset adjustment condition includes at least one of the following: The average depth value of the plurality of pixels in the first area is less than or equal to the average value threshold, The contrast of the first area is less than or equal to a contrast threshold.

4. The method according to claim 1, characterized in that: The first adjustment parameter corresponds to the color correction matrix, The adjusting the first area based on the first adjustment parameter includes: Extracting a first pixel value of each pixel in the first area in a first color space, wherein the first color space includes an RGB space; The first pixel value of each pixel in the first area is multiplied by the color correction matrix to obtain the second pixel value of each pixel.

5. The method according to claim 1, characterized in that Corresponding to the first adjustment parameters are a color correction matrix and a three-dimensional display lookup table, The adjusting the first area based on the first adjustment parameter includes: Extracting a first pixel value of each pixel in the first area in a first color space, wherein the first color space includes an RGB space; Based on a mapping relationship between the first color space and the second color space, converting the first pixel value of each pixel to obtain a third pixel value corresponding to the first pixel value in the second color space, wherein the second color space includes an HSL color space; The first area is adjusted based on the third pixel value of each pixel in the second color space and the data in the three-dimensional display lookup table.

6. The method according to claim 5, characterized in that The adjusting the first area based on the third pixel value of each pixel in the second color space and the data in the three-dimensional display lookup table includes: corresponding to the existence of a fourth pixel value in the three-dimensional display lookup table that is the same as the third pixel value of each pixel in the second color space, adjusting the third pixel value of each pixel in the first area to the fourth pixel value in the three-dimensional display lookup table; Corresponding to the fact that there is no pixel value in the three-dimensional display lookup table that is the same as the third pixel value of each pixel in the second color space, interpolation processing is performed on the fourth pixel value in the three-dimensional display lookup table that is adjacent to the third pixel value of each pixel in the second color space to obtain the fifth pixel value of each pixel in the second color space, and the third pixel value of each pixel in the first area is adjusted to the fifth pixel value in the three-dimensional display lookup table.

7. The method according to claim 1, characterized in that The step of dividing the first image into a plurality of regions comprises: Extracting an image feature of each pixel in the first image, wherein the image feature includes at least one of color, texture, and depth; determining a plurality of bounding boxes in the first image based on an image feature of each pixel in the first image; Based on the plurality of bounding boxes, the first image is divided into the plurality of regions.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Performing scoring processing on the entirety and parts of the second image to determine a total score of the second image; corresponding to the total score of the second image being less than a preset score threshold, adjusting the first adjustment parameter to a third adjustment parameter based on an optimization algorithm, and adjusting the second adjustment parameter to a fourth adjustment parameter; The first region is adjusted based on a third adjustment parameter, and the second region is adjusted based on a fourth adjustment parameter to obtain a third image.

9. The method according to claim 8, characterized in that The optimization algorithm includes an evolutionary algorithm and / or a Bayesian optimization algorithm.

10. The method according to claim 8, characterized in that The step of scoring the entirety and the parts of the second image to determine a total score of the second image includes: Scoring the second image as a whole to obtain an overall score of the second image; Scoring the first area in the second image and scoring the second area in the second image to obtain a local score of the second image; A total score of the second image is determined according to the overall score of the second image and the local score.

11. The method according to claim 10, characterized in that Scoring the first area in the second image and scoring the second area in the second image to obtain a local score of the second image includes: Scoring the first area and the second area of ​​the second image respectively to obtain a first area score of the first area and a second area score of the second area; Scoring at least one dimension in the first area and the second area of ​​the second image respectively to obtain a dimension score corresponding to the first area in the at least one dimension and a dimension score corresponding to the second area in the at least one dimension, wherein the at least one dimension includes color, noise, clarity, exposure, sharpness, color contrast, hue, saturation, brightness, blur, light and shadow effect, and 3D effect; A local score of the second image is determined based on a first region score of the first region, a second region score of the second region, a dimension score corresponding to the first region in at least one dimension, and a dimension score corresponding to the second region in at least one dimension.

12. The method according to claim 11, characterized in that The scoring the first area and the second area of ​​the second image respectively includes: The first area and the second area of ​​the second image are scored respectively using a scoring algorithm.

13. The method according to claim 12, characterized in that The scoring algorithm includes any one of the following: CNN-IQA algorithm, HyperlQA algorithm, NIMA algorithm, KonlQ++ algorithm, Transformer model.

14. The method according to claim 10, characterized in that The method further comprises: The overall score of the second image and the local score of the second image are normalized so that the overall score of the second image and the local score of the second image are within the same range.

15. An electronic device, characterized in that: include: A memory, used to store instructions executed by one or more processors of the electronic device, and a processor, which is one of the one or more processors of the electronic device, used to execute the image processing method described in any one of claims 1-14.

16. A readable storage medium, characterized in that: The readable storage medium stores instructions, and when the instructions are executed on an electronic device, the electronic device executes the image processing method according to any one of claims 1 to 14.

17. A computer program product, characterized in that The computer program product comprises computer instructions, and when executed by an electronic device, the electronic device executes the computer program code of the image processing method according to any one of claims 1 to 14.